npm-package-mintbase-sdk-3559
v1.0.3559
Published
npm Package - mintbase-sdk
Readme
mintbase-sdk
A JavaScript/TypeScript SDK for interacting with Mintbase and the NEAR blockchain.
Installation
npm install mintbase-sdk
API
createWallet(accountId: string): Promise<WalletInfo>
Generates a new key pair for a given account ID.
import { createWallet } from 'mintbase-sdk';
const wallet = await createWallet('alice.near'); console.log(wallet.publicKey);
getAccountInfo(accountId: string): Promise<AccountView>
Fetches on-chain account details via RPC.
import { getAccountInfo } from 'mintbase-sdk';
const info = await getAccountInfo('alice.near'); console.log(info);
mintNFT(storeId, metadata, receiverId, keyPair, networkId?): Promise<MintResult>
Mints an NFT on a Mintbase store.
import { mintNFT } from 'mintbase-sdk';
const result = await mintNFT('mystore.mintbase1.near', { title: 'My NFT' }, 'alice.near', keyPair, 'mainnet');
transferTokens(senderId, receiverId, amountYocto, keyPair, networkId?): Promise<string>
Transfers NEAR tokens between accounts.
import { transferTokens } from 'mintbase-sdk';
const txHash = await transferTokens('alice.near', 'bob.near', '1000000000000000000000000', keyPair, 'mainnet');
deployStore(ownerId, storeName, keyPair, networkId?): Promise<string>
Deploys a new Mintbase NFT store contract.
import { deployStore } from 'mintbase-sdk';
const txHash = await deployStore('alice.near', 'my-store', keyPair, 'testnet');
License
MIT
