tapass 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2886 -2
- package/dist/grpc/emit_subscription_error.d.ts +21 -0
- package/dist/grpc/emit_subscription_error.d.ts.map +1 -0
- package/dist/grpc/emit_subscription_error.js +26 -0
- package/dist/grpc/emit_subscription_error.js.map +1 -0
- package/dist/grpc/grpc_services.d.ts +46 -0
- package/dist/grpc/grpc_services.d.ts.map +1 -0
- package/dist/grpc/grpc_services.js +45 -0
- package/dist/grpc/grpc_services.js.map +1 -0
- package/dist/grpc/handle_remove_listener.d.ts +18 -0
- package/dist/grpc/handle_remove_listener.d.ts.map +1 -0
- package/dist/grpc/handle_remove_listener.js +22 -0
- package/dist/grpc/handle_remove_listener.js.map +1 -0
- package/dist/grpc/index.d.ts +32 -0
- package/dist/grpc/index.d.ts.map +1 -0
- package/dist/grpc/index.js +6 -0
- package/dist/grpc/index.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/tapd_grpc/api_for_proto.d.ts +28 -0
- package/dist/tapd_grpc/api_for_proto.d.ts.map +1 -0
- package/dist/tapd_grpc/api_for_proto.js +24 -0
- package/dist/tapd_grpc/api_for_proto.js.map +1 -0
- package/dist/tapd_grpc/authenticated_tapd_grpc.d.ts +35 -0
- package/dist/tapd_grpc/authenticated_tapd_grpc.d.ts.map +1 -0
- package/dist/tapd_grpc/authenticated_tapd_grpc.js +76 -0
- package/dist/tapd_grpc/authenticated_tapd_grpc.js.map +1 -0
- package/dist/tapd_grpc/decode_serialized.d.ts +18 -0
- package/dist/tapd_grpc/decode_serialized.d.ts.map +1 -0
- package/dist/tapd_grpc/decode_serialized.js +23 -0
- package/dist/tapd_grpc/decode_serialized.js.map +1 -0
- package/dist/tapd_grpc/grpc_credentials.d.ts +24 -0
- package/dist/tapd_grpc/grpc_credentials.d.ts.map +1 -0
- package/dist/tapd_grpc/grpc_credentials.js +39 -0
- package/dist/tapd_grpc/grpc_credentials.js.map +1 -0
- package/dist/tapd_grpc/grpc_options.d.ts +10 -0
- package/dist/tapd_grpc/grpc_options.d.ts.map +1 -0
- package/dist/tapd_grpc/grpc_options.js +9 -0
- package/dist/tapd_grpc/grpc_options.js.map +1 -0
- package/dist/tapd_grpc/grpc_ssl.d.ts +19 -0
- package/dist/tapd_grpc/grpc_ssl.d.ts.map +1 -0
- package/dist/tapd_grpc/grpc_ssl.js +18 -0
- package/dist/tapd_grpc/grpc_ssl.js.map +1 -0
- package/dist/tapd_grpc/index.d.ts +6 -0
- package/dist/tapd_grpc/index.d.ts.map +1 -0
- package/dist/tapd_grpc/index.js +2 -0
- package/dist/tapd_grpc/index.js.map +1 -0
- package/dist/tapd_grpc/types.d.ts +35 -0
- package/dist/tapd_grpc/types.d.ts.map +1 -0
- package/dist/tapd_grpc/types.js +2 -0
- package/dist/tapd_grpc/types.js.map +1 -0
- package/dist/tapd_methods/address/create_asset_address.d.ts +52 -0
- package/dist/tapd_methods/address/create_asset_address.d.ts.map +1 -0
- package/dist/tapd_methods/address/create_asset_address.js +127 -0
- package/dist/tapd_methods/address/create_asset_address.js.map +1 -0
- package/dist/tapd_methods/address/decode_asset_address.d.ts +38 -0
- package/dist/tapd_methods/address/decode_asset_address.d.ts.map +1 -0
- package/dist/tapd_methods/address/decode_asset_address.js +81 -0
- package/dist/tapd_methods/address/decode_asset_address.js.map +1 -0
- package/dist/tapd_methods/address/get_asset_addresses.d.ts +54 -0
- package/dist/tapd_methods/address/get_asset_addresses.d.ts.map +1 -0
- package/dist/tapd_methods/address/get_asset_addresses.js +153 -0
- package/dist/tapd_methods/address/get_asset_addresses.js.map +1 -0
- package/dist/tapd_methods/address/get_asset_receives.d.ts +72 -0
- package/dist/tapd_methods/address/get_asset_receives.d.ts.map +1 -0
- package/dist/tapd_methods/address/get_asset_receives.js +191 -0
- package/dist/tapd_methods/address/get_asset_receives.js.map +1 -0
- package/dist/tapd_methods/address/index.d.ts +15 -0
- package/dist/tapd_methods/address/index.d.ts.map +1 -0
- package/dist/tapd_methods/address/index.js +6 -0
- package/dist/tapd_methods/address/index.js.map +1 -0
- package/dist/tapd_methods/address/subscribe_to_asset_receives.d.ts +53 -0
- package/dist/tapd_methods/address/subscribe_to_asset_receives.d.ts.map +1 -0
- package/dist/tapd_methods/address/subscribe_to_asset_receives.js +93 -0
- package/dist/tapd_methods/address/subscribe_to_asset_receives.js.map +1 -0
- package/dist/tapd_methods/assets/get_asset_balances.d.ts +64 -0
- package/dist/tapd_methods/assets/get_asset_balances.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_asset_balances.js +177 -0
- package/dist/tapd_methods/assets/get_asset_balances.js.map +1 -0
- package/dist/tapd_methods/assets/get_asset_burns.d.ts +40 -0
- package/dist/tapd_methods/assets/get_asset_burns.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_asset_burns.js +92 -0
- package/dist/tapd_methods/assets/get_asset_burns.js.map +1 -0
- package/dist/tapd_methods/assets/get_asset_groups.d.ts +35 -0
- package/dist/tapd_methods/assets/get_asset_groups.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_asset_groups.js +78 -0
- package/dist/tapd_methods/assets/get_asset_groups.js.map +1 -0
- package/dist/tapd_methods/assets/get_asset_metadata.d.ts +40 -0
- package/dist/tapd_methods/assets/get_asset_metadata.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_asset_metadata.js +99 -0
- package/dist/tapd_methods/assets/get_asset_metadata.js.map +1 -0
- package/dist/tapd_methods/assets/get_asset_utxos.d.ts +83 -0
- package/dist/tapd_methods/assets/get_asset_utxos.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_asset_utxos.js +135 -0
- package/dist/tapd_methods/assets/get_asset_utxos.js.map +1 -0
- package/dist/tapd_methods/assets/get_assets.d.ts +113 -0
- package/dist/tapd_methods/assets/get_assets.d.ts.map +1 -0
- package/dist/tapd_methods/assets/get_assets.js +243 -0
- package/dist/tapd_methods/assets/get_assets.js.map +1 -0
- package/dist/tapd_methods/assets/index.d.ts +19 -0
- package/dist/tapd_methods/assets/index.d.ts.map +1 -0
- package/dist/tapd_methods/assets/index.js +7 -0
- package/dist/tapd_methods/assets/index.js.map +1 -0
- package/dist/tapd_methods/channels/asset_payment_args_error.d.ts +18 -0
- package/dist/tapd_methods/channels/asset_payment_args_error.d.ts.map +1 -0
- package/dist/tapd_methods/channels/asset_payment_args_error.js +59 -0
- package/dist/tapd_methods/channels/asset_payment_args_error.js.map +1 -0
- package/dist/tapd_methods/channels/asset_payment_request.d.ts +68 -0
- package/dist/tapd_methods/channels/asset_payment_request.d.ts.map +1 -0
- package/dist/tapd_methods/channels/asset_payment_request.js +54 -0
- package/dist/tapd_methods/channels/asset_payment_request.js.map +1 -0
- package/dist/tapd_methods/channels/create_asset_invoice.d.ts +134 -0
- package/dist/tapd_methods/channels/create_asset_invoice.d.ts.map +1 -0
- package/dist/tapd_methods/channels/create_asset_invoice.js +264 -0
- package/dist/tapd_methods/channels/create_asset_invoice.js.map +1 -0
- package/dist/tapd_methods/channels/decode_asset_payment_request.d.ts +72 -0
- package/dist/tapd_methods/channels/decode_asset_payment_request.d.ts.map +1 -0
- package/dist/tapd_methods/channels/decode_asset_payment_request.js +143 -0
- package/dist/tapd_methods/channels/decode_asset_payment_request.js.map +1 -0
- package/dist/tapd_methods/channels/emit_asset_payment.d.ts +30 -0
- package/dist/tapd_methods/channels/emit_asset_payment.d.ts.map +1 -0
- package/dist/tapd_methods/channels/emit_asset_payment.js +59 -0
- package/dist/tapd_methods/channels/emit_asset_payment.js.map +1 -0
- package/dist/tapd_methods/channels/encode_asset_custom_records.d.ts +51 -0
- package/dist/tapd_methods/channels/encode_asset_custom_records.d.ts.map +1 -0
- package/dist/tapd_methods/channels/encode_asset_custom_records.js +127 -0
- package/dist/tapd_methods/channels/encode_asset_custom_records.js.map +1 -0
- package/dist/tapd_methods/channels/get_asset_invoices.d.ts +84 -0
- package/dist/tapd_methods/channels/get_asset_invoices.d.ts.map +1 -0
- package/dist/tapd_methods/channels/get_asset_invoices.js +193 -0
- package/dist/tapd_methods/channels/get_asset_invoices.js.map +1 -0
- package/dist/tapd_methods/channels/get_asset_payments.d.ts +69 -0
- package/dist/tapd_methods/channels/get_asset_payments.d.ts.map +1 -0
- package/dist/tapd_methods/channels/get_asset_payments.js +180 -0
- package/dist/tapd_methods/channels/get_asset_payments.js.map +1 -0
- package/dist/tapd_methods/channels/index.d.ts +31 -0
- package/dist/tapd_methods/channels/index.d.ts.map +1 -0
- package/dist/tapd_methods/channels/index.js +12 -0
- package/dist/tapd_methods/channels/index.js.map +1 -0
- package/dist/tapd_methods/channels/open_asset_channel.d.ts +53 -0
- package/dist/tapd_methods/channels/open_asset_channel.d.ts.map +1 -0
- package/dist/tapd_methods/channels/open_asset_channel.js +128 -0
- package/dist/tapd_methods/channels/open_asset_channel.js.map +1 -0
- package/dist/tapd_methods/channels/pay_asset_invoice.d.ts +95 -0
- package/dist/tapd_methods/channels/pay_asset_invoice.d.ts.map +1 -0
- package/dist/tapd_methods/channels/pay_asset_invoice.js +132 -0
- package/dist/tapd_methods/channels/pay_asset_invoice.js.map +1 -0
- package/dist/tapd_methods/channels/send_asset_keysend.d.ts +84 -0
- package/dist/tapd_methods/channels/send_asset_keysend.d.ts.map +1 -0
- package/dist/tapd_methods/channels/send_asset_keysend.js +144 -0
- package/dist/tapd_methods/channels/send_asset_keysend.js.map +1 -0
- package/dist/tapd_methods/channels/send_asset_payment.d.ts +33 -0
- package/dist/tapd_methods/channels/send_asset_payment.d.ts.map +1 -0
- package/dist/tapd_methods/channels/send_asset_payment.js +114 -0
- package/dist/tapd_methods/channels/send_asset_payment.js.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_invoices.d.ts +51 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_invoices.d.ts.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_invoices.js +104 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_invoices.js.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_payments.d.ts +59 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_payments.d.ts.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_payments.js +104 -0
- package/dist/tapd_methods/channels/subscribe_to_asset_payments.js.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_past_asset_payment.d.ts +62 -0
- package/dist/tapd_methods/channels/subscribe_to_past_asset_payment.d.ts.map +1 -0
- package/dist/tapd_methods/channels/subscribe_to_past_asset_payment.js +106 -0
- package/dist/tapd_methods/channels/subscribe_to_past_asset_payment.js.map +1 -0
- package/dist/tapd_methods/daemon/create_tapd_macaroon.d.ts +45 -0
- package/dist/tapd_methods/daemon/create_tapd_macaroon.d.ts.map +1 -0
- package/dist/tapd_methods/daemon/create_tapd_macaroon.js +99 -0
- package/dist/tapd_methods/daemon/create_tapd_macaroon.js.map +1 -0
- package/dist/tapd_methods/daemon/index.d.ts +8 -0
- package/dist/tapd_methods/daemon/index.d.ts.map +1 -0
- package/dist/tapd_methods/daemon/index.js +4 -0
- package/dist/tapd_methods/daemon/index.js.map +1 -0
- package/dist/tapd_methods/daemon/set_tapd_debug_level.d.ts +23 -0
- package/dist/tapd_methods/daemon/set_tapd_debug_level.d.ts.map +1 -0
- package/dist/tapd_methods/daemon/set_tapd_debug_level.js +60 -0
- package/dist/tapd_methods/daemon/set_tapd_debug_level.js.map +1 -0
- package/dist/tapd_methods/daemon/stop_tapd.d.ts +16 -0
- package/dist/tapd_methods/daemon/stop_tapd.d.ts.map +1 -0
- package/dist/tapd_methods/daemon/stop_tapd.js +50 -0
- package/dist/tapd_methods/daemon/stop_tapd.js.map +1 -0
- package/dist/tapd_methods/index.d.ts +10 -0
- package/dist/tapd_methods/index.d.ts.map +1 -0
- package/dist/tapd_methods/index.js +10 -0
- package/dist/tapd_methods/index.js.map +1 -0
- package/dist/tapd_methods/info/get_tapd_info.d.ts +44 -0
- package/dist/tapd_methods/info/get_tapd_info.d.ts.map +1 -0
- package/dist/tapd_methods/info/get_tapd_info.js +80 -0
- package/dist/tapd_methods/info/get_tapd_info.js.map +1 -0
- package/dist/tapd_methods/info/index.d.ts +4 -0
- package/dist/tapd_methods/info/index.d.ts.map +1 -0
- package/dist/tapd_methods/info/index.js +2 -0
- package/dist/tapd_methods/info/index.js.map +1 -0
- package/dist/tapd_methods/mint/add_asset_to_mint_batch.d.ts +124 -0
- package/dist/tapd_methods/mint/add_asset_to_mint_batch.d.ts.map +1 -0
- package/dist/tapd_methods/mint/add_asset_to_mint_batch.js +283 -0
- package/dist/tapd_methods/mint/add_asset_to_mint_batch.js.map +1 -0
- package/dist/tapd_methods/mint/cancel_mint_batch.d.ts +23 -0
- package/dist/tapd_methods/mint/cancel_mint_batch.d.ts.map +1 -0
- package/dist/tapd_methods/mint/cancel_mint_batch.js +62 -0
- package/dist/tapd_methods/mint/cancel_mint_batch.js.map +1 -0
- package/dist/tapd_methods/mint/finalize_mint_batch.d.ts +64 -0
- package/dist/tapd_methods/mint/finalize_mint_batch.d.ts.map +1 -0
- package/dist/tapd_methods/mint/finalize_mint_batch.js +130 -0
- package/dist/tapd_methods/mint/finalize_mint_batch.js.map +1 -0
- package/dist/tapd_methods/mint/fund_mint_batch.d.ts +82 -0
- package/dist/tapd_methods/mint/fund_mint_batch.d.ts.map +1 -0
- package/dist/tapd_methods/mint/fund_mint_batch.js +145 -0
- package/dist/tapd_methods/mint/fund_mint_batch.js.map +1 -0
- package/dist/tapd_methods/mint/get_mint_batches.d.ts +72 -0
- package/dist/tapd_methods/mint/get_mint_batches.d.ts.map +1 -0
- package/dist/tapd_methods/mint/get_mint_batches.js +123 -0
- package/dist/tapd_methods/mint/get_mint_batches.js.map +1 -0
- package/dist/tapd_methods/mint/index.d.ts +21 -0
- package/dist/tapd_methods/mint/index.d.ts.map +1 -0
- package/dist/tapd_methods/mint/index.js +8 -0
- package/dist/tapd_methods/mint/index.js.map +1 -0
- package/dist/tapd_methods/mint/seal_mint_batch.d.ts +64 -0
- package/dist/tapd_methods/mint/seal_mint_batch.d.ts.map +1 -0
- package/dist/tapd_methods/mint/seal_mint_batch.js +135 -0
- package/dist/tapd_methods/mint/seal_mint_batch.js.map +1 -0
- package/dist/tapd_methods/mint/subscribe_to_mint_events.d.ts +52 -0
- package/dist/tapd_methods/mint/subscribe_to_mint_events.d.ts.map +1 -0
- package/dist/tapd_methods/mint/subscribe_to_mint_events.js +91 -0
- package/dist/tapd_methods/mint/subscribe_to_mint_events.js.map +1 -0
- package/dist/tapd_methods/proofs/decode_asset_proof.d.ts +61 -0
- package/dist/tapd_methods/proofs/decode_asset_proof.d.ts.map +1 -0
- package/dist/tapd_methods/proofs/decode_asset_proof.js +129 -0
- package/dist/tapd_methods/proofs/decode_asset_proof.js.map +1 -0
- package/dist/tapd_methods/proofs/export_asset_proof.d.ts +39 -0
- package/dist/tapd_methods/proofs/export_asset_proof.d.ts.map +1 -0
- package/dist/tapd_methods/proofs/export_asset_proof.js +113 -0
- package/dist/tapd_methods/proofs/export_asset_proof.js.map +1 -0
- package/dist/tapd_methods/proofs/index.d.ts +13 -0
- package/dist/tapd_methods/proofs/index.d.ts.map +1 -0
- package/dist/tapd_methods/proofs/index.js +5 -0
- package/dist/tapd_methods/proofs/index.js.map +1 -0
- package/dist/tapd_methods/proofs/unpack_asset_proof_file.d.ts +29 -0
- package/dist/tapd_methods/proofs/unpack_asset_proof_file.d.ts.map +1 -0
- package/dist/tapd_methods/proofs/unpack_asset_proof_file.js +85 -0
- package/dist/tapd_methods/proofs/unpack_asset_proof_file.js.map +1 -0
- package/dist/tapd_methods/proofs/verify_asset_proof.d.ts +58 -0
- package/dist/tapd_methods/proofs/verify_asset_proof.d.ts.map +1 -0
- package/dist/tapd_methods/proofs/verify_asset_proof.js +110 -0
- package/dist/tapd_methods/proofs/verify_asset_proof.js.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_buy_offer.d.ts +31 -0
- package/dist/tapd_methods/rfq/add_asset_buy_offer.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_buy_offer.js +88 -0
- package/dist/tapd_methods/rfq/add_asset_buy_offer.js.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_buy_order.d.ts +79 -0
- package/dist/tapd_methods/rfq/add_asset_buy_order.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_buy_order.js +200 -0
- package/dist/tapd_methods/rfq/add_asset_buy_order.js.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_sell_offer.d.ts +30 -0
- package/dist/tapd_methods/rfq/add_asset_sell_offer.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_sell_offer.js +87 -0
- package/dist/tapd_methods/rfq/add_asset_sell_offer.js.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_sell_order.d.ts +79 -0
- package/dist/tapd_methods/rfq/add_asset_sell_order.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/add_asset_sell_order.js +200 -0
- package/dist/tapd_methods/rfq/add_asset_sell_order.js.map +1 -0
- package/dist/tapd_methods/rfq/get_accepted_quotes.d.ts +52 -0
- package/dist/tapd_methods/rfq/get_accepted_quotes.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/get_accepted_quotes.js +100 -0
- package/dist/tapd_methods/rfq/get_accepted_quotes.js.map +1 -0
- package/dist/tapd_methods/rfq/get_asset_forwards.d.ts +70 -0
- package/dist/tapd_methods/rfq/get_asset_forwards.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/get_asset_forwards.js +185 -0
- package/dist/tapd_methods/rfq/get_asset_forwards.js.map +1 -0
- package/dist/tapd_methods/rfq/index.d.ts +19 -0
- package/dist/tapd_methods/rfq/index.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/index.js +8 -0
- package/dist/tapd_methods/rfq/index.js.map +1 -0
- package/dist/tapd_methods/rfq/subscribe_to_rfq_events.d.ts +68 -0
- package/dist/tapd_methods/rfq/subscribe_to_rfq_events.d.ts.map +1 -0
- package/dist/tapd_methods/rfq/subscribe_to_rfq_events.js +107 -0
- package/dist/tapd_methods/rfq/subscribe_to_rfq_events.js.map +1 -0
- package/dist/tapd_methods/send/burn_asset.d.ts +135 -0
- package/dist/tapd_methods/send/burn_asset.d.ts.map +1 -0
- package/dist/tapd_methods/send/burn_asset.js +220 -0
- package/dist/tapd_methods/send/burn_asset.js.map +1 -0
- package/dist/tapd_methods/send/get_asset_transfers.d.ts +73 -0
- package/dist/tapd_methods/send/get_asset_transfers.d.ts.map +1 -0
- package/dist/tapd_methods/send/get_asset_transfers.js +122 -0
- package/dist/tapd_methods/send/get_asset_transfers.js.map +1 -0
- package/dist/tapd_methods/send/index.d.ts +15 -0
- package/dist/tapd_methods/send/index.d.ts.map +1 -0
- package/dist/tapd_methods/send/index.js +6 -0
- package/dist/tapd_methods/send/index.js.map +1 -0
- package/dist/tapd_methods/send/register_asset_transfer.d.ts +77 -0
- package/dist/tapd_methods/send/register_asset_transfer.d.ts.map +1 -0
- package/dist/tapd_methods/send/register_asset_transfer.js +165 -0
- package/dist/tapd_methods/send/register_asset_transfer.js.map +1 -0
- package/dist/tapd_methods/send/send_asset.d.ts +94 -0
- package/dist/tapd_methods/send/send_asset.d.ts.map +1 -0
- package/dist/tapd_methods/send/send_asset.js +169 -0
- package/dist/tapd_methods/send/send_asset.js.map +1 -0
- package/dist/tapd_methods/send/subscribe_to_asset_sends.d.ts +117 -0
- package/dist/tapd_methods/send/subscribe_to_asset_sends.d.ts.map +1 -0
- package/dist/tapd_methods/send/subscribe_to_asset_sends.js +159 -0
- package/dist/tapd_methods/send/subscribe_to_asset_sends.js.map +1 -0
- package/dist/tapd_requests/decimal_as_fixed_point.d.ts +23 -0
- package/dist/tapd_requests/decimal_as_fixed_point.d.ts.map +1 -0
- package/dist/tapd_requests/decimal_as_fixed_point.js +31 -0
- package/dist/tapd_requests/decimal_as_fixed_point.js.map +1 -0
- package/dist/tapd_requests/fee_rate_as_tokens_per_kw.d.ts +13 -0
- package/dist/tapd_requests/fee_rate_as_tokens_per_kw.d.ts.map +1 -0
- package/dist/tapd_requests/fee_rate_as_tokens_per_kw.js +21 -0
- package/dist/tapd_requests/fee_rate_as_tokens_per_kw.js.map +1 -0
- package/dist/tapd_requests/index.d.ts +9 -0
- package/dist/tapd_requests/index.d.ts.map +1 -0
- package/dist/tapd_requests/index.js +9 -0
- package/dist/tapd_requests/index.js.map +1 -0
- package/dist/tapd_requests/is_connection_failure.d.ts +23 -0
- package/dist/tapd_requests/is_connection_failure.d.ts.map +1 -0
- package/dist/tapd_requests/is_connection_failure.js +40 -0
- package/dist/tapd_requests/is_connection_failure.js.map +1 -0
- package/dist/tapd_requests/is_method_unsupported.d.ts +24 -0
- package/dist/tapd_requests/is_method_unsupported.d.ts.map +1 -0
- package/dist/tapd_requests/is_method_unsupported.js +27 -0
- package/dist/tapd_requests/is_method_unsupported.js.map +1 -0
- package/dist/tapd_requests/is_permission_denied.d.ts +19 -0
- package/dist/tapd_requests/is_permission_denied.d.ts.map +1 -0
- package/dist/tapd_requests/is_permission_denied.js +16 -0
- package/dist/tapd_requests/is_permission_denied.js.map +1 -0
- package/dist/tapd_requests/is_tapd.d.ts +19 -0
- package/dist/tapd_requests/is_tapd.d.ts.map +1 -0
- package/dist/tapd_requests/is_tapd.js +16 -0
- package/dist/tapd_requests/is_tapd.js.map +1 -0
- package/dist/tapd_requests/mint_funding_request.d.ts +53 -0
- package/dist/tapd_requests/mint_funding_request.d.ts.map +1 -0
- package/dist/tapd_requests/mint_funding_request.js +48 -0
- package/dist/tapd_requests/mint_funding_request.js.map +1 -0
- package/dist/tapd_requests/script_key_type_query.d.ts +26 -0
- package/dist/tapd_requests/script_key_type_query.d.ts.map +1 -0
- package/dist/tapd_requests/script_key_type_query.js +41 -0
- package/dist/tapd_requests/script_key_type_query.js.map +1 -0
- package/dist/tapd_responses/asset_channel_rpc_error.d.ts +19 -0
- package/dist/tapd_responses/asset_channel_rpc_error.d.ts.map +1 -0
- package/dist/tapd_responses/asset_channel_rpc_error.js +69 -0
- package/dist/tapd_responses/asset_channel_rpc_error.js.map +1 -0
- package/dist/tapd_responses/batch_states.d.ts +4 -0
- package/dist/tapd_responses/batch_states.d.ts.map +1 -0
- package/dist/tapd_responses/batch_states.js +13 -0
- package/dist/tapd_responses/batch_states.js.map +1 -0
- package/dist/tapd_responses/fixed_point_as_decimal.d.ts +25 -0
- package/dist/tapd_responses/fixed_point_as_decimal.d.ts.map +1 -0
- package/dist/tapd_responses/fixed_point_as_decimal.js +39 -0
- package/dist/tapd_responses/fixed_point_as_decimal.js.map +1 -0
- package/dist/tapd_responses/index.d.ts +76 -0
- package/dist/tapd_responses/index.d.ts.map +1 -0
- package/dist/tapd_responses/index.js +30 -0
- package/dist/tapd_responses/index.js.map +1 -0
- package/dist/tapd_responses/long_key_as_number.d.ts +16 -0
- package/dist/tapd_responses/long_key_as_number.d.ts.map +1 -0
- package/dist/tapd_responses/long_key_as_number.js +28 -0
- package/dist/tapd_responses/long_key_as_number.js.map +1 -0
- package/dist/tapd_responses/mint_rpc_error.d.ts +19 -0
- package/dist/tapd_responses/mint_rpc_error.d.ts.map +1 -0
- package/dist/tapd_responses/mint_rpc_error.js +35 -0
- package/dist/tapd_responses/mint_rpc_error.js.map +1 -0
- package/dist/tapd_responses/outpoint_as_transaction.d.ts +19 -0
- package/dist/tapd_responses/outpoint_as_transaction.d.ts.map +1 -0
- package/dist/tapd_responses/outpoint_as_transaction.js +23 -0
- package/dist/tapd_responses/outpoint_as_transaction.js.map +1 -0
- package/dist/tapd_responses/receive_statuses.d.ts +4 -0
- package/dist/tapd_responses/receive_statuses.d.ts.map +1 -0
- package/dist/tapd_responses/receive_statuses.js +9 -0
- package/dist/tapd_responses/receive_statuses.js.map +1 -0
- package/dist/tapd_responses/rpc_addr_as_address.d.ts +79 -0
- package/dist/tapd_responses/rpc_addr_as_address.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_addr_as_address.js +87 -0
- package/dist/tapd_responses/rpc_addr_as_address.js.map +1 -0
- package/dist/tapd_responses/rpc_addr_event_as_receive.d.ts +63 -0
- package/dist/tapd_responses/rpc_addr_event_as_receive.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_addr_event_as_receive.js +64 -0
- package/dist/tapd_responses/rpc_addr_event_as_receive.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_amount_as_amount.d.ts +34 -0
- package/dist/tapd_responses/rpc_asset_amount_as_amount.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_amount_as_amount.js +38 -0
- package/dist/tapd_responses/rpc_asset_amount_as_amount.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_as_asset.d.ts +204 -0
- package/dist/tapd_responses/rpc_asset_as_asset.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_as_asset.js +174 -0
- package/dist/tapd_responses/rpc_asset_as_asset.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_balance_as_balance.d.ts +53 -0
- package/dist/tapd_responses/rpc_asset_balance_as_balance.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_balance_as_balance.js +53 -0
- package/dist/tapd_responses/rpc_asset_balance_as_balance.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_burn_as_burn.d.ts +51 -0
- package/dist/tapd_responses/rpc_asset_burn_as_burn.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_burn_as_burn.js +54 -0
- package/dist/tapd_responses/rpc_asset_burn_as_burn.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_invoice_as_invoice.d.ts +39 -0
- package/dist/tapd_responses/rpc_asset_invoice_as_invoice.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_invoice_as_invoice.js +45 -0
- package/dist/tapd_responses/rpc_asset_invoice_as_invoice.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_meta_as_metadata.d.ts +68 -0
- package/dist/tapd_responses/rpc_asset_meta_as_metadata.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_meta_as_metadata.js +70 -0
- package/dist/tapd_responses/rpc_asset_meta_as_metadata.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_pay_req_as_request.d.ts +76 -0
- package/dist/tapd_responses/rpc_asset_pay_req_as_request.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_pay_req_as_request.js +73 -0
- package/dist/tapd_responses/rpc_asset_pay_req_as_request.js.map +1 -0
- package/dist/tapd_responses/rpc_asset_payment_as_payment.d.ts +39 -0
- package/dist/tapd_responses/rpc_asset_payment_as_payment.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_asset_payment_as_payment.js +45 -0
- package/dist/tapd_responses/rpc_asset_payment_as_payment.js.map +1 -0
- package/dist/tapd_responses/rpc_batch_as_batch.d.ts +158 -0
- package/dist/tapd_responses/rpc_batch_as_batch.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_batch_as_batch.js +181 -0
- package/dist/tapd_responses/rpc_batch_as_batch.js.map +1 -0
- package/dist/tapd_responses/rpc_buy_quote_as_quote.d.ts +83 -0
- package/dist/tapd_responses/rpc_buy_quote_as_quote.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_buy_quote_as_quote.js +85 -0
- package/dist/tapd_responses/rpc_buy_quote_as_quote.js.map +1 -0
- package/dist/tapd_responses/rpc_decoded_proof_as_proof.d.ts +161 -0
- package/dist/tapd_responses/rpc_decoded_proof_as_proof.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_decoded_proof_as_proof.js +138 -0
- package/dist/tapd_responses/rpc_decoded_proof_as_proof.js.map +1 -0
- package/dist/tapd_responses/rpc_forward_as_asset_forward.d.ts +100 -0
- package/dist/tapd_responses/rpc_forward_as_asset_forward.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_forward_as_asset_forward.js +101 -0
- package/dist/tapd_responses/rpc_forward_as_asset_forward.js.map +1 -0
- package/dist/tapd_responses/rpc_grouped_assets_as_group.d.ts +76 -0
- package/dist/tapd_responses/rpc_grouped_assets_as_group.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_grouped_assets_as_group.js +71 -0
- package/dist/tapd_responses/rpc_grouped_assets_as_group.js.map +1 -0
- package/dist/tapd_responses/rpc_managed_utxo_as_utxo.d.ts +63 -0
- package/dist/tapd_responses/rpc_managed_utxo_as_utxo.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_managed_utxo_as_utxo.js +65 -0
- package/dist/tapd_responses/rpc_managed_utxo_as_utxo.js.map +1 -0
- package/dist/tapd_responses/rpc_receive_event_as_receive_update.d.ts +53 -0
- package/dist/tapd_responses/rpc_receive_event_as_receive_update.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_receive_event_as_receive_update.js +52 -0
- package/dist/tapd_responses/rpc_receive_event_as_receive_update.js.map +1 -0
- package/dist/tapd_responses/rpc_rfq_event_as_event.d.ts +70 -0
- package/dist/tapd_responses/rpc_rfq_event_as_event.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_rfq_event_as_event.js +89 -0
- package/dist/tapd_responses/rpc_rfq_event_as_event.js.map +1 -0
- package/dist/tapd_responses/rpc_sell_quote_as_quote.d.ts +80 -0
- package/dist/tapd_responses/rpc_sell_quote_as_quote.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_sell_quote_as_quote.js +85 -0
- package/dist/tapd_responses/rpc_sell_quote_as_quote.js.map +1 -0
- package/dist/tapd_responses/rpc_send_event_as_send_event.d.ts +124 -0
- package/dist/tapd_responses/rpc_send_event_as_send_event.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_send_event_as_send_event.js +161 -0
- package/dist/tapd_responses/rpc_send_event_as_send_event.js.map +1 -0
- package/dist/tapd_responses/rpc_transfer_as_transfer.d.ts +241 -0
- package/dist/tapd_responses/rpc_transfer_as_transfer.d.ts.map +1 -0
- package/dist/tapd_responses/rpc_transfer_as_transfer.js +212 -0
- package/dist/tapd_responses/rpc_transfer_as_transfer.js.map +1 -0
- package/dist/tapd_responses/short_channel_id_as_channel.d.ts +13 -0
- package/dist/tapd_responses/short_channel_id_as_channel.d.ts.map +1 -0
- package/dist/tapd_responses/short_channel_id_as_channel.js +26 -0
- package/dist/tapd_responses/short_channel_id_as_channel.js.map +1 -0
- package/dist/typescript/index.d.ts +16 -0
- package/dist/typescript/index.d.ts.map +1 -0
- package/dist/typescript/index.js +2 -0
- package/dist/typescript/index.js.map +1 -0
- package/package.json +76 -3
- package/protos/VERSIONS +2 -0
- package/protos/lnrpc/lightning.proto +5380 -0
- package/protos/lnrpc/routerrpc/router.proto +1115 -0
- package/protos/taprpc/assetwalletrpc/assetwallet.proto +631 -0
- package/protos/taprpc/authmailboxrpc/mailbox.proto +281 -0
- package/protos/taprpc/mintrpc/mint.proto +452 -0
- package/protos/taprpc/portfoliopilotrpc/portfolio_pilot.proto +410 -0
- package/protos/taprpc/priceoraclerpc/price_oracle.proto +262 -0
- package/protos/taprpc/rfqrpc/rfq.proto +614 -0
- package/protos/taprpc/tapchannelrpc/tapchannel.proto +490 -0
- package/protos/taprpc/tapcommon.proto +47 -0
- package/protos/taprpc/tapdevrpc/tapdev.proto +120 -0
- package/protos/taprpc/taprootassets.proto +2117 -0
- package/protos/taprpc/universerpc/universe.proto +1101 -0
- package/src/grpc/emit_subscription_error.ts +39 -0
- package/src/grpc/grpc_services.ts +45 -0
- package/src/grpc/handle_remove_listener.ts +35 -0
- package/src/grpc/index.ts +18 -0
- package/src/index.ts +24 -0
- package/src/tapd_grpc/api_for_proto.ts +42 -0
- package/src/tapd_grpc/authenticated_tapd_grpc.ts +88 -0
- package/src/tapd_grpc/decode_serialized.ts +25 -0
- package/src/tapd_grpc/grpc_credentials.ts +48 -0
- package/src/tapd_grpc/grpc_options.ts +10 -0
- package/src/tapd_grpc/grpc_ssl.ts +20 -0
- package/src/tapd_grpc/index.ts +5 -0
- package/src/tapd_grpc/types.ts +35 -0
- package/src/tapd_methods/address/create_asset_address.ts +179 -0
- package/src/tapd_methods/address/decode_asset_address.ts +117 -0
- package/src/tapd_methods/address/get_asset_addresses.ts +212 -0
- package/src/tapd_methods/address/get_asset_receives.ts +265 -0
- package/src/tapd_methods/address/index.ts +14 -0
- package/src/tapd_methods/address/subscribe_to_asset_receives.ts +114 -0
- package/src/tapd_methods/assets/get_asset_balances.ts +249 -0
- package/src/tapd_methods/assets/get_asset_burns.ts +133 -0
- package/src/tapd_methods/assets/get_asset_groups.ts +109 -0
- package/src/tapd_methods/assets/get_asset_metadata.ts +141 -0
- package/src/tapd_methods/assets/get_asset_utxos.ts +175 -0
- package/src/tapd_methods/assets/get_assets.ts +327 -0
- package/src/tapd_methods/assets/index.ts +18 -0
- package/src/tapd_methods/channels/asset_payment_args_error.ts +83 -0
- package/src/tapd_methods/channels/asset_payment_request.ts +76 -0
- package/src/tapd_methods/channels/create_asset_invoice.ts +387 -0
- package/src/tapd_methods/channels/decode_asset_payment_request.ts +192 -0
- package/src/tapd_methods/channels/emit_asset_payment.ts +78 -0
- package/src/tapd_methods/channels/encode_asset_custom_records.ts +187 -0
- package/src/tapd_methods/channels/get_asset_invoices.ts +258 -0
- package/src/tapd_methods/channels/get_asset_payments.ts +243 -0
- package/src/tapd_methods/channels/index.ts +30 -0
- package/src/tapd_methods/channels/open_asset_channel.ts +193 -0
- package/src/tapd_methods/channels/pay_asset_invoice.ts +171 -0
- package/src/tapd_methods/channels/send_asset_keysend.ts +196 -0
- package/src/tapd_methods/channels/send_asset_payment.ts +158 -0
- package/src/tapd_methods/channels/subscribe_to_asset_invoices.ts +134 -0
- package/src/tapd_methods/channels/subscribe_to_asset_payments.ts +126 -0
- package/src/tapd_methods/channels/subscribe_to_past_asset_payment.ts +132 -0
- package/src/tapd_methods/daemon/create_tapd_macaroon.ts +153 -0
- package/src/tapd_methods/daemon/index.ts +7 -0
- package/src/tapd_methods/daemon/set_tapd_debug_level.ts +90 -0
- package/src/tapd_methods/daemon/stop_tapd.ts +75 -0
- package/src/tapd_methods/index.ts +9 -0
- package/src/tapd_methods/info/get_tapd_info.ts +129 -0
- package/src/tapd_methods/info/index.ts +3 -0
- package/src/tapd_methods/mint/add_asset_to_mint_batch.ts +396 -0
- package/src/tapd_methods/mint/cancel_mint_batch.ts +95 -0
- package/src/tapd_methods/mint/finalize_mint_batch.ts +181 -0
- package/src/tapd_methods/mint/fund_mint_batch.ts +193 -0
- package/src/tapd_methods/mint/get_mint_batches.ts +162 -0
- package/src/tapd_methods/mint/index.ts +20 -0
- package/src/tapd_methods/mint/seal_mint_batch.ts +184 -0
- package/src/tapd_methods/mint/subscribe_to_mint_events.ts +104 -0
- package/src/tapd_methods/proofs/decode_asset_proof.ts +175 -0
- package/src/tapd_methods/proofs/export_asset_proof.ts +169 -0
- package/src/tapd_methods/proofs/index.ts +12 -0
- package/src/tapd_methods/proofs/unpack_asset_proof_file.ts +126 -0
- package/src/tapd_methods/proofs/verify_asset_proof.ts +156 -0
- package/src/tapd_methods/rfq/add_asset_buy_offer.ts +127 -0
- package/src/tapd_methods/rfq/add_asset_buy_order.ts +279 -0
- package/src/tapd_methods/rfq/add_asset_sell_offer.ts +126 -0
- package/src/tapd_methods/rfq/add_asset_sell_order.ts +279 -0
- package/src/tapd_methods/rfq/get_accepted_quotes.ts +137 -0
- package/src/tapd_methods/rfq/get_asset_forwards.ts +259 -0
- package/src/tapd_methods/rfq/index.ts +18 -0
- package/src/tapd_methods/rfq/subscribe_to_rfq_events.ts +130 -0
- package/src/tapd_methods/send/burn_asset.ts +280 -0
- package/src/tapd_methods/send/get_asset_transfers.ts +161 -0
- package/src/tapd_methods/send/index.ts +14 -0
- package/src/tapd_methods/send/register_asset_transfer.ts +219 -0
- package/src/tapd_methods/send/send_asset.ts +223 -0
- package/src/tapd_methods/send/subscribe_to_asset_sends.ts +181 -0
- package/src/tapd_requests/decimal_as_fixed_point.ts +36 -0
- package/src/tapd_requests/fee_rate_as_tokens_per_kw.ts +23 -0
- package/src/tapd_requests/index.ts +8 -0
- package/src/tapd_requests/is_connection_failure.ts +48 -0
- package/src/tapd_requests/is_method_unsupported.ts +33 -0
- package/src/tapd_requests/is_permission_denied.ts +18 -0
- package/src/tapd_requests/is_tapd.ts +22 -0
- package/src/tapd_requests/mint_funding_request.ts +57 -0
- package/src/tapd_requests/script_key_type_query.ts +44 -0
- package/src/tapd_responses/asset_channel_rpc_error.ts +73 -0
- package/src/tapd_responses/batch_states.ts +12 -0
- package/src/tapd_responses/fixed_point_as_decimal.ts +51 -0
- package/src/tapd_responses/index.ts +75 -0
- package/src/tapd_responses/long_key_as_number.ts +31 -0
- package/src/tapd_responses/mint_rpc_error.ts +39 -0
- package/src/tapd_responses/outpoint_as_transaction.ts +25 -0
- package/src/tapd_responses/receive_statuses.ts +8 -0
- package/src/tapd_responses/rpc_addr_as_address.ts +138 -0
- package/src/tapd_responses/rpc_addr_event_as_receive.ts +103 -0
- package/src/tapd_responses/rpc_asset_amount_as_amount.ts +57 -0
- package/src/tapd_responses/rpc_asset_as_asset.ts +299 -0
- package/src/tapd_responses/rpc_asset_balance_as_balance.ts +85 -0
- package/src/tapd_responses/rpc_asset_burn_as_burn.ts +85 -0
- package/src/tapd_responses/rpc_asset_invoice_as_invoice.ts +62 -0
- package/src/tapd_responses/rpc_asset_meta_as_metadata.ts +113 -0
- package/src/tapd_responses/rpc_asset_pay_req_as_request.ts +114 -0
- package/src/tapd_responses/rpc_asset_payment_as_payment.ts +62 -0
- package/src/tapd_responses/rpc_batch_as_batch.ts +281 -0
- package/src/tapd_responses/rpc_buy_quote_as_quote.ts +139 -0
- package/src/tapd_responses/rpc_decoded_proof_as_proof.ts +229 -0
- package/src/tapd_responses/rpc_forward_as_asset_forward.ts +164 -0
- package/src/tapd_responses/rpc_grouped_assets_as_group.ts +117 -0
- package/src/tapd_responses/rpc_managed_utxo_as_utxo.ts +105 -0
- package/src/tapd_responses/rpc_receive_event_as_receive_update.ts +84 -0
- package/src/tapd_responses/rpc_rfq_event_as_event.ts +123 -0
- package/src/tapd_responses/rpc_sell_quote_as_quote.ts +136 -0
- package/src/tapd_responses/rpc_send_event_as_send_event.ts +245 -0
- package/src/tapd_responses/rpc_transfer_as_transfer.ts +366 -0
- package/src/tapd_responses/short_channel_id_as_channel.ts +30 -0
- package/src/typescript/asyncjs_util.d.ts +14 -0
- package/src/typescript/index.ts +22 -0
- package/src/typescript/invoices.d.ts +30 -0
- package/src/typescript/lightning_lnd_responses.d.ts +44 -0
package/README.md
CHANGED
|
@@ -1,3 +1,2887 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tapass
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Methods for the Taproot Assets daemon (tapd), in the style of
|
|
4
|
+
[lightning](https://github.com/alexbosworth/lightning).
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
npm install tapass lightning
|
|
9
|
+
|
|
10
|
+
tapass needs Node.js 22.12 or later.
|
|
11
|
+
|
|
12
|
+
[lightning](https://github.com/alexbosworth/lightning) is a peer dependency.
|
|
13
|
+
The asset channel methods use it to return lnd payments, invoices, and payment
|
|
14
|
+
requests in the same shape as lightning.
|
|
15
|
+
|
|
16
|
+
## tapd Authentication
|
|
17
|
+
|
|
18
|
+
To connect to tapd, you need the TLS certificate and a macaroon. Encode each
|
|
19
|
+
file as base64:
|
|
20
|
+
|
|
21
|
+
base64 -w0 ~/.tapd/tls.cert
|
|
22
|
+
base64 -w0 ~/.tapd/data/mainnet/admin.macaroon
|
|
23
|
+
|
|
24
|
+
Then make an authenticated tapd object:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import {authenticatedTapdGrpc} from 'tapass';
|
|
28
|
+
|
|
29
|
+
const {tapd} = authenticatedTapdGrpc({
|
|
30
|
+
cert: 'base64 encoded tls.cert',
|
|
31
|
+
macaroon: 'base64 encoded admin.macaroon',
|
|
32
|
+
socket: '127.0.0.1:10029',
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Methods
|
|
37
|
+
|
|
38
|
+
- [addAssetBuyOffer](#addassetbuyoffer): Add or update an offer to buy an asset
|
|
39
|
+
- [addAssetBuyOrder](#addassetbuyorder): Ask a peer for a quote to buy an asset over an asset channel
|
|
40
|
+
- [addAssetSellOffer](#addassetselloffer): Add or update an offer to sell an asset
|
|
41
|
+
- [addAssetSellOrder](#addassetsellorder): Ask a peer for a quote to sell an asset over an asset channel
|
|
42
|
+
- [addAssetToMintBatch](#addassettomintbatch): Add an asset to the pending mint batch
|
|
43
|
+
- [burnAsset](#burnasset): Burn asset units
|
|
44
|
+
- [cancelMintBatch](#cancelmintbatch): Cancel the pending mint batch
|
|
45
|
+
- [createAssetAddress](#createassetaddress): Create a Taproot Assets address to receive an asset
|
|
46
|
+
- [createAssetInvoice](#createassetinvoice): Create an invoice that is paid with an asset, over an asset channel
|
|
47
|
+
- [createTapdMacaroon](#createtapdmacaroon): Create a tapd macaroon with specific permissions
|
|
48
|
+
- [decodeAssetAddress](#decodeassetaddress): Decode a Taproot Assets address
|
|
49
|
+
- [decodeAssetPaymentRequest](#decodeassetpaymentrequest): Decode a payment request and get its amount in units of an asset
|
|
50
|
+
- [decodeAssetProof](#decodeassetproof): Decode an asset proof or one proof in an asset proof file
|
|
51
|
+
- [encodeAssetCustomRecords](#encodeassetcustomrecords): Encode the first hop custom records of an asset payment
|
|
52
|
+
- [exportAssetProof](#exportassetproof): Export the proof file of an asset
|
|
53
|
+
- [finalizeMintBatch](#finalizemintbatch): Finalize the pending mint batch, and broadcast the genesis transaction
|
|
54
|
+
- [fundMintBatch](#fundmintbatch): Fund the pending mint batch with a genesis input
|
|
55
|
+
- [getAcceptedQuotes](#getacceptedquotes): Get the quotes that peers accepted for the orders of this node
|
|
56
|
+
- [getAssetAddresses](#getassetaddresses): Get the Taproot Assets addresses that this node created, oldest first
|
|
57
|
+
- [getAssetBalances](#getassetbalances): Get the asset balances of this node, by asset and by asset group
|
|
58
|
+
- [getAssetBurns](#getassetburns): Get the asset burns that this node made
|
|
59
|
+
- [getAssetForwards](#getassetforwards): Get the asset swaps that this edge node forwarded
|
|
60
|
+
- [getAssetGroups](#getassetgroups): Get the asset groups of the assets that this node owns
|
|
61
|
+
- [getAssetInvoices](#getassetinvoices): Get invoices that received an asset, newest first
|
|
62
|
+
- [getAssetMetadata](#getassetmetadata): Get the metadata of an asset
|
|
63
|
+
- [getAssetPayments](#getassetpayments): Get confirmed payments that sent an asset, newest first
|
|
64
|
+
- [getAssetReceives](#getassetreceives): Get the inbound asset transfers to Taproot Assets addresses, newest first
|
|
65
|
+
- [getAssets](#getassets): Get the assets that this node owns
|
|
66
|
+
- [getAssetTransfers](#getassettransfers): Get the outbound asset transfers of this node
|
|
67
|
+
- [getAssetUtxos](#getassetutxos): Get the on-chain outputs that hold the assets of this node
|
|
68
|
+
- [getMintBatches](#getmintbatches): Get mint batches, including pending and cancelled batches
|
|
69
|
+
- [getTapdInfo](#gettapdinfo): Get information about tapd and its lnd node
|
|
70
|
+
- [openAssetChannel](#openassetchannel): Open a channel that is funded with an asset
|
|
71
|
+
- [payAssetInvoice](#payassetinvoice): Pay a payment request with an asset, over an asset channel
|
|
72
|
+
- [registerAssetTransfer](#registerassettransfer): Register an inbound asset transfer that has no Taproot Assets address
|
|
73
|
+
- [sealMintBatch](#sealmintbatch): Seal the pending mint batch with asset group witnesses
|
|
74
|
+
- [sendAsset](#sendasset): Send assets to Taproot Assets addresses
|
|
75
|
+
- [sendAssetKeysend](#sendassetkeysend): Send an asset to a channel peer with a keysend payment
|
|
76
|
+
- [setTapdDebugLevel](#settapddebuglevel): Set the log level of tapd
|
|
77
|
+
- [stopTapd](#stoptapd): Stop tapd
|
|
78
|
+
- [subscribeToAssetInvoices](#subscribetoassetinvoices): Subscribe to invoices that receive an asset
|
|
79
|
+
- [subscribeToAssetPayments](#subscribetoassetpayments): Subscribe to the status of current outgoing asset payments
|
|
80
|
+
- [subscribeToAssetReceives](#subscribetoassetreceives): Subscribe to inbound asset transfers to Taproot Assets addresses
|
|
81
|
+
- [subscribeToAssetSends](#subscribetoassetsends): Subscribe to the state changes of outbound asset sends
|
|
82
|
+
- [subscribeToMintEvents](#subscribetomintevents): Subscribe to the state changes of mint batches
|
|
83
|
+
- [subscribeToPastAssetPayment](#subscribetopastassetpayment): Subscribe to the status of a past asset payment
|
|
84
|
+
- [subscribeToRfqEvents](#subscribetorfqevents): Subscribe to RFQ events
|
|
85
|
+
- [unpackAssetProofFile](#unpackassetprooffile): Get the individual proofs in an asset proof file
|
|
86
|
+
- [verifyAssetProof](#verifyassetproof): Verify an asset proof file
|
|
87
|
+
|
|
88
|
+
### addAssetBuyOffer
|
|
89
|
+
|
|
90
|
+
Add or update an offer to buy an asset
|
|
91
|
+
|
|
92
|
+
tapd uses buy offers to accept or reject the sell quote requests of peers,
|
|
93
|
+
before it checks the price
|
|
94
|
+
|
|
95
|
+
Requires `rfq:write` permission
|
|
96
|
+
|
|
97
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
98
|
+
|
|
99
|
+
{
|
|
100
|
+
[asset_id]: <Asset Id Hex String>
|
|
101
|
+
[group_key]: <Asset Group Key Hex String>
|
|
102
|
+
max_amount: <Maximum Asset Units To Buy Numeric String>
|
|
103
|
+
tapd: <Authenticated tapd API Object>
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@returns via cbk or Promise
|
|
107
|
+
|
|
108
|
+
Example:
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
import {addAssetBuyOffer} from 'tapass';
|
|
112
|
+
|
|
113
|
+
await addAssetBuyOffer({asset_id, max_amount: '1000000', tapd});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### addAssetBuyOrder
|
|
117
|
+
|
|
118
|
+
Ask a peer for a quote to buy an asset over an asset channel
|
|
119
|
+
|
|
120
|
+
Use a buy order before you make an invoice that is paid in an asset
|
|
121
|
+
|
|
122
|
+
Requires `rfq:write` permission
|
|
123
|
+
|
|
124
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
125
|
+
|
|
126
|
+
A rate is a number of asset units per BTC, as an exact decimal string
|
|
127
|
+
|
|
128
|
+
When there is no `min_amount`, the quote must fill the `max_amount`. Use
|
|
129
|
+
`"0"` to accept a partial fill.
|
|
130
|
+
|
|
131
|
+
The default `timeout_seconds` is 60
|
|
132
|
+
|
|
133
|
+
`min_amount`, `min_rate`, and `is_fill_or_kill` need tapd v0.8.0 or later.
|
|
134
|
+
Older tapd versions ignore them.
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
[asset_id]: <Asset Id Hex String>
|
|
138
|
+
expires_at: <Order Expires At ISO 8601 Date String>
|
|
139
|
+
[group_key]: <Asset Group Key Hex String>
|
|
140
|
+
[is_asset_channel_check_skipped]: <Skip Asset Channel Check Bool>
|
|
141
|
+
[is_fill_or_kill]: <Reject a Quote That Does Not Fill the Maximum Bool>
|
|
142
|
+
max_amount: <Maximum Asset Units Numeric String>
|
|
143
|
+
[min_amount]: <Minimum Asset Units Numeric String>
|
|
144
|
+
[min_rate]: <Minimum Rate Asset Units Per BTC Decimal String>
|
|
145
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
146
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
147
|
+
tapd: <Authenticated tapd API Object>
|
|
148
|
+
[timeout_seconds]: <Wait For the Peer Quote Seconds Number>
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@returns via cbk or Promise
|
|
152
|
+
{
|
|
153
|
+
[accepted_max_amount]: <Accepted Maximum Asset Units Numeric String>
|
|
154
|
+
[asset_id]: <Asset Id Hex String>
|
|
155
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
156
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
157
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
158
|
+
id: <Quote Request Id Hex String>
|
|
159
|
+
max_amount: <Maximum Asset Units Numeric String>
|
|
160
|
+
min_transportable_amount: <Minimum Asset Units In One HTLC Numeric String>
|
|
161
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
162
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
163
|
+
rate: <Ask Rate Asset Units Per BTC Exact Decimal String>
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
Example:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
import {addAssetBuyOrder} from 'tapass';
|
|
170
|
+
|
|
171
|
+
const quote = await addAssetBuyOrder({
|
|
172
|
+
asset_id,
|
|
173
|
+
expires_at: new Date(Date.now() + 60e3).toISOString(),
|
|
174
|
+
max_amount: '1000',
|
|
175
|
+
peer_public_key,
|
|
176
|
+
tapd,
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### addAssetSellOffer
|
|
181
|
+
|
|
182
|
+
Add or update an offer to sell an asset
|
|
183
|
+
|
|
184
|
+
tapd uses sell offers to accept or reject the buy quote requests of peers
|
|
185
|
+
|
|
186
|
+
Requires `rfq:write` permission
|
|
187
|
+
|
|
188
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
189
|
+
|
|
190
|
+
{
|
|
191
|
+
[asset_id]: <Asset Id Hex String>
|
|
192
|
+
[group_key]: <Asset Group Key Hex String>
|
|
193
|
+
max_amount: <Maximum Asset Units To Sell Numeric String>
|
|
194
|
+
tapd: <Authenticated tapd API Object>
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@returns via cbk or Promise
|
|
198
|
+
|
|
199
|
+
Example:
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
import {addAssetSellOffer} from 'tapass';
|
|
203
|
+
|
|
204
|
+
await addAssetSellOffer({asset_id, max_amount: '1000000', tapd});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### addAssetSellOrder
|
|
208
|
+
|
|
209
|
+
Ask a peer for a quote to sell an asset over an asset channel
|
|
210
|
+
|
|
211
|
+
Use a sell order before you pay an invoice with an asset
|
|
212
|
+
|
|
213
|
+
Requires `rfq:write` permission
|
|
214
|
+
|
|
215
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
216
|
+
|
|
217
|
+
A rate is a number of asset units per BTC, as an exact decimal string
|
|
218
|
+
|
|
219
|
+
When there is no `min_mtokens`, the quote must fill the `max_mtokens`. Use
|
|
220
|
+
`"0"` to accept a partial fill.
|
|
221
|
+
|
|
222
|
+
The default `timeout_seconds` is 60
|
|
223
|
+
|
|
224
|
+
`max_rate`, `min_mtokens`, and `is_fill_or_kill` need tapd v0.8.0 or later.
|
|
225
|
+
Older tapd versions ignore them.
|
|
226
|
+
|
|
227
|
+
{
|
|
228
|
+
[asset_id]: <Asset Id Hex String>
|
|
229
|
+
expires_at: <Order Expires At ISO 8601 Date String>
|
|
230
|
+
[group_key]: <Asset Group Key Hex String>
|
|
231
|
+
[is_asset_channel_check_skipped]: <Skip Asset Channel Check Bool>
|
|
232
|
+
[is_fill_or_kill]: <Reject a Quote That Does Not Fill the Maximum Bool>
|
|
233
|
+
max_mtokens: <Maximum Payment Millitokens String>
|
|
234
|
+
[max_rate]: <Maximum Rate Asset Units Per BTC Decimal String>
|
|
235
|
+
[min_mtokens]: <Minimum Payment Millitokens String>
|
|
236
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
237
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
238
|
+
tapd: <Authenticated tapd API Object>
|
|
239
|
+
[timeout_seconds]: <Wait For the Peer Quote Seconds Number>
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@returns via cbk or Promise
|
|
243
|
+
{
|
|
244
|
+
[accepted_max_mtokens]: <Accepted Maximum Payment Millitokens String>
|
|
245
|
+
amount: <Asset Units Numeric String>
|
|
246
|
+
[asset_id]: <Asset Id Hex String>
|
|
247
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
248
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
249
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
250
|
+
id: <Quote Request Id Hex String>
|
|
251
|
+
min_transportable_mtokens: <Minimum Millitokens To Send One Unit String>
|
|
252
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
253
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
254
|
+
rate: <Bid Rate Asset Units Per BTC Exact Decimal String>
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
import {addAssetSellOrder} from 'tapass';
|
|
261
|
+
|
|
262
|
+
const quote = await addAssetSellOrder({
|
|
263
|
+
asset_id,
|
|
264
|
+
expires_at: new Date(Date.now() + 60e3).toISOString(),
|
|
265
|
+
max_mtokens: '1000000',
|
|
266
|
+
peer_public_key,
|
|
267
|
+
tapd,
|
|
268
|
+
});
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### addAssetToMintBatch
|
|
272
|
+
|
|
273
|
+
Add an asset to the pending mint batch
|
|
274
|
+
|
|
275
|
+
Requires `mint:write` permission
|
|
276
|
+
|
|
277
|
+
tapd makes a new pending batch when there is no pending batch
|
|
278
|
+
|
|
279
|
+
A normal asset needs an `amount`. A collectible asset has an amount of 1.
|
|
280
|
+
|
|
281
|
+
Give metadata as hex with `metadata`, or as UTF-8 text with `metadata_text`,
|
|
282
|
+
not both. Set `is_json_metadata` when the metadata is a JSON object.
|
|
283
|
+
|
|
284
|
+
A `decimal_display` is not for collectibles. tapd also writes it into JSON
|
|
285
|
+
metadata. If the JSON metadata has a different decimal display, tapd fails.
|
|
286
|
+
|
|
287
|
+
To mint into an existing group, give a `group_key`, or a `group_anchor` that
|
|
288
|
+
names an asset in this batch that starts a new group.
|
|
289
|
+
|
|
290
|
+
`group_internal_key`, `group_tapscript_root`, `external_group_key`, and
|
|
291
|
+
`is_supply_committed` are only for an asset that starts a new group.
|
|
292
|
+
|
|
293
|
+
{
|
|
294
|
+
[amount]: <Asset Units To Mint Numeric String>
|
|
295
|
+
[decimal_display]: <Decimal Places To Show Number> // 0 to 12
|
|
296
|
+
[external_group_key]: {
|
|
297
|
+
derivation_path: <Key Derivation Path String>
|
|
298
|
+
master_fingerprint: <Master Key Fingerprint 4 Byte Hex String>
|
|
299
|
+
xpub: <Extended Public Key String>
|
|
300
|
+
}
|
|
301
|
+
[group_anchor]: <Name of an Asset in the Batch That Anchors a Group String>
|
|
302
|
+
[group_internal_key]: {
|
|
303
|
+
[key_family]: <Key Family Number>
|
|
304
|
+
[key_index]: <Key Index Number>
|
|
305
|
+
public_key: <Internal Public Key Hex String>
|
|
306
|
+
}
|
|
307
|
+
[group_key]: <Existing Group Key Hex String>
|
|
308
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
309
|
+
[is_collectible]: <Asset Is Collectible Bool>
|
|
310
|
+
[is_json_metadata]: <Metadata Is JSON Bool>
|
|
311
|
+
[is_new_group]: <Asset Starts a New Group Bool>
|
|
312
|
+
[is_supply_committed]: <Enable Supply Commitments for the New Group Bool>
|
|
313
|
+
[metadata]: <Metadata Hex String>
|
|
314
|
+
[metadata_text]: <Metadata UTF-8 Text String>
|
|
315
|
+
name: <Asset Name String>
|
|
316
|
+
tapd: <Authenticated tapd API Object>
|
|
317
|
+
[version]: <Asset Version Number> // 0 or 1
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@returns via cbk or Promise
|
|
321
|
+
{
|
|
322
|
+
assets: [{
|
|
323
|
+
amount: <Asset Units Numeric String>
|
|
324
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
325
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
326
|
+
[group_key]: <Group Key Hex String>
|
|
327
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
328
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
329
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
330
|
+
[metadata]: <Metadata Hex String>
|
|
331
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
332
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
333
|
+
name: <Asset Name String>
|
|
334
|
+
[script_key]: <Script Key Hex String>
|
|
335
|
+
version: <Asset Version Number>
|
|
336
|
+
}]
|
|
337
|
+
created_at: <Created At ISO 8601 Date String>
|
|
338
|
+
created_height: <Block Height When Created Number>
|
|
339
|
+
id: <Batch Key Hex String>
|
|
340
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
341
|
+
state: <Batch State String>
|
|
342
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
343
|
+
unsealed_assets: []
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
Example:
|
|
347
|
+
|
|
348
|
+
```js
|
|
349
|
+
import {addAssetToMintBatch} from 'tapass';
|
|
350
|
+
|
|
351
|
+
const batch = await addAssetToMintBatch({amount: '1000', name: 'coin', tapd});
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### burnAsset
|
|
355
|
+
|
|
356
|
+
Burn asset units
|
|
357
|
+
|
|
358
|
+
The burned asset units are destroyed and cannot be recovered
|
|
359
|
+
|
|
360
|
+
Requires `assets:write` permission
|
|
361
|
+
|
|
362
|
+
An `asset_id` or a `group_key` is required, not both. `is_burn_confirmed`
|
|
363
|
+
must be true.
|
|
364
|
+
|
|
365
|
+
A burn with a `group_key` needs tapd v0.8.0 or later
|
|
366
|
+
|
|
367
|
+
{
|
|
368
|
+
amount: <Asset Units To Burn Numeric String>
|
|
369
|
+
[asset_id]: <Asset Id Hex String>
|
|
370
|
+
[group_key]: <Asset Group Key Hex String>
|
|
371
|
+
is_burn_confirmed: <The Caller Confirms That the Assets Will Be Destroyed Bool>
|
|
372
|
+
[note]: <Burn Note String>
|
|
373
|
+
tapd: <Authenticated tapd API Object>
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
@returns via cbk or Promise
|
|
377
|
+
{
|
|
378
|
+
assets: [{
|
|
379
|
+
amount: <Asset Units Numeric String>
|
|
380
|
+
[anchor]: {
|
|
381
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
382
|
+
[block_height]: <Anchor Block Height Number>
|
|
383
|
+
[confirmed_at]: <Anchor Confirmed At ISO 8601 Date String>
|
|
384
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
385
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
386
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
387
|
+
transaction: <Raw Anchor Transaction Hex String>
|
|
388
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
389
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
390
|
+
}
|
|
391
|
+
asset_id: <Asset Id Hex String>
|
|
392
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
393
|
+
genesis_output_index: <Genesis Commitment Output Index Number>
|
|
394
|
+
genesis_transaction_id: <Genesis Point Transaction Id Hex String>
|
|
395
|
+
genesis_transaction_vout: <Genesis Point Transaction Output Index Number>
|
|
396
|
+
[group]: {
|
|
397
|
+
key: <Tweaked Group Key Hex String>
|
|
398
|
+
raw_key: <Raw Group Key Hex String>
|
|
399
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
400
|
+
[witness]: <Group Membership Witness Hex String>
|
|
401
|
+
}
|
|
402
|
+
is_burn: <Asset Is Burned Bool>
|
|
403
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
404
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
405
|
+
is_spent: <Asset Is Spent Bool>
|
|
406
|
+
[lease_expires_at]: <Lease Expires At ISO 8601 Date String>
|
|
407
|
+
[lease_owner]: <Lease Owner Id Hex String>
|
|
408
|
+
[lock_time]: <Lock Time Number>
|
|
409
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
410
|
+
name: <Asset Name String>
|
|
411
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
412
|
+
script_key: <Script Key Hex String>
|
|
413
|
+
script_key_type: <Script Key Type String>
|
|
414
|
+
script_version: <Script Version Number>
|
|
415
|
+
version: <Asset Version Number>
|
|
416
|
+
}]
|
|
417
|
+
transfer: {
|
|
418
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
419
|
+
[block_height]: <Anchor Block Height Number>
|
|
420
|
+
created_at: <Transfer Created At ISO 8601 Date String>
|
|
421
|
+
fee: <Anchor Transaction Chain Fee Tokens Number>
|
|
422
|
+
height_hint: <Anchor Transaction Confirmation Height Hint Number>
|
|
423
|
+
inputs: [{
|
|
424
|
+
amount: <Asset Units Numeric String>
|
|
425
|
+
asset_id: <Asset Id Hex String>
|
|
426
|
+
[group_key]: <Asset Group Key Hex String>
|
|
427
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
428
|
+
script_key: <Script Key Hex String>
|
|
429
|
+
transaction_id: <Spent Anchor Transaction Id Hex String>
|
|
430
|
+
transaction_vout: <Spent Anchor Transaction Output Index Number>
|
|
431
|
+
}]
|
|
432
|
+
[label]: <Transfer Label String>
|
|
433
|
+
outputs: [{
|
|
434
|
+
[address]: <Taproot Assets Address Of the Recipient String>
|
|
435
|
+
amount: <Asset Units Numeric String>
|
|
436
|
+
anchor: {
|
|
437
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
438
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
439
|
+
output_script: <Output Script Hex String>
|
|
440
|
+
passive_assets_count: <Count Of Passive Assets In the Anchor Number>
|
|
441
|
+
taproot_asset_root: <Taproot Asset Root Commitment Hex String>
|
|
442
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
443
|
+
tokens: <Anchor Output Tokens Number>
|
|
444
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
445
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
446
|
+
}
|
|
447
|
+
[asset_id]: <Asset Id Hex String>
|
|
448
|
+
asset_version: <Asset Version Number>
|
|
449
|
+
[group_key]: <Asset Group Key Hex String>
|
|
450
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
451
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
452
|
+
is_split_root: <Output Is the Split Root Bool>
|
|
453
|
+
[lock_time]: <Lock Time Number>
|
|
454
|
+
[proof]: <Proof File Hex String>
|
|
455
|
+
[proof_courier]: <Proof Courier Address String>
|
|
456
|
+
[proof_delivery]: <Proof Delivery State String> // complete, pending
|
|
457
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
458
|
+
script_key: <Script Key Hex String>
|
|
459
|
+
[split_root_hash]: <Split Commitment Root Hash Hex String>
|
|
460
|
+
}]
|
|
461
|
+
[transaction]: <Raw Anchor Transaction Hex String>
|
|
462
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
Example:
|
|
467
|
+
|
|
468
|
+
```js
|
|
469
|
+
import {burnAsset} from 'tapass';
|
|
470
|
+
|
|
471
|
+
const {transfer} = await burnAsset({
|
|
472
|
+
amount: '10',
|
|
473
|
+
asset_id,
|
|
474
|
+
is_burn_confirmed: true,
|
|
475
|
+
tapd,
|
|
476
|
+
});
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### cancelMintBatch
|
|
480
|
+
|
|
481
|
+
Cancel the pending mint batch
|
|
482
|
+
|
|
483
|
+
Requires `mint:write` permission
|
|
484
|
+
|
|
485
|
+
{
|
|
486
|
+
tapd: <Authenticated tapd API Object>
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
@returns via cbk or Promise
|
|
490
|
+
{
|
|
491
|
+
id: <Cancelled Batch Key Hex String>
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
Example:
|
|
495
|
+
|
|
496
|
+
```js
|
|
497
|
+
import {cancelMintBatch} from 'tapass';
|
|
498
|
+
|
|
499
|
+
const {id} = await cancelMintBatch({tapd});
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### createAssetAddress
|
|
503
|
+
|
|
504
|
+
Create a Taproot Assets address to receive an asset
|
|
505
|
+
|
|
506
|
+
Requires `addresses:write` permission
|
|
507
|
+
|
|
508
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
509
|
+
|
|
510
|
+
When there is a `group_key` and no `version`, tapd makes a V2 address
|
|
511
|
+
|
|
512
|
+
{
|
|
513
|
+
[amount]: <Asset Units To Receive Numeric String>
|
|
514
|
+
[asset_id]: <Asset Id Hex String>
|
|
515
|
+
[group_key]: <Asset Group Key Hex String>
|
|
516
|
+
[proof_courier]: <Proof Courier Address String>
|
|
517
|
+
tapd: <Authenticated tapd API Object>
|
|
518
|
+
[version]: <Address Version Number> // 0 || 1 || 2
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
@returns via cbk or Promise
|
|
522
|
+
{
|
|
523
|
+
address: <Encoded Taproot Assets Address String>
|
|
524
|
+
amount: <Asset Units To Receive Numeric String>
|
|
525
|
+
[asset_id]: <Asset Id Hex String>
|
|
526
|
+
asset_version: <Asset Version Number>
|
|
527
|
+
[group_key]: <Asset Group Key Hex String>
|
|
528
|
+
internal_key: <Internal Key Hex String>
|
|
529
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
530
|
+
proof_courier: <Proof Courier Address String>
|
|
531
|
+
script_key: <Script Key Hex String>
|
|
532
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
533
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
534
|
+
version: <Address Version Number>
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
Example:
|
|
538
|
+
|
|
539
|
+
```js
|
|
540
|
+
import {createAssetAddress} from 'tapass';
|
|
541
|
+
|
|
542
|
+
const {address} = await createAssetAddress({amount: '100', asset_id, tapd});
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### createAssetInvoice
|
|
546
|
+
|
|
547
|
+
Create an invoice that is paid with an asset, over an asset channel
|
|
548
|
+
|
|
549
|
+
The channel peer buys the asset for satoshis, at a rate in an RFQ quote
|
|
550
|
+
|
|
551
|
+
tapd must run inside litd, with lnd and tapd in integrated mode
|
|
552
|
+
|
|
553
|
+
Requires `channels:write` permission
|
|
554
|
+
|
|
555
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
556
|
+
|
|
557
|
+
One of `amount`, `tokens`, or `mtokens` is required. With `tokens` or
|
|
558
|
+
`mtokens`, the payer pays that satoshi value in the asset.
|
|
559
|
+
|
|
560
|
+
Use an `id` to make a hold invoice. A hold invoice has no `secret`.
|
|
561
|
+
|
|
562
|
+
A random `secret` is used when there is no `secret` and no `id`
|
|
563
|
+
|
|
564
|
+
When there is no `min_amount`, the quote must fill the `amount`. Use `"0"` to
|
|
565
|
+
accept a partial fill.
|
|
566
|
+
|
|
567
|
+
`min_amount`, `min_rate`, and `is_fill_or_kill` need tapd v0.8.0 or later.
|
|
568
|
+
Older tapd versions ignore them.
|
|
569
|
+
|
|
570
|
+
{
|
|
571
|
+
[amount]: <Asset Units To Receive Numeric String>
|
|
572
|
+
[asset_id]: <Asset Id Hex String>
|
|
573
|
+
[cltv_delta]: <Final CLTV Delta Number>
|
|
574
|
+
[description]: <Invoice Description String>
|
|
575
|
+
[description_hash]: <Hashed Description of Payment Hex String>
|
|
576
|
+
[expires_at]: <Expires At ISO 8601 Date String>
|
|
577
|
+
[group_key]: <Asset Group Key Hex String>
|
|
578
|
+
[id]: <Hold Invoice Payment Hash Hex String>
|
|
579
|
+
[is_fill_or_kill]: <Reject a Quote That Does Not Fill the Amount Bool>
|
|
580
|
+
[is_including_private_channels]: <Include Private Channels Bool>
|
|
581
|
+
[min_amount]: <Minimum Asset Units Numeric String>
|
|
582
|
+
[min_rate]: <Minimum Rate Asset Units Per BTC Decimal String>
|
|
583
|
+
[mtokens]: <Millitokens To Receive String>
|
|
584
|
+
[peer_public_key]: <RFQ Peer Public Key Hex String>
|
|
585
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
586
|
+
[secret]: <Payment Preimage Hex String>
|
|
587
|
+
tapd: <Authenticated tapd API Object>
|
|
588
|
+
[tokens]: <Tokens To Receive Number>
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
@returns via cbk or Promise
|
|
592
|
+
{
|
|
593
|
+
[chain_address]: <Fallback Chain Address String>
|
|
594
|
+
created_at: <Created At ISO 8601 Date String>
|
|
595
|
+
[description]: <Invoice Description String>
|
|
596
|
+
id: <Payment Hash Hex String>
|
|
597
|
+
mtokens: <Millitokens To Receive String>
|
|
598
|
+
[payment]: <Payment Identifier Hex String>
|
|
599
|
+
[quote]: {
|
|
600
|
+
[accepted_max_amount]: <Accepted Maximum Asset Units Numeric String>
|
|
601
|
+
[asset_id]: <Asset Id Hex String>
|
|
602
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
603
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
604
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
605
|
+
id: <Quote Request Id Hex String>
|
|
606
|
+
max_amount: <Maximum Asset Units Numeric String>
|
|
607
|
+
min_transportable_amount: <Minimum Asset Units In One HTLC Numeric String>
|
|
608
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
609
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
610
|
+
rate: <Ask Rate Asset Units Per BTC Exact Decimal String>
|
|
611
|
+
}
|
|
612
|
+
request: <BOLT 11 Encoded Payment Request String>
|
|
613
|
+
[secret]: <Payment Preimage Hex String>
|
|
614
|
+
tokens: <Tokens To Receive Rounded Down Number>
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
Example:
|
|
618
|
+
|
|
619
|
+
```js
|
|
620
|
+
import {createAssetInvoice} from 'tapass';
|
|
621
|
+
|
|
622
|
+
const {request} = await createAssetInvoice({amount: '100', asset_id, tapd});
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
### createTapdMacaroon
|
|
626
|
+
|
|
627
|
+
Create a tapd macaroon with specific permissions
|
|
628
|
+
|
|
629
|
+
tapd adds no caveats. Add caveats to the macaroon after you create it.
|
|
630
|
+
|
|
631
|
+
Use the entity `uri` and an RPC method URI as the action, to give access to
|
|
632
|
+
one RPC method
|
|
633
|
+
|
|
634
|
+
Requires `macaroon:write` permission
|
|
635
|
+
|
|
636
|
+
{
|
|
637
|
+
[is_external_allowed]: <Allow Permissions That tapd Does Not Know Bool>
|
|
638
|
+
permissions: [{
|
|
639
|
+
action: <Permission Action String>
|
|
640
|
+
entity: <Permission Entity String>
|
|
641
|
+
}]
|
|
642
|
+
[root_key_id]: <Root Key Id Numeric String>
|
|
643
|
+
tapd: <Authenticated tapd API Object>
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
@returns via cbk or Promise
|
|
647
|
+
{
|
|
648
|
+
macaroon: <Macaroon Base64 String>
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
Example:
|
|
652
|
+
|
|
653
|
+
```js
|
|
654
|
+
import {createTapdMacaroon} from 'tapass';
|
|
655
|
+
|
|
656
|
+
const {macaroon} = await createTapdMacaroon({
|
|
657
|
+
permissions: [{action: 'read', entity: 'assets'}],
|
|
658
|
+
tapd,
|
|
659
|
+
});
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
### decodeAssetAddress
|
|
663
|
+
|
|
664
|
+
Decode a Taproot Assets address
|
|
665
|
+
|
|
666
|
+
Requires `addresses:read` permission
|
|
667
|
+
|
|
668
|
+
The address must be for the network of tapd
|
|
669
|
+
|
|
670
|
+
{
|
|
671
|
+
address: <Encoded Taproot Assets Address String>
|
|
672
|
+
tapd: <Authenticated tapd API Object>
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
@returns via cbk or Promise
|
|
676
|
+
{
|
|
677
|
+
address: <Encoded Taproot Assets Address String>
|
|
678
|
+
amount: <Asset Units To Receive Numeric String>
|
|
679
|
+
[asset_id]: <Asset Id Hex String>
|
|
680
|
+
asset_version: <Asset Version Number>
|
|
681
|
+
[group_key]: <Asset Group Key Hex String>
|
|
682
|
+
internal_key: <Internal Key Hex String>
|
|
683
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
684
|
+
proof_courier: <Proof Courier Address String>
|
|
685
|
+
script_key: <Script Key Hex String>
|
|
686
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
687
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
688
|
+
version: <Address Version Number>
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
Example:
|
|
692
|
+
|
|
693
|
+
```js
|
|
694
|
+
import {decodeAssetAddress} from 'tapass';
|
|
695
|
+
|
|
696
|
+
const {amount, asset_id} = await decodeAssetAddress({address, tapd});
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
### decodeAssetPaymentRequest
|
|
700
|
+
|
|
701
|
+
Decode a payment request and get its amount in units of an asset
|
|
702
|
+
|
|
703
|
+
tapd asks its price oracle for the asset rate
|
|
704
|
+
|
|
705
|
+
Requires `channels:read` permission
|
|
706
|
+
|
|
707
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
708
|
+
|
|
709
|
+
{
|
|
710
|
+
[asset_id]: <Asset Id Hex String>
|
|
711
|
+
[group_key]: <Asset Group Key Hex String>
|
|
712
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
713
|
+
request: <BOLT 11 Payment Request String>
|
|
714
|
+
tapd: <Authenticated tapd API Object>
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
@returns via cbk or Promise
|
|
718
|
+
{
|
|
719
|
+
asset: {
|
|
720
|
+
amount: <Asset Units To Pay Numeric String>
|
|
721
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
722
|
+
[group_key]: <Asset Group Key Hex String>
|
|
723
|
+
id: <Asset Id Hex String>
|
|
724
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
725
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
726
|
+
name: <Asset Name String>
|
|
727
|
+
}
|
|
728
|
+
chain_address: <Fallback Chain Address String>
|
|
729
|
+
[cltv_delta]: <Final CLTV Delta Number>
|
|
730
|
+
created_at: <Payment Request Created At ISO 8601 Date String>
|
|
731
|
+
description: <Payment Description String>
|
|
732
|
+
description_hash: <Payment Longer Description Hash Hex String>
|
|
733
|
+
destination: <Public Key Hex String>
|
|
734
|
+
expires_at: <ISO 8601 Date String>
|
|
735
|
+
features: [{
|
|
736
|
+
bit: <BOLT 09 Feature Bit Number>
|
|
737
|
+
is_known: <Feature is Known Bool>
|
|
738
|
+
is_required: <Feature Support is Required To Pay Bool>
|
|
739
|
+
type: <Feature Type String>
|
|
740
|
+
}]
|
|
741
|
+
id: <Payment Hash Hex String>
|
|
742
|
+
is_expired: <Invoice is Expired Bool>
|
|
743
|
+
mtokens: <Requested Millitokens String>
|
|
744
|
+
[payment]: <Payment Identifier Hex Encoded String>
|
|
745
|
+
routes: [[{
|
|
746
|
+
[base_fee_mtokens]: <Base Routing Fee In Millitokens String>
|
|
747
|
+
[channel]: <Standard Format Channel Id String>
|
|
748
|
+
[cltv_delta]: <CLTV Blocks Delta Number>
|
|
749
|
+
[fee_rate]: <Fee Rate In Millitokens Per Million Number>
|
|
750
|
+
public_key: <Forward Edge Public Key Hex String>
|
|
751
|
+
}]]
|
|
752
|
+
safe_tokens: <Requested Tokens Rounded Up Number>
|
|
753
|
+
tokens: <Requested Tokens Rounded Down Number>
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
Example:
|
|
757
|
+
|
|
758
|
+
```js
|
|
759
|
+
import {decodeAssetPaymentRequest} from 'tapass';
|
|
760
|
+
|
|
761
|
+
const {asset, tokens} = await decodeAssetPaymentRequest({
|
|
762
|
+
asset_id,
|
|
763
|
+
request,
|
|
764
|
+
tapd,
|
|
765
|
+
});
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
### decodeAssetProof
|
|
769
|
+
|
|
770
|
+
Decode an asset proof or one proof in an asset proof file
|
|
771
|
+
|
|
772
|
+
Requires `proofs:read` permission
|
|
773
|
+
|
|
774
|
+
For a proof file, `depth` selects the proof: 0 is the last proof
|
|
775
|
+
|
|
776
|
+
{
|
|
777
|
+
[depth]: <Proof Depth From the Last Proof In the File Number>
|
|
778
|
+
[is_including_meta]: <Include the Asset Metadata Bool>
|
|
779
|
+
proof: <Asset Proof or Proof File Hex String>
|
|
780
|
+
tapd: <Authenticated tapd API Object>
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
@returns via cbk or Promise
|
|
784
|
+
{
|
|
785
|
+
additional_inputs_count: <Additional Inputs Count Number>
|
|
786
|
+
[alt_leaves]: <Alternative Leaves Hex String>
|
|
787
|
+
asset: <Asset Object>
|
|
788
|
+
challenge_witness: [<Challenge Witness Element Hex String>]
|
|
789
|
+
depth: <Proof Depth From the Last Proof In the File Number>
|
|
790
|
+
exclusion_proofs: [<Exclusion Proof Hex String>]
|
|
791
|
+
[genesis]: {
|
|
792
|
+
asset_id: <Asset Id Hex String>
|
|
793
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
794
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
795
|
+
name: <Asset Name String>
|
|
796
|
+
output_index: <Genesis Commitment Output Index Number>
|
|
797
|
+
transaction_id: <Genesis Point Transaction Id Hex String>
|
|
798
|
+
transaction_vout: <Genesis Point Transaction Output Index Number>
|
|
799
|
+
}
|
|
800
|
+
[group_key]: {
|
|
801
|
+
raw_key: <Raw Group Key Hex String>
|
|
802
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
803
|
+
}
|
|
804
|
+
inclusion_proof: <Inclusion Proof Hex String>
|
|
805
|
+
is_burn: <Proof Is For a Burn Bool>
|
|
806
|
+
[meta]: {
|
|
807
|
+
data: <Metadata Hex String>
|
|
808
|
+
hash: <Metadata Hash Hex String>
|
|
809
|
+
type: <Metadata Type String>
|
|
810
|
+
}
|
|
811
|
+
proofs_count: <Proofs In the File Count Number>
|
|
812
|
+
[split_root_proof]: <Split Root Proof Hex String>
|
|
813
|
+
transaction_merkle_proof: <Transaction Merkle Proof Hex String>
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
Example:
|
|
817
|
+
|
|
818
|
+
```js
|
|
819
|
+
import {decodeAssetProof} from 'tapass';
|
|
820
|
+
|
|
821
|
+
const {asset} = await decodeAssetProof({proof, tapd});
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
### encodeAssetCustomRecords
|
|
825
|
+
|
|
826
|
+
Encode the first hop custom records of an asset payment
|
|
827
|
+
|
|
828
|
+
Use the records as the first hop custom records of an lnd payment, to pay
|
|
829
|
+
with assets over an asset channel
|
|
830
|
+
|
|
831
|
+
This method does not need a permission
|
|
832
|
+
|
|
833
|
+
An `rfq_id` is for a payment that uses an accepted RFQ quote
|
|
834
|
+
|
|
835
|
+
`assets` or an `rfq_id` is required
|
|
836
|
+
|
|
837
|
+
{
|
|
838
|
+
[assets]: [{
|
|
839
|
+
amount: <Asset Units Numeric String>
|
|
840
|
+
asset_id: <Asset Id Hex String>
|
|
841
|
+
}]
|
|
842
|
+
[rfq_id]: <RFQ Quote Id Hex String>
|
|
843
|
+
tapd: <Authenticated tapd API Object>
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
@returns via cbk or Promise
|
|
847
|
+
{
|
|
848
|
+
records: [{
|
|
849
|
+
type: <Record Type Number String>
|
|
850
|
+
value: <Record Value Hex String>
|
|
851
|
+
}]
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
Example:
|
|
855
|
+
|
|
856
|
+
```js
|
|
857
|
+
import {encodeAssetCustomRecords} from 'tapass';
|
|
858
|
+
|
|
859
|
+
const {records} = await encodeAssetCustomRecords({
|
|
860
|
+
assets: [{amount: '100', asset_id}],
|
|
861
|
+
tapd,
|
|
862
|
+
});
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
### exportAssetProof
|
|
866
|
+
|
|
867
|
+
Export the proof file of an asset
|
|
868
|
+
|
|
869
|
+
Requires `proofs:read` permission
|
|
870
|
+
|
|
871
|
+
If there is more than one proof for the asset id and the script key, an
|
|
872
|
+
anchor outpoint is necessary: `transaction_id` and `transaction_vout`
|
|
873
|
+
|
|
874
|
+
{
|
|
875
|
+
asset_id: <Asset Id Hex String>
|
|
876
|
+
script_key: <Script Key Hex String>
|
|
877
|
+
tapd: <Authenticated tapd API Object>
|
|
878
|
+
[transaction_id]: <Anchor Transaction Id Hex String>
|
|
879
|
+
[transaction_vout]: <Anchor Transaction Output Index Number>
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
@returns via cbk or Promise
|
|
883
|
+
{
|
|
884
|
+
proof: <Asset Proof File Hex String>
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
Example:
|
|
888
|
+
|
|
889
|
+
```js
|
|
890
|
+
import {exportAssetProof} from 'tapass';
|
|
891
|
+
|
|
892
|
+
const {proof} = await exportAssetProof({asset_id, script_key, tapd});
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
### finalizeMintBatch
|
|
896
|
+
|
|
897
|
+
Finalize the pending mint batch, and broadcast the genesis transaction
|
|
898
|
+
|
|
899
|
+
Requires `mint:write` permission
|
|
900
|
+
|
|
901
|
+
tapd funds the batch first when it is not funded yet
|
|
902
|
+
|
|
903
|
+
A tapscript sibling is optional: give `tapscript_leaves` or a
|
|
904
|
+
`tapscript_branch`, not both.
|
|
905
|
+
|
|
906
|
+
{
|
|
907
|
+
[fee_tokens_per_vbyte]: <Fee Tokens Per Virtual Byte Number>
|
|
908
|
+
[tapscript_branch]: {
|
|
909
|
+
left: <Left Tap Branch Hash Hex String>
|
|
910
|
+
right: <Right Tap Branch Hash Hex String>
|
|
911
|
+
}
|
|
912
|
+
[tapscript_leaves]: [<Tapscript Leaf Script Hex String>]
|
|
913
|
+
tapd: <Authenticated tapd API Object>
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
@returns via cbk or Promise
|
|
917
|
+
{
|
|
918
|
+
assets: [{
|
|
919
|
+
amount: <Asset Units Numeric String>
|
|
920
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
921
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
922
|
+
[group_key]: <Group Key Hex String>
|
|
923
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
924
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
925
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
926
|
+
[metadata]: <Metadata Hex String>
|
|
927
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
928
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
929
|
+
name: <Asset Name String>
|
|
930
|
+
[script_key]: <Script Key Hex String>
|
|
931
|
+
version: <Asset Version Number>
|
|
932
|
+
}]
|
|
933
|
+
created_at: <Created At ISO 8601 Date String>
|
|
934
|
+
created_height: <Block Height When Created Number>
|
|
935
|
+
id: <Batch Key Hex String>
|
|
936
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
937
|
+
state: <Batch State String>
|
|
938
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
939
|
+
unsealed_assets: []
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
Example:
|
|
943
|
+
|
|
944
|
+
```js
|
|
945
|
+
import {finalizeMintBatch} from 'tapass';
|
|
946
|
+
|
|
947
|
+
const {state, transaction_id} = await finalizeMintBatch({tapd});
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
### fundMintBatch
|
|
951
|
+
|
|
952
|
+
Fund the pending mint batch with a genesis input
|
|
953
|
+
|
|
954
|
+
Requires `mint:write` permission
|
|
955
|
+
|
|
956
|
+
This is only necessary when the batch needs a custom witness before
|
|
957
|
+
`finalizeMintBatch`. tapd makes a new funded batch when there is no pending
|
|
958
|
+
batch.
|
|
959
|
+
|
|
960
|
+
A tapscript sibling is optional: give `tapscript_leaves` or a
|
|
961
|
+
`tapscript_branch`, not both.
|
|
962
|
+
|
|
963
|
+
{
|
|
964
|
+
[fee_tokens_per_vbyte]: <Fee Tokens Per Virtual Byte Number>
|
|
965
|
+
[tapscript_branch]: {
|
|
966
|
+
left: <Left Tap Branch Hash Hex String>
|
|
967
|
+
right: <Right Tap Branch Hash Hex String>
|
|
968
|
+
}
|
|
969
|
+
[tapscript_leaves]: [<Tapscript Leaf Script Hex String>]
|
|
970
|
+
tapd: <Authenticated tapd API Object>
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
@returns via cbk or Promise
|
|
974
|
+
{
|
|
975
|
+
assets: [{
|
|
976
|
+
amount: <Asset Units Numeric String>
|
|
977
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
978
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
979
|
+
[group_key]: <Group Key Hex String>
|
|
980
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
981
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
982
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
983
|
+
[metadata]: <Metadata Hex String>
|
|
984
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
985
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
986
|
+
name: <Asset Name String>
|
|
987
|
+
[script_key]: <Script Key Hex String>
|
|
988
|
+
version: <Asset Version Number>
|
|
989
|
+
}]
|
|
990
|
+
created_at: <Created At ISO 8601 Date String>
|
|
991
|
+
created_height: <Block Height When Created Number>
|
|
992
|
+
id: <Batch Key Hex String>
|
|
993
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
994
|
+
state: <Batch State String>
|
|
995
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
996
|
+
unsealed_assets: [{
|
|
997
|
+
amount: <Asset Units Numeric String>
|
|
998
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
999
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
1000
|
+
[group_key]: <Group Key Hex String>
|
|
1001
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
1002
|
+
[group_virtual_psbt]: <Group Virtual Transaction PSBT Hex String>
|
|
1003
|
+
[group_virtual_transaction]: <Group Virtual Transaction Hex String>
|
|
1004
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1005
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
1006
|
+
[metadata]: <Metadata Hex String>
|
|
1007
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
1008
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
1009
|
+
name: <Asset Name String>
|
|
1010
|
+
[script_key]: <Script Key Hex String>
|
|
1011
|
+
version: <Asset Version Number>
|
|
1012
|
+
}]
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
Example:
|
|
1016
|
+
|
|
1017
|
+
```js
|
|
1018
|
+
import {fundMintBatch} from 'tapass';
|
|
1019
|
+
|
|
1020
|
+
const {psbt} = await fundMintBatch({tapd});
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
### getAcceptedQuotes
|
|
1024
|
+
|
|
1025
|
+
Get the quotes that peers accepted for the orders of this node
|
|
1026
|
+
|
|
1027
|
+
Requires `rfq:read` permission
|
|
1028
|
+
|
|
1029
|
+
A rate is a number of asset units per BTC, as an exact decimal string
|
|
1030
|
+
|
|
1031
|
+
{
|
|
1032
|
+
tapd: <Authenticated tapd API Object>
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
@returns via cbk or Promise
|
|
1036
|
+
{
|
|
1037
|
+
buy_quotes: [{
|
|
1038
|
+
[accepted_max_amount]: <Accepted Maximum Asset Units Numeric String>
|
|
1039
|
+
[asset_id]: <Asset Id Hex String>
|
|
1040
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
1041
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
1042
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
1043
|
+
id: <Quote Request Id Hex String>
|
|
1044
|
+
max_amount: <Maximum Asset Units Numeric String>
|
|
1045
|
+
min_transportable_amount: <Minimum Asset Units In One HTLC String>
|
|
1046
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
1047
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
1048
|
+
rate: <Ask Rate Asset Units Per BTC Exact Decimal String>
|
|
1049
|
+
}]
|
|
1050
|
+
sell_quotes: [{
|
|
1051
|
+
[accepted_max_mtokens]: <Accepted Maximum Payment Millitokens String>
|
|
1052
|
+
amount: <Asset Units Numeric String>
|
|
1053
|
+
[asset_id]: <Asset Id Hex String>
|
|
1054
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
1055
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
1056
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
1057
|
+
id: <Quote Request Id Hex String>
|
|
1058
|
+
min_transportable_mtokens: <Minimum Millitokens To Send One Unit String>
|
|
1059
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
1060
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
1061
|
+
rate: <Bid Rate Asset Units Per BTC Exact Decimal String>
|
|
1062
|
+
}]
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
Example:
|
|
1066
|
+
|
|
1067
|
+
```js
|
|
1068
|
+
import {getAcceptedQuotes} from 'tapass';
|
|
1069
|
+
|
|
1070
|
+
const {buy_quotes, sell_quotes} = await getAcceptedQuotes({tapd});
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
### getAssetAddresses
|
|
1074
|
+
|
|
1075
|
+
Get the Taproot Assets addresses that this node created, oldest first
|
|
1076
|
+
|
|
1077
|
+
Requires `addresses:read` permission
|
|
1078
|
+
|
|
1079
|
+
Use the `next` token with the same filters to get the next page
|
|
1080
|
+
|
|
1081
|
+
{
|
|
1082
|
+
[created_after]: <Created After ISO 8601 Date String>
|
|
1083
|
+
[created_before]: <Created Before ISO 8601 Date String>
|
|
1084
|
+
[limit]: <Page Result Limit Number>
|
|
1085
|
+
tapd: <Authenticated tapd API Object>
|
|
1086
|
+
[token]: <Opaque Paging Token String>
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
@returns via cbk or Promise
|
|
1090
|
+
{
|
|
1091
|
+
addresses: [{
|
|
1092
|
+
address: <Encoded Taproot Assets Address String>
|
|
1093
|
+
amount: <Asset Units To Receive Numeric String>
|
|
1094
|
+
[asset_id]: <Asset Id Hex String>
|
|
1095
|
+
asset_version: <Asset Version Number>
|
|
1096
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1097
|
+
internal_key: <Internal Key Hex String>
|
|
1098
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1099
|
+
proof_courier: <Proof Courier Address String>
|
|
1100
|
+
script_key: <Script Key Hex String>
|
|
1101
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
1102
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
1103
|
+
version: <Address Version Number>
|
|
1104
|
+
}]
|
|
1105
|
+
[next]: <Next Opaque Paging Token String>
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
Example:
|
|
1109
|
+
|
|
1110
|
+
```js
|
|
1111
|
+
import {getAssetAddresses} from 'tapass';
|
|
1112
|
+
|
|
1113
|
+
const {addresses} = await getAssetAddresses({tapd});
|
|
1114
|
+
```
|
|
1115
|
+
|
|
1116
|
+
### getAssetBalances
|
|
1117
|
+
|
|
1118
|
+
Get the asset balances of this node, by asset and by asset group
|
|
1119
|
+
|
|
1120
|
+
Requires `assets:read` permission
|
|
1121
|
+
|
|
1122
|
+
By default, tapd includes only assets with a BIP-86 script key. Use
|
|
1123
|
+
`script_key_type` to get other assets, for example assets in channels.
|
|
1124
|
+
|
|
1125
|
+
An `asset_id` or a `group_key` is a filter, but not both. With an
|
|
1126
|
+
`asset_id`, there are no group balances.
|
|
1127
|
+
|
|
1128
|
+
{
|
|
1129
|
+
[asset_id]: <Asset Id Hex String>
|
|
1130
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1131
|
+
[is_including_leased]: <Include Leased Assets Bool>
|
|
1132
|
+
[script_key_type]: <Script Key Type String> // all, bip86, burn, channel,
|
|
1133
|
+
// script_path_external,
|
|
1134
|
+
// tombstone, unique_pedersen
|
|
1135
|
+
tapd: <Authenticated tapd API Object>
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
@returns via cbk or Promise
|
|
1139
|
+
{
|
|
1140
|
+
balances: [{
|
|
1141
|
+
asset_id: <Asset Id Hex String>
|
|
1142
|
+
balance: <Balance Asset Units Numeric String>
|
|
1143
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1144
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1145
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
1146
|
+
name: <Asset Name String>
|
|
1147
|
+
}]
|
|
1148
|
+
group_balances: [{
|
|
1149
|
+
balance: <Balance Asset Units Numeric String>
|
|
1150
|
+
group_key: <Asset Group Key Hex String>
|
|
1151
|
+
}]
|
|
1152
|
+
unconfirmed_transfers: <Unconfirmed Transfers Count Number>
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
Example:
|
|
1156
|
+
|
|
1157
|
+
```js
|
|
1158
|
+
import {getAssetBalances} from 'tapass';
|
|
1159
|
+
|
|
1160
|
+
const {balances} = await getAssetBalances({tapd});
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
### getAssetBurns
|
|
1164
|
+
|
|
1165
|
+
Get the asset burns that this node made
|
|
1166
|
+
|
|
1167
|
+
Requires `assets:read` permission
|
|
1168
|
+
|
|
1169
|
+
{
|
|
1170
|
+
[asset_id]: <Asset Id Hex String>
|
|
1171
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1172
|
+
tapd: <Authenticated tapd API Object>
|
|
1173
|
+
[transaction_id]: <Burn Anchor Transaction Id Hex String>
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
@returns via cbk or Promise
|
|
1177
|
+
{
|
|
1178
|
+
burns: [{
|
|
1179
|
+
amount: <Burned Asset Units Numeric String>
|
|
1180
|
+
asset_id: <Asset Id Hex String>
|
|
1181
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1182
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1183
|
+
[note]: <Burn Note String>
|
|
1184
|
+
transaction_id: <Burn Anchor Transaction Id Hex String>
|
|
1185
|
+
}]
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
Example:
|
|
1189
|
+
|
|
1190
|
+
```js
|
|
1191
|
+
import {getAssetBurns} from 'tapass';
|
|
1192
|
+
|
|
1193
|
+
const {burns} = await getAssetBurns({tapd});
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
### getAssetForwards
|
|
1197
|
+
|
|
1198
|
+
Get the asset swaps that this edge node forwarded
|
|
1199
|
+
|
|
1200
|
+
Requires `rfq:read` permission
|
|
1201
|
+
|
|
1202
|
+
This method needs tapd v0.8.0 or later
|
|
1203
|
+
|
|
1204
|
+
Use the `next` token with the same filters to get the next page
|
|
1205
|
+
|
|
1206
|
+
A rate is a number of asset units per BTC, as an exact decimal string
|
|
1207
|
+
|
|
1208
|
+
{
|
|
1209
|
+
[after]: <Settled At Or After ISO 8601 Date String>
|
|
1210
|
+
[asset_id]: <Asset Id Hex String>
|
|
1211
|
+
[before]: <Settled At Or Before ISO 8601 Date String>
|
|
1212
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1213
|
+
[limit]: <Page Result Limit Number>
|
|
1214
|
+
[peer_public_key]: <Peer Public Key Hex String>
|
|
1215
|
+
tapd: <Authenticated tapd API Object>
|
|
1216
|
+
[token]: <Opaque Paging Token String>
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
@returns via cbk or Promise
|
|
1220
|
+
{
|
|
1221
|
+
forwards: [{
|
|
1222
|
+
amount: <Swapped Asset Units Numeric String>
|
|
1223
|
+
[asset_id]: <Asset Id Hex String>
|
|
1224
|
+
[failed_at]: <Forward Failed At ISO 8601 Date String>
|
|
1225
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
1226
|
+
htlc_index: <Incoming HTLC Index Numeric String>
|
|
1227
|
+
incoming_channel: <Incoming Standard Format Channel Id String>
|
|
1228
|
+
incoming_mtokens: <Received Millitokens String>
|
|
1229
|
+
opened_at: <Forward Started At ISO 8601 Date String>
|
|
1230
|
+
outgoing_channel: <Outgoing Standard Format Channel Id String>
|
|
1231
|
+
outgoing_mtokens: <Sent Millitokens String>
|
|
1232
|
+
[peer_public_key]: <Peer Public Key Hex String>
|
|
1233
|
+
[rate]: <Rate Asset Units Per BTC Exact Decimal String>
|
|
1234
|
+
rfq_id: <RFQ Session Id Hex String>
|
|
1235
|
+
[settled_at]: <Forward Settled At ISO 8601 Date String>
|
|
1236
|
+
type: <Edge Node Policy Type String> // purchase, sale
|
|
1237
|
+
}]
|
|
1238
|
+
[next]: <Next Opaque Paging Token String>
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
Example:
|
|
1242
|
+
|
|
1243
|
+
```js
|
|
1244
|
+
import {getAssetForwards} from 'tapass';
|
|
1245
|
+
|
|
1246
|
+
const {forwards, next} = await getAssetForwards({limit: 10, tapd});
|
|
1247
|
+
```
|
|
1248
|
+
|
|
1249
|
+
### getAssetGroups
|
|
1250
|
+
|
|
1251
|
+
Get the asset groups of the assets that this node owns
|
|
1252
|
+
|
|
1253
|
+
Requires `assets:read` permission
|
|
1254
|
+
|
|
1255
|
+
{
|
|
1256
|
+
tapd: <Authenticated tapd API Object>
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
@returns via cbk or Promise
|
|
1260
|
+
{
|
|
1261
|
+
groups: [{
|
|
1262
|
+
assets: [{
|
|
1263
|
+
amount: <Asset Units Numeric String>
|
|
1264
|
+
asset_id: <Asset Id Hex String>
|
|
1265
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1266
|
+
[lock_time]: <Lock Time Number>
|
|
1267
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
1268
|
+
name: <Asset Name String>
|
|
1269
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
1270
|
+
version: <Asset Version Number>
|
|
1271
|
+
}]
|
|
1272
|
+
key: <Tweaked Group Key Hex String>
|
|
1273
|
+
}]
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
Example:
|
|
1277
|
+
|
|
1278
|
+
```js
|
|
1279
|
+
import {getAssetGroups} from 'tapass';
|
|
1280
|
+
|
|
1281
|
+
const {groups} = await getAssetGroups({tapd});
|
|
1282
|
+
```
|
|
1283
|
+
|
|
1284
|
+
### getAssetInvoices
|
|
1285
|
+
|
|
1286
|
+
Get invoices that received an asset, newest first
|
|
1287
|
+
|
|
1288
|
+
lnd pages over all invoices, then tapd keeps only the asset invoices, so a
|
|
1289
|
+
page can have fewer invoices than the limit. Use `next` until it is empty.
|
|
1290
|
+
|
|
1291
|
+
Requires `channels:read` permission
|
|
1292
|
+
|
|
1293
|
+
This method needs tapd v0.8.1 or later
|
|
1294
|
+
|
|
1295
|
+
The invoice fields are the same as in lightning getInvoices
|
|
1296
|
+
|
|
1297
|
+
{
|
|
1298
|
+
[created_after]: <Created At or After ISO 8601 Date String>
|
|
1299
|
+
[created_before]: <Created At or Before ISO 8601 Date String>
|
|
1300
|
+
[is_unconfirmed]: <Only Unconfirmed Invoices Bool>
|
|
1301
|
+
[limit]: <Page Result Limit Number>
|
|
1302
|
+
tapd: <Authenticated tapd API Object>
|
|
1303
|
+
[token]: <Opaque Paging Token String>
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
@returns via cbk or Promise
|
|
1307
|
+
{
|
|
1308
|
+
invoices: [{
|
|
1309
|
+
assets: [{
|
|
1310
|
+
amount: <Asset Units Numeric String>
|
|
1311
|
+
asset_id: <Asset Id Hex String>
|
|
1312
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1313
|
+
}]
|
|
1314
|
+
[chain_address]: <Fallback Chain Address String>
|
|
1315
|
+
cltv_delta: <Final CLTV Delta Number>
|
|
1316
|
+
[confirmed_at]: <Settled at ISO 8601 Date String>
|
|
1317
|
+
[confirmed_index]: <Confirmed Index Number>
|
|
1318
|
+
created_at: <ISO 8601 Date String>
|
|
1319
|
+
description: <Description String>
|
|
1320
|
+
[description_hash]: <Description Hash Hex String>
|
|
1321
|
+
expires_at: <ISO 8601 Date String>
|
|
1322
|
+
features: [{
|
|
1323
|
+
bit: <BOLT 09 Feature Bit Number>
|
|
1324
|
+
is_known: <Feature is Known Bool>
|
|
1325
|
+
is_required: <Feature Support is Required To Pay Bool>
|
|
1326
|
+
type: <Feature Type String>
|
|
1327
|
+
}]
|
|
1328
|
+
id: <Payment Hash Hex String>
|
|
1329
|
+
index: <Invoice Add Index Number>
|
|
1330
|
+
[is_canceled]: <Invoice is Canceled Bool>
|
|
1331
|
+
is_confirmed: <Invoice is Confirmed Bool>
|
|
1332
|
+
[is_held]: <HTLC is Held Bool>
|
|
1333
|
+
is_private: <Invoice is Private Bool>
|
|
1334
|
+
[is_push]: <Invoice is Push Payment Bool>
|
|
1335
|
+
mtokens: <Millitokens String>
|
|
1336
|
+
[payment]: <Payment Identifying Secret Hex String>
|
|
1337
|
+
payments: [<lightning Invoice Payment Object>]
|
|
1338
|
+
received: <Received Tokens Number>
|
|
1339
|
+
received_mtokens: <Received Millitokens String>
|
|
1340
|
+
[request]: <Bolt 11 Invoice String>
|
|
1341
|
+
secret: <Secret Preimage Hex String>
|
|
1342
|
+
tokens: <Tokens Number>
|
|
1343
|
+
}]
|
|
1344
|
+
[next]: <Next Opaque Paging Token String>
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
Example:
|
|
1348
|
+
|
|
1349
|
+
```js
|
|
1350
|
+
import {getAssetInvoices} from 'tapass';
|
|
1351
|
+
|
|
1352
|
+
const {invoices, next} = await getAssetInvoices({limit: 10, tapd});
|
|
1353
|
+
```
|
|
1354
|
+
|
|
1355
|
+
### getAssetMetadata
|
|
1356
|
+
|
|
1357
|
+
Get the metadata of an asset
|
|
1358
|
+
|
|
1359
|
+
Requires `assets:read` permission
|
|
1360
|
+
|
|
1361
|
+
An `asset_id` or a `meta_hash` is required, but not both
|
|
1362
|
+
|
|
1363
|
+
{
|
|
1364
|
+
[asset_id]: <Asset Id Hex String>
|
|
1365
|
+
[meta_hash]: <Metadata Hash Hex String>
|
|
1366
|
+
tapd: <Authenticated tapd API Object>
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
@returns via cbk or Promise
|
|
1370
|
+
{
|
|
1371
|
+
canonical_universes: [<Canonical Universe URL String>]
|
|
1372
|
+
data: <Metadata Hex String>
|
|
1373
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
1374
|
+
[delegation_key]: <Supply Commitment Delegation Public Key Hex String>
|
|
1375
|
+
hash: <Metadata Hash Hex String>
|
|
1376
|
+
is_publishing_supply_commitments: <Issuer Publishes Supply Commitments Bool>
|
|
1377
|
+
type: <Metadata Type String> // json, opaque, unknown
|
|
1378
|
+
unknown_types: [{
|
|
1379
|
+
type: <TLV Type Numeric String>
|
|
1380
|
+
value: <Value Hex String>
|
|
1381
|
+
}]
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
Example:
|
|
1385
|
+
|
|
1386
|
+
```js
|
|
1387
|
+
import {getAssetMetadata} from 'tapass';
|
|
1388
|
+
|
|
1389
|
+
const {data} = await getAssetMetadata({asset_id, tapd});
|
|
1390
|
+
```
|
|
1391
|
+
|
|
1392
|
+
### getAssetPayments
|
|
1393
|
+
|
|
1394
|
+
Get confirmed payments that sent an asset, newest first
|
|
1395
|
+
|
|
1396
|
+
lnd pages over all payments, then tapd keeps only the asset payments, so a
|
|
1397
|
+
page can have fewer payments than the limit. Use `next` until it is empty.
|
|
1398
|
+
|
|
1399
|
+
Requires `channels:read` permission
|
|
1400
|
+
|
|
1401
|
+
This method needs tapd v0.8.1 or later
|
|
1402
|
+
|
|
1403
|
+
The payment fields are the same as in lightning getPayments
|
|
1404
|
+
|
|
1405
|
+
{
|
|
1406
|
+
[created_after]: <Created At or After ISO 8601 Date String>
|
|
1407
|
+
[created_before]: <Created At or Before ISO 8601 Date String>
|
|
1408
|
+
[limit]: <Page Result Limit Number>
|
|
1409
|
+
tapd: <Authenticated tapd API Object>
|
|
1410
|
+
[token]: <Opaque Paging Token String>
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
@returns via cbk or Promise
|
|
1414
|
+
{
|
|
1415
|
+
payments: [{
|
|
1416
|
+
assets: [{
|
|
1417
|
+
amount: <Asset Units Numeric String>
|
|
1418
|
+
asset_id: <Asset Id Hex String>
|
|
1419
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1420
|
+
}]
|
|
1421
|
+
attempts: [<lightning Payment Attempt Object>]
|
|
1422
|
+
[confirmed_at]: <Payment Confirmed At ISO 8601 Date String>
|
|
1423
|
+
created_at: <Payment at ISO-8601 Date String>
|
|
1424
|
+
[destination]: <Destination Node Public Key Hex String>
|
|
1425
|
+
[fee]: <Paid Routing Fee Rounded Down Tokens Number>
|
|
1426
|
+
[fee_mtokens]: <Paid Routing Fee in Millitokens String>
|
|
1427
|
+
hops: [<First Route Hop Public Key Hex String>]
|
|
1428
|
+
id: <Payment Preimage Hash String>
|
|
1429
|
+
[index]: <Payment Add Index Number>
|
|
1430
|
+
is_confirmed: <Payment is Confirmed Bool>
|
|
1431
|
+
is_outgoing: <Transaction Is Outgoing Bool>
|
|
1432
|
+
mtokens: <Millitokens Sent to Destination String>
|
|
1433
|
+
[request]: <BOLT 11 Payment Request String>
|
|
1434
|
+
[safe_fee]: <Payment Forwarding Fee Rounded Up Tokens Number>
|
|
1435
|
+
safe_tokens: <Payment Tokens Rounded Up Number>
|
|
1436
|
+
[secret]: <Payment Preimage Hex String>
|
|
1437
|
+
tokens: <Rounded Down Tokens Sent to Destination Number>
|
|
1438
|
+
}]
|
|
1439
|
+
[next]: <Next Opaque Paging Token String>
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
Example:
|
|
1443
|
+
|
|
1444
|
+
```js
|
|
1445
|
+
import {getAssetPayments} from 'tapass';
|
|
1446
|
+
|
|
1447
|
+
const {payments, next} = await getAssetPayments({limit: 10, tapd});
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
### getAssetReceives
|
|
1451
|
+
|
|
1452
|
+
Get the inbound asset transfers to Taproot Assets addresses, newest first
|
|
1453
|
+
|
|
1454
|
+
Requires `addresses:read` permission
|
|
1455
|
+
|
|
1456
|
+
Use the `next` token with the same filters to get the next page
|
|
1457
|
+
|
|
1458
|
+
The maximum `limit` is 16384
|
|
1459
|
+
|
|
1460
|
+
{
|
|
1461
|
+
[address]: <Encoded Taproot Assets Address String>
|
|
1462
|
+
[created_after]: <Created After ISO 8601 Date String>
|
|
1463
|
+
[created_before]: <Created Before ISO 8601 Date String>
|
|
1464
|
+
[limit]: <Page Result Limit Number>
|
|
1465
|
+
[status]: <Receive Status String>
|
|
1466
|
+
tapd: <Authenticated tapd API Object>
|
|
1467
|
+
[token]: <Opaque Paging Token String>
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
@returns via cbk or Promise
|
|
1471
|
+
{
|
|
1472
|
+
[next]: <Next Opaque Paging Token String>
|
|
1473
|
+
receives: [{
|
|
1474
|
+
address: {
|
|
1475
|
+
address: <Encoded Taproot Assets Address String>
|
|
1476
|
+
amount: <Asset Units To Receive Numeric String>
|
|
1477
|
+
[asset_id]: <Asset Id Hex String>
|
|
1478
|
+
asset_version: <Asset Version Number>
|
|
1479
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1480
|
+
internal_key: <Internal Key Hex String>
|
|
1481
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1482
|
+
proof_courier: <Proof Courier Address String>
|
|
1483
|
+
script_key: <Script Key Hex String>
|
|
1484
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
1485
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
1486
|
+
version: <Address Version Number>
|
|
1487
|
+
}
|
|
1488
|
+
[confirmation_height]: <Confirmation Block Height Number>
|
|
1489
|
+
created_at: <Receive Detected At ISO 8601 Date String>
|
|
1490
|
+
is_proof_available: <Proof File Is Available Bool>
|
|
1491
|
+
status: <Receive Status String>
|
|
1492
|
+
[tapscript_sibling]: <Tapscript Sibling Hash Hex String>
|
|
1493
|
+
tokens: <Satoshis In the Anchor Output Number>
|
|
1494
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1495
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
1496
|
+
}]
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
Example:
|
|
1500
|
+
|
|
1501
|
+
```js
|
|
1502
|
+
import {getAssetReceives} from 'tapass';
|
|
1503
|
+
|
|
1504
|
+
const {receives} = await getAssetReceives({tapd});
|
|
1505
|
+
```
|
|
1506
|
+
|
|
1507
|
+
### getAssets
|
|
1508
|
+
|
|
1509
|
+
Get the assets that this node owns
|
|
1510
|
+
|
|
1511
|
+
Requires `assets:read` permission
|
|
1512
|
+
|
|
1513
|
+
By default, tapd includes only assets with a BIP-86 script key. Use
|
|
1514
|
+
`script_key_type` to get other assets, for example assets in channels.
|
|
1515
|
+
|
|
1516
|
+
An `asset_id` or a `group_key` is a filter, but not both. An `asset_id` needs
|
|
1517
|
+
tapd v0.8.0 or later, and it does not support paging or amount filters.
|
|
1518
|
+
|
|
1519
|
+
Spent assets and leased assets are not supported together.
|
|
1520
|
+
|
|
1521
|
+
Use the `next` token with the same filters to get the next page.
|
|
1522
|
+
|
|
1523
|
+
{
|
|
1524
|
+
[asset_id]: <Asset Id Hex String>
|
|
1525
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1526
|
+
[is_including_leased]: <Include Leased Assets Bool>
|
|
1527
|
+
[is_including_spent]: <Include Spent Assets Bool>
|
|
1528
|
+
[is_including_unconfirmed]: <Include Unconfirmed Mints Bool>
|
|
1529
|
+
[limit]: <Page Result Limit Number>
|
|
1530
|
+
[max_amount]: <Maximum Asset Units Numeric String>
|
|
1531
|
+
[min_amount]: <Minimum Asset Units Numeric String>
|
|
1532
|
+
[script_key_type]: <Script Key Type String> // all, bip86, burn, channel,
|
|
1533
|
+
// script_path_external,
|
|
1534
|
+
// tombstone, unique_pedersen
|
|
1535
|
+
tapd: <Authenticated tapd API Object>
|
|
1536
|
+
[token]: <Opaque Paging Token String>
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
@returns via cbk or Promise
|
|
1540
|
+
{
|
|
1541
|
+
assets: [{
|
|
1542
|
+
amount: <Asset Units Numeric String>
|
|
1543
|
+
[anchor]: {
|
|
1544
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
1545
|
+
[block_height]: <Anchor Block Height Number>
|
|
1546
|
+
[confirmed_at]: <Anchor Confirmed At ISO 8601 Date String>
|
|
1547
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
1548
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
1549
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
1550
|
+
transaction: <Raw Anchor Transaction Hex String>
|
|
1551
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1552
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
1553
|
+
}
|
|
1554
|
+
asset_id: <Asset Id Hex String>
|
|
1555
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
1556
|
+
genesis_output_index: <Genesis Commitment Output Index Number>
|
|
1557
|
+
genesis_transaction_id: <Genesis Point Transaction Id Hex String>
|
|
1558
|
+
genesis_transaction_vout: <Genesis Point Transaction Output Index Number>
|
|
1559
|
+
[group]: {
|
|
1560
|
+
key: <Tweaked Group Key Hex String>
|
|
1561
|
+
raw_key: <Raw Group Key Hex String>
|
|
1562
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
1563
|
+
[witness]: <Group Membership Witness Hex String>
|
|
1564
|
+
}
|
|
1565
|
+
is_burn: <Asset Is Burned Bool>
|
|
1566
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1567
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
1568
|
+
is_spent: <Asset Is Spent Bool>
|
|
1569
|
+
[lease_expires_at]: <Lease Expires At ISO 8601 Date String>
|
|
1570
|
+
[lease_owner]: <Lease Owner Id Hex String>
|
|
1571
|
+
[lock_time]: <Lock Time Number>
|
|
1572
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
1573
|
+
name: <Asset Name String>
|
|
1574
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
1575
|
+
script_key: <Script Key Hex String>
|
|
1576
|
+
script_key_type: <Script Key Type String>
|
|
1577
|
+
script_version: <Script Version Number>
|
|
1578
|
+
version: <Asset Version Number>
|
|
1579
|
+
}]
|
|
1580
|
+
[next]: <Next Opaque Paging Token String>
|
|
1581
|
+
[unconfirmed_mints]: <Unconfirmed Mints Count Number>
|
|
1582
|
+
[unconfirmed_transfers]: <Unconfirmed Transfers Count Number>
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
Example:
|
|
1586
|
+
|
|
1587
|
+
```js
|
|
1588
|
+
import {getAssets} from 'tapass';
|
|
1589
|
+
|
|
1590
|
+
const {assets, next} = await getAssets({limit: 10, tapd});
|
|
1591
|
+
|
|
1592
|
+
// Get the next page
|
|
1593
|
+
const page2 = await getAssets({tapd, token: next});
|
|
1594
|
+
```
|
|
1595
|
+
|
|
1596
|
+
### getAssetTransfers
|
|
1597
|
+
|
|
1598
|
+
Get the outbound asset transfers of this node
|
|
1599
|
+
|
|
1600
|
+
Requires `assets:read` permission
|
|
1601
|
+
|
|
1602
|
+
{
|
|
1603
|
+
tapd: <Authenticated tapd API Object>
|
|
1604
|
+
[transaction_id]: <Anchor Transaction Id Hex String>
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
@returns via cbk or Promise
|
|
1608
|
+
{
|
|
1609
|
+
transfers: [{
|
|
1610
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
1611
|
+
[block_height]: <Anchor Block Height Number>
|
|
1612
|
+
created_at: <Transfer Created At ISO 8601 Date String>
|
|
1613
|
+
fee: <Anchor Transaction Chain Fee Tokens Number>
|
|
1614
|
+
height_hint: <Anchor Transaction Confirmation Height Hint Number>
|
|
1615
|
+
inputs: [{
|
|
1616
|
+
amount: <Asset Units Numeric String>
|
|
1617
|
+
asset_id: <Asset Id Hex String>
|
|
1618
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1619
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1620
|
+
script_key: <Script Key Hex String>
|
|
1621
|
+
transaction_id: <Spent Anchor Transaction Id Hex String>
|
|
1622
|
+
transaction_vout: <Spent Anchor Transaction Output Index Number>
|
|
1623
|
+
}]
|
|
1624
|
+
[label]: <Transfer Label String>
|
|
1625
|
+
outputs: [{
|
|
1626
|
+
[address]: <Taproot Assets Address Of the Recipient String>
|
|
1627
|
+
amount: <Asset Units Numeric String>
|
|
1628
|
+
anchor: {
|
|
1629
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
1630
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
1631
|
+
output_script: <Output Script Hex String>
|
|
1632
|
+
passive_assets_count: <Count Of Passive Assets In the Anchor Number>
|
|
1633
|
+
taproot_asset_root: <Taproot Asset Root Commitment Hex String>
|
|
1634
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
1635
|
+
tokens: <Anchor Output Tokens Number>
|
|
1636
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1637
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
1638
|
+
}
|
|
1639
|
+
[asset_id]: <Asset Id Hex String>
|
|
1640
|
+
asset_version: <Asset Version Number>
|
|
1641
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1642
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1643
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
1644
|
+
is_split_root: <Output Is the Split Root Bool>
|
|
1645
|
+
[lock_time]: <Lock Time Number>
|
|
1646
|
+
[proof]: <Proof File Hex String>
|
|
1647
|
+
[proof_courier]: <Proof Courier Address String>
|
|
1648
|
+
[proof_delivery]: <Proof Delivery State String> // complete, pending
|
|
1649
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
1650
|
+
script_key: <Script Key Hex String>
|
|
1651
|
+
[split_root_hash]: <Split Commitment Root Hash Hex String>
|
|
1652
|
+
}]
|
|
1653
|
+
[transaction]: <Raw Anchor Transaction Hex String>
|
|
1654
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1655
|
+
}]
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
Example:
|
|
1659
|
+
|
|
1660
|
+
```js
|
|
1661
|
+
import {getAssetTransfers} from 'tapass';
|
|
1662
|
+
|
|
1663
|
+
const {transfers} = await getAssetTransfers({tapd});
|
|
1664
|
+
```
|
|
1665
|
+
|
|
1666
|
+
### getAssetUtxos
|
|
1667
|
+
|
|
1668
|
+
Get the on-chain outputs that hold the assets of this node
|
|
1669
|
+
|
|
1670
|
+
Requires `assets:read` permission
|
|
1671
|
+
|
|
1672
|
+
By default, tapd includes only assets with a BIP-86 script key. Use
|
|
1673
|
+
`script_key_type` to get other assets, for example assets in channels.
|
|
1674
|
+
|
|
1675
|
+
{
|
|
1676
|
+
[is_including_leased]: <Include Leased UTXOs Bool>
|
|
1677
|
+
[script_key_type]: <Script Key Type String> // all, bip86, burn, channel,
|
|
1678
|
+
// script_path_external,
|
|
1679
|
+
// tombstone, unique_pedersen
|
|
1680
|
+
tapd: <Authenticated tapd API Object>
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
@returns via cbk or Promise
|
|
1684
|
+
{
|
|
1685
|
+
utxos: [{
|
|
1686
|
+
assets: [{
|
|
1687
|
+
amount: <Asset Units Numeric String>
|
|
1688
|
+
[anchor]: {
|
|
1689
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
1690
|
+
[block_height]: <Anchor Block Height Number>
|
|
1691
|
+
[confirmed_at]: <Anchor Confirmed At ISO 8601 Date String>
|
|
1692
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
1693
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
1694
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
1695
|
+
transaction: <Raw Anchor Transaction Hex String>
|
|
1696
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1697
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
1698
|
+
}
|
|
1699
|
+
asset_id: <Asset Id Hex String>
|
|
1700
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
1701
|
+
genesis_output_index: <Genesis Commitment Output Index Number>
|
|
1702
|
+
genesis_transaction_id: <Genesis Point Transaction Id Hex String>
|
|
1703
|
+
genesis_transaction_vout: <Genesis Point Output Index Number>
|
|
1704
|
+
[group]: {
|
|
1705
|
+
key: <Tweaked Group Key Hex String>
|
|
1706
|
+
raw_key: <Raw Group Key Hex String>
|
|
1707
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
1708
|
+
[witness]: <Group Membership Witness Hex String>
|
|
1709
|
+
}
|
|
1710
|
+
is_burn: <Asset Is Burned Bool>
|
|
1711
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1712
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
1713
|
+
is_spent: <Asset Is Spent Bool>
|
|
1714
|
+
[lease_expires_at]: <Lease Expires At ISO 8601 Date String>
|
|
1715
|
+
[lease_owner]: <Lease Owner Id Hex String>
|
|
1716
|
+
[lock_time]: <Lock Time Number>
|
|
1717
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
1718
|
+
name: <Asset Name String>
|
|
1719
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
1720
|
+
script_key: <Script Key Hex String>
|
|
1721
|
+
script_key_type: <Script Key Type String>
|
|
1722
|
+
script_version: <Script Version Number>
|
|
1723
|
+
version: <Asset Version Number>
|
|
1724
|
+
}]
|
|
1725
|
+
internal_key: <Internal Key Hex String>
|
|
1726
|
+
[lease_expires_at]: <Lease Expires At ISO 8601 Date String>
|
|
1727
|
+
[lease_owner]: <Lease Owner Id Hex String>
|
|
1728
|
+
merkle_root: <Taproot Merkle Root Hex String>
|
|
1729
|
+
taproot_asset_root: <Taproot Asset Root Commitment Hash Hex String>
|
|
1730
|
+
tokens: <Output Value Tokens Number>
|
|
1731
|
+
transaction_id: <Transaction Id Hex String>
|
|
1732
|
+
transaction_vout: <Transaction Output Index Number>
|
|
1733
|
+
}]
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
Example:
|
|
1737
|
+
|
|
1738
|
+
```js
|
|
1739
|
+
import {getAssetUtxos} from 'tapass';
|
|
1740
|
+
|
|
1741
|
+
const {utxos} = await getAssetUtxos({tapd});
|
|
1742
|
+
```
|
|
1743
|
+
|
|
1744
|
+
### getMintBatches
|
|
1745
|
+
|
|
1746
|
+
Get mint batches, including pending and cancelled batches
|
|
1747
|
+
|
|
1748
|
+
Requires `mint:read` permission
|
|
1749
|
+
|
|
1750
|
+
With `is_verbose`, a funded pending batch has the group details of its
|
|
1751
|
+
unsealed assets, and tapd does not return unfunded or empty batches.
|
|
1752
|
+
|
|
1753
|
+
{
|
|
1754
|
+
[id]: <Batch Key Hex String>
|
|
1755
|
+
[is_verbose]: <Include Group Details of Unsealed Assets Bool>
|
|
1756
|
+
tapd: <Authenticated tapd API Object>
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
@returns via cbk or Promise
|
|
1760
|
+
{
|
|
1761
|
+
batches: [{
|
|
1762
|
+
assets: [{
|
|
1763
|
+
amount: <Asset Units Numeric String>
|
|
1764
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
1765
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
1766
|
+
[group_key]: <Group Key Hex String>
|
|
1767
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
1768
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1769
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
1770
|
+
[metadata]: <Metadata Hex String>
|
|
1771
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
1772
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
1773
|
+
name: <Asset Name String>
|
|
1774
|
+
[script_key]: <Script Key Hex String>
|
|
1775
|
+
version: <Asset Version Number>
|
|
1776
|
+
}]
|
|
1777
|
+
created_at: <Created At ISO 8601 Date String>
|
|
1778
|
+
created_height: <Block Height When Created Number>
|
|
1779
|
+
id: <Batch Key Hex String>
|
|
1780
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
1781
|
+
state: <Batch State String>
|
|
1782
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
1783
|
+
unsealed_assets: [{
|
|
1784
|
+
amount: <Asset Units Numeric String>
|
|
1785
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
1786
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
1787
|
+
[group_key]: <Group Key Hex String>
|
|
1788
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
1789
|
+
[group_virtual_psbt]: <Group Virtual Transaction PSBT Hex String>
|
|
1790
|
+
[group_virtual_transaction]: <Group Virtual Transaction Hex String>
|
|
1791
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
1792
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
1793
|
+
[metadata]: <Metadata Hex String>
|
|
1794
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
1795
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
1796
|
+
name: <Asset Name String>
|
|
1797
|
+
[script_key]: <Script Key Hex String>
|
|
1798
|
+
version: <Asset Version Number>
|
|
1799
|
+
}]
|
|
1800
|
+
}]
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
Example:
|
|
1804
|
+
|
|
1805
|
+
```js
|
|
1806
|
+
import {getMintBatches} from 'tapass';
|
|
1807
|
+
|
|
1808
|
+
const {batches} = await getMintBatches({tapd});
|
|
1809
|
+
```
|
|
1810
|
+
|
|
1811
|
+
### getTapdInfo
|
|
1812
|
+
|
|
1813
|
+
Get information about tapd and its lnd node
|
|
1814
|
+
|
|
1815
|
+
Requires `daemon:read` permission
|
|
1816
|
+
|
|
1817
|
+
{
|
|
1818
|
+
tapd: <Authenticated tapd API Object>
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
@returns via cbk or Promise
|
|
1822
|
+
{
|
|
1823
|
+
alias: <lnd Node Alias String>
|
|
1824
|
+
current_block_hash: <Best Chain Block Hash Hex String>
|
|
1825
|
+
current_block_height: <Best Chain Block Height Number>
|
|
1826
|
+
is_synced_to_chain: <tapd Is Synced To Chain Bool>
|
|
1827
|
+
lnd_version: <lnd Version String>
|
|
1828
|
+
network: <Network Name String>
|
|
1829
|
+
public_key: <lnd Identity Public Key Hex String>
|
|
1830
|
+
version: <tapd Version String>
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
Example:
|
|
1834
|
+
|
|
1835
|
+
```js
|
|
1836
|
+
import {getTapdInfo} from 'tapass';
|
|
1837
|
+
|
|
1838
|
+
const {is_synced_to_chain, version} = await getTapdInfo({tapd});
|
|
1839
|
+
```
|
|
1840
|
+
|
|
1841
|
+
### openAssetChannel
|
|
1842
|
+
|
|
1843
|
+
Open a channel that is funded with an asset
|
|
1844
|
+
|
|
1845
|
+
The peer must be connected. tapd sets the satoshi amount of the channel.
|
|
1846
|
+
|
|
1847
|
+
tapd must run inside litd, with lnd and tapd in integrated mode
|
|
1848
|
+
|
|
1849
|
+
Requires `channels:write` permission
|
|
1850
|
+
|
|
1851
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
1852
|
+
|
|
1853
|
+
`give_tokens` is a gift to the peer, in the same way as with openChannel
|
|
1854
|
+
|
|
1855
|
+
{
|
|
1856
|
+
amount: <Asset Units To Fund the Channel With Numeric String>
|
|
1857
|
+
[asset_id]: <Asset Id Hex String>
|
|
1858
|
+
chain_fee_tokens_per_vbyte: <Chain Fee Tokens Per Virtual Byte Number>
|
|
1859
|
+
[give_tokens]: <Tokens To Give To the Peer Number>
|
|
1860
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1861
|
+
partner_public_key: <Connected Peer Public Key Hex String>
|
|
1862
|
+
tapd: <Authenticated tapd API Object>
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
@returns via cbk or Promise
|
|
1866
|
+
{
|
|
1867
|
+
transaction_id: <Funding Transaction Id Hex String>
|
|
1868
|
+
transaction_vout: <Funding Transaction Output Index Number>
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
Example:
|
|
1872
|
+
|
|
1873
|
+
```js
|
|
1874
|
+
import {openAssetChannel} from 'tapass';
|
|
1875
|
+
|
|
1876
|
+
const {transaction_id} = await openAssetChannel({
|
|
1877
|
+
amount: '1000',
|
|
1878
|
+
asset_id,
|
|
1879
|
+
chain_fee_tokens_per_vbyte: 2,
|
|
1880
|
+
partner_public_key,
|
|
1881
|
+
tapd,
|
|
1882
|
+
});
|
|
1883
|
+
```
|
|
1884
|
+
|
|
1885
|
+
### payAssetInvoice
|
|
1886
|
+
|
|
1887
|
+
Pay a payment request with an asset, over an asset channel
|
|
1888
|
+
|
|
1889
|
+
The channel peer sells satoshis for the asset, at a rate in an RFQ quote
|
|
1890
|
+
|
|
1891
|
+
tapd must run inside litd, with lnd and tapd in integrated mode
|
|
1892
|
+
|
|
1893
|
+
Requires `channels:write` permission
|
|
1894
|
+
|
|
1895
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
1896
|
+
|
|
1897
|
+
Use an `rfq_id` of an accepted sell quote to pay with that quote
|
|
1898
|
+
|
|
1899
|
+
Without `max_fee` or `max_fee_mtokens`, only routes with no fee are used,
|
|
1900
|
+
the same as lnd
|
|
1901
|
+
|
|
1902
|
+
The default `pathfinding_timeout` is 25 seconds. The default `max_paths` is 1.
|
|
1903
|
+
|
|
1904
|
+
tapd rejects a payment that is too small to carry one asset unit, unless
|
|
1905
|
+
`is_overpay_allowed` is set
|
|
1906
|
+
|
|
1907
|
+
{
|
|
1908
|
+
[asset_id]: <Asset Id Hex String>
|
|
1909
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1910
|
+
[is_overpay_allowed]: <Allow a Payment Above the Request Amount Bool>
|
|
1911
|
+
[max_fee]: <Maximum Fee Tokens Number>
|
|
1912
|
+
[max_fee_mtokens]: <Maximum Fee Millitokens String>
|
|
1913
|
+
[max_paths]: <Maximum Payment Paths Number>
|
|
1914
|
+
[pathfinding_timeout]: <Time To Spend Finding a Route Milliseconds Number>
|
|
1915
|
+
[peer_public_key]: <RFQ Peer Public Key Hex String>
|
|
1916
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
1917
|
+
request: <BOLT 11 Payment Request String>
|
|
1918
|
+
[rfq_id]: <Accepted Sell Quote Id Hex String>
|
|
1919
|
+
tapd: <Authenticated tapd API Object>
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
@returns via cbk or Promise
|
|
1923
|
+
{
|
|
1924
|
+
confirmed_at: <Payment Confirmed At ISO 8601 Date String>
|
|
1925
|
+
created_at: <Payment Created At ISO 8601 Date String>
|
|
1926
|
+
destination: <Payment Destination Public Key Hex String>
|
|
1927
|
+
fee: <Total Fee Tokens Paid Rounded Down Number>
|
|
1928
|
+
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
1929
|
+
hops: [{
|
|
1930
|
+
channel: <Standard Format Channel Id String>
|
|
1931
|
+
channel_capacity: <Channel Capacity Tokens Number>
|
|
1932
|
+
fee: <Fee Tokens Rounded Down Number>
|
|
1933
|
+
fee_mtokens: <Fee Millitokens String>
|
|
1934
|
+
forward: <Forward Tokens Number>
|
|
1935
|
+
forward_mtokens: <Forward Millitokens String>
|
|
1936
|
+
public_key: <Public Key Hex String>
|
|
1937
|
+
timeout: <Timeout Block Height Number>
|
|
1938
|
+
}]
|
|
1939
|
+
id: <Payment Hash Hex String>
|
|
1940
|
+
[index]: <Payment Index Number String>
|
|
1941
|
+
mtokens: <Total Millitokens Paid String>
|
|
1942
|
+
paths: [{
|
|
1943
|
+
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
1944
|
+
hops: [<Hop Object>]
|
|
1945
|
+
mtokens: <Total Millitokens Paid String>
|
|
1946
|
+
}]
|
|
1947
|
+
quotes: [{
|
|
1948
|
+
[accepted_max_mtokens]: <Accepted Maximum Payment Millitokens String>
|
|
1949
|
+
amount: <Asset Units Numeric String>
|
|
1950
|
+
[asset_id]: <Asset Id Hex String>
|
|
1951
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
1952
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
1953
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
1954
|
+
id: <Quote Request Id Hex String>
|
|
1955
|
+
min_transportable_mtokens: <Minimum Millitokens To Send One Unit String>
|
|
1956
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
1957
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
1958
|
+
rate: <Bid Rate Asset Units Per BTC Exact Decimal String>
|
|
1959
|
+
}]
|
|
1960
|
+
[request]: <BOLT 11 Payment Request String>
|
|
1961
|
+
safe_fee: <Total Fee Tokens Paid Rounded Up Number>
|
|
1962
|
+
safe_tokens: <Total Tokens Paid, Rounded Up Number>
|
|
1963
|
+
secret: <Payment Preimage Hex String>
|
|
1964
|
+
timeout: <Expiration Block Height Number>
|
|
1965
|
+
tokens: <Total Tokens Paid Rounded Down Number>
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
Example:
|
|
1969
|
+
|
|
1970
|
+
```js
|
|
1971
|
+
import {payAssetInvoice} from 'tapass';
|
|
1972
|
+
|
|
1973
|
+
const {fee, secret} = await payAssetInvoice({asset_id, request, tapd});
|
|
1974
|
+
```
|
|
1975
|
+
|
|
1976
|
+
### registerAssetTransfer
|
|
1977
|
+
|
|
1978
|
+
Register an inbound asset transfer that has no Taproot Assets address
|
|
1979
|
+
|
|
1980
|
+
Use this for an interactive transfer, when the sender sent the proof by a
|
|
1981
|
+
different way. The proof must already be in the local universe, and the
|
|
1982
|
+
script key must already be known to this node.
|
|
1983
|
+
|
|
1984
|
+
Requires `assets:write` permission
|
|
1985
|
+
|
|
1986
|
+
{
|
|
1987
|
+
asset_id: <Asset Id Hex String>
|
|
1988
|
+
[group_key]: <Asset Group Key Hex String>
|
|
1989
|
+
script_key: <Script Key Hex String>
|
|
1990
|
+
tapd: <Authenticated tapd API Object>
|
|
1991
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
1992
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
@returns via cbk or Promise
|
|
1996
|
+
{
|
|
1997
|
+
amount: <Asset Units Numeric String>
|
|
1998
|
+
[anchor]: {
|
|
1999
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
2000
|
+
[block_height]: <Anchor Block Height Number>
|
|
2001
|
+
[confirmed_at]: <Anchor Confirmed At ISO 8601 Date String>
|
|
2002
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
2003
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
2004
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
2005
|
+
transaction: <Raw Anchor Transaction Hex String>
|
|
2006
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
2007
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
2008
|
+
}
|
|
2009
|
+
asset_id: <Asset Id Hex String>
|
|
2010
|
+
[decimal_display]: <Decimal Places To Show Number>
|
|
2011
|
+
genesis_output_index: <Genesis Commitment Output Index Number>
|
|
2012
|
+
genesis_transaction_id: <Genesis Point Transaction Id Hex String>
|
|
2013
|
+
genesis_transaction_vout: <Genesis Point Transaction Output Index Number>
|
|
2014
|
+
[group]: {
|
|
2015
|
+
key: <Tweaked Group Key Hex String>
|
|
2016
|
+
raw_key: <Raw Group Key Hex String>
|
|
2017
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
2018
|
+
[witness]: <Group Membership Witness Hex String>
|
|
2019
|
+
}
|
|
2020
|
+
is_burn: <Asset Is Burned Bool>
|
|
2021
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2022
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
2023
|
+
is_spent: <Asset Is Spent Bool>
|
|
2024
|
+
[lease_expires_at]: <Lease Expires At ISO 8601 Date String>
|
|
2025
|
+
[lease_owner]: <Lease Owner Id Hex String>
|
|
2026
|
+
[lock_time]: <Lock Time Number>
|
|
2027
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
2028
|
+
name: <Asset Name String>
|
|
2029
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
2030
|
+
script_key: <Script Key Hex String>
|
|
2031
|
+
script_key_type: <Script Key Type String>
|
|
2032
|
+
script_version: <Script Version Number>
|
|
2033
|
+
version: <Asset Version Number>
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
Example:
|
|
2037
|
+
|
|
2038
|
+
```js
|
|
2039
|
+
import {registerAssetTransfer} from 'tapass';
|
|
2040
|
+
|
|
2041
|
+
const asset = await registerAssetTransfer({
|
|
2042
|
+
asset_id,
|
|
2043
|
+
script_key,
|
|
2044
|
+
tapd,
|
|
2045
|
+
transaction_id,
|
|
2046
|
+
transaction_vout,
|
|
2047
|
+
});
|
|
2048
|
+
```
|
|
2049
|
+
|
|
2050
|
+
### sealMintBatch
|
|
2051
|
+
|
|
2052
|
+
Seal the pending mint batch with asset group witnesses
|
|
2053
|
+
|
|
2054
|
+
Requires `mint:write` permission
|
|
2055
|
+
|
|
2056
|
+
This is only necessary when an asset in the batch has a group key that needs
|
|
2057
|
+
an external signer. Fund the batch first with `fundMintBatch`, and sign the
|
|
2058
|
+
`group_virtual_psbt` of each unsealed asset.
|
|
2059
|
+
|
|
2060
|
+
tapd signs the group witnesses that are not given
|
|
2061
|
+
|
|
2062
|
+
Give `group_witnesses` or `signed_group_psbts`, not both
|
|
2063
|
+
|
|
2064
|
+
{
|
|
2065
|
+
[group_witnesses]: [{
|
|
2066
|
+
asset_id: <Asset Id Hex String>
|
|
2067
|
+
witness: [<Witness Stack Element Hex String>]
|
|
2068
|
+
}]
|
|
2069
|
+
[signed_group_psbts]: [<Signed Group Virtual Transaction PSBT Hex String>]
|
|
2070
|
+
tapd: <Authenticated tapd API Object>
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
@returns via cbk or Promise
|
|
2074
|
+
{
|
|
2075
|
+
assets: [{
|
|
2076
|
+
amount: <Asset Units Numeric String>
|
|
2077
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
2078
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
2079
|
+
[group_key]: <Group Key Hex String>
|
|
2080
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
2081
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2082
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
2083
|
+
[metadata]: <Metadata Hex String>
|
|
2084
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
2085
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
2086
|
+
name: <Asset Name String>
|
|
2087
|
+
[script_key]: <Script Key Hex String>
|
|
2088
|
+
version: <Asset Version Number>
|
|
2089
|
+
}]
|
|
2090
|
+
created_at: <Created At ISO 8601 Date String>
|
|
2091
|
+
created_height: <Block Height When Created Number>
|
|
2092
|
+
id: <Batch Key Hex String>
|
|
2093
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
2094
|
+
state: <Batch State String>
|
|
2095
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
2096
|
+
unsealed_assets: []
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
Example:
|
|
2100
|
+
|
|
2101
|
+
```js
|
|
2102
|
+
import {sealMintBatch} from 'tapass';
|
|
2103
|
+
|
|
2104
|
+
const batch = await sealMintBatch({tapd});
|
|
2105
|
+
```
|
|
2106
|
+
|
|
2107
|
+
### sendAsset
|
|
2108
|
+
|
|
2109
|
+
Send assets to Taproot Assets addresses
|
|
2110
|
+
|
|
2111
|
+
Requires `assets:write` permission
|
|
2112
|
+
|
|
2113
|
+
All addresses must be for the same asset id or asset group
|
|
2114
|
+
|
|
2115
|
+
An `amount` is only for an address without an amount, for example a V2
|
|
2116
|
+
address. When an address has an `amount`, tapd v0.8.0 or later is
|
|
2117
|
+
necessary.
|
|
2118
|
+
|
|
2119
|
+
A fee rate below 253 tokens per thousand weight units (about 1.012 tokens
|
|
2120
|
+
per virtual byte) is raised to 253, because tapd rejects a lower rate
|
|
2121
|
+
|
|
2122
|
+
{
|
|
2123
|
+
addresses: [{
|
|
2124
|
+
address: <Taproot Assets Address String>
|
|
2125
|
+
[amount]: <Asset Units To Send Numeric String>
|
|
2126
|
+
}]
|
|
2127
|
+
[fee_tokens_per_vbyte]: <Chain Fee Tokens Per Virtual Byte Number>
|
|
2128
|
+
[is_courier_ping_skipped]: <Skip the Proof Courier Ping Check Bool>
|
|
2129
|
+
[label]: <Transfer Label String>
|
|
2130
|
+
tapd: <Authenticated tapd API Object>
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
@returns via cbk or Promise
|
|
2134
|
+
{
|
|
2135
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
2136
|
+
[block_height]: <Anchor Block Height Number>
|
|
2137
|
+
created_at: <Transfer Created At ISO 8601 Date String>
|
|
2138
|
+
fee: <Anchor Transaction Chain Fee Tokens Number>
|
|
2139
|
+
height_hint: <Anchor Transaction Confirmation Height Hint Number>
|
|
2140
|
+
inputs: [{
|
|
2141
|
+
amount: <Asset Units Numeric String>
|
|
2142
|
+
asset_id: <Asset Id Hex String>
|
|
2143
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2144
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2145
|
+
script_key: <Script Key Hex String>
|
|
2146
|
+
transaction_id: <Spent Anchor Transaction Id Hex String>
|
|
2147
|
+
transaction_vout: <Spent Anchor Transaction Output Index Number>
|
|
2148
|
+
}]
|
|
2149
|
+
[label]: <Transfer Label String>
|
|
2150
|
+
outputs: [{
|
|
2151
|
+
[address]: <Taproot Assets Address Of the Recipient String>
|
|
2152
|
+
amount: <Asset Units Numeric String>
|
|
2153
|
+
anchor: {
|
|
2154
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
2155
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
2156
|
+
output_script: <Output Script Hex String>
|
|
2157
|
+
passive_assets_count: <Count Of Passive Assets In the Anchor Number>
|
|
2158
|
+
taproot_asset_root: <Taproot Asset Root Commitment Hex String>
|
|
2159
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
2160
|
+
tokens: <Anchor Output Tokens Number>
|
|
2161
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
2162
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
2163
|
+
}
|
|
2164
|
+
[asset_id]: <Asset Id Hex String>
|
|
2165
|
+
asset_version: <Asset Version Number>
|
|
2166
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2167
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2168
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
2169
|
+
is_split_root: <Output Is the Split Root Bool>
|
|
2170
|
+
[lock_time]: <Lock Time Number>
|
|
2171
|
+
[proof]: <Proof File Hex String>
|
|
2172
|
+
[proof_courier]: <Proof Courier Address String>
|
|
2173
|
+
[proof_delivery]: <Proof Delivery State String> // complete, pending
|
|
2174
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
2175
|
+
script_key: <Script Key Hex String>
|
|
2176
|
+
[split_root_hash]: <Split Commitment Root Hash Hex String>
|
|
2177
|
+
}]
|
|
2178
|
+
[transaction]: <Raw Anchor Transaction Hex String>
|
|
2179
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
Example:
|
|
2183
|
+
|
|
2184
|
+
```js
|
|
2185
|
+
import {sendAsset} from 'tapass';
|
|
2186
|
+
|
|
2187
|
+
const transfer = await sendAsset({addresses: [{address}], tapd});
|
|
2188
|
+
```
|
|
2189
|
+
|
|
2190
|
+
### sendAssetKeysend
|
|
2191
|
+
|
|
2192
|
+
Send an asset to a channel peer with a keysend payment
|
|
2193
|
+
|
|
2194
|
+
tapd only sends an asset keysend payment to a direct asset channel peer
|
|
2195
|
+
|
|
2196
|
+
tapd must run inside litd, with lnd and tapd in integrated mode
|
|
2197
|
+
|
|
2198
|
+
Requires `channels:write` permission
|
|
2199
|
+
|
|
2200
|
+
An `asset_id` or a `group_key` is required, but not both
|
|
2201
|
+
|
|
2202
|
+
The default `tokens` is 354, the smallest amount that tapd accepts
|
|
2203
|
+
|
|
2204
|
+
A random `secret` is used when there is no `secret`
|
|
2205
|
+
|
|
2206
|
+
Without `max_fee` or `max_fee_mtokens`, only routes with no fee are used,
|
|
2207
|
+
the same as lnd
|
|
2208
|
+
|
|
2209
|
+
{
|
|
2210
|
+
amount: <Asset Units To Send Numeric String>
|
|
2211
|
+
[asset_id]: <Asset Id Hex String>
|
|
2212
|
+
destination: <Destination Peer Public Key Hex String>
|
|
2213
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2214
|
+
[max_fee]: <Maximum Fee Tokens Number>
|
|
2215
|
+
[max_fee_mtokens]: <Maximum Fee Millitokens String>
|
|
2216
|
+
[max_paths]: <Maximum Payment Paths Number>
|
|
2217
|
+
[pathfinding_timeout]: <Time To Spend Finding a Route Milliseconds Number>
|
|
2218
|
+
[peer_public_key]: <RFQ Peer Public Key Hex String>
|
|
2219
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
2220
|
+
[secret]: <Payment Preimage Hex String>
|
|
2221
|
+
tapd: <Authenticated tapd API Object>
|
|
2222
|
+
[tokens]: <Tokens That Carry the Asset Units Number>
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
@returns via cbk or Promise
|
|
2226
|
+
{
|
|
2227
|
+
confirmed_at: <Payment Confirmed At ISO 8601 Date String>
|
|
2228
|
+
created_at: <Payment Created At ISO 8601 Date String>
|
|
2229
|
+
destination: <Payment Destination Public Key Hex String>
|
|
2230
|
+
fee: <Total Fee Tokens Paid Rounded Down Number>
|
|
2231
|
+
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
2232
|
+
hops: [{
|
|
2233
|
+
channel: <Standard Format Channel Id String>
|
|
2234
|
+
channel_capacity: <Channel Capacity Tokens Number>
|
|
2235
|
+
fee: <Fee Tokens Rounded Down Number>
|
|
2236
|
+
fee_mtokens: <Fee Millitokens String>
|
|
2237
|
+
forward: <Forward Tokens Number>
|
|
2238
|
+
forward_mtokens: <Forward Millitokens String>
|
|
2239
|
+
public_key: <Public Key Hex String>
|
|
2240
|
+
timeout: <Timeout Block Height Number>
|
|
2241
|
+
}]
|
|
2242
|
+
id: <Payment Hash Hex String>
|
|
2243
|
+
[index]: <Payment Index Number String>
|
|
2244
|
+
mtokens: <Total Millitokens Paid String>
|
|
2245
|
+
paths: [{
|
|
2246
|
+
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
2247
|
+
hops: [<Hop Object>]
|
|
2248
|
+
mtokens: <Total Millitokens Paid String>
|
|
2249
|
+
}]
|
|
2250
|
+
quotes: [<Accepted Sell Quote Object>]
|
|
2251
|
+
safe_fee: <Total Fee Tokens Paid Rounded Up Number>
|
|
2252
|
+
safe_tokens: <Total Tokens Paid, Rounded Up Number>
|
|
2253
|
+
secret: <Payment Preimage Hex String>
|
|
2254
|
+
timeout: <Expiration Block Height Number>
|
|
2255
|
+
tokens: <Total Tokens Paid Rounded Down Number>
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
Example:
|
|
2259
|
+
|
|
2260
|
+
```js
|
|
2261
|
+
import {sendAssetKeysend} from 'tapass';
|
|
2262
|
+
|
|
2263
|
+
const {fee, secret} = await sendAssetKeysend({
|
|
2264
|
+
amount: '100',
|
|
2265
|
+
asset_id,
|
|
2266
|
+
destination,
|
|
2267
|
+
tapd,
|
|
2268
|
+
});
|
|
2269
|
+
```
|
|
2270
|
+
|
|
2271
|
+
### setTapdDebugLevel
|
|
2272
|
+
|
|
2273
|
+
Set the log level of tapd
|
|
2274
|
+
|
|
2275
|
+
Use a level for all subsystems, for example `debug`, or a level for each
|
|
2276
|
+
subsystem, for example `TADB=trace,FRTR=info`
|
|
2277
|
+
|
|
2278
|
+
Requires `daemon:write` permission
|
|
2279
|
+
|
|
2280
|
+
{
|
|
2281
|
+
level: <Log Level Specification String>
|
|
2282
|
+
tapd: <Authenticated tapd API Object>
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
@returns via cbk or Promise
|
|
2286
|
+
|
|
2287
|
+
Example:
|
|
2288
|
+
|
|
2289
|
+
```js
|
|
2290
|
+
import {setTapdDebugLevel} from 'tapass';
|
|
2291
|
+
|
|
2292
|
+
await setTapdDebugLevel({level: 'debug', tapd});
|
|
2293
|
+
```
|
|
2294
|
+
|
|
2295
|
+
### stopTapd
|
|
2296
|
+
|
|
2297
|
+
Stop tapd
|
|
2298
|
+
|
|
2299
|
+
Requires `daemon:write` permission
|
|
2300
|
+
|
|
2301
|
+
{
|
|
2302
|
+
tapd: <Authenticated tapd API Object>
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
@returns via cbk or Promise
|
|
2306
|
+
|
|
2307
|
+
Example:
|
|
2308
|
+
|
|
2309
|
+
```js
|
|
2310
|
+
import {stopTapd} from 'tapass';
|
|
2311
|
+
|
|
2312
|
+
await stopTapd({tapd});
|
|
2313
|
+
```
|
|
2314
|
+
|
|
2315
|
+
### subscribeToAssetInvoices
|
|
2316
|
+
|
|
2317
|
+
Subscribe to invoices that receive an asset
|
|
2318
|
+
|
|
2319
|
+
tapd only sends updates of invoices that involve an asset
|
|
2320
|
+
|
|
2321
|
+
Use `added_after` and `confirmed_after` to get past updates after an index
|
|
2322
|
+
|
|
2323
|
+
Requires `channels:read` permission
|
|
2324
|
+
|
|
2325
|
+
This method needs tapd v0.8.1 or later
|
|
2326
|
+
|
|
2327
|
+
The invoice fields are the same as in lightning getInvoices
|
|
2328
|
+
|
|
2329
|
+
{
|
|
2330
|
+
[added_after]: <Invoice Add Index To Start After Number>
|
|
2331
|
+
[confirmed_after]: <Invoice Confirmed Index To Start After Number>
|
|
2332
|
+
tapd: <Authenticated tapd API Object>
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
@throws
|
|
2336
|
+
<Error>
|
|
2337
|
+
|
|
2338
|
+
@returns
|
|
2339
|
+
<Subscription EventEmitter Object>
|
|
2340
|
+
|
|
2341
|
+
@event 'invoice_updated'
|
|
2342
|
+
{
|
|
2343
|
+
assets: [{
|
|
2344
|
+
amount: <Asset Units Numeric String>
|
|
2345
|
+
asset_id: <Asset Id Hex String>
|
|
2346
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2347
|
+
}]
|
|
2348
|
+
created_at: <ISO 8601 Date String>
|
|
2349
|
+
id: <Payment Hash Hex String>
|
|
2350
|
+
index: <Invoice Add Index Number>
|
|
2351
|
+
is_confirmed: <Invoice is Confirmed Bool>
|
|
2352
|
+
...<lightning Invoice Object>
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
Example:
|
|
2356
|
+
|
|
2357
|
+
```js
|
|
2358
|
+
import {subscribeToAssetInvoices} from 'tapass';
|
|
2359
|
+
|
|
2360
|
+
const sub = subscribeToAssetInvoices({tapd});
|
|
2361
|
+
|
|
2362
|
+
sub.on('invoice_updated', invoice => console.log(invoice));
|
|
2363
|
+
```
|
|
2364
|
+
|
|
2365
|
+
### subscribeToAssetPayments
|
|
2366
|
+
|
|
2367
|
+
Subscribe to the status of current outgoing asset payments
|
|
2368
|
+
|
|
2369
|
+
The events are the same as in lightning subscribeToPayments, and each
|
|
2370
|
+
event also has the asset amounts of the payment
|
|
2371
|
+
|
|
2372
|
+
tapd only sends updates of payments that involve an asset
|
|
2373
|
+
|
|
2374
|
+
Requires `channels:read` permission
|
|
2375
|
+
|
|
2376
|
+
This method needs tapd v0.8.1 or later
|
|
2377
|
+
|
|
2378
|
+
{
|
|
2379
|
+
tapd: <Authenticated tapd API Object>
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
@throws
|
|
2383
|
+
<Error>
|
|
2384
|
+
|
|
2385
|
+
@returns
|
|
2386
|
+
<Subscription EventEmitter Object>
|
|
2387
|
+
|
|
2388
|
+
@event 'confirmed'
|
|
2389
|
+
{
|
|
2390
|
+
assets: [{
|
|
2391
|
+
amount: <Asset Units Numeric String>
|
|
2392
|
+
asset_id: <Asset Id Hex String>
|
|
2393
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2394
|
+
}]
|
|
2395
|
+
confirmed_at: <Payment Confirmed At ISO 8601 Date String>
|
|
2396
|
+
...<lightning Confirmed Payment Object>
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
@event 'failed'
|
|
2400
|
+
{
|
|
2401
|
+
assets: [<Asset Amount Object>]
|
|
2402
|
+
id: <Payment Hash Hex String>
|
|
2403
|
+
is_canceled: <Payment Canceled Bool>
|
|
2404
|
+
is_insufficient_balance: <Failed Due To Lack of Balance Bool>
|
|
2405
|
+
is_invalid_payment: <Failed Due to Payment Rejected At Destination Bool>
|
|
2406
|
+
is_pathfinding_timeout: <Failed Due to Pathfinding Timeout Bool>
|
|
2407
|
+
is_route_not_found: <Failed Due to Absence of Path Through Graph Bool>
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
@event 'paying'
|
|
2411
|
+
{
|
|
2412
|
+
assets: [<Asset Amount Object>]
|
|
2413
|
+
created_at: <Payment Created At ISO 8601 Date String>
|
|
2414
|
+
...<lightning Pending Payment Object>
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
Example:
|
|
2418
|
+
|
|
2419
|
+
```js
|
|
2420
|
+
import {subscribeToAssetPayments} from 'tapass';
|
|
2421
|
+
|
|
2422
|
+
const sub = subscribeToAssetPayments({tapd});
|
|
2423
|
+
|
|
2424
|
+
sub.on('confirmed', payment => console.log(payment));
|
|
2425
|
+
```
|
|
2426
|
+
|
|
2427
|
+
### subscribeToAssetReceives
|
|
2428
|
+
|
|
2429
|
+
Subscribe to inbound asset transfers to Taproot Assets addresses
|
|
2430
|
+
|
|
2431
|
+
Requires `assets:read` permission
|
|
2432
|
+
|
|
2433
|
+
With `created_after`, tapd also sends the past events after that date
|
|
2434
|
+
|
|
2435
|
+
{
|
|
2436
|
+
[address]: <Encoded Taproot Assets Address String>
|
|
2437
|
+
[created_after]: <Replay Events After ISO 8601 Date String>
|
|
2438
|
+
tapd: <Authenticated tapd API Object>
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
@throws
|
|
2442
|
+
<Error>
|
|
2443
|
+
|
|
2444
|
+
@returns
|
|
2445
|
+
<EventEmitter Object>
|
|
2446
|
+
|
|
2447
|
+
@event 'receive'
|
|
2448
|
+
{
|
|
2449
|
+
address: {
|
|
2450
|
+
address: <Encoded Taproot Assets Address String>
|
|
2451
|
+
amount: <Asset Units To Receive Numeric String>
|
|
2452
|
+
[asset_id]: <Asset Id Hex String>
|
|
2453
|
+
asset_version: <Asset Version Number>
|
|
2454
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2455
|
+
internal_key: <Internal Key Hex String>
|
|
2456
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2457
|
+
proof_courier: <Proof Courier Address String>
|
|
2458
|
+
script_key: <Script Key Hex String>
|
|
2459
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
2460
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
2461
|
+
version: <Address Version Number>
|
|
2462
|
+
}
|
|
2463
|
+
[confirmation_height]: <Confirmation Block Height Number>
|
|
2464
|
+
[error]: <Receive Error String>
|
|
2465
|
+
status: <Receive Status String>
|
|
2466
|
+
[transaction_id]: <Anchor Transaction Id Hex String>
|
|
2467
|
+
[transaction_vout]: <Anchor Transaction Output Index Number>
|
|
2468
|
+
updated_at: <Updated At ISO 8601 Date String>
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
Example:
|
|
2472
|
+
|
|
2473
|
+
```js
|
|
2474
|
+
import {subscribeToAssetReceives} from 'tapass';
|
|
2475
|
+
|
|
2476
|
+
const sub = subscribeToAssetReceives({tapd});
|
|
2477
|
+
|
|
2478
|
+
sub.on('receive', receive => console.log(receive));
|
|
2479
|
+
```
|
|
2480
|
+
|
|
2481
|
+
### subscribeToAssetSends
|
|
2482
|
+
|
|
2483
|
+
Subscribe to the state changes of outbound asset sends
|
|
2484
|
+
|
|
2485
|
+
Requires `assets:read` permission
|
|
2486
|
+
|
|
2487
|
+
A `start_at` date in the past replays the events from that date. Without a
|
|
2488
|
+
`start_at`, the events start now.
|
|
2489
|
+
|
|
2490
|
+
{
|
|
2491
|
+
[label]: <Transfer Label String>
|
|
2492
|
+
[script_key]: <Recipient Script Key Hex String>
|
|
2493
|
+
[start_at]: <Replay Events From ISO 8601 Date String>
|
|
2494
|
+
tapd: <Authenticated tapd API Object>
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
@throws
|
|
2498
|
+
<Error>
|
|
2499
|
+
|
|
2500
|
+
@returns
|
|
2501
|
+
<EventEmitter Object>
|
|
2502
|
+
|
|
2503
|
+
@event 'send'
|
|
2504
|
+
{
|
|
2505
|
+
addresses: [{
|
|
2506
|
+
address: <Encoded Taproot Assets Address String>
|
|
2507
|
+
amount: <Asset Units To Receive Numeric String>
|
|
2508
|
+
[asset_id]: <Asset Id Hex String>
|
|
2509
|
+
asset_version: <Asset Version Number>
|
|
2510
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2511
|
+
internal_key: <Internal Key Hex String>
|
|
2512
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2513
|
+
proof_courier: <Proof Courier Address String>
|
|
2514
|
+
script_key: <Script Key Hex String>
|
|
2515
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
2516
|
+
taproot_output_key: <Taproot Output Key Hex String>
|
|
2517
|
+
version: <Address Version Number>
|
|
2518
|
+
}]
|
|
2519
|
+
[anchor]: {
|
|
2520
|
+
[change_output_index]: <Change Output Index Number>
|
|
2521
|
+
fee: <Chain Fee Tokens Number>
|
|
2522
|
+
fee_tokens_per_vbyte: <Target Fee Tokens Per Virtual Byte Number>
|
|
2523
|
+
locked_utxos: [{
|
|
2524
|
+
transaction_id: <Locked Transaction Id Hex String>
|
|
2525
|
+
transaction_vout: <Locked Transaction Output Index Number>
|
|
2526
|
+
}]
|
|
2527
|
+
psbt: <Anchor Transaction PSBT Hex String>
|
|
2528
|
+
[transaction]: <Signed Anchor Transaction Hex String>
|
|
2529
|
+
}
|
|
2530
|
+
at: <Event At ISO 8601 Date String>
|
|
2531
|
+
[error]: <Send State Error String>
|
|
2532
|
+
[label]: <Transfer Label String>
|
|
2533
|
+
[next_state]: <Next Send State String>
|
|
2534
|
+
parcel_type: <Parcel Type String> // address, pending, pre_anchored, ...
|
|
2535
|
+
passive_virtual_packets: [<Passive Virtual Packet Hex String>]
|
|
2536
|
+
state: <Executed Send State String> // for example anchor_sign, complete
|
|
2537
|
+
[transfer]: {
|
|
2538
|
+
[block_hash]: <Anchor Block Hash Hex String>
|
|
2539
|
+
[block_height]: <Anchor Block Height Number>
|
|
2540
|
+
created_at: <Transfer Created At ISO 8601 Date String>
|
|
2541
|
+
fee: <Anchor Transaction Chain Fee Tokens Number>
|
|
2542
|
+
height_hint: <Anchor Transaction Confirmation Height Hint Number>
|
|
2543
|
+
inputs: [{
|
|
2544
|
+
amount: <Asset Units Numeric String>
|
|
2545
|
+
asset_id: <Asset Id Hex String>
|
|
2546
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2547
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2548
|
+
script_key: <Script Key Hex String>
|
|
2549
|
+
transaction_id: <Spent Anchor Transaction Id Hex String>
|
|
2550
|
+
transaction_vout: <Spent Anchor Transaction Output Index Number>
|
|
2551
|
+
}]
|
|
2552
|
+
[label]: <Transfer Label String>
|
|
2553
|
+
outputs: [{
|
|
2554
|
+
[address]: <Taproot Assets Address Of the Recipient String>
|
|
2555
|
+
amount: <Asset Units Numeric String>
|
|
2556
|
+
anchor: {
|
|
2557
|
+
internal_key: <Anchor Internal Key Hex String>
|
|
2558
|
+
merkle_root: <Anchor Taproot Merkle Root Hex String>
|
|
2559
|
+
output_script: <Output Script Hex String>
|
|
2560
|
+
passive_assets_count: <Count Of Passive Assets In the Anchor Number>
|
|
2561
|
+
taproot_asset_root: <Taproot Asset Root Commitment Hex String>
|
|
2562
|
+
[tapscript_sibling]: <Tapscript Sibling Preimage Hex String>
|
|
2563
|
+
tokens: <Anchor Output Tokens Number>
|
|
2564
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
2565
|
+
transaction_vout: <Anchor Transaction Output Index Number>
|
|
2566
|
+
}
|
|
2567
|
+
[asset_id]: <Asset Id Hex String>
|
|
2568
|
+
asset_version: <Asset Version Number>
|
|
2569
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2570
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2571
|
+
is_local: <Script Key Belongs To This Node Bool>
|
|
2572
|
+
is_split_root: <Output Is the Split Root Bool>
|
|
2573
|
+
[lock_time]: <Lock Time Number>
|
|
2574
|
+
[proof]: <Proof File Hex String>
|
|
2575
|
+
[proof_courier]: <Proof Courier Address String>
|
|
2576
|
+
[proof_delivery]: <Proof Delivery State String> // complete, pending
|
|
2577
|
+
[relative_lock_time]: <Relative Lock Time Number>
|
|
2578
|
+
script_key: <Script Key Hex String>
|
|
2579
|
+
[split_root_hash]: <Split Commitment Root Hash Hex String>
|
|
2580
|
+
}]
|
|
2581
|
+
[transaction]: <Raw Anchor Transaction Hex String>
|
|
2582
|
+
transaction_id: <Anchor Transaction Id Hex String>
|
|
2583
|
+
}
|
|
2584
|
+
virtual_packets: [<Virtual Packet Hex String>]
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
Example:
|
|
2588
|
+
|
|
2589
|
+
```js
|
|
2590
|
+
import {subscribeToAssetSends} from 'tapass';
|
|
2591
|
+
|
|
2592
|
+
const sub = subscribeToAssetSends({tapd});
|
|
2593
|
+
|
|
2594
|
+
sub.on('send', send => console.log(send));
|
|
2595
|
+
```
|
|
2596
|
+
|
|
2597
|
+
### subscribeToMintEvents
|
|
2598
|
+
|
|
2599
|
+
Subscribe to the state changes of mint batches
|
|
2600
|
+
|
|
2601
|
+
Requires `mint:read` permission
|
|
2602
|
+
|
|
2603
|
+
{
|
|
2604
|
+
tapd: <Authenticated tapd API Object>
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
@throws
|
|
2608
|
+
<Error>
|
|
2609
|
+
|
|
2610
|
+
@returns
|
|
2611
|
+
<EventEmitter Object>
|
|
2612
|
+
|
|
2613
|
+
// A mint batch changed state, or it failed to change state
|
|
2614
|
+
@event 'batch'
|
|
2615
|
+
{
|
|
2616
|
+
at: <Event At ISO 8601 Date String>
|
|
2617
|
+
batch: {
|
|
2618
|
+
assets: [{
|
|
2619
|
+
amount: <Asset Units Numeric String>
|
|
2620
|
+
[group_anchor]: <Name of the Asset That Anchors a New Group String>
|
|
2621
|
+
[group_internal_key]: <Group Internal Public Key Hex String>
|
|
2622
|
+
[group_key]: <Group Key Hex String>
|
|
2623
|
+
[group_tapscript_root]: <Group Tapscript Root Hex String>
|
|
2624
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2625
|
+
is_new_group: <Asset Starts a New Group Bool>
|
|
2626
|
+
[metadata]: <Metadata Hex String>
|
|
2627
|
+
[metadata_hash]: <Metadata Hash Hex String>
|
|
2628
|
+
[metadata_type]: <Metadata Type String> // json, opaque
|
|
2629
|
+
name: <Asset Name String>
|
|
2630
|
+
[script_key]: <Script Key Hex String>
|
|
2631
|
+
version: <Asset Version Number>
|
|
2632
|
+
}]
|
|
2633
|
+
created_at: <Created At ISO 8601 Date String>
|
|
2634
|
+
created_height: <Block Height When Created Number>
|
|
2635
|
+
id: <Batch Key Hex String>
|
|
2636
|
+
[psbt]: <Genesis Transaction PSBT Hex String>
|
|
2637
|
+
state: <Batch State String>
|
|
2638
|
+
[transaction_id]: <Genesis Transaction Id Hex String>
|
|
2639
|
+
unsealed_assets: []
|
|
2640
|
+
}
|
|
2641
|
+
[error]: <State Change Error String>
|
|
2642
|
+
state: <Last Done Batch State String>
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
Example:
|
|
2646
|
+
|
|
2647
|
+
```js
|
|
2648
|
+
import {subscribeToMintEvents} from 'tapass';
|
|
2649
|
+
|
|
2650
|
+
const sub = subscribeToMintEvents({tapd});
|
|
2651
|
+
|
|
2652
|
+
sub.on('batch', ({at, batch}) => console.log(at, batch.state));
|
|
2653
|
+
```
|
|
2654
|
+
|
|
2655
|
+
### subscribeToPastAssetPayment
|
|
2656
|
+
|
|
2657
|
+
Subscribe to the status of a past asset payment
|
|
2658
|
+
|
|
2659
|
+
The events are the same as in lightning subscribeToPastPayment, and each
|
|
2660
|
+
event also has the asset amounts of the payment
|
|
2661
|
+
|
|
2662
|
+
tapd only sends updates of a payment that involves an asset
|
|
2663
|
+
|
|
2664
|
+
Requires `channels:read` permission
|
|
2665
|
+
|
|
2666
|
+
This method needs tapd v0.8.1 or later
|
|
2667
|
+
|
|
2668
|
+
{
|
|
2669
|
+
id: <Payment Hash Hex String>
|
|
2670
|
+
tapd: <Authenticated tapd API Object>
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
@throws
|
|
2674
|
+
<Error>
|
|
2675
|
+
|
|
2676
|
+
@returns
|
|
2677
|
+
<Subscription EventEmitter Object>
|
|
2678
|
+
|
|
2679
|
+
@event 'confirmed'
|
|
2680
|
+
{
|
|
2681
|
+
assets: [{
|
|
2682
|
+
amount: <Asset Units Numeric String>
|
|
2683
|
+
asset_id: <Asset Id Hex String>
|
|
2684
|
+
[group_key]: <Asset Group Key Hex String>
|
|
2685
|
+
}]
|
|
2686
|
+
confirmed_at: <Payment Confirmed At ISO 8601 Date String>
|
|
2687
|
+
...<lightning Confirmed Payment Object>
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
@event 'failed'
|
|
2691
|
+
{
|
|
2692
|
+
assets: [<Asset Amount Object>]
|
|
2693
|
+
id: <Payment Hash Hex String>
|
|
2694
|
+
is_canceled: <Payment Canceled Bool>
|
|
2695
|
+
is_insufficient_balance: <Failed Due To Lack of Balance Bool>
|
|
2696
|
+
is_invalid_payment: <Failed Due to Payment Rejected At Destination Bool>
|
|
2697
|
+
is_pathfinding_timeout: <Failed Due to Pathfinding Timeout Bool>
|
|
2698
|
+
is_route_not_found: <Failed Due to Absence of Path Through Graph Bool>
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
@event 'paying'
|
|
2702
|
+
{
|
|
2703
|
+
assets: [<Asset Amount Object>]
|
|
2704
|
+
created_at: <Payment Created At ISO 8601 Date String>
|
|
2705
|
+
...<lightning Pending Payment Object>
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
Example:
|
|
2709
|
+
|
|
2710
|
+
```js
|
|
2711
|
+
import {subscribeToPastAssetPayment} from 'tapass';
|
|
2712
|
+
|
|
2713
|
+
const sub = subscribeToPastAssetPayment({id, tapd});
|
|
2714
|
+
|
|
2715
|
+
sub.on('confirmed', payment => console.log(payment));
|
|
2716
|
+
```
|
|
2717
|
+
|
|
2718
|
+
### subscribeToRfqEvents
|
|
2719
|
+
|
|
2720
|
+
Subscribe to RFQ events
|
|
2721
|
+
|
|
2722
|
+
Requires `rfq:read` permission
|
|
2723
|
+
|
|
2724
|
+
A rate is a number of asset units per BTC, as an exact decimal string
|
|
2725
|
+
|
|
2726
|
+
{
|
|
2727
|
+
tapd: <Authenticated tapd API Object>
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
@throws
|
|
2731
|
+
<Error>
|
|
2732
|
+
|
|
2733
|
+
@returns
|
|
2734
|
+
<EventEmitter Object>
|
|
2735
|
+
|
|
2736
|
+
@event 'accepted_buy_quote'
|
|
2737
|
+
{
|
|
2738
|
+
[accepted_max_amount]: <Accepted Maximum Asset Units Numeric String>
|
|
2739
|
+
[asset_id]: <Asset Id Hex String>
|
|
2740
|
+
at: <Event At ISO 8601 Date String>
|
|
2741
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
2742
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
2743
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
2744
|
+
id: <Quote Request Id Hex String>
|
|
2745
|
+
max_amount: <Maximum Asset Units Numeric String>
|
|
2746
|
+
min_transportable_amount: <Minimum Asset Units In One HTLC Numeric String>
|
|
2747
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
2748
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
2749
|
+
rate: <Ask Rate Asset Units Per BTC Exact Decimal String>
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
@event 'accepted_htlc'
|
|
2753
|
+
{
|
|
2754
|
+
at: <Event At ISO 8601 Date String>
|
|
2755
|
+
channel: <Payment Standard Format Channel Id String>
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
@event 'accepted_sell_quote'
|
|
2759
|
+
{
|
|
2760
|
+
[accepted_max_mtokens]: <Accepted Maximum Payment Millitokens String>
|
|
2761
|
+
amount: <Asset Units Numeric String>
|
|
2762
|
+
[asset_id]: <Asset Id Hex String>
|
|
2763
|
+
at: <Event At ISO 8601 Date String>
|
|
2764
|
+
channel: <Channel To Pay Over Standard Format Channel Id String>
|
|
2765
|
+
expires_at: <Quote Expires At ISO 8601 Date String>
|
|
2766
|
+
[group_key]: <Asset Group BIP340 Public Key Hex String>
|
|
2767
|
+
id: <Quote Request Id Hex String>
|
|
2768
|
+
min_transportable_mtokens: <Minimum Millitokens To Send One Unit String>
|
|
2769
|
+
peer_public_key: <Peer Public Key Hex String>
|
|
2770
|
+
[price_oracle_metadata]: <Price Oracle Metadata String>
|
|
2771
|
+
rate: <Bid Rate Asset Units Per BTC Exact Decimal String>
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
@event 'end'
|
|
2775
|
+
|
|
2776
|
+
@event 'error'
|
|
2777
|
+
[<Error Code Number>, <Error Message String>, <Error Details Object>]
|
|
2778
|
+
|
|
2779
|
+
Example:
|
|
2780
|
+
|
|
2781
|
+
```js
|
|
2782
|
+
import {subscribeToRfqEvents} from 'tapass';
|
|
2783
|
+
|
|
2784
|
+
const sub = subscribeToRfqEvents({tapd});
|
|
2785
|
+
|
|
2786
|
+
sub.on('accepted_buy_quote', quote => console.log(quote));
|
|
2787
|
+
```
|
|
2788
|
+
|
|
2789
|
+
### unpackAssetProofFile
|
|
2790
|
+
|
|
2791
|
+
Get the individual proofs in an asset proof file
|
|
2792
|
+
|
|
2793
|
+
Requires `proofs:read` permission
|
|
2794
|
+
|
|
2795
|
+
The first proof in the list is the first proof in the proof chain
|
|
2796
|
+
|
|
2797
|
+
{
|
|
2798
|
+
proof: <Asset Proof File Hex String>
|
|
2799
|
+
tapd: <Authenticated tapd API Object>
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
@returns via cbk or Promise
|
|
2803
|
+
{
|
|
2804
|
+
proofs: [<Asset Proof Hex String>]
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
Example:
|
|
2808
|
+
|
|
2809
|
+
```js
|
|
2810
|
+
import {unpackAssetProofFile} from 'tapass';
|
|
2811
|
+
|
|
2812
|
+
const {proofs} = await unpackAssetProofFile({proof, tapd});
|
|
2813
|
+
```
|
|
2814
|
+
|
|
2815
|
+
### verifyAssetProof
|
|
2816
|
+
|
|
2817
|
+
Verify an asset proof file
|
|
2818
|
+
|
|
2819
|
+
Requires `proofs:read` permission
|
|
2820
|
+
|
|
2821
|
+
A valid proof file also returns its last proof, decoded
|
|
2822
|
+
|
|
2823
|
+
{
|
|
2824
|
+
proof: <Asset Proof File Hex String>
|
|
2825
|
+
tapd: <Authenticated tapd API Object>
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
@returns via cbk or Promise
|
|
2829
|
+
{
|
|
2830
|
+
is_valid: <Proof File Is Valid Bool>
|
|
2831
|
+
[proof]: {
|
|
2832
|
+
additional_inputs_count: <Additional Inputs Count Number>
|
|
2833
|
+
[alt_leaves]: <Alternative Leaves Hex String>
|
|
2834
|
+
asset: <Asset Object>
|
|
2835
|
+
challenge_witness: [<Challenge Witness Element Hex String>]
|
|
2836
|
+
depth: <Proof Depth From the Last Proof In the File Number>
|
|
2837
|
+
exclusion_proofs: [<Exclusion Proof Hex String>]
|
|
2838
|
+
[genesis]: {
|
|
2839
|
+
asset_id: <Asset Id Hex String>
|
|
2840
|
+
is_collectible: <Asset Is Collectible Bool>
|
|
2841
|
+
meta_hash: <Asset Metadata Hash Hex String>
|
|
2842
|
+
name: <Asset Name String>
|
|
2843
|
+
output_index: <Genesis Commitment Output Index Number>
|
|
2844
|
+
transaction_id: <Genesis Point Transaction Id Hex String>
|
|
2845
|
+
transaction_vout: <Genesis Point Transaction Output Index Number>
|
|
2846
|
+
}
|
|
2847
|
+
[group_key]: {
|
|
2848
|
+
raw_key: <Raw Group Key Hex String>
|
|
2849
|
+
[tapscript_root]: <Group Tapscript Root Hex String>
|
|
2850
|
+
}
|
|
2851
|
+
inclusion_proof: <Inclusion Proof Hex String>
|
|
2852
|
+
is_burn: <Proof Is For a Burn Bool>
|
|
2853
|
+
proofs_count: <Proofs In the File Count Number>
|
|
2854
|
+
[split_root_proof]: <Split Root Proof Hex String>
|
|
2855
|
+
transaction_merkle_proof: <Transaction Merkle Proof Hex String>
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
Example:
|
|
2860
|
+
|
|
2861
|
+
```js
|
|
2862
|
+
import {verifyAssetProof} from 'tapass';
|
|
2863
|
+
|
|
2864
|
+
const {is_valid} = await verifyAssetProof({proof, tapd});
|
|
2865
|
+
```
|
|
2866
|
+
|
|
2867
|
+
## Errors
|
|
2868
|
+
|
|
2869
|
+
Methods return errors as arrays: `[code, 'ErrorMessage', {err}]`.
|
|
2870
|
+
|
|
2871
|
+
- `400`: An argument is not correct.
|
|
2872
|
+
- `403`: The macaroon does not have the permission for the method.
|
|
2873
|
+
- `404`: tapd does not have the item, for example an asset.
|
|
2874
|
+
- `409`: The item already exists, for example a proof.
|
|
2875
|
+
- `501`: tapd does not have the RPC or the feature. Some RPCs need a newer tapd.
|
|
2876
|
+
- `503`: tapd returned an error, or tapd is not available.
|
|
2877
|
+
|
|
2878
|
+
## Development
|
|
2879
|
+
|
|
2880
|
+
pnpm install
|
|
2881
|
+
pnpm test
|
|
2882
|
+
pnpm lint
|
|
2883
|
+
pnpm build
|
|
2884
|
+
|
|
2885
|
+
To copy the protos of a different tapd release into `protos/`:
|
|
2886
|
+
|
|
2887
|
+
pnpm sync-protos v0.8.5
|