Skip to main content

ListBatches

ListBatches lists the set of batches submitted to the daemon, including pending and cancelled batches.

Source: mintrpc/mint.proto

gRPC

rpc ListBatches (ListBatchRequest) returns (ListBatchResponse);

REST

HTTP MethodPath
GET /v1/taproot-assets/assets/mint/batches/{batch_key}

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:10029'
const MACAROON_PATH = 'TAPROOT-ASSETS_DIR/regtest/taproot-assets.macaroon'
const TLS_PATH = 'TAPROOT-ASSETS_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('mintrpc/mint.proto', loaderOptions);
const mintrpc = grpc.loadPackageDefinition(packageDefinition).mintrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new mintrpc.Mint(GRPC_HOST, creds);
let request = {
batch_key: <bytes>,
batch_key_str: <string>,
verbose: <bool>,
};
client.listBatches(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "batches": <VerboseBatch>,
// }

Messages

mintrpc.ListBatchRequest

Source: mintrpc/mint.proto

FieldgRPC TypeREST TypeREST Placement
batch_key
bytesstringpath
batch_key_str
stringstringquery
verbose
boolbooleanquery

mintrpc.ListBatchResponse

Source: mintrpc/mint.proto

FieldgRPC TypeREST Type
batches
VerboseBatch[]array

Nested Messages

mintrpc.MintingBatch

FieldgRPC TypeREST Type
batch_key
bytesstring
batch_txid
stringstring
state
BatchStatestring
assets
PendingAsset[]array
created_at
int64string
height_hint
uint32integer
batch_psbt
bytesstring

mintrpc.PendingAsset

FieldgRPC TypeREST Type
asset_version
AssetVersionstring
asset_type
AssetTypestring
name
stringstring
asset_meta
AssetMetaobject
amount
uint64string
new_grouped_asset
boolboolean
group_key
bytesstring
group_anchor
stringstring
group_internal_key
KeyDescriptorobject
group_tapscript_root
bytesstring
script_key
ScriptKeyobject

mintrpc.UnsealedAsset

FieldgRPC TypeREST Type
asset
PendingAssetobject
group_key_request
GroupKeyRequestobject
group_virtual_tx
GroupVirtualTxobject

mintrpc.VerboseBatch

FieldgRPC TypeREST Type
batch
MintingBatchobject
unsealed_assets
UnsealedAsset[]array

taprpc.AssetMeta

FieldgRPC TypeREST Type
data
bytesstring
type
AssetMetaTypestring
meta_hash
bytesstring

taprpc.GenesisInfo

FieldgRPC TypeREST Type
genesis_point
stringstring
name
stringstring
meta_hash
bytesstring
asset_id
bytesstring
asset_type
AssetTypestring
output_index
uint32integer

taprpc.GroupKeyRequest

FieldgRPC TypeREST Type
raw_key
KeyDescriptorobject
anchor_genesis
GenesisInfoobject
tapscript_root
bytesstring
new_asset
bytesstring

taprpc.GroupVirtualTx

FieldgRPC TypeREST Type
transaction
bytesstring
prev_out
TxOutobject
genesis_id
bytesstring
tweaked_key
bytesstring

taprpc.KeyDescriptor

FieldgRPC TypeREST Type
raw_key_bytes
bytesstring
key_loc
KeyLocatorobject

taprpc.KeyLocator

FieldgRPC TypeREST Type
key_family
int32integer
key_index
int32integer

taprpc.ScriptKey

FieldgRPC TypeREST Type
pub_key
bytesstring
key_desc
KeyDescriptorobject
tap_tweak
bytesstring

taprpc.TxOut

FieldgRPC TypeREST Type
value
int64string
pk_script
bytesstring

Enums

mintrpc.BatchState

NameNumber
BATCH_STATE_UNKNOWN
0
BATCH_STATE_PENDING
1
BATCH_STATE_FROZEN
2
BATCH_STATE_COMMITTED
3
BATCH_STATE_BROADCAST
4
BATCH_STATE_CONFIRMED
5
BATCH_STATE_FINALIZED
6
BATCH_STATE_SEEDLING_CANCELLED
7
BATCH_STATE_SPROUT_CANCELLED
8

taprpc.AssetMetaType

NameNumber
META_TYPE_OPAQUE
0
META_TYPE_JSON
1

taprpc.AssetType

NameNumber
NORMAL
0
COLLECTIBLE
1

taprpc.AssetVersion

NameNumber
ASSET_VERSION_V0
0
ASSET_VERSION_V1
1