npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vwbl-sdk

v0.1.20

Published

VWBL SDK for EVM Compatible Chain

Downloads

10

Readme

VWBL SDK for EVM Compatible Chain

npm version npm download License: MIT

official document

https://docs.vwbl-protocol.org

install

Using NPM

npm install vwbl-sdk

Using Yarn

yarn add vwbl-sdk

Build

npm run build:evm

Test

npm run test:evm

api document

create instance

new VWBL({
  web3,
  contractAddress: "0x...",
  manageKeyType: ManageKeyType.VWBL_NETWORK_SERVER,
  uploadContentType: UploadContentType.S3,
  uploadMetadataType: UploadMetadataType.S3,
  vwblNetworkUrl: "https://vwbl.network",
  awsConfig: {
    region: "ap-northeast-1",
    idPoolId: "ap-northeast-1:...",
    cloudFrontUrl: "https://xxx.cloudfront.net",
    bucketName: {
      metadata: "vwbl-metadata",
      content: "vwbl-content",
    },
  },
});

Constructor Options

| name | required | type | description | | ------------------ | -------------------------------------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | web3 | true | Web3 | web3 instance | | contractAddress | true | string | VWBL nft's contract address | | vwblNetworkUrl | true | string | VWBL network's url | | manageKeyType | false | ManageKeyType | how to manage key, you can choose from VWBL_NETWORK_SERVER VWBL_NETWORK_CONSORTIUM(not implemented yet) MY_SERVER(not implemented yet). | | uploadContentType | flase | UploadContentType | where to upload content, you can choose from S3 IPFS CUSTOM | | uploadMetadataType | flase | UploadMetadataType | where to upload content, you can choose from S3 IPFS CUSTOM | | awsConfig | true if you choose to upload content or metadata to S3 | AWSConfig | AWSConfig *1 | | ipfsConfig | true if you choose to upload content or metadata to IPFS | IPFSConfig | IPFSConfig *2 |

AWSConfig(*1)

| name | required | type | description | | ------------- | -------- | ----------------------------------- | --------------------------------------------------------- | | region | true | string | AWS region | | idPoolId | true | string | idPoolId which has granted S3-put-object | | cloudFrontUrl | true | string | cloudFront url connect to s3 which is uploaded content | | bucketName | true | {content: string, metadata: string} | bucketName of metadata and content, it's ok they are same |

IPFSConfig(*2)

| name | required | type | description | | ------------- | -------- | ----------------------------------- | --------------------------------------------------------- | | apiKey | true | string | API key | | apiSecret | false | string | API secret key | |

sign to server

Signing is necessary before creating token or viewing contents.

await vwbl.sign();

create token

await vwbl.managedCreateToken(
  name,
  description,
  fileContent,
  thumbnailContent,
  0 // royaltiesPercentage
);

Arguments

| name | required | type | description | | --------------------------- | ------------------------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | name | true | string | ERC721 metadata name | | description | true | string | ERC721 metadata description | | plainFile | true | File | File[] | The data that only NFT owner can view | | thumbnailImage | true | File | ERC721 metadata image | | royaltiesPercentage | true | number | If the marketplace supports EIP2981, this percentage of the sale price will be paid to the NFT creator every time the NFT is sold or re-sold | | encryptLogic | false (default="base64") | EncryptLogic | "base64" or "binary". Selection criteria: "base64" -> sutable for small data. "binary" -> sutable for large data. | | uploadEncryptedFileCallback | true if uploadContentType is CUSTOM | UploadEncryptedFile | you can custom upload function | | uploadThumbnailCallback | true if uploadContentType is CUSTOM | UploadThumbnail | you can custom upload function | | uploadMetadataCallback | true if uploadMetadataType is CUSTOM | UploadMetadata | you can custom upload function | | gasSettings | false | GasSettings | you can custom gas settings |

view contents ( get NFT metadata from given tokenId)

const token = await vwbl.getTokenById(tokenId);