Skip to content

Commit

Permalink
Alpha (#559)
Browse files Browse the repository at this point in the history
* fix: XMLParser force array not object (#242)

* Feat/export req (#243)

* fix: XMLParser force array not object

* fix: XMLParser force array not object

* chore: [ci] release (alpha) (#244)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Export types (#245)

* Export types (#247)

* feat: Export types

* fix: Hex number convert to string not big number

* chore: [ci] release (alpha) (#246)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/up and down (#248)

* feat: Upload Object add AuthType

* feat: Download s3 object

* feat: Migrate Bucket add authType

* feat: SpClient expose makeHeaders method

* chore: Update constant pathj

* chore: [ci] release (alpha) (#249)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/xml null (#250)

* feat: Add default XML value

* feat: Add default XML value

* chore: [ci] release (alpha) (#251)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/gap time (#252)

* fix: Gap time

* fix: Gap time

* Feat/meta (#254)

* feat: GetBucketMeta

* feat: Object Meta

* Create curly-fishes-bow.md

* chore: [ci] release (alpha) (#253)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Refactor/sp client (#255)

* chore: Exact parseError

* feat: Remove deps

* chore: Structor

* feat: Refeactor Sp Client

* chore: [ci] release (alpha) (#256)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Custom HTTP method (#257)

* feat: Custom HTTP method

* chore(example): Update

* chore: [ci] release (alpha) (#258)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(docs): Update README (#259)

* chore: Add comment (#260)

* fix: Sp types (#261)

* Feat/upload progress (#263)

* fix: GfSpGetUserBucketsResponse Bucket types

* feat: Cross fetch

* chore: [ci] release (alpha) (#262)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: EncodePath (#264)

* chore: [ci] release (alpha) (#265)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Download http method (#266)

* fix: Download http method (#267)

* chore: [ci] release (alpha) (#268)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: New API getObjectPreviewUrl (#270)

* chore: [ci] release (alpha) (#271)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: XML type align to go struct (#272)

* feat: Optional endpoint param (#273)

* chore: [ci] release (alpha) (#274)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: XML parse boolean (#275)

* chore: [ci] release (alpha) (#276)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Common Prefix parse as array (#277)

* chore: [ci] release (alpha) (#278)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* test: Parse XML test case (#279)

* feat: Migrate bucket (#280)

* fix: Create bucket quota params (#282)

* chore: [ci] release (alpha) (#281)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Replace xml2js to fast-xml-parse (#283)

* Feat/update bucket info (#284)

* feat: Update Bucket Info API

* chore(example): Update

* chore: [ci] release (alpha) (#285)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: EncodePath function (#286)

* fix: Convert enum to number (#287)

* chore: [ci] release (alpha) (#288)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Add listReadRecords api

* feat: ListGroups API

* feat: ListObjectsByIds API

* feat: ListBucketsByIds api

* feat: Add verifyPermission api

* feat: ListGroupsMembers

* feat: ListUserGroups api

* feat: Add listUserOwnedGroups api

* chore: [ci] release (alpha)

* feat: Sort query (#292)

* feat: Sort query

* Create healthy-chicken-beam.md

* chore: [ci] release (alpha) (#293)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(exmaple): Group (#294)

* docs: Update API (#295)

* chore: Pre Exit (#296)

* Pre exit (#297)

* chore: Pre Exit

* chore: Pre Exit

* chore: [ci] release (#298)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pre Enter (#299)

* Refactor/sp (#302)

* feat: Auth expiry timestamp add default value

* refactor: Sp types

* fix: Expire time

* feat: Upgrade TinyGo version

* Refactor/sp (#305)

* feat: Auth expiry timestamp add default value

* refactor: Sp types

* fix: Expire time

* feat: Upgrade TinyGo version

* refactor: Sp metainfo

* chore: Update Example

* chore: [ci] release (alpha) (#303)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Build (#306)

* chore: Update Deps (#308)

* chore: [ci] release (alpha) (#307)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: Update README (#309)

* Feat/validator (#310)

* feat: EditValidator

* feat: Add proposal api

* refactor: TxClient

* feat: Bucket listBucketsByPaymentAccount api

* fix: Proposal and Validator API

* feat: ListUserPaymentAccount api

* chore: [ci] release (alpha) (#311)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Nodejs example update

* test: Test case update

* chore: README update

* feat: ListBuckets

* fix: QueryClient and TxClient is not singleton

* chore: Upgrade types

* fix: PutPolicy

* feat: ListObjectPolicies api

* chore: [ci] release (alpha)

* fix: IOC (#314)

fix: All class use injectable

* chore: [ci] release (alpha) (#315)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Update exmaple (#316)

* feat: Distribution API (#317)

* chore: [ci] release (alpha) (#318)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: MsgSettle (#319)

* feat: MsgSettle

* Create fast-houses-do.md

* chore: [ci] release (alpha) (#320)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(example): Update custom tx (#321)

* chore: [ci] release (alpha) (#322)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Github Action issue close (#323)

* feat: Bucket headBucketExtra api (#324)

* chore: [ci] release (alpha) (#325)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Nodejs Example update (#326)

* chore: Example Update (#327)

* Chore/example (#328)

* chore: Example Update

* chore: Example Update

* chore: Update (#329)

* feat: Custom Tx (#330)

* chore: [ci] release (alpha) (#331)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Delete Policy (#332)

* chore: [ci] release (alpha) (#333)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/create app (#334)

* feat: Template Init

* feat: Template Init

* feat: Create App Commander

* chore: [ci] release (alpha) (#335)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Create App Commander (#336)

* chore: [ci] release (alpha) (#337)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Update README (#338)

* feat: Add vite template (#339)

* chore: [ci] release (alpha) (#340)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* release 0.2.5 (#341)

chore: Pre Exit

* chore: [ci] release (#342)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Enter pre (#343)

* chore(docs): Update README (#344)

* Chore/package (#346)

* chore: Update package.json

* chore: Update package.json

* Chore/package js sdk (#347)

* chore: Update deps

* chore: Update deps

* chore: [ci] release (alpha) (#348)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Chore/update deps (#349)

* chore: Update deps

* chore: Update deps

* Docs site ! (#350)

* feat: Docs init

* feat: Docs init

* chore: Update README

* docs: Update Docs

* chore: Update deps

* chore: Update docs

* chore: Update docs

* chore: Update

* docs: Update

* docs: Update

* docs: Update

* docs: Update Crosschain doc

* chore: Update docs

* chore: Pre exit (#351)

* chore: [ci] release (#352)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Custom Tx support any type! (#355)

* chore: Pre enter (#357)

* chore: [ci] release (alpha) (#356)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Offchain auth ei.data undefined (#358)

* fix: Offchain auth ei.data undefined

* Create witty-bikes-flash.md

---------

Co-authored-by: rrr523 <[email protected]>

* chore: [ci] release (alpha) (#359)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Offchain auth ei.data undefined (#360)

* fix: Offchain auth ei.data undefined

* Create ten-maps-travel.md

---------

Co-authored-by: rrr523 <[email protected]>

* chore: [ci] release (alpha) (#361)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Release 1.0.0 (#365)

* chore: [ci] release (alpha) (#366)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pre exit (#367)

* chore: [ci] release (#368)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pre enter

* fix(types): Payment listUserPaymentAccounts return response (#370)

* fix(types): Payment listUserPaymentAccounts return response

* fix(types): Payment listUserPaymentAccounts return response

* Create chilly-pens-listen.md

* chore: [ci] release (alpha) (#371)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Update doc url (#372)

* chore: Pre exit (#377)

* chore: [ci] release (#378)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Replace legacy method (#381)

* fix: Replace legacy method

* Create cool-shoes-visit.md

---------

Co-authored-by: rrr523 <[email protected]>

* chore: Update Deps (#382)

* docs: Update README (#384)

* chore: [ci] release (#383)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/new msg tag (#413)

* feat: Upgrade types to 0.4.0-alpha-25

* feat: Create Group with tags

* feat: SetTag tx

* chore(example): Update Group Tag

* feat: Create Bucket with tags

* chore(example): Create bucket with tags

* refactor: Rename Object class name

* feat: Create Object with tags

* chore(example): Create Object with tags

* chore: Enter pre changeset

* chore: Minor Changeset

* chore: [ci] release (alpha) (#414)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Chore/update create tags (#415)

* chore(example): Nodejs example update new create tx

* docs: Update Docs - new create tx

* chore: Remove engines filed (#418)

* Feat/js reed solomon (#422)

* feat: Js implement reed solomon

* docs: Update README

* docs: Update README

* Create beige-beds-lay.md

* feat: Empty buffer

* chore: Update params

* feat: Nodejs support worker

* feat: Nodejs support worker

* feat: Add types

* chore: Update Nodejs example

* chore: Update docs and example

* chore: [ci] release (alpha) (#419)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Update example (#423)

* feat: Add SP Api types (#424)

* chore: [ci] release (alpha) (#425)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Add bucket meta type (#426)

* feat: Add bucket meta type (#427)

* chore: [ci] release (alpha) (#428)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/rs webworker (#429)

* chore: Update example, using reed solomon

* chore: Update Rollup config

* chore: Benchmark

* docs: Update README

* feat: Support WebWorker

* chore: [ci] release (alpha) (#430)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Feat/rs webworker (#431)

* chore: Update example, using reed solomon

* chore: Update Rollup config

* chore: Benchmark

* docs: Update README

* feat: Support WebWorker

* feat: Add types

* chore: Add benchmark

* Merge branch 'alpha' into feat/rs_webworker

* chore: [ci] release (alpha) (#432)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Exit pre

* chore: [ci] release (#433)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Enter alpha

* Feat/new tag (#461)

* Fix/sp tag type (#444)

* fix: Sp types

* fix: Sp types

(cherry picked from commit eb75e4d)

* fix: Tag compatibility (#443)

(cherry picked from commit 7a2e9d2)

* feat: Upgrade cosmos type to 0.4.0 alpha 30

* chore: Update feegranet example

* feat: Add SetTag API

* chore: [ci] release (alpha) (#462)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pnpm install --no-frozen-lockfile

* chore: [ci] release (alpha) (#463)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Sp Api types (#464)

* chore: [ci] release (alpha) (#465)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pre Exit (#468)

* chore: [ci] release (#469)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pnpm install --no-frozen-lockfile

* simply offchainauth (ED25519) (#489)

* feat: Register pub key

* feat: Replace zk crypto with ed25519

* chore: Remove file

* chore: Remove console

* chore: Changeset file

* feat: Remove Client wasm url param

* chore/ remove file (#490)

* feat: Register pub key

* feat: Replace zk crypto with ed25519

* chore: Remove file

* chore: Remove console

* chore: Changeset file

* feat: Remove Client wasm url param

* chore: Update Example

* chore: Remove file

* chore: Alpha mode

* chore: Merge in alpha (#492)

* chore: Merge in alpha

* chore: Changeset file

* Create heavy-dolphins-obey.md

* Update heavy-dolphins-obey.md

* chore: [ci] release (alpha) (#493)

* chore: [ci] release (alpha)

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: rk <[email protected]>

* chore: Pnpm lockfile

* Changeset release/alpha (#494)

* chore: [ci] release (alpha)

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: Update REAMDE (#495)

* Feat/preview api (#496)

* feat: Preview Api

* feat: Preview Api

* chore: [ci] release (alpha) (#497)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Upgrade types to 31

* feat: Remove Approval when creating bucket

* feat: Remove Approval when creating object

* chore: [ci] release (alpha)

* feat: Delegate upload

* feat: Add visibility params

* feat: Add toggleSpAsDelegatedAgent API

* feat: Resumable Object Upload

* chore: [ci] release (alpha)

* docs: Example all update

* chore: Test case update

* chore: Update README

* docs(docusaurus): Update API refs

* chore: Remove deprecated packages

* feat: DelegatedCreateFolder api

* chore: [ci] release (alpha)

* chore(docs): Update docs

* feat: Sp response add offchainstatus and SpAsDelegatedAgentDisabled

* feat: Bucket.getBucketReadQuota add monthly field

* chore: [ci] release (alpha)

* fix: OffChainStatus type

* fix: Delegated create folder response return parse error

* chore: [ci] release (alpha) (#514)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix/vgf strategy (#520)

fix: Change Vgf Strategy

* chore: [ci] release (alpha) (#521)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fetch timeout

* fix: Statement's expirationTime compatibility

* chore: [ci] release (alpha) (#527)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Update Deps

* Feat/upload progress (#529)

* chore: Install superagent

* feat: Support upload progress

* feat: Compatibility with Nodejs and Browser

* chore: Update example

* Create lucky-insects-reply.md

* chore: [ci] release (alpha) (#530)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Upgrade wagmi and rainkit (#532)

* chore: Update example (#533)

* feat: MsgSetBucketFlowRateLimit (#531)

* feat: MsgSetBucketFlowRateLimit

* chore: Import package

* Create rich-jars-fix.md

* chore: Upgrade action node version

* Feat: BSC Cross Chain SDK (#522)

* chore: Cross BSC and Gnfd init

* chore: Install deps

* feat: Abi files

* feat: Framework

* feat: Executor

* test: Test case

* chore(test): Test framework

* feat: Hub Abi files

* chore: Hub tests

* feat: MultiMessage

* feat: MultiMessage module

* feat: Exectuor

* chore: README

* Create five-chefs-lay.md

* chore: Assert

* feat: Support Local Account and JSONRPC Account

* chore(example): Cross Example

* docs: Update README

* test: Delete policy case

* chore: Export enum

* feat: Support Callback

* chore: Clean deps

* chore: [ci] release (alpha) (#534)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: Update docs (#535)

* chore: Exit pre

* chore: [ci] release (#536)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Enter alpha

* feat: Bucket cancelMigrateBucket (#540)

* chore: [ci] release (alpha) (#541)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: EncodePath utf8 (#549)

* chore: [ci] release (alpha) (#550)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Export encodePath (#551)

* Feat/export encode path (#553)

* feat: Export encodePath

* fix: EncodePath utf8

* chore: [ci] release (alpha) (#552)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: Pre exit

* chore: [ci] release (#557)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: aiden-cao <[email protected]>
  • Loading branch information
4 people authored Jul 1, 2024
1 parent d1b742a commit e06c25f
Show file tree
Hide file tree
Showing 18 changed files with 2,664 additions and 2,217 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ You can find some package documentation below:
| [@bnb-chain/create-gnfd-app](./packages/create-gnfd-app/README.md) | Create Greenfield App Quickly | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fcreate-gnfd-app?color=blue)](https://www.npmjs.com/package/@bnb-chain/create-gnfd-app) |
| [@bnb-chain/bsc-cross-greenfield-sdk](./packages/bsc-cross-sdk/README.md) | Execute tx in BSC | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fbsc-cross-greenfield-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/bsc-cross-greenfield-sdk) |

<!-- ## Playground
* [Browser](https://codesandbox.io/p/github/rrr523/greenfield-nextjs-template/main?import=true) -->
<!-- TODO: after upgrade SDK version -->
<!-- * [Nodejs](https://codesandbox.io/p/devbox/nodejs-greenfield-js-sdk-demo-wd5zft) -->

## Online Examples / Playground

* [Nextjs](https://stackblitz.com/github/rrr523/greenfield-nextjs-template)
* [Vite](https://stackblitz.com/github/rrr523/greenfield-vite-template)
* [Create React App](https://stackblitz.com/github/rrr523/greenfield-cra-template)

## Quick Start

You can use [`create-gnfd-app`](./packages/create-gnfd-app/README.md) to create a app quickly.
Expand Down
11 changes: 11 additions & 0 deletions doc-site/docs/FAQs/migrate-to-1.3.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: migrate
title: migrate to 2
order: 1
---

1. Remove `zkCryptoUrl` params when `Client` initializing. [PR: simply offchainauth (ED25519)](https://github.com/bnb-chain/greenfield-js-sdk/pull/489)

2. `bucket.createBucket` and `object.createObject` 's params changes. [PR: remove approval when create bucket / object](https://github.com/bnb-chain/greenfield-js-sdk/pull/498)

3. `object.uploadObject` 's params changes. [PR: upload object](https://github.com/bnb-chain/greenfield-js-sdk/pull/500)
28 changes: 28 additions & 0 deletions examples/browser-file-management/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@
- Updated dependencies
[[`64a62b1e1d0387148bbd621448a67b2bb2c2aa5b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/64a62b1e1d0387148bbd621448a67b2bb2c2aa5b)]:
- @bnb-chain/greenfield-js-sdk@2.0.1
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b),
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0

## 0.1.2-alpha.2

### Patch Changes

- Updated dependencies
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.2

## 0.1.2-alpha.1

### Patch Changes

- Updated dependencies
[[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.1

## 0.1.2-alpha.0

### Patch Changes

- Updated dependencies
[[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.0

## 0.1.1

Expand Down
34 changes: 32 additions & 2 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,38 @@
### Patch Changes

- Updated dependencies
[[`64a62b1e1d0387148bbd621448a67b2bb2c2aa5b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/64a62b1e1d0387148bbd621448a67b2bb2c2aa5b)]:
- @bnb-chain/greenfield-js-sdk@2.0.1
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`acdf20f879f21140fc355ca38c532d523263076d`](https://github.com/bnb-chain/greenfield-js-sdk/commit/acdf20f879f21140fc355ca38c532d523263076d),
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b),
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0
- @bnb-chain/bsc-cross-greenfield-sdk@0.0.3

## 0.0.29-alpha.2

### Patch Changes

- Updated dependencies
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`acdf20f879f21140fc355ca38c532d523263076d`](https://github.com/bnb-chain/greenfield-js-sdk/commit/acdf20f879f21140fc355ca38c532d523263076d)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.2
- @bnb-chain/bsc-cross-greenfield-sdk@0.0.3-alpha.0

## 0.0.29-alpha.1

### Patch Changes

- Updated dependencies
[[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.1

## 0.0.29-alpha.0

### Patch Changes

- Updated dependencies
[[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.0

## 0.0.28

Expand Down
45 changes: 43 additions & 2 deletions examples/nextjs/src/components/bucket/migrate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const MigrateBucket = () => {

return (
<>
<h4>Migrate Bucket</h4>
<h4>Migrate Bucket / Cancel Migrate Bucket</h4>
<div>
bucket name:
<input
Expand Down Expand Up @@ -68,7 +68,48 @@ export const MigrateBucket = () => {
}
}}
>
broadcast with simulate
Migrate Bucket
</button>

<br />
<button
onClick={async () => {
if (!address) return;

const provider = await connector?.getProvider();
const offChainData = await getOffchainAuthKeys(address, provider);
if (!offChainData) {
alert('No offchain, please create offchain pairs first');
return;
}

const cancelMigrateBucketTx = await client.bucket.cancelMigrateBucket({
bucketName,
operator: address,
});

const simulateInfo = await cancelMigrateBucketTx.simulate({
denom: 'BNB',
});

console.log('simulateInfo', simulateInfo);

const res = await cancelMigrateBucketTx.broadcast({
denom: 'BNB',
gasLimit: Number(simulateInfo?.gasLimit),
gasPrice: simulateInfo?.gasPrice || '5000000000',
payer: address,
granter: '',
});

console.log('res', res);

if (res.code === 0) {
alert('success');
}
}}
>
Cancel Migrate Bucket
</button>
</>
);
Expand Down
1 change: 1 addition & 0 deletions examples/nextjs/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ export const wagmiConfig = createConfig({
[bscChain.id]: http(),
},
connectors,
ssr: true,
});
30 changes: 28 additions & 2 deletions examples/nodejs-file-management/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,34 @@
### Patch Changes

- Updated dependencies
[[`64a62b1e1d0387148bbd621448a67b2bb2c2aa5b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/64a62b1e1d0387148bbd621448a67b2bb2c2aa5b)]:
- @bnb-chain/greenfield-js-sdk@2.0.1
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a),
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b),
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0

## 0.0.28-alpha.2

### Patch Changes

- Updated dependencies
[[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.2

## 0.0.28-alpha.1

### Patch Changes

- Updated dependencies
[[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.1

## 0.0.28-alpha.0

### Patch Changes

- Updated dependencies
[[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)]:
- @bnb-chain/greenfield-js-sdk@2.1.0-alpha.0

## 0.0.27

Expand Down
16 changes: 16 additions & 0 deletions packages/bsc-cross-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @bnb-chain/bsc-cross-greenfield-sdk

## 0.0.3

### Patch Changes

- [#551](https://github.com/bnb-chain/greenfield-js-sdk/pull/551)
[`acdf20f879f21140fc355ca38c532d523263076d`](https://github.com/bnb-chain/greenfield-js-sdk/commit/acdf20f879f21140fc355ca38c532d523263076d)
Thanks [@rrr523](https://github.com/rrr523)! - feat: export `encodePath`

## 0.0.3-alpha.0

### Patch Changes

- [#551](https://github.com/bnb-chain/greenfield-js-sdk/pull/551)
[`acdf20f879f21140fc355ca38c532d523263076d`](https://github.com/bnb-chain/greenfield-js-sdk/commit/acdf20f879f21140fc355ca38c532d523263076d)
Thanks [@rrr523](https://github.com/rrr523)! - feat: export `encodePath`

## 0.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bsc-cross-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/bsc-cross-greenfield-sdk",
"version": "0.0.2",
"version": "0.0.3",
"description": "bsc cross greenfield sdk",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
43 changes: 38 additions & 5 deletions packages/js-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
# @bnb-chain/greenfield-js-sdk

## 2.0.1
## 2.1.0

### Minor Changes

- [#540](https://github.com/bnb-chain/greenfield-js-sdk/pull/540)
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)
Thanks [@rrr523](https://github.com/rrr523)! - feat: Add `bucket.cancelMigrateBucket` API.

### Patch Changes

- [#553](https://github.com/bnb-chain/greenfield-js-sdk/pull/553)
[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a)
Thanks [@rrr523](https://github.com/rrr523)! - feat: export `encodePath`

- [#549](https://github.com/bnb-chain/greenfield-js-sdk/pull/549)
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b)
Thanks [@rrr523](https://github.com/rrr523)! - feat: EncodePath UTF-8

## 2.1.0-alpha.2

### Patch Changes

- [#554](https://github.com/bnb-chain/greenfield-js-sdk/pull/554)
[`64a62b1e1d0387148bbd621448a67b2bb2c2aa5b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/64a62b1e1d0387148bbd621448a67b2bb2c2aa5b)
Thanks [@rrr523](https://github.com/rrr523)! - fix: Upload file that `content-type` is
`application/json`, cancel serialize.
- [#553](https://github.com/bnb-chain/greenfield-js-sdk/pull/553)
[`909b463c72a0c83bddc1e41b840d5c871325d54a`](https://github.com/bnb-chain/greenfield-js-sdk/commit/909b463c72a0c83bddc1e41b840d5c871325d54a)
Thanks [@rrr523](https://github.com/rrr523)! - feat: export `encodePath`

## 2.1.0-alpha.1

### Patch Changes

- [#549](https://github.com/bnb-chain/greenfield-js-sdk/pull/549)
[`34aa1c71d9ee1bc3856aa199a3eee9e50827376b`](https://github.com/bnb-chain/greenfield-js-sdk/commit/34aa1c71d9ee1bc3856aa199a3eee9e50827376b)
Thanks [@rrr523](https://github.com/rrr523)! - feat: EncodePath UTF-8

## 2.1.0-alpha.0

### Minor Changes

- [#540](https://github.com/bnb-chain/greenfield-js-sdk/pull/540)
[`3e7f1cae3ac12215d5d46ef6755fd198ad450190`](https://github.com/bnb-chain/greenfield-js-sdk/commit/3e7f1cae3ac12215d5d46ef6755fd198ad450190)
Thanks [@rrr523](https://github.com/rrr523)! - feat: Add `bucket.cancelMigrateBucket` API.

## 2.0.0

Expand Down
2 changes: 1 addition & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/greenfield-js-sdk",
"version": "2.0.1",
"version": "2.1.0",
"description": "greenfield js chain and sp sdk",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
15 changes: 15 additions & 0 deletions packages/js-sdk/src/api/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
QueryVerifyPermissionResponse,
} from '@bnb-chain/greenfield-cosmos-types/greenfield/storage/query';
import {
MsgCancelMigrateBucket,
MsgCreateBucket,
MsgDeleteBucket,
MsgDeletePolicy,
Expand All @@ -42,6 +43,7 @@ import { container, delay, inject, injectable } from 'tsyringe';
import {
AuthType,
GRNToString,
MsgCancelMigrateBucketTypeUrl,
MsgCreateBucketTypeUrl,
MsgDeleteBucketTypeUrl,
MsgMigrateBucketTypeUrl,
Expand Down Expand Up @@ -104,6 +106,7 @@ import { decodeObjectFromHexString } from '../utils/encoding';
import { Sp } from './sp';
import { Storage } from './storage';
import { VirtualGroup } from './virtualGroup';
import { MsgCancelMigrateBucketSDKTypeEIP712 } from '@/messages/greenfield/storage/MsgCancelMigrateBucket';

export interface IBucket {
/**
Expand Down Expand Up @@ -182,6 +185,8 @@ export interface IBucket {

migrateBucket(params: MigrateBucketApprovalRequest, authType: AuthType): Promise<TxResponse>;

cancelMigrateBucket(msg: MsgCancelMigrateBucket): Promise<TxResponse>;

putBucketPolicy(bucketName: string, srcMsg: Omit<MsgPutPolicy, 'resource'>): Promise<TxResponse>;

/**
Expand Down Expand Up @@ -568,6 +573,16 @@ export class Bucket implements IBucket {
return await this.migrateBucketTx(msg, signedMsg);
}

public async cancelMigrateBucket(msg: MsgCancelMigrateBucket): Promise<TxResponse> {
return await this.txClient.tx(
MsgCancelMigrateBucketTypeUrl,
msg.operator,
MsgCancelMigrateBucketSDKTypeEIP712,
MsgCancelMigrateBucket.toSDK(msg),
MsgCancelMigrateBucket.encode(msg).finish(),
);
}

private async migrateBucketTx(msg: MsgMigrateBucket, signedMsg: MigrateBucketApprovalResponse) {
return await this.txClient.tx(
MsgMigrateBucketTypeUrl,
Expand Down
17 changes: 8 additions & 9 deletions packages/js-sdk/src/clients/spclient/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AuthType, ReqMeta } from '@/types/auth';
import { hexlify, joinSignature } from '@ethersproject/bytes';
import { SigningKey } from '@ethersproject/signing-key';
import { toUtf8Bytes } from '@ethersproject/strings';
import { ed25519 } from '@noble/curves/ed25519';
import { Headers } from 'cross-fetch';
import { keccak256 } from 'ethereum-cryptography/keccak.js';
Expand Down Expand Up @@ -196,16 +197,14 @@ export const encodePath = (pathName: string) => {
continue;

// others characters need to be encoded
default:
// . ! @ # $ % ^ & * ) ( - + = { } [ ] / " , ' < > ~ \ .` ? : ; | \\
if (/[.!@#\$%\^&\*\)\(\-+=\{\}\[\]\/\",'<>~\·`\?:;|\\]+$/.test(s)) {
// english characters
const hexStr = s.charCodeAt(0).toString(16);
encodedPathName += '%' + hexStr.toUpperCase();
} else {
// others characters
encodedPathName += encodeURI(s);
default: {
const u = toUtf8Bytes(s);

for (let i = 0; i < u.length; i++) {
const hexStr = hexlify(u[i]);
encodedPathName += '%' + hexStr.slice(2).toUpperCase();
}
}
}
}
return encodedPathName;
Expand Down
1 change: 1 addition & 0 deletions packages/js-sdk/src/constants/typeUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const MsgDisableRefundTypeUrl = '/greenfield.payment.MsgDisableRefund';
export const MsgWithdrawTypeUrl = '/greenfield.payment.MsgWithdraw';
export const MsgCancelCreateObjectTypeUrl = '/greenfield.storage.MsgCancelCreateObject';
export const MsgMigrateBucketTypeUrl = '/greenfield.storage.MsgMigrateBucket';
export const MsgCancelMigrateBucketTypeUrl = '/greenfield.storage.MsgCancelMigrateBucket';
export const MsgCreateBucketTypeUrl = '/greenfield.storage.MsgCreateBucket';
export const MsgCreateGroupTypeUrl = '/greenfield.storage.MsgCreateGroup';
export const MsgCreateObjectTypeUrl = '/greenfield.storage.MsgCreateObject';
Expand Down
Loading

0 comments on commit e06c25f

Please sign in to comment.