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

Function isTokenAddress

packages/cashscript/src/utils.ts:189–194  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

187}
188
189function isTokenAddress(address: string): boolean {
190 const result = decodeCashAddress(address);
191 if (typeof result === 'string') throw new Error(result);
192 const supportsTokens = (result.type === 'p2pkhWithTokens' || result.type === 'p2shWithTokens');
193 return supportsTokens;
194}
195
196function getNetworkPrefixForAddress(address: string): string {
197 const result = decodeCashAddress(address);

Callers 1

validateOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected