diff --git a/examples/nextjs/src/components/feegrant/createObj.tsx b/examples/nextjs/src/components/feegrant/createObj.tsx index 42f84e2f..094d90a6 100644 --- a/examples/nextjs/src/components/feegrant/createObj.tsx +++ b/examples/nextjs/src/components/feegrant/createObj.tsx @@ -4,6 +4,7 @@ import { GRNToString, MsgCreateObjectTypeUrl, newBucketGRN, + newObjectGRN, PermissionTypes, toTimestamp, } from '@bnb-chain/greenfield-js-sdk'; @@ -146,13 +147,28 @@ export const CreateObj = () => { }, ); - const simulateInfo = await createObjectTx.simulate({ + const setTagTx = await client.storage.setTag({ + operator: granteeAddr, + resource: GRNToString(newObjectGRN(bucketName, objectName)), + tags: { + tags: [ + { + key: 'x', + value: 'xx', + }, + ], + }, + }); + + const multiTx = await client.txClient.multiTx([createObjectTx, setTagTx]); + + const simulateInfo = await multiTx.simulate({ denom: 'BNB', }); console.log('simulateInfo', simulateInfo); - const res = await createObjectTx.broadcast({ + const res = await multiTx.broadcast({ denom: 'BNB', gasLimit: Number(simulateInfo?.gasLimit), gasPrice: simulateInfo?.gasPrice || '5000000000', diff --git a/packages/js-sdk/tests/.env.simple b/packages/js-sdk/tests/.env.simple index 7af35f11..6dfbd432 100644 --- a/packages/js-sdk/tests/.env.simple +++ b/packages/js-sdk/tests/.env.simple @@ -1,4 +1,4 @@ ACCOUNT_ADDRESS='0x...' ACCOUNT_PRIVATEKEY='0x...' -NEXT_PUBLIC_GREENFIELD_RPC_URL=https://gnfd-testnet-fullnode-tendermint-ap.bnbchain.org -NEXT_PUBLIC_GREEN_CHAIN_ID=5600 +GREENFIELD_URL=https://gnfd-testnet-fullnode-tendermint-ap.bnbchain.org +GREENFIELD_CHAIN_ID=5600