We provide the Golang and Javascript versions of Zecrey Marketplace SDK so that developers can easily access Zecrey's NFT marketplace service. It is an API wrapper for Zecrey that provides most of the functionality for the Zecrey platform. Before starting to use the SDK, developers must initialize the client.
Get Marketplace SDK package
go get github.com/zecrey-Labs/zecrey-marketplace-go-sdk
npm i @zecrey/zecrey-legend-js-sdk
Most forms of the data available are read-only, so user authentication is not required when querying to update the status of Zecrey NFT Marketplace. Therefore, we designed two ways for calling of the client and SDK for Zecrey NFT Marketplace.
When signing data to change the status of Zecrey NFT marketplace, you need to initialize the client to call.
When you only need to query data or generate a new signer, you can directly call the method in the SDK package.
In the following, we list the circumstances under which the client should be initialized and when the SDK should be called directly.
packagemainimport ("github.com/Zecrey-Labs/zecrey-marketplace-go-sdk/sdk")var ( accountName ="Alice" seed ="0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688")funcmain() {//Initializing the client needs to access accountName and seed//Refer to the module of Register users to get parameters of accountName and seed client, err := sdk.NewClient(accountName, seed) if err !=nil { panic(err) } }
Example
import { Client } from"@zecrey/zecrey-legend-js-sdk";constaccountName="Alice.zec";constseed="0x7ea589236ac7e6034a40ad31f27a6ea1bbaeb7746ba5e8d3408a3abb480a8688";//Using accountName and seed is required to initialize the client//Please refer to the Register users module for the accountName and seed parameters.constclient=newClient(accountName, seed);