diff --git a/.changeset/little-melons-care.md b/.changeset/little-melons-care.md
new file mode 100644
index 00000000..6a7793e2
--- /dev/null
+++ b/.changeset/little-melons-care.md
@@ -0,0 +1,5 @@
+---
+'@bnb-chain/greenfield-js-sdk': minor
+---
+
+feat: Add SetTag API
diff --git a/.changeset/twelve-mice-grin.md b/.changeset/twelve-mice-grin.md
new file mode 100644
index 00000000..c061f7ac
--- /dev/null
+++ b/.changeset/twelve-mice-grin.md
@@ -0,0 +1,5 @@
+---
+'@bnb-chain/greenfield-js-sdk': patch
+---
+
+feat: Upgrade cosmos types to 0.4.0-alpha.30
diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json
index dda90da6..963935e6 100644
--- a/examples/nextjs/package.json
+++ b/examples/nextjs/package.json
@@ -11,7 +11,7 @@
"lint": "next lint"
},
"dependencies": {
- "@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.25",
+ "@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.30",
"@bnb-chain/greenfield-js-sdk": "workspace:*",
"@bnb-chain/reed-solomon": "workspace:*",
"@cosmjs/encoding": "^0.32.0",
diff --git a/examples/nextjs/src/components/bucket/create/index.tsx b/examples/nextjs/src/components/bucket/create/index.tsx
index 5209776a..62d31c84 100644
--- a/examples/nextjs/src/components/bucket/create/index.tsx
+++ b/examples/nextjs/src/components/bucket/create/index.tsx
@@ -47,20 +47,6 @@ export const CreateBucket = () => {
primarySpAddress: spInfo.primarySpAddress,
},
paymentAddress: address,
- // empty tags
- tags: {
- tags: [],
- },
-
- // with tags:
- // tags: {
- // tags: [
- // {
- // key: 'test',
- // value: 'test',
- // },
- // ],
- // },
},
{
// type: 'ECDSA',
diff --git a/examples/nextjs/src/components/feegrant/createObj.tsx b/examples/nextjs/src/components/feegrant/createObj.tsx
index 2dc78792..42f84e2f 100644
--- a/examples/nextjs/src/components/feegrant/createObj.tsx
+++ b/examples/nextjs/src/components/feegrant/createObj.tsx
@@ -11,6 +11,7 @@ import { Wallet } from '@ethersproject/wallet';
import { ChangeEvent, useState } from 'react';
import { parseEther } from 'viem';
import { useAccount } from 'wagmi';
+import { ReedSolomon } from '@bnb-chain/reed-solomon';
/**
* fee grant for creat object
@@ -124,11 +125,9 @@ export const CreateObj = () => {
console.log('temp account', granteeAddr, privateKey);
+ const rs = new ReedSolomon();
const fileBytes = await file.arrayBuffer();
- const hashResult = await (window as any).FileHandle.getCheckSums(
- new Uint8Array(fileBytes),
- );
- const { contentLength, expectCheckSums } = hashResult;
+ const expectCheckSums = rs.encode(new Uint8Array(fileBytes));
const createObjectTx = await client.object.createObject(
{
@@ -137,13 +136,13 @@ export const CreateObj = () => {
objectName: objectName,
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
redundancyType: 'REDUNDANCY_EC_TYPE',
- contentLength,
+ contentLength: fileBytes.byteLength,
expectCheckSums,
fileType: file.type,
},
{
type: 'ECDSA',
- privateKey: ACCOUNT_PRIVATEKEY,
+ privateKey: privateKey,
},
);
diff --git a/examples/nextjs/src/components/group/create/index.tsx b/examples/nextjs/src/components/group/create/index.tsx
index 924ab087..b9f7855e 100644
--- a/examples/nextjs/src/components/group/create/index.tsx
+++ b/examples/nextjs/src/components/group/create/index.tsx
@@ -28,9 +28,6 @@ export const CreateGroup = () => {
creator: address,
groupName: createGroupInfo.groupName,
extra: 'extra info',
- tags: {
- tags: [],
- },
});
const simulateInfo = await createGroupTx.simulate({
@@ -61,49 +58,7 @@ export const CreateGroup = () => {
console.log(res);
}}
>
- create group with empty tags
-
-
-
);
diff --git a/examples/nextjs/src/components/group/update/index.tsx b/examples/nextjs/src/components/group/update/index.tsx
index 202e8af5..f8fed8ea 100644
--- a/examples/nextjs/src/components/group/update/index.tsx
+++ b/examples/nextjs/src/components/group/update/index.tsx
@@ -1,7 +1,6 @@
import { client } from '@/client';
-import { GRNToString, newBucketGRN, newGroupGRN, toTimestamp } from '@bnb-chain/greenfield-js-sdk';
+import { GRNToString, newGroupGRN, toTimestamp } from '@bnb-chain/greenfield-js-sdk';
import { useState } from 'react';
-import { zeroAddress } from 'viem';
import { useAccount } from 'wagmi';
export const GroupUpdate = () => {
@@ -130,6 +129,9 @@ export const GroupUpdate = () => {
const updateGroupTx = await client.storage.setTag({
operator: address,
resource,
+ // tags: {
+ // tags: [],
+ // },
tags: {
tags: [
{
diff --git a/examples/nextjs/src/components/object/create/index.tsx b/examples/nextjs/src/components/object/create/index.tsx
index fc420329..ee990a1c 100644
--- a/examples/nextjs/src/components/object/create/index.tsx
+++ b/examples/nextjs/src/components/object/create/index.tsx
@@ -168,18 +168,6 @@ export const CreateObject = () => {
bucketName: createObjectInfo.bucketName,
objectName: createObjectInfo.objectName + '/',
creator: address,
- // empty tags
- // tags: {
- // tags: [],
- // },
- tags: {
- tags: [
- {
- key: 'test',
- value: 'test',
- },
- ],
- },
},
{
type: 'EDDSA',
diff --git a/examples/nextjs/src/pages/_document.tsx b/examples/nextjs/src/pages/_document.tsx
index 660f65ba..e1e9cbbb 100644
--- a/examples/nextjs/src/pages/_document.tsx
+++ b/examples/nextjs/src/pages/_document.tsx
@@ -8,12 +8,6 @@ export default function Document() {