Transactions
Wallet Connection and Transactions JS Library
Mintbase uses MintbaseJS for all of our transactions on both the market and minter including mint, transfer, burn, sell, buy, so if we can use it, so can you.
The best documentation to go off of is the typescript docs as this library will change rapidly. If something is broken please make sure you have the latest and run see if the type are matching. Please create issue on Github to help us make it better.
​
​

⚠️⚠️ In active development ⚠️⚠️

This package is under active development. Expect breaking changes often.

Mintbase API

General purpose Mintbase API for interacting with NEAR, Arweave and other supported blockchains and decentralized file storage systems.

Table of Contents

  • Mintbase API
  • Table of Contents
  • Install
  • Getting Started
  • Support
  • Examples
  • License

Install

1
$ npm install mintbase
Copied!

Getting started

Initializing and Connecting Mintbase Wallet
  • Acquire an API key in the Developer tab on Mintbase​
1
import { Wallet, Chain, Network } from 'mintbase'
2
​
3
// Connect and fetch details
4
async function connect() {
5
const { data: walletData, error } = await new Wallet().init({
6
networkName: Network.testnet,
7
chain: Chain.near,
8
apiKey: API_KEY,
9
})
10
​
11
const { wallet, isConnected } = walletData
12
​
13
if (isConnected) {
14
const { data: details } = await wallet.details()
15
​
16
/*
17
accountId: "qwerty.testnet"
18
allowance: "0.25"
19
balance: "365.77"
20
contractName: "mintbase13.testnet"
21
*/
22
}
23
}
24
​
25
connect()
Copied!
Here's an example of a button to connect to the wallet.
1
<Button onClick={() => wallet.connect({ requestSignIn: true })}>Login</Button>
Copied!

Examples

Bootstrap your app with Create Mintbase App (React + Typescript)​

Support

Open an issue!
or ask in our developer telegram​

License

​MIT​