Skip to main content

SubscribeReceiveAssetEventNtfns

SubscribeReceiveAssetEventNtfns registers a subscription to the event notification stream which relates to the asset receive process.

Source: tapdevrpc/tapdev.proto

gRPC

info

This is a server-streaming RPC

rpc SubscribeReceiveAssetEventNtfns (SubscribeReceiveAssetEventNtfnsRequest) returns (stream ReceiveAssetEvent);

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('tapdevrpc/tapdev.proto', loaderOptions);
const tapdevrpc = grpc.loadPackageDefinition(packageDefinition).tapdevrpc;
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 tapdevrpc.TapDev(GRPC_HOST, creds);
let request = {};
let call = client.subscribeReceiveAssetEventNtfns(request);
call.on('data', function(response) {
// A response was received from the server.
console.log(response);
});
call.on('status', function(status) {
// The current status of the stream.
});
call.on('end', function() {
// The server has closed the stream.
});
// Console output:
// {
// "proof_transfer_backoff_wait_event": <ProofTransferBackoffWaitEvent>,
// "asset_receive_complete_event": <AssetReceiveCompleteEvent>,
// }

Messages

tapdevrpc.SubscribeReceiveAssetEventNtfnsRequest

Source: tapdevrpc/tapdev.proto

note

This request has no parameters.

tapdevrpc.ReceiveAssetEvent

Source: tapdevrpc/tapdev.proto

FieldgRPC TypeREST Type
proof_transfer_backoff_wait_event
ProofTransferBackoffWaitEventobject
asset_receive_complete_event
AssetReceiveCompleteEventobject

Nested Messages

tapdevrpc.AssetReceiveCompleteEvent

FieldgRPC TypeREST Type
timestamp
int64string
address
Addrobject
outpoint
stringstring

tapdevrpc.ProofTransferBackoffWaitEvent

FieldgRPC TypeREST Type
timestamp
int64string
backoff
int64string
tries_counter
int64string
transfer_type
ProofTransferTypestring

taprpc.Addr

FieldgRPC TypeREST Type
encoded
stringstring
asset_id
bytesstring
asset_type
AssetTypestring
amount
uint64string
group_key
bytesstring
script_key
bytesstring
internal_key
bytesstring
tapscript_sibling
bytesstring
taproot_output_key
bytesstring
proof_courier_addr
stringstring
asset_version
AssetVersionstring
address_version
AddrVersionstring

Enums

tapdevrpc.ProofTransferType

NameNumber
PROOF_TRANSFER_TYPE_SEND
0
PROOF_TRANSFER_TYPE_RECEIVE
1

taprpc.AddrVersion

NameNumber
ADDR_VERSION_UNSPECIFIED
0
ADDR_VERSION_V0
1
ADDR_VERSION_V1
2

taprpc.AssetType

NameNumber
NORMAL
0
COLLECTIBLE
1

taprpc.AssetVersion

NameNumber
ASSET_VERSION_V0
0
ASSET_VERSION_V1
1