Skip to content

Commit

Permalink
Chore/update create tags (#415)
Browse files Browse the repository at this point in the history
* chore(example): Nodejs example update new create tx

* docs: Update Docs - new create tx
  • Loading branch information
rrr523 authored Dec 7, 2023
1 parent 67430c8 commit 9d09047
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc-site/docs/api/bucket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ for creating bucket and sends the createBucket transaction to the Greenfield.
| chargedReadQuota | defines the traffic quota that you read from primary sp |
| spInfo | primary sp address |
| paymentAddress | payment address |
| tags | defines a list of tags which will be set to the bucket |
| authType | [AuthType](/client/sp-client#authtype) |

```jsx title="example"
Expand All @@ -32,6 +33,9 @@ const tx = await client.bucket.createBucket(
primarySpAddress: 'primary_sp_address',
},
paymentAddress: address,
tags: {
tags: [],
},
},
{
type: 'EDDSA',
Expand Down
8 changes: 8 additions & 0 deletions doc-site/docs/api/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Send create empty object txn to greenfield chain.
| bucketName | bucket name |
| objectName | object name |
| creator | the creator of object |
| tags | defines a list of tags which will be set to the object |
| authType | [AuthType](/client/sp-client#authtype) |

```jsx title="example"
Expand All @@ -35,6 +36,9 @@ const tx = await client.object.createFolder(
bucketName: createObjectInfo.bucketName,
objectName: createObjectInfo.objectName + '/',
creator: address,
tags: {
tags: [],
},
},
{
type: 'EDDSA',
Expand All @@ -60,6 +64,7 @@ Get approval of creating object and send createObject txn to greenfield chain.
| authType | [AuthType](/client/sp-client#authtype) |
| contentLength | file content length |
| expectCheckSums | file's expectCheckSums |
| tags | defines a list of tags which will be set to the object |

```jsx title="example"
const tx = await client.object.createObject(
Expand All @@ -72,6 +77,9 @@ const tx = await client.object.createObject(
redundancyType: 'REDUNDANCY_EC_TYPE',
contentLength: 13311,
expectCheckSums: JSON.parse(expectCheckSums),
tags: {
tags: [],
},
},
{
type: 'EDDSA',
Expand Down
3 changes: 3 additions & 0 deletions examples/nodejs/cases/policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const { ACCOUNT_ADDRESS, ACCOUNT_PRIVATEKEY } = require('../env');
creator: ACCOUNT_ADDRESS,
extra: EXTRA,
groupName: GROUP_NAME,
tags: {
tags: [],
},
});

const createGroupTxSimulateInfo = await createGroupTx.simulate({
Expand Down
6 changes: 6 additions & 0 deletions examples/nodejs/cases/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ console.log('objectName', objectName);
primarySpAddress: spInfo.primarySpAddress,
},
paymentAddress: ACCOUNT_ADDRESS,
tags: {
tags: [],
},
},
{
type: 'ECDSA',
Expand Down Expand Up @@ -68,6 +71,9 @@ console.log('objectName', objectName);
redundancyType: 'REDUNDANCY_EC_TYPE',
contentLength,
expectCheckSums: JSON.parse(expectCheckSums),
tags: {
tags: [],
},
},
{
type: 'ECDSA',
Expand Down

0 comments on commit 9d09047

Please sign in to comment.