Skip to content

Commit

Permalink
Release 2.0.0 (#538)
Browse files Browse the repository at this point in the history
* chore: [ci] release (alpha) (#231)

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

* Feat/auth (#232)

* feat: Compatibility new payment api

* feat: Compatibility updateGroupMember api

* chore: Update example

* feat: Feegrant api add timestamp

* feat: EDDSA Sign

* feat: Remove log (#234)

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

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

* fix: Feegrant add expiration time (#235)

* fix: Feegrant add expiration time

* chore(example): GetAllowence support pagination

* refactor (#236)

* refactor: Tx

* fix: Type

* feat: Add Group API

* feat: Update Sp API

* feat: Bucket add authType

* feat:  and  add  params

* fix: Types

* feat: Change type

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

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

* Fix/read quota (#238)

* fix: CreateBucketApproval

* feat: ReadQuota

* chore(example): Update Example

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

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

* XML response (#240)

* feat: Return XML type

* feat: CreateBucket Add payment address

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

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

* 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>

---------

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 May 2, 2024
1 parent 68a504c commit e254e56
Show file tree
Hide file tree
Showing 158 changed files with 24,572 additions and 21,917 deletions.
2 changes: 1 addition & 1 deletion .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
node-version: '18.17.0'
node-version: '18.20.2'
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ A Greenfield JS SDK is an easy-to-use tool designed to help developers build dec

You can find some package documentation below:

| Package | Description | Version |
| Package | Description | Version |
| --- | --- | --- |
| [@bnb-chain/greenfield-js-sdk](./packages/js-sdk/README.md) | A client library for Greenfield Chain | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-js-sdk?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-js-sdk) |
| [@bnb-chain/reed-solomon](./packages/reed-solomon/README.md) | calculate file's `checksums` | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Freed-solomon?color=blue)](https://www.npmjs.com/package/@bnb-chain/reed-solomon) |
| [@bnb-chain/greenfield-zk-crypto](./packages/zk-crypto/README.md) | WASM module about sign crypto | [![npm](https://img.shields.io/npm/v/%40bnb-chain%2Fgreenfield-zk-crypto?color=blue)](https://www.npmjs.com/package/@bnb-chain/greenfield-zk-crypto) |
| [@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

* [Nextjs](https://codesandbox.io/p/github/rrr523/greenfield-nextjs-template/main)
* [Create React App](https://codesandbox.io/p/github/rrr523/greenfield-cra-template/main)
* [Nextjs](https://codesandbox.io/p/github/rrr523/greenfield-nextjs-template/main?import=true)
* [Vite](https://codesandbox.io/p/github/rrr523/greenfield-vite-template/main)
* [Create React App](https://codesandbox.io/p/github/rrr523/greenfield-cra-template/main?import=true)

## Quick Start

Expand All @@ -27,7 +33,7 @@ You can use [`create-gnfd-app`](./packages/create-gnfd-app/README.md) to create
> npx @bnb-chain/create-gnfd-app
```

![](./packages/create-gnfd-app/example.gif)
![quick start example](./packages/create-gnfd-app/example.gif)

## Supported JS environments

Expand All @@ -44,6 +50,7 @@ You can use [`create-gnfd-app`](./packages/create-gnfd-app/README.md) to create
```

2. Build packages:

```bash
> pnpm -F "@bnb-chain/**" build
```
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)
68 changes: 11 additions & 57 deletions doc-site/docs/api/bucket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,69 +18,23 @@ for creating bucket and sends the createBucket transaction to the Greenfield.
| bucketName | bucket name |
| creator | creator account address |
| visibility | [VisibilityType](/types/visibility) |
| chargedReadQuota | defines the traffic quota that you read from primary sp |
| spInfo | primary sp address |
| chargedReadQuota | [Long](/types/long)defines the traffic quota that you read from primary sp |
| primarySpAddress | 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) |


<Tabs groupId="example">
<TabItem value="Browser" label="Browser">

```jsx
```js
const tx = await client.bucket.createBucket(
{
bucketName: 'bucket_name',
creator: address,
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
chargedReadQuota: '0',
spInfo: {
primarySpAddress: 'primary_sp_address',
},
creator: '0x...',
visibility: VisibilityType.VISIBILITY_TYPE_PUBLIC_READ,
chargedReadQuota: Long.fromString('0'),
primarySpAddress: '0x....',
paymentAddress: address,
tags: {
tags: [],
},
},
// highlight-start
{
type: 'EDDSA',
domain: window.location.origin,
seed: offChainData.seedString,
address,
},
// highlight-end
);
```

</TabItem>
<TabItem value="Nodejs" label="Nodejs">

```js
const createBucketTx = await client.bucket.createBucket(
{
bucketName: bucketName,
creator: ACCOUNT_ADDRESS,
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
chargedReadQuota: '0',
spInfo: {
primarySpAddress: spInfo.primarySpAddress,
},
paymentAddress: ACCOUNT_ADDRESS,
},
// highlight-start
{
type: 'ECDSA',
privateKey: ACCOUNT_PRIVATEKEY,
},
// highlight-end
}
);
```

</TabItem>
</Tabs>

## deleteBucket <ApiTypes type="Tx" />

Send DeleteBucket msg to greenfield chain and return txn hash.
Expand All @@ -90,7 +44,7 @@ Send DeleteBucket msg to greenfield chain and return txn hash.
| bucketName | The name of the bucket to be deleted |
| operator | operator account address |

```jsx title="Browser | Nodejs"
```js
const tx = await client.bucket.deleteBucket({
bucketName: bucketName,
operator: address,
Expand All @@ -110,7 +64,7 @@ Delete the bucket policy of the principal.
| principalAddr | Principal define the roles that can grant permissions |
| principalType | PrincipalType refers to the identity type of system users or entities. |

```jsx title="Browser | Nodejs"
```js
const tx = await client.bucket.deleteBucketPolicy(
address,
bucketName,
Expand All @@ -129,7 +83,7 @@ This API is used to get bucket meta by bucket name.
| ---------- | ----------- |
| bucketName | bucket name |

```jsx title="Browser | Nodejs"
```js
const bucketInfo = await client.bucket.getBucketMeta({
bucketName: 'bucketName',
});
Expand Down
3 changes: 2 additions & 1 deletion doc-site/docs/api/group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ await client.group.updateGroupExtra({

<Tx />

## updateGroupMember <ApiTypes type="Tx" />
## updateGroupMember
<!-- <ApiTypes type="Tx" /> -->

Update a group by adding or removing members. The sender can be the group owner or any individual
account(Principle) that has been granted permission by the group owner.
Expand Down
114 changes: 19 additions & 95 deletions doc-site/docs/api/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Send `CancelCreateObject` txn to greenfield chain.
| bucketName | the name of the bucket |
| objectName | the name of the object |

<!-- <Tx /> -->

## createFolder <ApiTypes type="Storage Provider" /> <ApiTypes type="Tx" />

Expand All @@ -27,132 +26,57 @@ Send create empty object txn to greenfield chain.
| params | description |
| ---------- | -------------------------------------- |
| bucketName | bucket name |
| objectName | object name |
| objectName | folder name, end with `/` |
| creator | the creator of object |
| tags | defines a list of tags which will be set to the object |
| authType | [AuthType](/client/sp-client#authtype) |
| visibility | [VisibilityType](/types/visibility) |
| redundancyType | [RedundancyType](/types/redundancy) |

<Tabs groupId="example">
<TabItem value="Browser" label="Browser">

```jsx
const tx = await client.object.createFolder(
{
bucketName: createObjectInfo.bucketName,
objectName: createObjectInfo.objectName + '/',
creator: address,
tags: {
tags: [],
},
},
// highlight-start
{
type: 'EDDSA',
domain: window.location.origin,
seed: offChainData.seedString,
address,
},
// highlight-end
redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,
visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,
}
);
```

</TabItem>
<TabItem value="Nodejs" label="Nodejs">

```js
const tx = await client.object.createFolder(
{
bucketName: bucketName,
objectName: objectName + '/',
creator: ACCOUNT_ADDRESS,
},
// highlight-start
{
type: 'ECDSA',
privateKey: ACCOUNT_PRIVATEKEY,
},
// highlight-end
);
```

</TabItem>
</Tabs>

<Tx />

## createObject <ApiTypes type="Storage Provider" /> <ApiTypes type="Tx" />
## createObject

<!-- <ApiTypes type="Storage Provider" /> <ApiTypes type="Tx" /> -->

Get approval of creating object and send createObject txn to greenfield chain.
Creating object and send createObject txn to greenfield chain.

| params | description |
| --------------- | ----------------------------------------------------------------------- |
| bucketName | bucket name |
| objectName | object name |
| creator | the creator of object |
| visibility | [VisibilityType](/types/visibility) |
| fileType | [file type](https://developer.mozilla.org/en-US/docs/Web/API/File/type) |
| contentType | [file type](https://developer.mozilla.org/en-US/docs/Web/API/File/type) |
| redundancyType | [RedundancyType](/types/redundancy) |
| 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 |

<Tabs groupId="example">
<TabItem value="Browser" label="Browser">
| payloadSize | file content [Long](/types/long)length |
| expectChecksums | file's expectChecksums |

```jsx
// https://github.com/bnb-chain/greenfield-js-sdk/blob/main/examples/nextjs/src/components/object/create/index.tsx#L76-L95
const tx = await client.object.createObject(
{
bucketName: 'bucket_name',
objectName: 'object_name',
creator: '0x...',
visibility: 'VISIBILITY_TYPE_PRIVATE',
fileType: 'json',
redundancyType: 'REDUNDANCY_EC_TYPE',
contentLength: 13311,
expectCheckSums: JSON.parse(expectCheckSums),
tags: {
tags: [],
},
},
// highlight-start
{
type: 'EDDSA',
domain: window.location.origin,
seed: offChainData.seedString,
address,
},
// highlight-end
visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,
contentType: 'json',
redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,
payloadSize: Long.fromInt(13311),
expectCheckSums: expectCheckSums.map((x) => bytesFromBase64(x)),
}
);
```
</TabItem>
<TabItem value="Nodejs" label="Nodejs">

```js
// https://github.com/bnb-chain/greenfield-js-sdk/blob/main/examples/nodejs/cases/storage.js#L61-L76
const tx = await client.object.createObject(
{
bucketName: bucketName,
objectName: objectName,
creator: ACCOUNT_ADDRESS,
visibility: 'VISIBILITY_TYPE_PRIVATE',
fileType: fileType,
redundancyType: 'REDUNDANCY_EC_TYPE',
contentLength,
expectCheckSums: JSON.parse(expectCheckSums),
},
// highlight-start
{
type: 'ECDSA',
privateKey: ACCOUNT_PRIVATEKEY,
},
// highlight-end
);
```

</TabItem>
</Tabs>

<Tx />

Expand Down
12 changes: 1 addition & 11 deletions doc-site/docs/client/greenfield.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import TabItem from '@theme/TabItem';

```js
import { Client } from '@bnb-chain/greenfield-js-sdk';

const client = Client.create(GRPC_URL, String(GREEN_CHAIN_ID), {
zkCryptoUrl:
'https://unpkg.com/@bnb-chain/[email protected]/dist/node/zk-crypto.wasm',
});
const client = Client.create(GRPC_URL, GREEN_CHAIN_ID);
```

</TabItem>
Expand All @@ -37,12 +33,6 @@ const client = Client.create(GRPC_URL, GREEN_CHAIN_ID);
</TabItem>
</Tabs>

:::tip

The browser needs to load wasm manually.

:::

The JS SDK consists of two parts:

- Chain: https://docs.bnbchain.org/greenfield-docs/docs/api/blockchain-rest
Expand Down
3 changes: 1 addition & 2 deletions doc-site/docs/constants/msg-type-url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ title: Message Type URL

The specific type urls you want look up. Leave empty to get all entries.

More details:
https://github.com/bnb-chain/greenfield-js-sdk/blob/alpha/packages/js-sdk/src/constants/typeUrl.ts
More details: [typeUrl](https://github.com/bnb-chain/greenfield-js-sdk/blob/alpha/packages/js-sdk/src/constants/typeUrl.ts)
Loading

0 comments on commit e254e56

Please sign in to comment.