MCPcopy Create free account
hub / github.com/CashScript/cashscript / getUtxos

Method getUtxos

packages/cashscript/src/Contract.ts:87–93  ·  view source on GitHub ↗

* Retrieve all UTXOs (confirmed and unconfirmed) locked at the contract's address. * * @returns A list of UTXOs spendable by this contract.

()

Source from the content-addressed store, hash-verified

85 * @returns A list of UTXOs spendable by this contract.
86 */
87 async getUtxos(): Promise<Utxo[]> {
88 if (this.contractType === 'p2s') {
89 return this.provider.getUtxosForLockingBytecode(this.bytecode);
90 }
91
92 return this.provider.getUtxos(this.address);
93 }
94}
95
96class ContractInternal<

Callers 1

getBalanceMethod · 0.95

Calls 2

getUtxosMethod · 0.65

Tested by

no test coverage detected