UNPKG

@arklabs/wallet-sdk

Version:

Bitcoin wallet SDK with Taproot and Ark integration

161 lines (160 loc) 4.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Response = void 0; var Response; (function (Response) { Response.walletInitialized = { type: "WALLET_INITIALIZED", success: true, }; function error(message) { return { type: "ERROR", success: false, message, }; } Response.error = error; function settleEvent(event) { return { type: "SETTLE_EVENT", success: true, event, }; } Response.settleEvent = settleEvent; function settleSuccess(txid) { return { type: "SETTLE_SUCCESS", success: true, txid, }; } Response.settleSuccess = settleSuccess; function isSettleSuccess(response) { return response.type === "SETTLE_SUCCESS" && response.success; } Response.isSettleSuccess = isSettleSuccess; function isAddress(response) { return response.type === "ADDRESS" && response.success === true; } Response.isAddress = isAddress; function address(address) { return { type: "ADDRESS", success: true, address, }; } Response.address = address; function isBalance(response) { return response.type === "BALANCE" && response.success === true; } Response.isBalance = isBalance; function balance(balance) { return { type: "BALANCE", success: true, balance, }; } Response.balance = balance; function isCoins(response) { return response.type === "COINS" && response.success === true; } Response.isCoins = isCoins; function coins(coins) { return { type: "COINS", success: true, coins, }; } Response.coins = coins; function isVtxos(response) { return response.type === "VTXOS" && response.success === true; } Response.isVtxos = isVtxos; function vtxos(vtxos) { return { type: "VTXOS", success: true, vtxos, }; } Response.vtxos = vtxos; function isVirtualCoins(response) { return response.type === "VIRTUAL_COINS" && response.success === true; } Response.isVirtualCoins = isVirtualCoins; function virtualCoins(virtualCoins) { return { type: "VIRTUAL_COINS", success: true, virtualCoins, }; } Response.virtualCoins = virtualCoins; function isBoardingUtxos(response) { return response.type === "BOARDING_UTXOS" && response.success === true; } Response.isBoardingUtxos = isBoardingUtxos; function boardingUtxos(boardingUtxos) { return { type: "BOARDING_UTXOS", success: true, boardingUtxos, }; } Response.boardingUtxos = boardingUtxos; function isSendBitcoinSuccess(response) { return (response.type === "SEND_BITCOIN_SUCCESS" && response.success === true); } Response.isSendBitcoinSuccess = isSendBitcoinSuccess; function sendBitcoinSuccess(txid) { return { type: "SEND_BITCOIN_SUCCESS", success: true, txid, }; } Response.sendBitcoinSuccess = sendBitcoinSuccess; function isTransactionHistory(response) { return (response.type === "TRANSACTION_HISTORY" && response.success === true); } Response.isTransactionHistory = isTransactionHistory; function transactionHistory(transactions) { return { type: "TRANSACTION_HISTORY", success: true, transactions, }; } Response.transactionHistory = transactionHistory; function isWalletStatus(response) { return response.type === "WALLET_STATUS" && response.success === true; } Response.isWalletStatus = isWalletStatus; function walletStatus(walletInitialized) { return { type: "WALLET_STATUS", success: true, status: { walletInitialized, }, }; } Response.walletStatus = walletStatus; function isClearResponse(response) { return response.type === "CLEAR_RESPONSE"; } Response.isClearResponse = isClearResponse; function clearResponse(success) { return { type: "CLEAR_RESPONSE", success, }; } Response.clearResponse = clearResponse; })(Response || (exports.Response = Response = {}));