From 9d09047223a02611349d3e6bc4672444c4d06377 Mon Sep 17 00:00:00 2001 From: rk <59029880+rrr523@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:04:15 +0800 Subject: [PATCH] Chore/update create tags (#415) * chore(example): Nodejs example update new create tx * docs: Update Docs - new create tx --- doc-site/docs/api/bucket.mdx | 4 ++++ doc-site/docs/api/object.mdx | 8 ++++++++ examples/nodejs/cases/policy.js | 3 +++ examples/nodejs/cases/storage.js | 6 ++++++ 4 files changed, 21 insertions(+) diff --git a/doc-site/docs/api/bucket.mdx b/doc-site/docs/api/bucket.mdx index b3e7a457..c9749123 100644 --- a/doc-site/docs/api/bucket.mdx +++ b/doc-site/docs/api/bucket.mdx @@ -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" @@ -32,6 +33,9 @@ const tx = await client.bucket.createBucket( primarySpAddress: 'primary_sp_address', }, paymentAddress: address, + tags: { + tags: [], + }, }, { type: 'EDDSA', diff --git a/doc-site/docs/api/object.mdx b/doc-site/docs/api/object.mdx index 933507b6..7dda6181 100644 --- a/doc-site/docs/api/object.mdx +++ b/doc-site/docs/api/object.mdx @@ -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" @@ -35,6 +36,9 @@ const tx = await client.object.createFolder( bucketName: createObjectInfo.bucketName, objectName: createObjectInfo.objectName + '/', creator: address, + tags: { + tags: [], + }, }, { type: 'EDDSA', @@ -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( @@ -72,6 +77,9 @@ const tx = await client.object.createObject( redundancyType: 'REDUNDANCY_EC_TYPE', contentLength: 13311, expectCheckSums: JSON.parse(expectCheckSums), + tags: { + tags: [], + }, }, { type: 'EDDSA', diff --git a/examples/nodejs/cases/policy.js b/examples/nodejs/cases/policy.js index d24209a8..9ce4570e 100644 --- a/examples/nodejs/cases/policy.js +++ b/examples/nodejs/cases/policy.js @@ -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({ diff --git a/examples/nodejs/cases/storage.js b/examples/nodejs/cases/storage.js index eaaa9ee2..5503c2b4 100644 --- a/examples/nodejs/cases/storage.js +++ b/examples/nodejs/cases/storage.js @@ -30,6 +30,9 @@ console.log('objectName', objectName); primarySpAddress: spInfo.primarySpAddress, }, paymentAddress: ACCOUNT_ADDRESS, + tags: { + tags: [], + }, }, { type: 'ECDSA', @@ -68,6 +71,9 @@ console.log('objectName', objectName); redundancyType: 'REDUNDANCY_EC_TYPE', contentLength, expectCheckSums: JSON.parse(expectCheckSums), + tags: { + tags: [], + }, }, { type: 'ECDSA',