From 39126679e4645f98cf3c8b137f81248b7dbc01d1 Mon Sep 17 00:00:00 2001 From: rrr523 <59029880+rrr523@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:33:07 +0800 Subject: [PATCH 1/2] Alpha (#379) * feat: Migrate out zkbas-js-sdk and upate the sign msg format (#85) * feat: Migrate out zkbas-js-sdk and upate the sign msg format * Create fluffy-pumas-yawn.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#84) Co-authored-by: github-actions[bot] * fix: Head Group (#96) * fix: Head Group * Create cyan-ties-cross.md * feat: Multi Send Txs (#97) * feat: Multi Send Txs * Create lovely-knives-smile.md * chore: [ci] release (alpha) (#98) Co-authored-by: github-actions[bot] * feat: Allow to have sp auth fail (#101) * feat: Allow to have sp auth fail * fix: Replace endpoint with address when auth failed * Create tidy-dodos-care.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: TS lib (#104) * feat: Sync cosmos types (#106) * chore: [ci] release (alpha) (#102) Co-authored-by: github-actions[bot] * chore: Use rainbowkit simply wallet of example (#107) * Feat/update group (#108) * feat: Update group extra api * chore: Test group api * Create quiet-planets-shop.md * chore: [ci] release (alpha) (#109) Co-authored-by: github-actions[bot] * Feat/sp listgroup (#110) * feat: Add sp.listGroup API * chore: Update Example * chore: [ci] release (alpha) (#111) Co-authored-by: github-actions[bot] * chore: Update Example (#112) * chore: Update Examples (#114) * chore(dep): Add cross-env * chore(dep): Npm script * chore: Pnpm engines * chore: Codesandbox Example (#115) * chore(docs): Update stackblitz url (#116) * refactor: CreateFoler API params (#119) * chore: [ci] release (alpha) (#120) Co-authored-by: github-actions[bot] * feat: TimeStamp format * chore: [ci] release (alpha) (#121) Co-authored-by: github-actions[bot] * Refactor/policy (#122) * refactor: Bucket policy * refactor: Bucket policy * chore: [ci] release (alpha) (#123) Co-authored-by: github-actions[bot] * chore(example): BucketPolicy (#127) * Chore/update policy example (#128) * chore(example): BucketPolicy * chore(example): BucketPolicy * Feat/gashub (#129) * feat: Add gas hub API * refactor: TypeUrl as constants * chore: [ci] release (alpha) (#130) Co-authored-by: github-actions[bot] * feat: Export queryClient (#131) * feat: Export queryClient * Create calm-birds-sleep.md * Update README.md * fix: Compatiable net error (#133) * fix: Compatiable net error * Create old-roses-play.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#132) Co-authored-by: github-actions[bot] * Test/test case (#134) * feat: Isomorphic fetch * test: Uint test and e2e test * feat: Sync Types (#136) * feat: Sync Types * Create weak-hounds-sell.md * chore: [ci] release (alpha) (#135) Co-authored-by: github-actions[bot] * Fix/sort types (#137) * feat: Sort EIP712 message field * feat: Extra field * Create happy-humans-thank.md * chore: [ci] release (alpha) (#138) Co-authored-by: github-actions[bot] * feat: Bump version (#139) * chore: [ci] release (alpha) (#140) Co-authored-by: github-actions[bot] * feat: Split approval and simulate (#141) * chore: [ci] release (alpha) (#142) Co-authored-by: github-actions[bot] * Revert "feat: Split approval and simulate" (#143) * Revert "feat: Split approval and simulate" This reverts commit 76defa7f31b7f2d4683f8ed04e8dc2786dd1ef6c. * Create dirty-parrots-hear.md * chore: [ci] release (alpha) (#144) Co-authored-by: github-actions[bot] * Chore/test case (#145) * chore(test): Remove private key from config * chore: Test CI * chore: Update rainkit version (#146) * feat: Query Lock Fee API (#147) * feat: Query Lock Fee API * Create green-avocados-jump.md * chore: [ci] release (alpha) (#148) Co-authored-by: github-actions[bot] * Update bucket.ts (#149) * Update bucket.ts throw error * Create hot-countries-begin.md --------- Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#150) Co-authored-by: github-actions[bot] * fix: Return real statuscode when call metaservice (#164) * fix: Return real statuscode when call metaservice * Create kind-eyes-brake.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#166) Co-authored-by: github-actions[bot] * feat: Upgrade types version (#167) * chore: [ci] release (alpha) (#168) Co-authored-by: github-actions[bot] * Feat/sp exit (#169) * feat: Add Virtual Group API * feat: Compatibility createBukcet and createObject API * feat: Add Migrate bucket API * Feat/batch upload (#171) * feat: Feegrant * feat: Feegrant * Create angry-horses-enjoy.md * Feat/batch upload (#174) * feat: Feegrant * feat: Feegrant * feat: Feegrant grantAllowance API * feat: CreateObject example * feat: CreateBucket example * feat: Transfer example * feat: AuthInfoBytes add feePayer and feeGranter * feat: Add Two Apis (#179) * feat: Add Two Apis * Create mean-wombats-remain.md * chore: [ci] release (alpha) (#170) Co-authored-by: github-actions[bot] * feat AuthV1 (#182) * chore: Update example * chore: Update Example * feat: V1Auth * feat: V1Auth generate * feat: V1Auth createObject Approval * Create shaggy-experts-approve.md * Feat/com new (#186) * feat: Remove GetUserBuckets API Auth * feat: Update BucketProps type * feat: Remove listObjects api auth and update response type * feat: Remove listGroup api auth * feat: Update Types * chore: [ci] release (alpha) (#183) Co-authored-by: github-actions[bot] * feat: Offchainauth timeout reduced to 2s (#187) * feat: Offchainauth timeout reduced to 2s * Create warm-planets-exercise.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#188) Co-authored-by: github-actions[bot] * Feat/auth v1 (#189) * feat: Upgrade types * chore: Update Example Account config * feat: Object create update * Create empty-pens-sing.md * chore: [ci] release (alpha) (#190) Co-authored-by: github-actions[bot] * Feat/auth v1 (#191) * feat: Upgrade types * chore: Update Example Account config * feat: Object create update * feat: API getStorageProviderInfo params update * chore: Upgrade types * feat: GetSpURLfrom bucket * feat: Remove Sp param when create object and bucket * chore: [ci] release (alpha) (#192) Co-authored-by: github-actions[bot] * feat: Change Allwance value type (#193) * chore: Test config update * feat: Change Allowance Type * chore: [ci] release (alpha) (#194) Co-authored-by: github-actions[bot] * feat: MultiTx support private key (#195) * fix: Throw sp error code and message (#197) * fix: Throw sp error code and message * Create good-bobcats-hang.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#196) Co-authored-by: github-actions[bot] * fix: No sp available error (#200) * fix: No sp available error * Create khaki-ducks-brake.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * Opt (#198) * chore: Update Example * refactor: Replace @ethereumjs/util with @ethersproject/bytes * feat: Upload Object V1 auth * fix: CreateObjectTx content-type msg * chore: [ci] release (alpha) (#201) Co-authored-by: github-actions[bot] * feat: Extend response time to 3s (#202) * feat: Extend response time to 3s * Create orange-spiders-add.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#203) Co-authored-by: github-actions[bot] * Chore/conflict (#209) * release 0.2.2 (#204) * feat: Update Types * chore: [ci] release (alpha) * Feat/query status (#42) * fix: Return types * feat: Feegrant * fix: Pubkey typeUrl * feat: Upgrade Cosmos SDK * refactor: Simply broadcast and simulate tx * feat: Support Tx by PrivateKey * feat: Replace local message with types npm * test: Test Framework * chore: Upgrade Example wagmi version, Replace ethersjs with viem * feat: Support EIP712 callback use external provider * feat: Support dynamic provider * test: Support jest test * test: Account Query * feat: Change Tx API * feat: Type Complete * chore: Complate Example in New API * fix: Rollup bundle Support Nodejs * feat: Resolute Module (IoC) * docs: Update README * chore: [ci] release (alpha) (#43) Co-authored-by: github-actions[bot] * Feat/multi msg (#49) * feat: Multi Send * feat: Compatibility multi tx message * Revert "Feat/multi msg (#49)" (#53) This reverts commit fc3dd986646624c81f3cc43bdffb02e70d170b4f. * Update WASM (#55) * feat: Update WASM * feat: Update create object tx * docs: Update doc (#56) * feat: Pre alpha (#57) * chore: [ci] release (alpha) (#58) Co-authored-by: github-actions[bot] * Update README.md * multi msg (#59) * feat: Multi Send * feat: Compatibility multi tx message * chore: [ci] release (alpha) (#62) Co-authored-by: github-actions[bot] * fix: CreateObject Msg (#65) * feat: add offchainauth method (#64) * feat: Add offchainauth method * feat: Compatiable old get approval method * Create ten-suits-crash.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> Co-authored-by: rrr523 * chore: [ci] release (alpha) (#66) Co-authored-by: github-actions[bot] * feat: Add Sp params (#67) * feat: Optimize get approval types and add throw error (#70) * feat: Optimize get approval types and add throw error * Create fluffy-snails-explain.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#68) Co-authored-by: github-actions[bot] * chore: Update example without greenfield-cosmos-types (#71) * fix: Return Promise (#72) * fix: Return Promise * Create strong-snails-count.md * chore: [ci] release (alpha) (#73) Co-authored-by: github-actions[bot] * fix: Create Group message (#74) * fix: Create Group message * Create young-bears-scream.md * feat: Add Storage Params API (#76) * chore: [ci] release (alpha) (#75) Co-authored-by: github-actions[bot] * Chore/group example (#77) * feat: Group API * chore: Group and Mirror example * chore: [ci] release (alpha) (#78) Co-authored-by: github-actions[bot] * chore: Update example (#79) * feat: Add query param to ListObjects API for display folder. (#80) * feat: Add query params to ListObjects API for folder * Create clean-dogs-joke.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * Feat/group (#82) * chore: Update Example * feat: Add some group API * Create sweet-feet-hide.md * chore: [ci] release (alpha) (#81) Co-authored-by: github-actions[bot] * Update objectt.ts (#83) * Update objectt.ts add missing resp params * Create cold-suns-accept.md --------- Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * Feat/policy (#86) * feat: Policy API * fix: Object API name * Create pretty-bulldogs-notice.md * feat: Migrate out zkbas-js-sdk and upate the sign msg format (#85) * feat: Migrate out zkbas-js-sdk and upate the sign msg format * Create fluffy-pumas-yawn.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#84) Co-authored-by: github-actions[bot] * fix: Head Group (#96) * fix: Head Group * Create cyan-ties-cross.md * feat: Multi Send Txs (#97) * feat: Multi Send Txs * Create lovely-knives-smile.md * chore: [ci] release (alpha) (#98) Co-authored-by: github-actions[bot] * feat: Allow to have sp auth fail (#101) * feat: Allow to have sp auth fail * fix: Replace endpoint with address when auth failed * Create tidy-dodos-care.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: TS lib (#104) * feat: Sync cosmos types (#106) * chore: [ci] release (alpha) (#102) Co-authored-by: github-actions[bot] * chore: Use rainbowkit simply wallet of example (#107) * Feat/update group (#108) * feat: Update group extra api * chore: Test group api * Create quiet-planets-shop.md * chore: [ci] release (alpha) (#109) Co-authored-by: github-actions[bot] * Feat/sp listgroup (#110) * feat: Add sp.listGroup API * chore: Update Example * chore: [ci] release (alpha) (#111) Co-authored-by: github-actions[bot] * chore: Update Example (#112) * chore: Update Examples (#114) * chore(dep): Add cross-env * chore(dep): Npm script * chore: Pnpm engines * chore: Codesandbox Example (#115) * chore(docs): Update stackblitz url (#116) * refactor: CreateFoler API params (#119) * chore: [ci] release (alpha) (#120) Co-authored-by: github-actions[bot] * feat: TimeStamp format * chore: [ci] release (alpha) (#121) Co-authored-by: github-actions[bot] * Refactor/policy (#122) * refactor: Bucket policy * refactor: Bucket policy * chore: [ci] release (alpha) (#123) Co-authored-by: github-actions[bot] * chore(example): BucketPolicy (#127) * Chore/update policy example (#128) * chore(example): BucketPolicy * chore(example): BucketPolicy * Feat/gashub (#129) * feat: Add gas hub API * refactor: TypeUrl as constants * chore: [ci] release (alpha) (#130) Co-authored-by: github-actions[bot] * feat: Export queryClient (#131) * feat: Export queryClient * Create calm-birds-sleep.md * Update README.md * fix: Compatiable net error (#133) * fix: Compatiable net error * Create old-roses-play.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#132) Co-authored-by: github-actions[bot] * Test/test case (#134) * feat: Isomorphic fetch * test: Uint test and e2e test * feat: Sync Types (#136) * feat: Sync Types * Create weak-hounds-sell.md * chore: [ci] release (alpha) (#135) Co-authored-by: github-actions[bot] * Fix/sort types (#137) * feat: Sort EIP712 message field * feat: Extra field * Create happy-humans-thank.md * chore: [ci] release (alpha) (#138) Co-authored-by: github-actions[bot] * feat: Bump version (#139) * chore: [ci] release (alpha) (#140) Co-authored-by: github-actions[bot] * feat: Split approval and simulate (#141) * chore: [ci] release (alpha) (#142) Co-authored-by: github-actions[bot] * Revert "feat: Split approval and simulate" (#143) * Revert "feat: Split approval and simulate" This reverts commit 76defa7f31b7f2d4683f8ed04e8dc2786dd1ef6c. * Create dirty-parrots-hear.md * chore: [ci] release (alpha) (#144) Co-authored-by: github-actions[bot] * Chore/test case (#145) * chore(test): Remove private key from config * chore: Test CI * chore: Update rainkit version (#146) * feat: Query Lock Fee API (#147) * feat: Query Lock Fee API * Create green-avocados-jump.md * chore: [ci] release (alpha) (#148) Co-authored-by: github-actions[bot] * Update bucket.ts (#149) * Update bucket.ts throw error * Create hot-countries-begin.md --------- Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#150) Co-authored-by: github-actions[bot] * fix: Return real statuscode when call metaservice (#164) * fix: Return real statuscode when call metaservice * Create kind-eyes-brake.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#166) Co-authored-by: github-actions[bot] * feat: Upgrade types version (#167) * chore: [ci] release (alpha) (#168) Co-authored-by: github-actions[bot] * Feat/sp exit (#169) * feat: Add Virtual Group API * feat: Compatibility createBukcet and createObject API * feat: Add Migrate bucket API * Feat/batch upload (#171) * feat: Feegrant * feat: Feegrant * Create angry-horses-enjoy.md * Feat/batch upload (#174) * feat: Feegrant * feat: Feegrant * feat: Feegrant grantAllowance API * feat: CreateObject example * feat: CreateBucket example * feat: Transfer example * feat: AuthInfoBytes add feePayer and feeGranter * feat: Add Two Apis (#179) * feat: Add Two Apis * Create mean-wombats-remain.md * chore: [ci] release (alpha) (#170) Co-authored-by: github-actions[bot] * feat AuthV1 (#182) * chore: Update example * chore: Update Example * feat: V1Auth * feat: V1Auth generate * feat: V1Auth createObject Approval * Create shaggy-experts-approve.md * Feat/com new (#186) * feat: Remove GetUserBuckets API Auth * feat: Update BucketProps type * feat: Remove listObjects api auth and update response type * feat: Remove listGroup api auth * feat: Update Types * chore: [ci] release (alpha) (#183) Co-authored-by: github-actions[bot] * feat: Offchainauth timeout reduced to 2s (#187) * feat: Offchainauth timeout reduced to 2s * Create warm-planets-exercise.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#188) Co-authored-by: github-actions[bot] * Feat/auth v1 (#189) * feat: Upgrade types * chore: Update Example Account config * feat: Object create update * Create empty-pens-sing.md * chore: [ci] release (alpha) (#190) Co-authored-by: github-actions[bot] * Feat/auth v1 (#191) * feat: Upgrade types * chore: Update Example Account config * feat: Object create update * feat: API getStorageProviderInfo params update * chore: Upgrade types * feat: GetSpURLfrom bucket * feat: Remove Sp param when create object and bucket * chore: [ci] release (alpha) (#192) Co-authored-by: github-actions[bot] * feat: Change Allwance value type (#193) * chore: Test config update * feat: Change Allowance Type * chore: [ci] release (alpha) (#194) Co-authored-by: github-actions[bot] * feat: MultiTx support private key (#195) * fix: Throw sp error code and message (#197) * fix: Throw sp error code and message * Create good-bobcats-hang.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#196) Co-authored-by: github-actions[bot] * fix: No sp available error (#200) * fix: No sp available error * Create khaki-ducks-brake.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * Opt (#198) * chore: Update Example * refactor: Replace @ethereumjs/util with @ethersproject/bytes * feat: Upload Object V1 auth * fix: CreateObjectTx content-type msg * chore: [ci] release (alpha) (#201) Co-authored-by: github-actions[bot] * feat: Extend response time to 3s (#202) * feat: Extend response time to 3s * Create orange-spiders-add.md --------- Co-authored-by: devinxl Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#203) Co-authored-by: github-actions[bot] --------- Co-authored-by: github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: randomx999 <84435529+randomx999@users.noreply.github.com> Co-authored-by: devinxl Co-authored-by: aiden-cao <104969608+aiden-cao@users.noreply.github.com> * chore: Pre exit (#205) * chore: [ci] release (#206) Co-authored-by: github-actions[bot] * chore: Rename package (#207) * chore: [ci] release (#208) Co-authored-by: github-actions[bot] --------- Co-authored-by: github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: randomx999 <84435529+randomx999@users.noreply.github.com> Co-authored-by: devinxl Co-authored-by: aiden-cao <104969608+aiden-cao@users.noreply.github.com> * Feat/payment (#210) * feat: Add Payment query API * fix: Create Payment Account * fix: Payment disableRefund * chore: Update Example * chore: [ci] release (alpha) (#211) Co-authored-by: github-actions[bot] * chore: Update README link (#214) * fix: Return Types (#213) * chore: Update withdraw example params (#212) * chore: Update withdraw example params * feat: Zk crypto wasm package * chore: Nodejs example update package * chore: Add comment * chore: Update UMD name * feat: Upgrade file handle package * chore: Update OffchainAuth example * feat: New Zk package * chore: Changeset (#215) * chore: [ci] release (alpha) (#216) Co-authored-by: github-actions[bot] * Feat/group api (#217) * fix: Dynamic add and delete members string array * chore: Release zk crypto * chore: [ci] release (alpha) (#218) Co-authored-by: github-actions[bot] * chore: Release zk crypto (#219) * chore: [ci] release (alpha) (#220) Co-authored-by: github-actions[bot] * fix: Zk version bump (#221) * chore: [ci] release (alpha) (#222) Co-authored-by: github-actions[bot] * fix: DeepClone EIP712 (#223) * chore: [ci] release (alpha) (#224) Co-authored-by: github-actions[bot] * fix: Error try catch (#230) * chore: [ci] release (alpha) (#231) Co-authored-by: github-actions[bot] * 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] * 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] * Fix/read quota (#238) * fix: CreateBucketApproval * feat: ReadQuota * chore(example): Update Example * chore: [ci] release (alpha) (#239) Co-authored-by: github-actions[bot] * XML response (#240) * feat: Return XML type * feat: CreateBucket Add payment address * chore: [ci] release (alpha) (#241) Co-authored-by: github-actions[bot] * 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] * 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] * 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] * 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] * 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] * 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] * feat: Custom HTTP method (#257) * feat: Custom HTTP method * chore(example): Update * chore: [ci] release (alpha) (#258) Co-authored-by: github-actions[bot] * 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] * fix: EncodePath (#264) * chore: [ci] release (alpha) (#265) Co-authored-by: github-actions[bot] * fix: Download http method (#266) * fix: Download http method (#267) * chore: [ci] release (alpha) (#268) Co-authored-by: github-actions[bot] * feat: New API getObjectPreviewUrl (#270) * chore: [ci] release (alpha) (#271) Co-authored-by: github-actions[bot] * fix: XML type align to go struct (#272) * feat: Optional endpoint param (#273) * chore: [ci] release (alpha) (#274) Co-authored-by: github-actions[bot] * fix: XML parse boolean (#275) * chore: [ci] release (alpha) (#276) Co-authored-by: github-actions[bot] * fix: Common Prefix parse as array (#277) * chore: [ci] release (alpha) (#278) Co-authored-by: github-actions[bot] * 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] * 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] * fix: EncodePath function (#286) * fix: Convert enum to number (#287) * chore: [ci] release (alpha) (#288) Co-authored-by: github-actions[bot] * 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] * 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] * 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] * fix: Build (#306) * chore: Update Deps (#308) * chore: [ci] release (alpha) (#307) Co-authored-by: github-actions[bot] * 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] * 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] * chore: Update exmaple (#316) * feat: Distribution API (#317) * chore: [ci] release (alpha) (#318) Co-authored-by: github-actions[bot] * feat: MsgSettle (#319) * feat: MsgSettle * Create fast-houses-do.md * chore: [ci] release (alpha) (#320) Co-authored-by: github-actions[bot] * chore(example): Update custom tx (#321) * chore: [ci] release (alpha) (#322) Co-authored-by: github-actions[bot] * chore: Github Action issue close (#323) * feat: Bucket headBucketExtra api (#324) * chore: [ci] release (alpha) (#325) Co-authored-by: github-actions[bot] * 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] * fix: Delete Policy (#332) * chore: [ci] release (alpha) (#333) Co-authored-by: github-actions[bot] * 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] * feat: Create App Commander (#336) * chore: [ci] release (alpha) (#337) Co-authored-by: github-actions[bot] * chore: Update README (#338) * feat: Add vite template (#339) * chore: [ci] release (alpha) (#340) Co-authored-by: github-actions[bot] * release 0.2.5 (#341) chore: Pre Exit * chore: [ci] release (#342) Co-authored-by: github-actions[bot] * 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] * 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] * feat: Custom Tx support any type! (#355) * chore: Pre enter (#357) * chore: [ci] release (alpha) (#356) Co-authored-by: github-actions[bot] * fix: Offchain auth ei.data undefined (#358) * fix: Offchain auth ei.data undefined * Create witty-bikes-flash.md --------- Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#359) Co-authored-by: github-actions[bot] * fix: Offchain auth ei.data undefined (#360) * fix: Offchain auth ei.data undefined * Create ten-maps-travel.md --------- Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com> * chore: [ci] release (alpha) (#361) Co-authored-by: github-actions[bot] * chore: Release 1.0.0 (#365) * chore: [ci] release (alpha) (#366) Co-authored-by: github-actions[bot] * chore: Pre exit (#367) * chore: [ci] release (#368) Co-authored-by: github-actions[bot] * 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] * chore: Update doc url (#372) * chore: Pre exit (#377) * chore: [ci] release (#378) Co-authored-by: github-actions[bot] --------- Co-authored-by: randomx999 <84435529+randomx999@users.noreply.github.com> Co-authored-by: devinxl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] Co-authored-by: aiden-cao <104969608+aiden-cao@users.noreply.github.com> --- examples/nextjs/CHANGELOG.md | 16 ++ examples/nextjs/package.json | 2 +- examples/nodejs/CHANGELOG.md | 16 ++ examples/nodejs/package.json | 5 +- packages/js-sdk/CHANGELOG.md | 18 +++ packages/js-sdk/package.json | 2 +- .../spApis/listUserPaymentAccounts.ts | 24 ++- .../src/types/sp/ListUserPaymentAccounts.ts | 18 ++- pnpm-lock.yaml | 140 ++++++++++++++++-- 9 files changed, 212 insertions(+), 29 deletions(-) diff --git a/examples/nextjs/CHANGELOG.md b/examples/nextjs/CHANGELOG.md index 02ad804d..d2aad371 100644 --- a/examples/nextjs/CHANGELOG.md +++ b/examples/nextjs/CHANGELOG.md @@ -1,5 +1,21 @@ # @demo/wallet +## 0.0.9 + +### Patch Changes + +- Updated dependencies + [[`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e)]: + - @bnb-chain/greenfield-js-sdk@1.0.1 + +## 0.0.9-alpha.0 + +### Patch Changes + +- Updated dependencies + [[`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e)]: + - @bnb-chain/greenfield-js-sdk@1.0.1-alpha.0 + ## 0.0.8 ### Patch Changes diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index f3fa7289..0cbf9ddb 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@demo/wallet", - "version": "0.0.8", + "version": "0.0.9", "private": true, "scripts": { "dev": "cross-env NODE_ENV=development next dev", diff --git a/examples/nodejs/CHANGELOG.md b/examples/nodejs/CHANGELOG.md index 6e9dbad7..35a74c55 100644 --- a/examples/nodejs/CHANGELOG.md +++ b/examples/nodejs/CHANGELOG.md @@ -1,5 +1,21 @@ # @demo/nodejs +## 0.0.12 + +### Patch Changes + +- Updated dependencies + [[`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e)]: + - @bnb-chain/greenfield-js-sdk@1.0.1 + +## 0.0.12-alpha.0 + +### Patch Changes + +- Updated dependencies + [[`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e)]: + - @bnb-chain/greenfield-js-sdk@1.0.1-alpha.0 + ## 0.0.11 ### Patch Changes diff --git a/examples/nodejs/package.json b/examples/nodejs/package.json index 4a00480a..3e581843 100644 --- a/examples/nodejs/package.json +++ b/examples/nodejs/package.json @@ -1,13 +1,12 @@ { "name": "@demo/nodejs", - "version": "0.0.11", + "version": "0.0.12", "type": "commonjs", "private": true, "scripts": {}, "dependencies": { "@bnb-chain/greenfield-js-sdk": "workspace:*", - "@bnb-chain/greenfiled-file-handle": "workspace:*", - "mime-types": "^2.1.35" + "@bnb-chain/greenfiled-file-handle": "workspace:*" }, "devDependencies": { "cross-env": "^7.0.3" diff --git a/packages/js-sdk/CHANGELOG.md b/packages/js-sdk/CHANGELOG.md index ef8bc79b..e773392f 100644 --- a/packages/js-sdk/CHANGELOG.md +++ b/packages/js-sdk/CHANGELOG.md @@ -1,5 +1,23 @@ # @bnb-chain/greenfield-js-sdk +## 1.0.1 + +### Patch Changes + +- [#370](https://github.com/bnb-chain/greenfield-js-sdk/pull/370) + [`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e) + Thanks [@rrr523](https://github.com/rrr523)! - fix(types): Payment listUserPaymentAccounts return + response + +## 1.0.1-alpha.0 + +### Patch Changes + +- [#370](https://github.com/bnb-chain/greenfield-js-sdk/pull/370) + [`5c2d075`](https://github.com/bnb-chain/greenfield-js-sdk/commit/5c2d0753d1514fd24f8d5733e44cf0fbb758792e) + Thanks [@rrr523](https://github.com/rrr523)! - fix(types): Payment listUserPaymentAccounts return + response + ## 1.0.0 ### Major Changes diff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.json index 8e3b37c1..16a41ab4 100644 --- a/packages/js-sdk/package.json +++ b/packages/js-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@bnb-chain/greenfield-js-sdk", - "version": "1.0.0", + "version": "1.0.1", "description": "greenfield js chain and sp sdk", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/packages/js-sdk/src/clients/spclient/spApis/listUserPaymentAccounts.ts b/packages/js-sdk/src/clients/spclient/spApis/listUserPaymentAccounts.ts index 7bfaa840..668b4627 100644 --- a/packages/js-sdk/src/clients/spclient/spApis/listUserPaymentAccounts.ts +++ b/packages/js-sdk/src/clients/spclient/spApis/listUserPaymentAccounts.ts @@ -1,5 +1,6 @@ import { EMPTY_STRING_SHA256, METHOD_GET } from '@/constants'; import { ReqMeta } from '@/types'; +import { convertStrToBool } from '@/types/sp/Common'; import { ListUserPaymentAccountsResponse, ListUserPaymentAccountsResquest, @@ -7,6 +8,7 @@ import { import { XMLParser } from 'fast-xml-parser'; import { getSortQuery, getSortQueryParams } from '../auth'; +// https://docs.bnbchain.org/greenfield-docs/docs/api/storage-provider-rest/list_user_payment_accounts export const getListUserPaymentAccountMetaInfo = ( endpoint: string, params: ListUserPaymentAccountsResquest, @@ -47,15 +49,27 @@ export const parseListUserPaymentAccountResponse = (data: string) => { }); const res = xmlParser.parse(data) as ListUserPaymentAccountsResponse; - let StreamRecords = res.GfSpListUserPaymentAccountsResponse.StreamRecords || []; + let PaymentAccounts = res.GfSpListUserPaymentAccountsResponse.PaymentAccounts || []; - if (StreamRecords) { - if (!Array.isArray(StreamRecords)) { - StreamRecords = [StreamRecords]; + if (PaymentAccounts) { + if (!Array.isArray(PaymentAccounts)) { + PaymentAccounts = [PaymentAccounts]; } + + PaymentAccounts = PaymentAccounts.map((item) => { + item.PaymentAccount = { + ...item.PaymentAccount, + // @ts-ignore + Refundable: convertStrToBool(item.PaymentAccount.Refundable), + UpdateAt: Number(item.PaymentAccount.UpdateAt), + UpdateTime: Number(item.PaymentAccount.UpdateTime), + }; + + return item; + }); } - res.GfSpListUserPaymentAccountsResponse.StreamRecords = StreamRecords; + res.GfSpListUserPaymentAccountsResponse.PaymentAccounts = PaymentAccounts; return res; }; diff --git a/packages/js-sdk/src/types/sp/ListUserPaymentAccounts.ts b/packages/js-sdk/src/types/sp/ListUserPaymentAccounts.ts index 7a82184d..41c14a5b 100644 --- a/packages/js-sdk/src/types/sp/ListUserPaymentAccounts.ts +++ b/packages/js-sdk/src/types/sp/ListUserPaymentAccounts.ts @@ -8,11 +8,17 @@ export type ListUserPaymentAccountsResponse = { GfSpListUserPaymentAccountsResponse: GfSPListUserPaymentAccountsResponse; }; -export interface GfSPListUserPaymentAccountsResponse { - StreamRecords: StreamRecords[]; -} +export type PaymentAccount = { + Address: string; + Owner: string; + Refundable: boolean; + UpdateAt: number; + UpdateTime: number; +}; -export interface StreamRecords { - StreamRecord: StreamRecord; - Refundable: string; +export interface GfSPListUserPaymentAccountsResponse { + PaymentAccounts: { + PaymentAccount: PaymentAccount; + StreamRecord: StreamRecord; + }[]; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c00df824..cae8fb2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -390,7 +390,7 @@ importers: version: 29.5.0 '@rollup/plugin-typescript': specifier: ^11.1.3 - version: 11.1.3(rollup@2.79.1)(tslib@2.5.2)(typescript@4.9.5) + version: 11.1.3(tslib@2.5.2)(typescript@4.9.5) '@types/jest': specifier: ^29.5.1 version: 29.5.1 @@ -417,7 +417,7 @@ importers: version: 0.4.11 jest: specifier: ^29.5.0 - version: 29.5.0(@types/node@18.16.18)(ts-node@10.9.1) + version: 29.5.0(@types/node@20.6.0)(ts-node@10.9.1) mime: specifier: ^3.0.0 version: 3.0.0 @@ -426,7 +426,7 @@ importers: version: 29.1.0(@babel/core@7.22.15)(jest@29.5.0)(typescript@4.9.5) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.16.18)(typescript@4.9.5) + version: 10.9.1(@types/node@20.6.0)(typescript@4.9.5) tslib: specifier: ^2.5.0 version: 2.5.2 @@ -660,7 +660,7 @@ packages: '@babel/traverse': 7.22.15 '@babel/types': 7.22.15 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -2045,7 +2045,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.22.15 '@babel/types': 7.22.15 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -4984,6 +4984,25 @@ packages: typescript: 4.9.5 dev: true + /@rollup/plugin-typescript@11.1.3(tslib@2.5.2)(typescript@4.9.5): + resolution: {integrity: sha512-8o6cNgN44kQBcpsUJTbTXMTtb87oR1O0zgP3Dxm71hrNgparap3VujgofEilTYJo+ivf2ke6uy3/E5QEaiRlDA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.14.0||^3.0.0 + tslib: '*' + typescript: '>=3.7.0' + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2 + resolve: 1.22.2 + tslib: 2.5.2 + typescript: 4.9.5 + dev: true + /@rollup/pluginutils@3.1.0(rollup@2.79.1): resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} @@ -4996,6 +5015,20 @@ packages: rollup: 2.79.1 dev: true + /@rollup/pluginutils@5.0.2: + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.1 + estree-walker: 2.0.2 + picomatch: 2.3.1 + dev: true + /@rollup/pluginutils@5.0.2(rollup@2.79.1): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} @@ -5803,7 +5836,6 @@ packages: /@types/node@20.6.0: resolution: {integrity: sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==} - dev: false /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -8793,6 +8825,17 @@ packages: dependencies: ms: 2.1.3 + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -11810,7 +11853,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -11892,7 +11935,7 @@ packages: - supports-color dev: true - /jest-cli@29.5.0(@types/node@18.16.18)(ts-node@10.9.1): + /jest-cli@29.5.0(@types/node@20.6.0)(ts-node@10.9.1): resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -11909,7 +11952,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.5.0(@types/node@18.16.18)(ts-node@10.9.1) + jest-config: 29.5.0(@types/node@20.6.0)(ts-node@10.9.1) jest-util: 29.5.0 jest-validate: 29.5.0 prompts: 2.4.2 @@ -11955,7 +11998,47 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@18.16.18)(typescript@4.9.5) + ts-node: 10.9.1(@types/node@20.6.0)(typescript@4.9.5) + transitivePeerDependencies: + - supports-color + dev: true + + /jest-config@29.5.0(@types/node@20.6.0)(ts-node@10.9.1): + resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.22.15 + '@jest/test-sequencer': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 20.6.0 + babel-jest: 29.5.0(@babel/core@7.22.15) + chalk: 4.1.2 + ci-info: 3.8.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.5.0 + jest-environment-node: 29.5.0 + jest-get-type: 29.4.3 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-runner: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.5.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1(@types/node@20.6.0)(typescript@4.9.5) transitivePeerDependencies: - supports-color dev: true @@ -12261,7 +12344,7 @@ packages: merge-stream: 2.0.0 supports-color: 8.1.1 - /jest@29.5.0(@types/node@18.16.18)(ts-node@10.9.1): + /jest@29.5.0(@types/node@20.6.0)(ts-node@10.9.1): resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -12274,7 +12357,7 @@ packages: '@jest/core': 29.5.0(ts-node@10.9.1) '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.5.0(@types/node@18.16.18)(ts-node@10.9.1) + jest-cli: 29.5.0(@types/node@20.6.0)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - supports-color @@ -16610,7 +16693,7 @@ packages: '@babel/core': 7.22.15 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.5.0(@types/node@18.16.18)(ts-node@10.9.1) + jest: 29.5.0(@types/node@20.6.0)(ts-node@10.9.1) jest-util: 29.5.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -16651,6 +16734,37 @@ packages: yn: 3.1.1 dev: true + /ts-node@10.9.1(@types/node@20.6.0)(typescript@4.9.5): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 20.6.0 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.5 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} dependencies: From 91ca10251bd7f0f342e46a04a79f9aa97b0dcfdb Mon Sep 17 00:00:00 2001 From: rrr523 <59029880+rrr523@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:43:53 +0800 Subject: [PATCH 2/2] docs: Update README (#380) --- packages/file-handle/README.md | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/packages/file-handle/README.md b/packages/file-handle/README.md index b7ac81d9..b6c2fdc4 100644 --- a/packages/file-handle/README.md +++ b/packages/file-handle/README.md @@ -2,4 +2,43 @@ WASM module that handle file, such as `checksums` method. -* [ ] Nodejs `checksums` need support pass Buffer +## Usage on Nodejs + +```javascript +const fs = require('fs') +const { getCheckSums } = require('@bnb-chain/greenfiled-file-handle'); +const fileBuffer = fs.readFileSync('./CHANGELOG.md'); + +(async () => { + const { contentLength, expectCheckSums } = await getCheckSums(fileBuffer); +})() +``` + +Full Code: https://github.com/bnb-chain/greenfield-js-sdk/blob/main/examples/nodejs/storage.js + +## Usage on Browser + +load wasm: + +```html + + +``` + +execute wasm: + +```javascript +(async () => { + // file is from input element + const fileBytes = await file.arrayBuffer(); + const hashResult = await (window as any).FileHandle.getCheckSums( + new Uint8Array(fileBytes), + ); + const { contentLength, expectCheckSums } = hashResult; +})() +``` + +Full Code: https://github.com/bnb-chain/greenfield-js-sdk/blob/main/examples/nextjs/src/components/object/create/index.tsx#L63