Core API
Overview
Wallet Layer API
import { MetaletWalletForBtc } from '@metaid/metaid';
// Create a wallet object based on the currently logged-in wallet account
const _wallet = await MetaletWalletForBtc.create();
// Access the wallet object's public properties
const address = _wallet.address // Get address
const pubicKey = _wallet.pub // Get public key
// Access a series of methods provided by the wallet object (provided the wallet is connected, otherwise returns {status: 'not-connected' })
await _wallet.getAddress() // Get wallet address
await _wallet.getAddressType() // Get wallet address type
await _wallet.getPublicKey(path) // Get public key based on path
await _wallet.getBalance() // Get balance
await _wallet.signMessage(message) // Send signed message
await _wallet.signPsbt({
psbtHex,
options,
}: {
psbtHex: string
options?: { toSignInputs?: ToSignInput[]; autoFinalized: boolean }
}) // Sign the input psbtHex
// This is a low-level inscription API method; unless you have very customized inscription needs, it is not recommended to call it directly.
// The connector layer has abstracted and encapsulated this method, along with related parameter descriptions.
await _wallet.inscribe({data, options} : \
{ data: InscriptionRequest, options: {noBroadcast : boolean }) Notes on Wallet Method Parameters and Return Types:
Connector Layer API
Notes on Connector Layer API:
Entity Layer API
Notes on the Entity's create Method:
create Method:Last updated