Swappland is a p2p Marketplace for Near, where people can trade NFT for NFT or Near for NFT, and eventually all forms of tokens for an NFT. We allow anyone to list any in their wallet for trade. This is the dev friendly client.
npm install @swappland/market-contract-client
import SwapplandClient from "@swappland/market-contract-client"
const testnetContractId ="mkt.landofswapps.testnet"
const mainnetContractid = "mkt.swappland.near"
// Setup Purely for example
const accountId: string = "some_account_you_have_in_credentials.near"
const keystore = new keyStores.UnencryptedFileSystemKeyStore(`${os.homedir()}/.near-credentials`)
const near = new Near({
networkId: "testnet",
nodeUrl: "https://rpc.testnet.near.org",
walletUrl: "https://wallet.testnet.near.org",
explorerUrl: "https://explorer.testnet.near.org",
deps: {keyStore}, headers:{}})
// The only thing the client really needs followed by the contractId
const account:Account = await near.account(accountId);
const client = new SwapplandClient({account, contractId: testnetContractId})
npm install
npm run build
It's early days and the interface is still subject to change depending on usecases that come up. A few methods still need to be deprecated around the adminstration of the contract here's a that was easy link to the spec(beware some non essential methods are now deprecated, but are pending removal from spec).
The specification is written in OpenRPC uses the Open-Rpc Near Client Generator and the Open RPC Near Token Standards. Refer to the OpenRPC specification and the JSON schema specification to get started.