Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove approval when create bucket / object #498

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

rrr523
Copy link
Collaborator

@rrr523 rrr523 commented Mar 15, 2024

Description

  • Remove approval when creating bucket and object

Dependencies Changes

  • Upgrade types to 0.4.0-alpha.31

API Changes

  1. bucket.createBucket params changes, example:
  • remove spInfo
  • add primarySpAddress
  • visibility type: string -> VisibilityType
  • chargedReadQuota type: string -> Long
  • remove authType
const createBucketTx = await client.bucket.createBucket({
  bucketName: createBucketInfo.bucketName,
  creator: address,
  visibility: VisibilityType.VISIBILITY_TYPE_PUBLIC_READ,
  chargedReadQuota: Long.fromString('0'),
  paymentAddress: address,
  primarySpAddress: spInfo.primarySpAddress,
});
  1. object.createObject params changes, example:
  • contentLength -> payloadSize
  • expectCheckSums -> expectChecksums
  • visibility type: string -> VisibilityType
  • redundancyType type: string -> RedundancyType
  • expectCheckSums -> expectChecksums
  • remove authType
 const createObjectTx = await client.object.createObject({
    bucketName: 'bucketName',
    objectName: 'objectName',
    creator: '0x...',
    visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,
    contentType: file.type,
    redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,
    payloadSize: Long.fromInt(fileBytes.byteLength),
    expectChecksums: expectCheckSums.map((x) => bytesFromBase64(x)),
  });
  1. object.createFolder params changes: example
const createFolderTx = await client.object.createFolder({
  bucketName: 'bucketName',
  objectName: 'objectName' + '/',
  creator: '0x..',
  redundancyType: RedundancyType.REDUNDANCY_EC_TYPE,
  visibility: VisibilityType.VISIBILITY_TYPE_PRIVATE,
});

Copy link

codesandbox bot commented Mar 15, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Mar 15, 2024

🦋 Changeset detected

Latest commit: d937109

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@bnb-chain/greenfield-js-sdk Minor
@demo/wallet Patch
@demo/nodejs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Mar 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
greenfield-js-sdk-nextjs-h2q3 ❌ Failed (Inspect) Mar 15, 2024 4:39pm

packages/js-sdk/src/utils/asserts/s3.ts Dismissed Show dismissed Hide dismissed
@rrr523 rrr523 marked this pull request as ready for review March 15, 2024 16:50
@rrr523 rrr523 merged commit 10244a5 into alpha Mar 15, 2024
6 of 7 checks passed
@rrr523 rrr523 deleted the feat/remove_create_approval branch March 15, 2024 16:53
@github-actions github-actions bot mentioned this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant