UNPKG

bigblocks

Version:

Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React

18 lines 3.75 kB
{ "name": "wallet-types-wallet", "type": "registry:component", "dependencies": [ "@bsv/sdk", "js-1sat-ord" ], "devDependencies": [], "registryDependencies": [], "files": [ { "path": "components/wallet/types/wallet.ts", "type": "registry:component", "content": "// Wallet Types - Core wallet and balance types\nimport type { PrivateKey } from \"@bsv/sdk\";\nimport type { NftUtxo, TokenUtxo, Utxo } from \"js-1sat-ord\";\n\nexport interface WalletConfig {\n\tpaymentKey?: PrivateKey;\n\tordinalKey?: PrivateKey;\n\tchangeAddress?: string;\n\tordinalAddress?: string;\n\tfeeRate?: number;\n}\n\nexport interface BSVBalance {\n\tconfirmed: number;\n\tunconfirmed: number;\n\ttotal: number;\n}\n\nexport interface TokenBalance {\n\tid: string;\n\tsymbol: string;\n\tname?: string;\n\ticon?: string;\n\tdecimals: number;\n\tbalance: {\n\t\tconfirmed: string;\n\t\tunconfirmed: string;\n\t\ttotal: string;\n\t};\n\tlisted: {\n\t\tconfirmed: string;\n\t\tunconfirmed: string;\n\t\ttotal: string;\n\t};\n\tprice?: number;\n\tvalue?: number;\n\ttype: \"bsv20\" | \"bsv21\";\n}\n\nexport interface OrdinalBalance {\n\ttxid: string;\n\tvout: number;\n\torigin: string;\n\tcontentType: string;\n\tcollectionId?: string;\n\tname?: string;\n\tpreview?: string;\n\tlisted?: boolean;\n\tprice?: number;\n}\n\nexport interface WalletBalance {\n\tbsv: BSVBalance;\n\ttokens: TokenBalance[];\n\tordinals: OrdinalBalance[];\n\ttotalValue: {\n\t\tbsv: number;\n\t\tusd: number;\n\t};\n}\n\nexport interface UTXOSet {\n\tpayment: Utxo[];\n\tordinals: NftUtxo[];\n\ttokens: TokenUtxo[];\n\ttotal: {\n\t\tutxos: number;\n\t\tsatoshis: number;\n\t};\n}\n\nexport interface WalletActivity {\n\ttxid: string;\n\ttype: \"send\" | \"receive\" | \"mint\" | \"burn\" | \"list\" | \"buy\" | \"cancel\";\n\tamount?: number;\n\ttoken?: {\n\t\tid: string;\n\t\tsymbol: string;\n\t\tamount: string;\n\t};\n\tordinal?: {\n\t\torigin: string;\n\t\tcontentType: string;\n\t};\n\ttimestamp: number;\n\theight?: number;\n\tstatus: \"confirmed\" | \"unconfirmed\" | \"failed\";\n\tfrom?: string;\n\tto?: string;\n\tfee?: number;\n}\n\nexport interface SendTransactionConfig {\n\tto: string;\n\tamount: number;\n\tmessage?: string;\n\tfeeRate?: number;\n\tbroadcast?: boolean;\n}\n\nexport interface SendTokenConfig {\n\tto: string;\n\ttokenId: string;\n\tamount: string;\n\tmessage?: string;\n\tfeeRate?: number;\n\tbroadcast?: boolean;\n}\n\nexport interface SendOrdinalConfig {\n\tto: string;\n\tordinal: {\n\t\ttxid: string;\n\t\tvout: number;\n\t};\n\tmessage?: string;\n\tfeeRate?: number;\n\tbroadcast?: boolean;\n}\n\nexport interface SendConfig {\n\ttoAddress: string;\n\tsatoshis: number;\n\tmessage?: string;\n\tfeeRate?: number;\n\tbroadcast?: boolean;\n}\n\nexport interface SendResult {\n\ttxid: string;\n\tfee: number;\n\tamount: number;\n\trecipient: string;\n\tmessage?: string;\n\tsize: number;\n}\n\nexport interface ConsolidateConfig {\n\tmaxInputs?: number;\n\tfeeRate?: number;\n\ttargetAddress?: string;\n\tbroadcast?: boolean;\n}\n\nexport interface TransactionResult {\n\ttxid: string;\n\trawTx: string;\n\tfee: number;\n\tsize: number;\n\tinputs: number;\n\toutputs: number;\n}\n\nexport interface WalletError {\n\tcode: string;\n\tmessage: string;\n\tdetails?: Error | Record<string, unknown>;\n}\n\nexport enum WalletErrorCode {\n\tINSUFFICIENT_FUNDS = \"INSUFFICIENT_FUNDS\",\n\tINVALID_ADDRESS = \"INVALID_ADDRESS\",\n\tINVALID_AMOUNT = \"INVALID_AMOUNT\",\n\tTRANSACTION_FAILED = \"TRANSACTION_FAILED\",\n\tBROADCAST_FAILED = \"BROADCAST_FAILED\",\n\tMISSING_UTXOS = \"MISSING_UTXOS\",\n\tMISSING_PRIVATE_KEY = \"MISSING_PRIVATE_KEY\",\n}\n", "target": "<%- config.aliases.components %>/wallet.tsx" } ] }