Skip to content

Commit

Permalink
chore: Example update (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 authored Apr 10, 2024
1 parent 9484f7d commit 504b926
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions examples/nextjs/src/components/feegrant/createObj.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,13 @@ export const CreateObj = () => {
},
);

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({
const simulateInfo = await createObjectTx.simulate({
denom: 'BNB',
});

console.log('simulateInfo', simulateInfo);

const res = await multiTx.broadcast({
const res = await createObjectTx.broadcast({
denom: 'BNB',
gasLimit: Number(simulateInfo?.gasLimit),
gasPrice: simulateInfo?.gasPrice || '5000000000',
Expand All @@ -178,7 +163,7 @@ export const CreateObj = () => {
});

if (res.code === 0) {
alert('success');
alert('create objectTx success');
}

// const uploadRes = await client.object.uploadObject({
Expand Down

0 comments on commit 504b926

Please sign in to comment.