@secondlayer/stacks 4.0.0 → 4.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/README.md +4 -0
- package/dist/shared/{stacks-zwgsbbb2.cjs → stacks-0nedd34w.cjs} +18 -13
- package/dist/shared/{stacks-zwgsbbb2.cjs.map → stacks-0nedd34w.cjs.map} +7 -6
- package/dist/shared/stacks-1arrcd11.js +48 -0
- package/dist/shared/stacks-1arrcd11.js.map +10 -0
- package/dist/shared/stacks-9mqveyjv.cjs.map +2 -2
- package/dist/shared/{stacks-dr5en54r.cjs → stacks-9qcr921s.cjs} +42 -5
- package/dist/shared/stacks-9qcr921s.cjs.map +10 -0
- package/dist/shared/stacks-enpj9krt.cjs +38 -0
- package/dist/shared/stacks-enpj9krt.cjs.map +10 -0
- package/dist/shared/{stacks-90jcxs98.js → stacks-fb75yew8.js} +8 -6
- package/dist/shared/{stacks-90jcxs98.js.map → stacks-fb75yew8.js.map} +3 -3
- package/dist/shared/{stacks-rw2xbtdv.js → stacks-gxq2pbky.js} +2 -2
- package/dist/shared/{stacks-rw2xbtdv.js.map → stacks-gxq2pbky.js.map} +1 -1
- package/dist/shared/{stacks-jx146qf1.js → stacks-hnqt5rz4.js} +27 -377
- package/dist/shared/stacks-hnqt5rz4.js.map +13 -0
- package/dist/shared/{stacks-z3vztaz1.js → stacks-jpt52csy.js} +3 -3
- package/dist/shared/stacks-jpt52csy.js.map +10 -0
- package/dist/shared/{stacks-thkhfwz8.js → stacks-rndfw2vh.js} +30 -23
- package/dist/shared/{stacks-thkhfwz8.js.map → stacks-rndfw2vh.js.map} +7 -6
- package/dist/shared/{stacks-fse1f76h.js → stacks-rpqtgpyj.js} +42 -8
- package/dist/shared/stacks-rpqtgpyj.js.map +10 -0
- package/dist/shared/{stacks-g2qnr5qn.cjs → stacks-rryme9bv.cjs} +11 -364
- package/dist/shared/stacks-rryme9bv.cjs.map +13 -0
- package/dist/shared/{stacks-byyex2zk.cjs → stacks-ta1gar0b.cjs} +7 -2
- package/dist/shared/{stacks-byyex2zk.cjs.map → stacks-ta1gar0b.cjs.map} +2 -2
- package/dist/shared/stacks-tdsp5gsb.cjs.map +2 -2
- package/dist/shared/stacks-vea7nde7.cjs +731 -0
- package/dist/shared/stacks-vea7nde7.cjs.map +13 -0
- package/dist/shared/stacks-w23294am.js +760 -0
- package/dist/shared/stacks-w23294am.js.map +13 -0
- package/dist/src/accounts/index.d.cts +1 -1
- package/dist/src/accounts/index.d.ts +1 -1
- package/dist/src/actions/index.cjs +2 -1
- package/dist/src/actions/index.cjs.map +1 -1
- package/dist/src/actions/index.d.cts +21 -12
- package/dist/src/actions/index.d.ts +21 -12
- package/dist/src/actions/index.js +9 -6
- package/dist/src/actions/index.js.map +1 -1
- package/dist/src/bitcoin/index.d.cts +29 -29
- package/dist/src/bitcoin/index.d.ts +29 -29
- package/dist/src/bitcoin/index.js +3 -2
- package/dist/src/bitcoin/index.js.map +2 -2
- package/dist/src/bns/index.d.cts +1 -1
- package/dist/src/bns/index.d.ts +1 -1
- package/dist/src/bns/index.js +8 -6
- package/dist/src/bns/index.js.map +2 -2
- package/dist/src/clarity/index.d.cts +37 -1
- package/dist/src/clarity/index.d.ts +37 -1
- package/dist/src/clarity/index.js +14 -2
- package/dist/src/clarity/index.js.map +1 -1
- package/dist/src/index.cjs +2 -1
- package/dist/src/index.cjs.map +4 -4
- package/dist/src/index.d.cts +23 -14
- package/dist/src/index.d.ts +23 -14
- package/dist/src/index.js +8 -5
- package/dist/src/index.js.map +4 -4
- package/dist/src/postconditions/index.d.cts +66 -3
- package/dist/src/postconditions/index.d.ts +66 -3
- package/dist/src/postconditions/index.js +13 -2
- package/dist/src/postconditions/index.js.map +1 -1
- package/dist/src/pox/index.d.cts +1 -1
- package/dist/src/pox/index.d.ts +1 -1
- package/dist/src/pox/index.js +6 -5
- package/dist/src/pox/index.js.map +2 -2
- package/dist/src/pox5/index.cjs +213 -14
- package/dist/src/pox5/index.cjs.map +8 -7
- package/dist/src/pox5/index.d.cts +88 -5
- package/dist/src/pox5/index.d.ts +88 -5
- package/dist/src/pox5/index.js +220 -17
- package/dist/src/pox5/index.js.map +8 -7
- package/dist/src/sbtc/index.d.cts +1 -1
- package/dist/src/sbtc/index.d.ts +1 -1
- package/dist/src/sbtc/index.js +5 -4
- package/dist/src/sbtc/index.js.map +2 -2
- package/dist/src/stackingdao/index.d.cts +1 -1
- package/dist/src/stackingdao/index.d.ts +1 -1
- package/dist/src/stackingdao/index.js +6 -5
- package/dist/src/stackingdao/index.js.map +2 -2
- package/dist/src/subscriptions/index.d.cts +1 -1
- package/dist/src/subscriptions/index.d.ts +1 -1
- package/dist/src/tools/index.cjs +500 -361
- package/dist/src/tools/index.cjs.map +13 -10
- package/dist/src/tools/index.d.cts +1 -1
- package/dist/src/tools/index.d.ts +1 -1
- package/dist/src/tools/index.js +500 -361
- package/dist/src/tools/index.js.map +13 -10
- package/dist/src/transactions/index.cjs +3 -1
- package/dist/src/transactions/index.cjs.map +1 -1
- package/dist/src/transactions/index.d.cts +16 -9
- package/dist/src/transactions/index.d.ts +16 -9
- package/dist/src/transactions/index.js +31 -27
- package/dist/src/transactions/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/shared/stacks-dr5en54r.cjs.map +0 -10
- package/dist/shared/stacks-fse1f76h.js.map +0 -10
- package/dist/shared/stacks-g2qnr5qn.cjs.map +0 -15
- package/dist/shared/stacks-gkf9tsws.js +0 -285
- package/dist/shared/stacks-gkf9tsws.js.map +0 -10
- package/dist/shared/stacks-jx146qf1.js.map +0 -15
- package/dist/shared/stacks-qjgh6pqr.cjs +0 -258
- package/dist/shared/stacks-qjgh6pqr.cjs.map +0 -10
- package/dist/shared/stacks-z3vztaz1.js.map +0 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/transactions/types.ts", "../src/transactions/wire/serialize.ts", "../src/transactions/wire/deserialize.ts", "../src/postconditions/convert.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ClarityValue } from \"../clarity/types.ts\";\n\n// Auth types\nexport const AuthType = {\n\tStandard: 0x04,\n\tSponsored: 0x05,\n} as const;\nexport type AuthType = (typeof AuthType)[keyof typeof AuthType];\n\n// Payload types\nexport const PayloadType = {\n\tTokenTransfer: 0x00,\n\tSmartContract: 0x01,\n\tContractCall: 0x02,\n\tPoisonMicroblock: 0x03,\n\tCoinbase: 0x04,\n\tCoinbaseToAltRecipient: 0x05,\n\tVersionedSmartContract: 0x06,\n\tTenureChange: 0x07,\n\tNakamotoCoinbase: 0x08,\n} as const;\nexport type PayloadType = (typeof PayloadType)[keyof typeof PayloadType];\n\n// Clarity version\nexport const ClarityVersion = {\n\tClarity1: 1,\n\tClarity2: 2,\n\tClarity3: 3,\n\tClarity4: 4,\n\tClarity5: 5,\n\tClarity6: 6, // SIP-044, Epoch 4.0\n} as const;\nexport type ClarityVersion =\n\t(typeof ClarityVersion)[keyof typeof ClarityVersion];\n\n// Anchor mode (deprecated post-Nakamoto, but needed for wire format)\nexport const AnchorMode = {\n\tOnChainOnly: 0x01,\n\tOffChainOnly: 0x02,\n\tAny: 0x03,\n} as const;\nexport type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode];\n\n// Post condition mode\nexport const PostConditionModeWire = {\n\tAllow: 0x01,\n\tDeny: 0x02,\n\tOriginator: 0x03, // SIP-040, Epoch 3.4\n} as const;\nexport type PostConditionModeWire =\n\t(typeof PostConditionModeWire)[keyof typeof PostConditionModeWire];\n\n// Address hash modes\nexport const AddressHashMode = {\n\tP2PKH: 0x00,\n\tP2SH: 0x01,\n\tP2WPKH: 0x02,\n\tP2WSH: 0x03,\n\tP2SH_NonSequential: 0x05, // SIP-027\n\tP2WSH_P2SH_NonSequential: 0x07, // SIP-027\n} as const;\nexport type AddressHashMode =\n\t(typeof AddressHashMode)[keyof typeof AddressHashMode];\n\n// Pub key encoding\nexport const PubKeyEncoding = {\n\tCompressed: 0x00,\n\tUncompressed: 0x01,\n} as const;\nexport type PubKeyEncoding =\n\t(typeof PubKeyEncoding)[keyof typeof PubKeyEncoding];\n\n// Fungible condition codes (wire format)\nexport const FungibleConditionCode = {\n\tEqual: 0x01,\n\tGreater: 0x02,\n\tGreaterEqual: 0x03,\n\tLess: 0x04,\n\tLessEqual: 0x05,\n} as const;\n\n// Non-fungible condition codes (wire format)\nexport const NonFungibleConditionCode = {\n\tSends: 0x10,\n\tDoesNotSend: 0x11,\n\tMaybeSent: 0x12, // SIP-040, Epoch 3.4\n} as const;\n\n// PoX condition codes (wire format, SIP-045)\nexport const PoxConditionCode = {\n\tWillNotPerform: 0x30,\n\tMayPerform: 0x31,\n\tWillPerform: 0x32,\n} as const;\nexport type PoxConditionCode =\n\t(typeof PoxConditionCode)[keyof typeof PoxConditionCode];\n\n// Post condition principal types\nexport const PostConditionPrincipalId = {\n\tOrigin: 0x01,\n\tStandard: 0x02,\n\tContract: 0x03,\n} as const;\n\n// Post condition asset types\nexport const AssetType = {\n\tSTX: 0x00,\n\tFungible: 0x01,\n\tNonFungible: 0x02,\n\tStaking: 0x03, // SIP-045\n\tPox: 0x04, // SIP-045\n} as const;\n\n// Auth field types\nexport const AuthFieldType = {\n\tPublicKeyCompressed: 0x00,\n\tPublicKeyUncompressed: 0x01,\n\tSignatureCompressed: 0x02,\n\tSignatureUncompressed: 0x03,\n} as const;\n\nexport const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65;\nexport const MEMO_MAX_LENGTH_BYTES = 34;\nexport const MAX_STRING_LENGTH_BYTES = 128;\nexport const COINBASE_BYTES_LENGTH = 32;\nexport const VRF_PROOF_BYTES_LENGTH = 80;\nexport const MICROBLOCK_HEADER_BYTES_LENGTH = 132; // 1 + 2 + 32 + 32 + 65\n\n// Tenure change cause\nexport const TenureChangeCause = {\n\tBlockFound: 0x00,\n\tExtended: 0x01,\n\tExtendedRuntime: 0x02,\n\tExtendedReadCount: 0x03,\n\tExtendedReadLength: 0x04,\n\tExtendedWriteCount: 0x05,\n\tExtendedWriteLength: 0x06,\n} as const;\nexport type TenureChangeCause =\n\t(typeof TenureChangeCause)[keyof typeof TenureChangeCause];\n\n// Token transfer payload\nexport type TokenTransferPayload = {\n\tpayloadType: typeof PayloadType.TokenTransfer;\n\trecipient: ClarityValue; // PrincipalCV\n\tamount: bigint;\n\tmemo: string;\n};\n\n// Contract call payload\nexport type ContractCallPayload = {\n\tpayloadType: typeof PayloadType.ContractCall;\n\tcontractAddress: string;\n\tcontractName: string;\n\tfunctionName: string;\n\tfunctionArgs: ClarityValue[];\n};\n\n// Smart contract deploy payload\nexport type SmartContractPayload = {\n\tpayloadType:\n\t\t| typeof PayloadType.SmartContract\n\t\t| typeof PayloadType.VersionedSmartContract;\n\tclarityVersion?: ClarityVersion;\n\tcontractName: string;\n\tcodeBody: string;\n};\n\n// Coinbase payload (appears in every pre-Nakamoto block)\nexport type CoinbasePayload = {\n\tpayloadType: typeof PayloadType.Coinbase;\n\tcoinbaseBuffer: string; // 32 bytes hex\n};\n\n// Coinbase to alt recipient payload\nexport type CoinbaseToAltRecipientPayload = {\n\tpayloadType: typeof PayloadType.CoinbaseToAltRecipient;\n\tcoinbaseBuffer: string; // 32 bytes hex\n\trecipient: ClarityValue; // PrincipalCV\n};\n\n// Poison microblock payload\nexport type PoisonMicroblockPayload = {\n\tpayloadType: typeof PayloadType.PoisonMicroblock;\n\theader1: string; // 132 bytes hex (raw microblock header)\n\theader2: string; // 132 bytes hex (raw microblock header)\n};\n\n// Tenure change payload (Nakamoto)\nexport type TenureChangePayload = {\n\tpayloadType: typeof PayloadType.TenureChange;\n\ttenureConsensusHash: string; // 20 bytes hex\n\tprevTenureConsensusHash: string; // 20 bytes hex\n\tburnViewConsensusHash: string; // 20 bytes hex\n\tpreviousTenureEnd: string; // 32 bytes hex\n\tpreviousTenureBlocks: number; // u32\n\tcause: TenureChangeCause;\n\tpubkeyHash: string; // 20 bytes hex\n};\n\n// Nakamoto coinbase payload\nexport type NakamotoCoinbasePayload = {\n\tpayloadType: typeof PayloadType.NakamotoCoinbase;\n\tcoinbaseBuffer: string; // 32 bytes hex\n\trecipient: ClarityValue | null; // Optional PrincipalCV\n\tvrfProof: string; // 80 bytes hex\n};\n\nexport type TransactionPayload =\n\t| TokenTransferPayload\n\t| ContractCallPayload\n\t| SmartContractPayload\n\t| CoinbasePayload\n\t| CoinbaseToAltRecipientPayload\n\t| PoisonMicroblockPayload\n\t| TenureChangePayload\n\t| NakamotoCoinbasePayload;\n\n// Spending condition\nexport type SingleSigSpendingCondition = {\n\thashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH;\n\tsigner: string; // hash160 hex\n\tnonce: bigint;\n\tfee: bigint;\n\tkeyEncoding: PubKeyEncoding;\n\tsignature: string; // 65-byte recoverable sig hex\n};\n\nexport type TransactionAuthField = {\n\tpubKeyEncoding: PubKeyEncoding;\n\ttype: \"publicKey\" | \"signature\";\n\tdata: string; // hex\n};\n\nexport type MultiSigHashMode =\n\t| typeof AddressHashMode.P2SH\n\t| typeof AddressHashMode.P2WSH\n\t| typeof AddressHashMode.P2SH_NonSequential\n\t| typeof AddressHashMode.P2WSH_P2SH_NonSequential;\n\nexport type MultiSigSpendingCondition = {\n\thashMode: MultiSigHashMode;\n\tsigner: string;\n\tnonce: bigint;\n\tfee: bigint;\n\tfields: TransactionAuthField[];\n\tsignaturesRequired: number;\n};\n\nexport type SpendingCondition =\n\t| SingleSigSpendingCondition\n\t| MultiSigSpendingCondition;\n\nexport type StandardAuthorization = {\n\tauthType: typeof AuthType.Standard;\n\tspendingCondition: SpendingCondition;\n};\n\nexport type SponsoredAuthorization = {\n\tauthType: typeof AuthType.Sponsored;\n\tspendingCondition: SpendingCondition;\n\tsponsorSpendingCondition: SpendingCondition;\n};\n\nexport type Authorization = StandardAuthorization | SponsoredAuthorization;\n\n// Full transaction\nexport type StacksTransaction = {\n\tversion: number;\n\tchainId: number;\n\tauth: Authorization;\n\tanchorMode: AnchorMode;\n\tpostConditionMode: PostConditionModeWire;\n\tpostConditions: PostConditionWire[];\n\tpayload: TransactionPayload;\n\t/** Multi-sig signer metadata — not part of the wire format, preserved\n\t * through serialize/deserialize round-trip for auto-detection. */\n\t_multisig?: { publicKeys: string[] };\n};\n\n// Wire post condition types\nexport type PostConditionWire =\n\t| StxPostConditionWire\n\t| FtPostConditionWire\n\t| NftPostConditionWire\n\t| StakingPostConditionWire\n\t| PoxPostConditionWire;\n\nexport type StxPostConditionWire = {\n\ttype: \"stx\";\n\tprincipal: PostConditionPrincipalWire;\n\tconditionCode: number;\n\tamount: bigint;\n};\n\nexport type FtPostConditionWire = {\n\ttype: \"ft\";\n\tprincipal: PostConditionPrincipalWire;\n\tasset: AssetInfoWire;\n\tconditionCode: number;\n\tamount: bigint;\n};\n\nexport type NftPostConditionWire = {\n\ttype: \"nft\";\n\tprincipal: PostConditionPrincipalWire;\n\tasset: AssetInfoWire;\n\tconditionCode: number;\n\tassetId: ClarityValue;\n};\n\n// SIP-045: gates stake/register-for-bond/stake-update; same shape as STX\nexport type StakingPostConditionWire = {\n\ttype: \"staking\";\n\tprincipal: PostConditionPrincipalWire;\n\tconditionCode: number;\n\tamount: bigint;\n};\n\n// SIP-045: gates non-locking PoX state changes (unstake, announce-l1-early-exit, …); no amount\nexport type PoxPostConditionWire = {\n\ttype: \"pox\";\n\tprincipal: PostConditionPrincipalWire;\n\tconditionCode: PoxConditionCode;\n};\n\nexport type PostConditionPrincipalWire =\n\t| { type: \"origin\" }\n\t| { type: \"standard\"; address: string }\n\t| { type: \"contract\"; address: string; contractName: string };\n\nexport type AssetInfoWire = {\n\taddress: string;\n\tcontractName: string;\n\tassetName: string;\n};\n",
|
|
6
|
+
"import { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport { c32addressDecode } from \"../../utils/c32.ts\";\nimport {\n\tasciiToBytes,\n\tbytesToHex,\n\tconcatBytes,\n\thexToBytes,\n\tintToBytes,\n\tintToHex,\n\tutf8ToBytes,\n\twriteUInt8,\n\twriteUInt16BE,\n\twriteUInt32BE,\n} from \"../../utils/encoding.ts\";\nimport {\n\ttype AssetInfoWire,\n\tAssetType,\n\tAuthType,\n\ttype Authorization,\n\ttype CoinbasePayload,\n\ttype CoinbaseToAltRecipientPayload,\n\tMEMO_MAX_LENGTH_BYTES,\n\ttype MultiSigSpendingCondition,\n\ttype NakamotoCoinbasePayload,\n\tPayloadType,\n\ttype PoisonMicroblockPayload,\n\tPostConditionPrincipalId,\n\ttype PostConditionPrincipalWire,\n\ttype PostConditionWire,\n\ttype SingleSigSpendingCondition,\n\ttype SpendingCondition,\n\ttype StacksTransaction,\n\ttype TenureChangePayload as TenureChangePayloadType,\n\ttype TransactionAuthField,\n\ttype TransactionPayload,\n} from \"../types.ts\";\n\n// Address serialization: version (1 byte) + hash160 (20 bytes)\nfunction serializeAddress(c32Address: string): Uint8Array {\n\tconst [version, hash160] = c32addressDecode(c32Address);\n\treturn concatBytes(new Uint8Array([version]), hexToBytes(hash160));\n}\n\n// LP string: length prefix (n bytes) + content bytes\nfunction serializeLPString(str: string, prefixBytes = 1): Uint8Array {\n\tconst content = utf8ToBytes(str);\n\tconst prefix = hexToBytes(intToHex(content.byteLength, prefixBytes));\n\treturn concatBytes(prefix, content);\n}\n\n// LP string for code body (4-byte prefix)\nfunction serializeLPStringLong(str: string): Uint8Array {\n\treturn serializeLPString(str, 4);\n}\n\n// Memo: flat 34-byte field (no length prefix) per SIP-005\nfunction serializeMemo(memo: string): Uint8Array {\n\tconst content = asciiToBytes(memo);\n\tconst padded = new Uint8Array(MEMO_MAX_LENGTH_BYTES);\n\tpadded.set(content.slice(0, MEMO_MAX_LENGTH_BYTES));\n\treturn padded;\n}\n\nfunction serializeSpendingCondition(condition: SpendingCondition): Uint8Array {\n\tconst parts: Uint8Array[] = [\n\t\twriteUInt8(condition.hashMode),\n\t\thexToBytes(condition.signer), // 20 bytes\n\t\tintToBytes(condition.nonce, 8),\n\t\tintToBytes(condition.fee, 8),\n\t];\n\n\tif (\"signature\" in condition) {\n\t\t// Single sig\n\t\tconst sc = condition as SingleSigSpendingCondition;\n\t\tparts.push(writeUInt8(sc.keyEncoding));\n\t\tparts.push(hexToBytes(sc.signature)); // 65 bytes\n\t} else {\n\t\t// Multi sig\n\t\tconst mc = condition as MultiSigSpendingCondition;\n\t\t// Fields as LP list\n\t\tparts.push(writeUInt32BE(mc.fields.length));\n\t\tfor (const field of mc.fields) {\n\t\t\tparts.push(serializeAuthField(field));\n\t\t}\n\t\tparts.push(writeUInt16BE(mc.signaturesRequired));\n\t}\n\n\treturn concatBytes(...parts);\n}\n\nfunction serializeAuthField(field: TransactionAuthField): Uint8Array {\n\tif (field.type === \"publicKey\") {\n\t\tconst typeId = field.pubKeyEncoding === 0x00 ? 0x00 : 0x01;\n\t\treturn concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n\t}\n\tconst typeId = field.pubKeyEncoding === 0x00 ? 0x02 : 0x03;\n\treturn concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n}\n\nfunction serializeAuthorization(auth: Authorization): Uint8Array {\n\tconst parts: Uint8Array[] = [writeUInt8(auth.authType)];\n\tparts.push(serializeSpendingCondition(auth.spendingCondition));\n\tif (auth.authType === AuthType.Sponsored) {\n\t\tparts.push(serializeSpendingCondition(auth.sponsorSpendingCondition));\n\t}\n\treturn concatBytes(...parts);\n}\n\nfunction serializePrincipal(principal: PostConditionPrincipalWire): Uint8Array {\n\tswitch (principal.type) {\n\t\tcase \"origin\":\n\t\t\treturn writeUInt8(PostConditionPrincipalId.Origin);\n\t\tcase \"standard\":\n\t\t\treturn concatBytes(\n\t\t\t\twriteUInt8(PostConditionPrincipalId.Standard),\n\t\t\t\tserializeAddress(principal.address),\n\t\t\t);\n\t\tcase \"contract\":\n\t\t\treturn concatBytes(\n\t\t\t\twriteUInt8(PostConditionPrincipalId.Contract),\n\t\t\t\tserializeAddress(principal.address),\n\t\t\t\tserializeLPString(principal.contractName),\n\t\t\t);\n\t}\n}\n\nfunction serializeAssetInfo(asset: AssetInfoWire): Uint8Array {\n\treturn concatBytes(\n\t\tserializeAddress(asset.address),\n\t\tserializeLPString(asset.contractName),\n\t\tserializeLPString(asset.assetName),\n\t);\n}\n\nexport function serializePostConditionWire(pc: PostConditionWire): Uint8Array {\n\t// Wire order: asset_type first, then principal (per SIP-005)\n\tconst parts: Uint8Array[] = [];\n\n\tswitch (pc.type) {\n\t\tcase \"stx\":\n\t\t\tparts.push(writeUInt8(AssetType.STX));\n\t\t\tparts.push(serializePrincipal(pc.principal));\n\t\t\tparts.push(writeUInt8(pc.conditionCode));\n\t\t\tparts.push(intToBytes(pc.amount, 8));\n\t\t\tbreak;\n\t\tcase \"ft\":\n\t\t\tparts.push(writeUInt8(AssetType.Fungible));\n\t\t\tparts.push(serializePrincipal(pc.principal));\n\t\t\tparts.push(serializeAssetInfo(pc.asset));\n\t\t\tparts.push(writeUInt8(pc.conditionCode));\n\t\t\tparts.push(intToBytes(pc.amount, 8));\n\t\t\tbreak;\n\t\tcase \"nft\":\n\t\t\tparts.push(writeUInt8(AssetType.NonFungible));\n\t\t\tparts.push(serializePrincipal(pc.principal));\n\t\t\tparts.push(serializeAssetInfo(pc.asset));\n\t\t\tparts.push(serializeCVBytes(pc.assetId));\n\t\t\tparts.push(writeUInt8(pc.conditionCode));\n\t\t\tbreak;\n\t\tcase \"staking\":\n\t\t\t// SIP-045: same body as STX (fungible condition code + amount)\n\t\t\tparts.push(writeUInt8(AssetType.Staking));\n\t\t\tparts.push(serializePrincipal(pc.principal));\n\t\t\tparts.push(writeUInt8(pc.conditionCode));\n\t\t\tparts.push(intToBytes(pc.amount, 8));\n\t\t\tbreak;\n\t\tcase \"pox\":\n\t\t\t// SIP-045: PoX condition code only, no amount\n\t\t\tparts.push(writeUInt8(AssetType.Pox));\n\t\t\tparts.push(serializePrincipal(pc.principal));\n\t\t\tparts.push(writeUInt8(pc.conditionCode));\n\t\t\tbreak;\n\t}\n\n\treturn concatBytes(...parts);\n}\n\nfunction serializePostConditions(pcs: PostConditionWire[]): Uint8Array {\n\tconst parts: Uint8Array[] = [writeUInt32BE(pcs.length)];\n\tfor (const pc of pcs) parts.push(serializePostConditionWire(pc));\n\treturn concatBytes(...parts);\n}\n\nexport function serializePayload(payload: TransactionPayload): Uint8Array {\n\tconst parts: Uint8Array[] = [writeUInt8(payload.payloadType)];\n\n\tswitch (payload.payloadType) {\n\t\tcase PayloadType.TokenTransfer:\n\t\t\tparts.push(serializeCVBytes(payload.recipient));\n\t\t\tparts.push(intToBytes(payload.amount, 8));\n\t\t\tparts.push(serializeMemo(payload.memo));\n\t\t\tbreak;\n\n\t\tcase PayloadType.ContractCall:\n\t\t\tparts.push(serializeAddress(payload.contractAddress));\n\t\t\tparts.push(serializeLPString(payload.contractName));\n\t\t\tparts.push(serializeLPString(payload.functionName));\n\t\t\tparts.push(writeUInt32BE(payload.functionArgs.length));\n\t\t\tfor (const arg of payload.functionArgs) {\n\t\t\t\tparts.push(serializeCVBytes(arg));\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase PayloadType.SmartContract:\n\t\t\tparts.push(serializeLPString(payload.contractName));\n\t\t\tparts.push(serializeLPStringLong(payload.codeBody));\n\t\t\tbreak;\n\n\t\tcase PayloadType.VersionedSmartContract:\n\t\t\tparts.push(writeUInt8(payload.clarityVersion ?? 2));\n\t\t\tparts.push(serializeLPString(payload.contractName));\n\t\t\tparts.push(serializeLPStringLong(payload.codeBody));\n\t\t\tbreak;\n\n\t\tcase PayloadType.Coinbase:\n\t\t\tparts.push(hexToBytes((payload as CoinbasePayload).coinbaseBuffer));\n\t\t\tbreak;\n\n\t\tcase PayloadType.CoinbaseToAltRecipient: {\n\t\t\tconst cbAlt = payload as CoinbaseToAltRecipientPayload;\n\t\t\tparts.push(hexToBytes(cbAlt.coinbaseBuffer));\n\t\t\tparts.push(serializeCVBytes(cbAlt.recipient));\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PayloadType.PoisonMicroblock: {\n\t\t\tconst pm = payload as PoisonMicroblockPayload;\n\t\t\tparts.push(hexToBytes(pm.header1));\n\t\t\tparts.push(hexToBytes(pm.header2));\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PayloadType.TenureChange: {\n\t\t\tconst tc = payload as TenureChangePayloadType;\n\t\t\tparts.push(hexToBytes(tc.tenureConsensusHash));\n\t\t\tparts.push(hexToBytes(tc.prevTenureConsensusHash));\n\t\t\tparts.push(hexToBytes(tc.burnViewConsensusHash));\n\t\t\tparts.push(hexToBytes(tc.previousTenureEnd));\n\t\t\tparts.push(writeUInt32BE(tc.previousTenureBlocks));\n\t\t\tparts.push(writeUInt8(tc.cause));\n\t\t\tparts.push(hexToBytes(tc.pubkeyHash));\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PayloadType.NakamotoCoinbase: {\n\t\t\tconst nc = payload as NakamotoCoinbasePayload;\n\t\t\tparts.push(hexToBytes(nc.coinbaseBuffer));\n\t\t\tif (nc.recipient) {\n\t\t\t\tparts.push(serializeCVBytes({ type: \"some\", value: nc.recipient }));\n\t\t\t} else {\n\t\t\t\tparts.push(serializeCVBytes({ type: \"none\" }));\n\t\t\t}\n\t\t\tparts.push(hexToBytes(nc.vrfProof));\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn concatBytes(...parts);\n}\n\n// Memoization cache: transactions are immutable in practice (fields are set\n// once during build/signing), so the serialized bytes for a given transaction\n// object never change. The signing flow serializes the same object several\n// times (txid, sighash, sponsor sighash); caching avoids that redundant work.\n// Any in-place mutation MUST call clearTxCache — see setUnsignedFee.\nconst _txCache = new WeakMap<StacksTransaction, Uint8Array>();\n\n/** Invalidate the memoized serialization of a mutated transaction */\nexport function clearTxCache(tx: StacksTransaction): void {\n\t_txCache.delete(tx);\n}\n\nexport function serializeTransaction(tx: StacksTransaction): Uint8Array {\n\tconst cached = _txCache.get(tx);\n\tif (cached) return cached;\n\tconst bytes = concatBytes(\n\t\twriteUInt8(tx.version),\n\t\twriteUInt32BE(tx.chainId),\n\t\tserializeAuthorization(tx.auth),\n\t\twriteUInt8(tx.anchorMode),\n\t\twriteUInt8(tx.postConditionMode),\n\t\tserializePostConditions(tx.postConditions),\n\t\tserializePayload(tx.payload),\n\t);\n\t_txCache.set(tx, bytes);\n\treturn bytes;\n}\n\nexport function serializeTransactionHex(tx: StacksTransaction): string {\n\treturn bytesToHex(serializeTransaction(tx));\n}\n\n/** Serialize a transaction, returning the wire bytes plus the out-of-band\n * `_multisig` metadata so callers can preserve it across a round-trip\n * (the wire format itself does not carry it). */\nexport function serializeTransactionWithMeta(tx: StacksTransaction): {\n\tbytes: Uint8Array;\n\t_multisig?: { publicKeys: string[] };\n} {\n\treturn { bytes: serializeTransaction(tx), _multisig: tx._multisig };\n}\n",
|
|
7
|
+
"import {\n\treadAddress,\n\treadCV,\n\treadLPString,\n} from \"../../clarity/deserialize.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { BytesReader } from \"../../utils/bytes-reader.ts\";\nimport {\n\tbytesToAscii,\n\tbytesToHex,\n\thexToBytes,\n\twithout0x,\n} from \"../../utils/encoding.ts\";\nimport {\n\tAddressHashMode,\n\ttype AnchorMode,\n\ttype AssetInfoWire,\n\tAssetType,\n\tAuthType,\n\ttype Authorization,\n\tCOINBASE_BYTES_LENGTH,\n\ttype ClarityVersion,\n\tMEMO_MAX_LENGTH_BYTES,\n\tMICROBLOCK_HEADER_BYTES_LENGTH,\n\tPayloadType,\n\ttype PostConditionModeWire,\n\tPostConditionPrincipalId,\n\ttype PostConditionPrincipalWire,\n\ttype PostConditionWire,\n\ttype PoxConditionCode,\n\tRECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n\ttype SpendingCondition,\n\ttype StacksTransaction,\n\ttype TenureChangeCause,\n\ttype TransactionAuthField,\n\ttype TransactionPayload,\n\tVRF_PROOF_BYTES_LENGTH,\n} from \"../types.ts\";\n\nfunction readSpendingCondition(r: BytesReader): SpendingCondition {\n\tconst hashMode = r.readUInt8();\n\tconst signer = bytesToHex(r.readBytes(20));\n\tconst nonce = r.readBigUInt64BE();\n\tconst fee = r.readBigUInt64BE();\n\n\tif (\n\t\thashMode === AddressHashMode.P2PKH ||\n\t\thashMode === AddressHashMode.P2WPKH\n\t) {\n\t\tconst keyEncoding = r.readUInt8();\n\t\tconst signature = bytesToHex(\n\t\t\tr.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES),\n\t\t);\n\t\treturn {\n\t\t\thashMode,\n\t\t\tsigner,\n\t\t\tnonce,\n\t\t\tfee,\n\t\t\tkeyEncoding,\n\t\t\tsignature,\n\t\t} as SpendingCondition;\n\t}\n\n\tconst fieldCount = r.readUInt32BE();\n\tconst fields: TransactionAuthField[] = [];\n\tfor (let i = 0; i < fieldCount; i++) {\n\t\tconst fieldType = r.readUInt8();\n\t\tif (fieldType <= 0x01) {\n\t\t\tconst keyLen = fieldType === 0x00 ? 33 : 65;\n\t\t\tfields.push({\n\t\t\t\ttype: \"publicKey\",\n\t\t\t\tpubKeyEncoding: fieldType as 0x00 | 0x01,\n\t\t\t\tdata: bytesToHex(r.readBytes(keyLen)),\n\t\t\t});\n\t\t} else {\n\t\t\tfields.push({\n\t\t\t\ttype: \"signature\",\n\t\t\t\tpubKeyEncoding: (fieldType === 0x02 ? 0x00 : 0x01) as 0x00 | 0x01,\n\t\t\t\tdata: bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES)),\n\t\t\t});\n\t\t}\n\t}\n\tconst signaturesRequired = r.readUInt16BE();\n\n\treturn {\n\t\thashMode,\n\t\tsigner,\n\t\tnonce,\n\t\tfee,\n\t\tfields,\n\t\tsignaturesRequired,\n\t} as SpendingCondition;\n}\n\nfunction readAuthorization(r: BytesReader): Authorization {\n\tconst authType = r.readUInt8();\n\tconst spendingCondition = readSpendingCondition(r);\n\n\tif (authType === AuthType.Standard) {\n\t\treturn { authType: AuthType.Standard, spendingCondition };\n\t}\n\n\tconst sponsorSpendingCondition = readSpendingCondition(r);\n\treturn {\n\t\tauthType: AuthType.Sponsored,\n\t\tspendingCondition,\n\t\tsponsorSpendingCondition,\n\t};\n}\n\nfunction readAssetInfo(r: BytesReader): AssetInfoWire {\n\treturn {\n\t\taddress: readAddress(r),\n\t\tcontractName: readLPString(r),\n\t\tassetName: readLPString(r),\n\t};\n}\n\nfunction readPostConditionPrincipal(\n\tr: BytesReader,\n): PostConditionPrincipalWire {\n\tconst type = r.readUInt8();\n\tswitch (type) {\n\t\tcase PostConditionPrincipalId.Origin:\n\t\t\treturn { type: \"origin\" };\n\t\tcase PostConditionPrincipalId.Standard:\n\t\t\treturn { type: \"standard\", address: readAddress(r) };\n\t\tcase PostConditionPrincipalId.Contract:\n\t\t\treturn {\n\t\t\t\ttype: \"contract\",\n\t\t\t\taddress: readAddress(r),\n\t\t\t\tcontractName: readLPString(r),\n\t\t\t};\n\t\tdefault:\n\t\t\t// Some legacy transactions may have unexpected principal types.\n\t\t\t// Treat as origin to allow deserialization to continue.\n\t\t\treturn { type: \"origin\" };\n\t}\n}\n\nfunction readPostCondition(r: BytesReader): PostConditionWire {\n\t// Wire order: asset_type, then principal (per SIP-005 and stacks.js)\n\tconst assetType = r.readUInt8();\n\tconst principal = readPostConditionPrincipal(r);\n\tswitch (assetType) {\n\t\tcase AssetType.STX:\n\t\t\treturn {\n\t\t\t\ttype: \"stx\",\n\t\t\t\tprincipal,\n\t\t\t\tconditionCode: r.readUInt8(),\n\t\t\t\tamount: r.readBigUInt64BE(),\n\t\t\t};\n\t\tcase AssetType.Fungible:\n\t\t\treturn {\n\t\t\t\ttype: \"ft\",\n\t\t\t\tprincipal,\n\t\t\t\tasset: readAssetInfo(r),\n\t\t\t\tconditionCode: r.readUInt8(),\n\t\t\t\tamount: r.readBigUInt64BE(),\n\t\t\t};\n\t\tcase AssetType.NonFungible:\n\t\t\treturn {\n\t\t\t\ttype: \"nft\",\n\t\t\t\tprincipal,\n\t\t\t\tasset: readAssetInfo(r),\n\t\t\t\tassetId: readCV(r),\n\t\t\t\tconditionCode: r.readUInt8(),\n\t\t\t};\n\t\tcase AssetType.Staking:\n\t\t\treturn {\n\t\t\t\ttype: \"staking\",\n\t\t\t\tprincipal,\n\t\t\t\tconditionCode: r.readUInt8(),\n\t\t\t\tamount: r.readBigUInt64BE(),\n\t\t\t};\n\t\tcase AssetType.Pox:\n\t\t\treturn {\n\t\t\t\ttype: \"pox\",\n\t\t\t\tprincipal,\n\t\t\t\tconditionCode: r.readUInt8() as PoxConditionCode,\n\t\t\t};\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t`Unknown post-condition asset type: 0x${assetType.toString(16).padStart(2, \"0\")}`,\n\t\t\t);\n\t}\n}\n\nfunction readPostConditions(r: BytesReader): PostConditionWire[] {\n\tconst count = r.readUInt32BE();\n\tconst pcs: PostConditionWire[] = [];\n\tfor (let i = 0; i < count; i++) {\n\t\ttry {\n\t\t\tpcs.push(readPostCondition(r));\n\t\t} catch (e) {\n\t\t\tif (\n\t\t\t\te instanceof Error &&\n\t\t\t\te.message.startsWith(\"Unknown post-condition asset type:\")\n\t\t\t) {\n\t\t\t\tthrow new Error(`${e.message} (post-condition ${i + 1}/${count})`);\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}\n\treturn pcs;\n}\n\nfunction readPayload(r: BytesReader): TransactionPayload {\n\tconst payloadType = r.readUInt8();\n\n\tswitch (payloadType) {\n\t\tcase PayloadType.TokenTransfer: {\n\t\t\tconst recipient = readCV(r);\n\t\t\tconst amount = r.readBigUInt64BE();\n\t\t\t// Memo is a flat 34-byte field (no length prefix) per SIP-005\n\t\t\tconst memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES);\n\t\t\tconst memo = bytesToAscii(memoBytes).replace(/\\0+$/, \"\");\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.TokenTransfer,\n\t\t\t\trecipient,\n\t\t\t\tamount,\n\t\t\t\tmemo,\n\t\t\t};\n\t\t}\n\t\tcase PayloadType.ContractCall: {\n\t\t\tconst contractAddress = readAddress(r);\n\t\t\tconst contractName = readLPString(r);\n\t\t\tconst functionName = readLPString(r);\n\t\t\tconst numArgs = r.readUInt32BE();\n\t\t\tconst functionArgs: ClarityValue[] = [];\n\t\t\tfor (let i = 0; i < numArgs; i++) functionArgs.push(readCV(r));\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.ContractCall,\n\t\t\t\tcontractAddress,\n\t\t\t\tcontractName,\n\t\t\t\tfunctionName,\n\t\t\t\tfunctionArgs,\n\t\t\t};\n\t\t}\n\t\tcase PayloadType.SmartContract: {\n\t\t\tconst contractName = readLPString(r);\n\t\t\tconst codeBody = readLPString(r, 4);\n\t\t\treturn { payloadType: PayloadType.SmartContract, contractName, codeBody };\n\t\t}\n\t\tcase PayloadType.VersionedSmartContract: {\n\t\t\tconst clarityVersion = r.readUInt8() as ClarityVersion;\n\t\t\tconst contractName = readLPString(r);\n\t\t\tconst codeBody = readLPString(r, 4);\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.VersionedSmartContract,\n\t\t\t\tclarityVersion,\n\t\t\t\tcontractName,\n\t\t\t\tcodeBody,\n\t\t\t};\n\t\t}\n\t\tcase PayloadType.Coinbase: {\n\t\t\tconst coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n\t\t\treturn { payloadType: PayloadType.Coinbase, coinbaseBuffer };\n\t\t}\n\t\tcase PayloadType.CoinbaseToAltRecipient: {\n\t\t\tconst coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n\t\t\tconst recipient = readCV(r);\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.CoinbaseToAltRecipient,\n\t\t\t\tcoinbaseBuffer,\n\t\t\t\trecipient,\n\t\t\t};\n\t\t}\n\t\tcase PayloadType.PoisonMicroblock: {\n\t\t\tconst header1 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));\n\t\t\tconst header2 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));\n\t\t\treturn { payloadType: PayloadType.PoisonMicroblock, header1, header2 };\n\t\t}\n\t\tcase PayloadType.TenureChange: {\n\t\t\tconst tenureConsensusHash = bytesToHex(r.readBytes(20));\n\t\t\tconst prevTenureConsensusHash = bytesToHex(r.readBytes(20));\n\t\t\tconst burnViewConsensusHash = bytesToHex(r.readBytes(20));\n\t\t\tconst previousTenureEnd = bytesToHex(r.readBytes(32));\n\t\t\tconst previousTenureBlocks = r.readUInt32BE();\n\t\t\tconst cause = r.readUInt8() as TenureChangeCause;\n\t\t\tconst pubkeyHash = bytesToHex(r.readBytes(20));\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.TenureChange,\n\t\t\t\ttenureConsensusHash,\n\t\t\t\tprevTenureConsensusHash,\n\t\t\t\tburnViewConsensusHash,\n\t\t\t\tpreviousTenureEnd,\n\t\t\t\tpreviousTenureBlocks,\n\t\t\t\tcause,\n\t\t\t\tpubkeyHash,\n\t\t\t};\n\t\t}\n\t\tcase PayloadType.NakamotoCoinbase: {\n\t\t\tconst coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n\t\t\tconst optionalCV = readCV(r);\n\t\t\tconst recipient =\n\t\t\t\toptionalCV.type === \"none\"\n\t\t\t\t\t? null\n\t\t\t\t\t: optionalCV.type === \"some\"\n\t\t\t\t\t\t? optionalCV.value\n\t\t\t\t\t\t: optionalCV;\n\t\t\tconst vrfProof = bytesToHex(r.readBytes(VRF_PROOF_BYTES_LENGTH));\n\t\t\treturn {\n\t\t\t\tpayloadType: PayloadType.NakamotoCoinbase,\n\t\t\t\tcoinbaseBuffer,\n\t\t\t\trecipient,\n\t\t\t\tvrfProof,\n\t\t\t};\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown payload type: ${payloadType}`);\n\t}\n}\n\nexport function deserializePostConditionWire(\n\tinput: string | Uint8Array,\n): PostConditionWire {\n\tconst bytes =\n\t\ttypeof input === \"string\" ? hexToBytes(without0x(input)) : input;\n\treturn readPostCondition(new BytesReader(bytes));\n}\n\nexport function deserializeTransaction(\n\tinput: string | Uint8Array,\n\tmeta?: { _multisig?: { publicKeys: string[] } },\n): StacksTransaction {\n\tconst bytes =\n\t\ttypeof input === \"string\" ? hexToBytes(without0x(input)) : input;\n\tconst r = new BytesReader(bytes);\n\n\tconst tx: StacksTransaction = {\n\t\tversion: r.readUInt8(),\n\t\tchainId: r.readUInt32BE(),\n\t\tauth: readAuthorization(r),\n\t\tanchorMode: r.readUInt8() as AnchorMode,\n\t\tpostConditionMode: r.readUInt8() as PostConditionModeWire,\n\t\tpostConditions: readPostConditions(r),\n\t\tpayload: readPayload(r),\n\t};\n\tif (meta?._multisig) {\n\t\ttx._multisig = meta._multisig;\n\t}\n\treturn tx;\n}\n",
|
|
8
|
+
"import {\n\tFungibleConditionCode,\n\tNonFungibleConditionCode,\n\ttype PostConditionPrincipalWire,\n\ttype PostConditionWire,\n\tPoxConditionCode,\n} from \"../transactions/types.ts\";\nimport { deserializePostConditionWire } from \"../transactions/wire/deserialize.ts\";\nimport { serializePostConditionWire } from \"../transactions/wire/serialize.ts\";\nimport { parseContractId } from \"../utils/address.ts\";\nimport {\n\ttype IntegerType,\n\tbytesToHex,\n\tintToBigInt,\n} from \"../utils/encoding.ts\";\nimport type {\n\tFungibleComparator,\n\tNonFungibleComparator,\n\tPostCondition,\n\tPoxComparator,\n} from \"./types.ts\";\n\nconst MAX_U64 = 18446744073709551615n; // 2^64 - 1\n\n/** Parse a PC amount; throw if outside the u64 the wire can carry. */\nexport function parsePostConditionAmount(amount: IntegerType): bigint {\n\tconst value = intToBigInt(amount);\n\tif (value < 0n || value > MAX_U64) {\n\t\tthrow new RangeError(\n\t\t\t`Post-condition amount must be between 0 and ${MAX_U64} (u64 max), received: ${value}`,\n\t\t);\n\t}\n\treturn value;\n}\n\nexport const FUNGIBLE_CODE_MAP: Record<FungibleComparator, number> = {\n\teq: FungibleConditionCode.Equal,\n\tgt: FungibleConditionCode.Greater,\n\tgte: FungibleConditionCode.GreaterEqual,\n\tlt: FungibleConditionCode.Less,\n\tlte: FungibleConditionCode.LessEqual,\n};\n\nconst FUNGIBLE_CODE_REVERSE: Record<number, FungibleComparator> = {\n\t[FungibleConditionCode.Equal]: \"eq\",\n\t[FungibleConditionCode.Greater]: \"gt\",\n\t[FungibleConditionCode.GreaterEqual]: \"gte\",\n\t[FungibleConditionCode.Less]: \"lt\",\n\t[FungibleConditionCode.LessEqual]: \"lte\",\n};\n\nexport const NFT_CODE_MAP: Record<NonFungibleComparator, number> = {\n\tsent: NonFungibleConditionCode.Sends,\n\t\"not-sent\": NonFungibleConditionCode.DoesNotSend,\n\t\"maybe-sent\": NonFungibleConditionCode.MaybeSent,\n};\n\nconst NFT_CODE_REVERSE: Record<number, NonFungibleComparator> = {\n\t[NonFungibleConditionCode.Sends]: \"sent\",\n\t[NonFungibleConditionCode.DoesNotSend]: \"not-sent\",\n\t[NonFungibleConditionCode.MaybeSent]: \"maybe-sent\",\n};\n\nexport const POX_CODE_MAP: Record<PoxComparator, PoxConditionCode> = {\n\t\"will-not-perform\": PoxConditionCode.WillNotPerform,\n\t\"may-perform\": PoxConditionCode.MayPerform,\n\t\"will-perform\": PoxConditionCode.WillPerform,\n};\n\nconst POX_CODE_REVERSE: Record<number, PoxComparator> = {\n\t[PoxConditionCode.WillNotPerform]: \"will-not-perform\",\n\t[PoxConditionCode.MayPerform]: \"may-perform\",\n\t[PoxConditionCode.WillPerform]: \"will-perform\",\n};\n\nexport function resolvePrincipal(address: string): PostConditionPrincipalWire {\n\tif (address === \"origin\") return { type: \"origin\" };\n\tconst [addr, name] = address.split(\".\");\n\tif (name) {\n\t\t// biome-ignore lint/style/noNonNullAssertion: split yields address when name is present\n\t\treturn { type: \"contract\", address: addr!, contractName: name };\n\t}\n\t// biome-ignore lint/style/noNonNullAssertion: address is the whole string\n\treturn { type: \"standard\", address: addr! };\n}\n\nfunction principalToString(principal: PostConditionPrincipalWire): string {\n\tif (principal.type === \"origin\") return \"origin\";\n\tif (principal.type === \"contract\") {\n\t\treturn `${principal.address}.${principal.contractName}`;\n\t}\n\treturn principal.address;\n}\n\nfunction assetToString(asset: {\n\taddress: string;\n\tcontractName: string;\n\tassetName: string;\n}): string {\n\treturn `${asset.address}.${asset.contractName}::${asset.assetName}`;\n}\n\nfunction parseAsset(asset: string): {\n\taddress: string;\n\tcontractName: string;\n\tassetName: string;\n} {\n\tconst [contractId, tokenName] = asset.split(\"::\");\n\t// biome-ignore lint/style/noNonNullAssertion: callers validate `::` form\n\tconst [addr, name] = parseContractId(contractId!);\n\t// biome-ignore lint/style/noNonNullAssertion: split of `addr.contract::token`\n\treturn { address: addr, contractName: name, assetName: tokenName! };\n}\n\nexport function convertPostCondition(pc: PostCondition): PostConditionWire {\n\tswitch (pc.type) {\n\t\tcase \"stx-postcondition\":\n\t\t\treturn {\n\t\t\t\ttype: \"stx\",\n\t\t\t\tprincipal: resolvePrincipal(pc.address),\n\t\t\t\tconditionCode: FUNGIBLE_CODE_MAP[pc.condition],\n\t\t\t\tamount: parsePostConditionAmount(pc.amount),\n\t\t\t};\n\t\tcase \"ft-postcondition\":\n\t\t\treturn {\n\t\t\t\ttype: \"ft\",\n\t\t\t\tprincipal: resolvePrincipal(pc.address),\n\t\t\t\tasset: parseAsset(pc.asset),\n\t\t\t\tconditionCode: FUNGIBLE_CODE_MAP[pc.condition],\n\t\t\t\tamount: parsePostConditionAmount(pc.amount),\n\t\t\t};\n\t\tcase \"nft-postcondition\":\n\t\t\treturn {\n\t\t\t\ttype: \"nft\",\n\t\t\t\tprincipal: resolvePrincipal(pc.address),\n\t\t\t\tasset: parseAsset(pc.asset),\n\t\t\t\tconditionCode: NFT_CODE_MAP[pc.condition],\n\t\t\t\tassetId: pc.assetId,\n\t\t\t};\n\t\tcase \"staking-postcondition\":\n\t\t\treturn {\n\t\t\t\ttype: \"staking\",\n\t\t\t\tprincipal: resolvePrincipal(pc.address),\n\t\t\t\tconditionCode: FUNGIBLE_CODE_MAP[pc.condition],\n\t\t\t\tamount: parsePostConditionAmount(pc.amount),\n\t\t\t};\n\t\tcase \"pox-postcondition\":\n\t\t\treturn {\n\t\t\t\ttype: \"pox\",\n\t\t\t\tprincipal: resolvePrincipal(pc.address),\n\t\t\t\tconditionCode: POX_CODE_MAP[pc.condition],\n\t\t\t};\n\t}\n}\n\nexport function wireToPostCondition(wire: PostConditionWire): PostCondition {\n\tswitch (wire.type) {\n\t\tcase \"stx\":\n\t\t\treturn {\n\t\t\t\ttype: \"stx-postcondition\",\n\t\t\t\taddress: principalToString(wire.principal),\n\t\t\t\tcondition: fungibleName(wire.conditionCode),\n\t\t\t\tamount: wire.amount.toString(),\n\t\t\t};\n\t\tcase \"ft\":\n\t\t\treturn {\n\t\t\t\ttype: \"ft-postcondition\",\n\t\t\t\taddress: principalToString(wire.principal),\n\t\t\t\tcondition: fungibleName(wire.conditionCode),\n\t\t\t\tamount: wire.amount.toString(),\n\t\t\t\tasset: assetToString(wire.asset),\n\t\t\t};\n\t\tcase \"nft\":\n\t\t\treturn {\n\t\t\t\ttype: \"nft-postcondition\",\n\t\t\t\taddress: principalToString(wire.principal),\n\t\t\t\tcondition: nftName(wire.conditionCode),\n\t\t\t\tasset: assetToString(wire.asset),\n\t\t\t\tassetId: wire.assetId,\n\t\t\t};\n\t\tcase \"staking\":\n\t\t\treturn {\n\t\t\t\ttype: \"staking-postcondition\",\n\t\t\t\taddress: principalToString(wire.principal),\n\t\t\t\tcondition: fungibleName(wire.conditionCode),\n\t\t\t\tamount: wire.amount.toString(),\n\t\t\t};\n\t\tcase \"pox\":\n\t\t\treturn {\n\t\t\t\ttype: \"pox-postcondition\",\n\t\t\t\taddress: principalToString(wire.principal),\n\t\t\t\tcondition: poxName(wire.conditionCode),\n\t\t\t};\n\t}\n}\n\nfunction fungibleName(code: number): FungibleComparator {\n\tconst name = FUNGIBLE_CODE_REVERSE[code];\n\tif (!name) throw new Error(`Unknown fungible post-condition code: ${code}`);\n\treturn name;\n}\n\nfunction nftName(code: number): NonFungibleComparator {\n\tconst name = NFT_CODE_REVERSE[code];\n\tif (!name) throw new Error(`Unknown nft post-condition code: ${code}`);\n\treturn name;\n}\n\nfunction poxName(code: number): PoxComparator {\n\tconst name = POX_CODE_REVERSE[code];\n\tif (!name) throw new Error(`Unknown pox post-condition code: ${code}`);\n\treturn name;\n}\n\n/** Decode a serialized post-condition (stacks.js `Pc.fromHex`). */\nexport function fromHex(hex: string): PostCondition {\n\treturn wireToPostCondition(deserializePostConditionWire(hex));\n}\n\n/** Encode a post-condition to hex (stacks.js `postConditionToHex`). */\nexport function postConditionToHex(pc: PostCondition): string {\n\treturn bytesToHex(serializePostConditionWire(convertPostCondition(pc)));\n}\n"
|
|
9
|
+
],
|
|
10
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,WAAW;AAAA,EACvB,UAAU;AAAA,EACV,WAAW;AACZ;AAIO,IAAM,cAAc;AAAA,EAC1B,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,cAAc;AAAA,EACd,kBAAkB;AACnB;AAIO,IAAM,iBAAiB;AAAA,EAC7B,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACX;AAKO,IAAM,aAAa;AAAA,EACzB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AACN;AAIO,IAAM,wBAAwB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,YAAY;AACb;AAKO,IAAM,kBAAkB;AAAA,EAC9B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,0BAA0B;AAC3B;AAKO,IAAM,iBAAiB;AAAA,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O;AAAA;AAID,SAAS,OAAO,CAAC,KAA4B;AAAA,EACnD,OAAO,oBAAoB,6BAA6B,GAAG,CAAC;AAAA;AAItD,SAAS,kBAAkB,CAAC,IAA2B;AAAA,EAC7D,OAAO,WAAW,2BAA2B,qBAAqB,EAAE,CAAC,CAAC;AAAA;",
|
|
11
|
+
"debugId": "0727B877F1BE3A9864756E2164756E21",
|
|
12
|
+
"names": []
|
|
13
|
+
}
|
|
@@ -6,7 +6,7 @@ type LocalAccount = {
|
|
|
6
6
|
publicKey: string
|
|
7
7
|
/** Raw ECDSA sign over a hash */
|
|
8
8
|
sign(hash: Uint8Array): Uint8Array
|
|
9
|
-
/** Sign a
|
|
9
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
10
10
|
signMessage(message: string | Uint8Array): string
|
|
11
11
|
};
|
|
12
12
|
/** Account with a user-provided signing function (sync or async). */
|
|
@@ -6,7 +6,7 @@ type LocalAccount = {
|
|
|
6
6
|
publicKey: string
|
|
7
7
|
/** Raw ECDSA sign over a hash */
|
|
8
8
|
sign(hash: Uint8Array): Uint8Array
|
|
9
|
-
/** Sign a
|
|
9
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
10
10
|
signMessage(message: string | Uint8Array): string
|
|
11
11
|
};
|
|
12
12
|
/** Account with a user-provided signing function (sync or async). */
|
|
@@ -29,6 +29,7 @@ __export(exports_actions, {
|
|
|
29
29
|
getNftHoldings: () => getNftHoldings,
|
|
30
30
|
getMempoolStats: () => getMempoolStats,
|
|
31
31
|
getMapEntry: () => getMapEntry,
|
|
32
|
+
getDataVar: () => getDataVar,
|
|
32
33
|
getContractSource: () => getContractSource,
|
|
33
34
|
getContractAbi: () => getContractAbi,
|
|
34
35
|
getContract: () => getContract,
|
|
@@ -46,5 +47,5 @@ __export(exports_actions, {
|
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(exports_actions);
|
|
48
49
|
|
|
49
|
-
//# debugId=
|
|
50
|
+
//# debugId=2AECFF33A899A83C64756E2164756E21
|
|
50
51
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -6,7 +6,7 @@ type LocalAccount = {
|
|
|
6
6
|
publicKey: string
|
|
7
7
|
/** Raw ECDSA sign over a hash */
|
|
8
8
|
sign(hash: Uint8Array): Uint8Array
|
|
9
|
-
/** Sign a
|
|
9
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
10
10
|
signMessage(message: string | Uint8Array): string
|
|
11
11
|
};
|
|
12
12
|
/** Account with a user-provided signing function (sync or async). */
|
|
@@ -124,6 +124,7 @@ type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode];
|
|
|
124
124
|
declare const PostConditionModeWire: {
|
|
125
125
|
readonly Allow: 0x01
|
|
126
126
|
readonly Deny: 0x02
|
|
127
|
+
readonly Originator: 0x03
|
|
127
128
|
};
|
|
128
129
|
type PostConditionModeWire = (typeof PostConditionModeWire)[keyof typeof PostConditionModeWire];
|
|
129
130
|
declare const AddressHashMode: {
|
|
@@ -481,6 +482,11 @@ type ContractSourceResponse = {
|
|
|
481
482
|
* node has no source for the contract.
|
|
482
483
|
*/
|
|
483
484
|
declare function getContractSource(client: Client, params: GetContractSourceParams): Promise<ContractSourceResponse | null>;
|
|
485
|
+
type GetDataVarParams = {
|
|
486
|
+
contract: string
|
|
487
|
+
varName: string
|
|
488
|
+
};
|
|
489
|
+
declare function getDataVar<T extends ClarityValue = ClarityValue>(client: Client, params: GetDataVarParams): Promise<T>;
|
|
484
490
|
type GetMapEntryParams = {
|
|
485
491
|
contract: string
|
|
486
492
|
mapName: string
|
|
@@ -864,7 +870,7 @@ type SignTransactionParams = {
|
|
|
864
870
|
/** Sign a transaction using the client's account */
|
|
865
871
|
declare function signTransactionAction(client: Client, params: SignTransactionParams): Promise<StacksTransaction>;
|
|
866
872
|
type FungibleComparator = "eq" | "gt" | "gte" | "lt" | "lte";
|
|
867
|
-
type NonFungibleComparator = "sent" | "not-sent";
|
|
873
|
+
type NonFungibleComparator = "sent" | "not-sent" | "maybe-sent";
|
|
868
874
|
type StxPostCondition = {
|
|
869
875
|
type: "stx-postcondition"
|
|
870
876
|
address: string
|
|
@@ -898,6 +904,9 @@ type PoxPostCondition = {
|
|
|
898
904
|
condition: PoxComparator
|
|
899
905
|
};
|
|
900
906
|
type PostCondition = StxPostCondition | FtPostCondition | NftPostCondition | StakingPostCondition | PoxPostCondition;
|
|
907
|
+
/** Serialized PC hex is accepted anywhere a `PostCondition` object is. */
|
|
908
|
+
type PostConditionInput = PostCondition | string;
|
|
909
|
+
type PostConditionMode = "allow" | "deny" | "originator";
|
|
901
910
|
type IntegerType = number | string | bigint | Uint8Array;
|
|
902
911
|
declare function isProviderAccount(account: Account): account is ProviderAccount;
|
|
903
912
|
/**
|
|
@@ -929,8 +938,8 @@ type TransferStxParams = {
|
|
|
929
938
|
memo?: string
|
|
930
939
|
fee?: FeeParam
|
|
931
940
|
nonce?: IntegerType
|
|
932
|
-
postConditionMode?:
|
|
933
|
-
postConditions?:
|
|
941
|
+
postConditionMode?: PostConditionMode
|
|
942
|
+
postConditions?: PostConditionInput[]
|
|
934
943
|
};
|
|
935
944
|
/** Build, sign, and broadcast an STX transfer */
|
|
936
945
|
declare function transferStx(client: Client, params: TransferStxParams): Promise<string>;
|
|
@@ -940,8 +949,8 @@ type CallContractParams = {
|
|
|
940
949
|
functionArgs?: ClarityValue[]
|
|
941
950
|
fee?: FeeParam
|
|
942
951
|
nonce?: IntegerType
|
|
943
|
-
postConditionMode?:
|
|
944
|
-
postConditions?:
|
|
952
|
+
postConditionMode?: PostConditionMode
|
|
953
|
+
postConditions?: PostConditionInput[]
|
|
945
954
|
};
|
|
946
955
|
/** Build, sign, and broadcast a contract call */
|
|
947
956
|
declare function callContract(client: Client, params: CallContractParams): Promise<string>;
|
|
@@ -951,8 +960,8 @@ type DeployContractParams = {
|
|
|
951
960
|
clarityVersion?: ClarityVersion
|
|
952
961
|
fee?: FeeParam
|
|
953
962
|
nonce?: IntegerType
|
|
954
|
-
postConditionMode?:
|
|
955
|
-
postConditions?:
|
|
963
|
+
postConditionMode?: PostConditionMode
|
|
964
|
+
postConditions?: PostConditionInput[]
|
|
956
965
|
};
|
|
957
966
|
/** Build, sign, and broadcast a contract deploy */
|
|
958
967
|
declare function deployContract(client: Client, params: DeployContractParams): Promise<string>;
|
|
@@ -964,7 +973,7 @@ type SignMessageParams = {
|
|
|
964
973
|
chainId: number
|
|
965
974
|
}
|
|
966
975
|
};
|
|
967
|
-
/** Sign a
|
|
976
|
+
/** Sign a message. With `domain`, hashes per SIP-018; without, hashes the serialized CV. */
|
|
968
977
|
declare function signMessage2(client: Client, params: SignMessageParams): Promise<string>;
|
|
969
978
|
type SponsorTransactionParams = {
|
|
970
979
|
transaction: StacksTransaction
|
|
@@ -1210,8 +1219,8 @@ type MapMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never] ? { [N
|
|
|
1210
1219
|
type ContractCallOptions = {
|
|
1211
1220
|
fee?: IntegerType
|
|
1212
1221
|
nonce?: IntegerType
|
|
1213
|
-
postConditionMode?:
|
|
1214
|
-
postConditions?:
|
|
1222
|
+
postConditionMode?: PostConditionMode
|
|
1223
|
+
postConditions?: PostConditionInput[]
|
|
1215
1224
|
};
|
|
1216
1225
|
/**
|
|
1217
1226
|
* Options for `buildCall.*` — building an unsigned transaction for
|
|
@@ -1252,4 +1261,4 @@ declare class ContractResponseError extends Error {
|
|
|
1252
1261
|
name: string;
|
|
1253
1262
|
constructor(message: string, errorValue: unknown);
|
|
1254
1263
|
}
|
|
1255
|
-
export { watchTransaction, watchNftEvent, watchMempool, watchBlocks, watchAddressBalance, watchAddress, waitForTransactionReceipt, transferStx, sponsorTransaction, simulateTransaction, simulateCall, signTransactionAction, signMessage2 as signMessage, sendTransaction, resolveFee, readContract, multicall, minimumFee, isResponseOutput, isProviderAccount, isFeeTier, indexTxSource, getTransaction, getRawBlock, getNonce, getNftHoldings, getMempoolStats, getMapEntry, getContractSource, getContractAbi, getContract, getBlockHeight, getBlock, getBalance, getAccountInfo, getAccountHistory, extendedApiSource, estimateFee, deployContract, callContract, buildFunctionArgs, WatchTransactionParams, WatchNftEventParams, WatchMempoolParams, WatchBlocksParams, WatchAddressParams, WatchAddressBalanceParams, WaitForTransactionReceiptParams, UnwrapResponse, TransferStxParams, TransactionStatusSource, TransactionStatus, TransactionSnapshot, TransactionReceipt, SponsorTransactionParams, SimulateTransferResult, SimulateTransactionResult, SimulateTransactionParams, SimulateDeployResult, SimulateContractCallResult, SimulateCallSuccess, SimulateCallResult, SimulateCallParams, SimulateCallFailure, SignTransactionParams, SignMessageParams, SendTransactionResult, SendTransactionParams, ReadContractParams, RawBlockResponse, NftHoldingsResponse, MulticallSuccessResult, MulticallResult, MulticallParams, MulticallFailureResult, MulticallCall, IndexTxSourceParams, GetTransactionParams, GetRawBlockParams, GetNonceParams, GetNftHoldingsParams, GetMapEntryParams, GetContractSourceParams, GetContractParams, GetContractAbiParams, GetBlockParams, GetBalanceParams, GetAccountInfoParams, GetAccountHistoryParams, FeeTier, FeeParam, FeeEstimation, EstimateFeeParams, DeployContractParams, ContractSourceResponse, ContractResponseError, ContractInstance, ContractCallOptions, ContractBuildCallOptions, CallContractParams, AccountInfo, AccountHistoryResponse };
|
|
1264
|
+
export { watchTransaction, watchNftEvent, watchMempool, watchBlocks, watchAddressBalance, watchAddress, waitForTransactionReceipt, transferStx, sponsorTransaction, simulateTransaction, simulateCall, signTransactionAction, signMessage2 as signMessage, sendTransaction, resolveFee, readContract, multicall, minimumFee, isResponseOutput, isProviderAccount, isFeeTier, indexTxSource, getTransaction, getRawBlock, getNonce, getNftHoldings, getMempoolStats, getMapEntry, getDataVar, getContractSource, getContractAbi, getContract, getBlockHeight, getBlock, getBalance, getAccountInfo, getAccountHistory, extendedApiSource, estimateFee, deployContract, callContract, buildFunctionArgs, WatchTransactionParams, WatchNftEventParams, WatchMempoolParams, WatchBlocksParams, WatchAddressParams, WatchAddressBalanceParams, WaitForTransactionReceiptParams, UnwrapResponse, TransferStxParams, TransactionStatusSource, TransactionStatus, TransactionSnapshot, TransactionReceipt, SponsorTransactionParams, SimulateTransferResult, SimulateTransactionResult, SimulateTransactionParams, SimulateDeployResult, SimulateContractCallResult, SimulateCallSuccess, SimulateCallResult, SimulateCallParams, SimulateCallFailure, SignTransactionParams, SignMessageParams, SendTransactionResult, SendTransactionParams, ReadContractParams, RawBlockResponse, NftHoldingsResponse, MulticallSuccessResult, MulticallResult, MulticallParams, MulticallFailureResult, MulticallCall, IndexTxSourceParams, GetTransactionParams, GetRawBlockParams, GetNonceParams, GetNftHoldingsParams, GetMapEntryParams, GetDataVarParams, GetContractSourceParams, GetContractParams, GetContractAbiParams, GetBlockParams, GetBalanceParams, GetAccountInfoParams, GetAccountHistoryParams, FeeTier, FeeParam, FeeEstimation, EstimateFeeParams, DeployContractParams, ContractSourceResponse, ContractResponseError, ContractInstance, ContractCallOptions, ContractBuildCallOptions, CallContractParams, AccountInfo, AccountHistoryResponse };
|
|
@@ -6,7 +6,7 @@ type LocalAccount = {
|
|
|
6
6
|
publicKey: string
|
|
7
7
|
/** Raw ECDSA sign over a hash */
|
|
8
8
|
sign(hash: Uint8Array): Uint8Array
|
|
9
|
-
/** Sign a
|
|
9
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
10
10
|
signMessage(message: string | Uint8Array): string
|
|
11
11
|
};
|
|
12
12
|
/** Account with a user-provided signing function (sync or async). */
|
|
@@ -124,6 +124,7 @@ type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode];
|
|
|
124
124
|
declare const PostConditionModeWire: {
|
|
125
125
|
readonly Allow: 0x01
|
|
126
126
|
readonly Deny: 0x02
|
|
127
|
+
readonly Originator: 0x03
|
|
127
128
|
};
|
|
128
129
|
type PostConditionModeWire = (typeof PostConditionModeWire)[keyof typeof PostConditionModeWire];
|
|
129
130
|
declare const AddressHashMode: {
|
|
@@ -481,6 +482,11 @@ type ContractSourceResponse = {
|
|
|
481
482
|
* node has no source for the contract.
|
|
482
483
|
*/
|
|
483
484
|
declare function getContractSource(client: Client, params: GetContractSourceParams): Promise<ContractSourceResponse | null>;
|
|
485
|
+
type GetDataVarParams = {
|
|
486
|
+
contract: string
|
|
487
|
+
varName: string
|
|
488
|
+
};
|
|
489
|
+
declare function getDataVar<T extends ClarityValue = ClarityValue>(client: Client, params: GetDataVarParams): Promise<T>;
|
|
484
490
|
type GetMapEntryParams = {
|
|
485
491
|
contract: string
|
|
486
492
|
mapName: string
|
|
@@ -864,7 +870,7 @@ type SignTransactionParams = {
|
|
|
864
870
|
/** Sign a transaction using the client's account */
|
|
865
871
|
declare function signTransactionAction(client: Client, params: SignTransactionParams): Promise<StacksTransaction>;
|
|
866
872
|
type FungibleComparator = "eq" | "gt" | "gte" | "lt" | "lte";
|
|
867
|
-
type NonFungibleComparator = "sent" | "not-sent";
|
|
873
|
+
type NonFungibleComparator = "sent" | "not-sent" | "maybe-sent";
|
|
868
874
|
type StxPostCondition = {
|
|
869
875
|
type: "stx-postcondition"
|
|
870
876
|
address: string
|
|
@@ -898,6 +904,9 @@ type PoxPostCondition = {
|
|
|
898
904
|
condition: PoxComparator
|
|
899
905
|
};
|
|
900
906
|
type PostCondition = StxPostCondition | FtPostCondition | NftPostCondition | StakingPostCondition | PoxPostCondition;
|
|
907
|
+
/** Serialized PC hex is accepted anywhere a `PostCondition` object is. */
|
|
908
|
+
type PostConditionInput = PostCondition | string;
|
|
909
|
+
type PostConditionMode = "allow" | "deny" | "originator";
|
|
901
910
|
type IntegerType = number | string | bigint | Uint8Array;
|
|
902
911
|
declare function isProviderAccount(account: Account): account is ProviderAccount;
|
|
903
912
|
/**
|
|
@@ -929,8 +938,8 @@ type TransferStxParams = {
|
|
|
929
938
|
memo?: string
|
|
930
939
|
fee?: FeeParam
|
|
931
940
|
nonce?: IntegerType
|
|
932
|
-
postConditionMode?:
|
|
933
|
-
postConditions?:
|
|
941
|
+
postConditionMode?: PostConditionMode
|
|
942
|
+
postConditions?: PostConditionInput[]
|
|
934
943
|
};
|
|
935
944
|
/** Build, sign, and broadcast an STX transfer */
|
|
936
945
|
declare function transferStx(client: Client, params: TransferStxParams): Promise<string>;
|
|
@@ -940,8 +949,8 @@ type CallContractParams = {
|
|
|
940
949
|
functionArgs?: ClarityValue[]
|
|
941
950
|
fee?: FeeParam
|
|
942
951
|
nonce?: IntegerType
|
|
943
|
-
postConditionMode?:
|
|
944
|
-
postConditions?:
|
|
952
|
+
postConditionMode?: PostConditionMode
|
|
953
|
+
postConditions?: PostConditionInput[]
|
|
945
954
|
};
|
|
946
955
|
/** Build, sign, and broadcast a contract call */
|
|
947
956
|
declare function callContract(client: Client, params: CallContractParams): Promise<string>;
|
|
@@ -951,8 +960,8 @@ type DeployContractParams = {
|
|
|
951
960
|
clarityVersion?: ClarityVersion
|
|
952
961
|
fee?: FeeParam
|
|
953
962
|
nonce?: IntegerType
|
|
954
|
-
postConditionMode?:
|
|
955
|
-
postConditions?:
|
|
963
|
+
postConditionMode?: PostConditionMode
|
|
964
|
+
postConditions?: PostConditionInput[]
|
|
956
965
|
};
|
|
957
966
|
/** Build, sign, and broadcast a contract deploy */
|
|
958
967
|
declare function deployContract(client: Client, params: DeployContractParams): Promise<string>;
|
|
@@ -964,7 +973,7 @@ type SignMessageParams = {
|
|
|
964
973
|
chainId: number
|
|
965
974
|
}
|
|
966
975
|
};
|
|
967
|
-
/** Sign a
|
|
976
|
+
/** Sign a message. With `domain`, hashes per SIP-018; without, hashes the serialized CV. */
|
|
968
977
|
declare function signMessage2(client: Client, params: SignMessageParams): Promise<string>;
|
|
969
978
|
type SponsorTransactionParams = {
|
|
970
979
|
transaction: StacksTransaction
|
|
@@ -1210,8 +1219,8 @@ type MapMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never] ? { [N
|
|
|
1210
1219
|
type ContractCallOptions = {
|
|
1211
1220
|
fee?: IntegerType
|
|
1212
1221
|
nonce?: IntegerType
|
|
1213
|
-
postConditionMode?:
|
|
1214
|
-
postConditions?:
|
|
1222
|
+
postConditionMode?: PostConditionMode
|
|
1223
|
+
postConditions?: PostConditionInput[]
|
|
1215
1224
|
};
|
|
1216
1225
|
/**
|
|
1217
1226
|
* Options for `buildCall.*` — building an unsigned transaction for
|
|
@@ -1252,4 +1261,4 @@ declare class ContractResponseError extends Error {
|
|
|
1252
1261
|
name: string;
|
|
1253
1262
|
constructor(message: string, errorValue: unknown);
|
|
1254
1263
|
}
|
|
1255
|
-
export { watchTransaction, watchNftEvent, watchMempool, watchBlocks, watchAddressBalance, watchAddress, waitForTransactionReceipt, transferStx, sponsorTransaction, simulateTransaction, simulateCall, signTransactionAction, signMessage2 as signMessage, sendTransaction, resolveFee, readContract, multicall, minimumFee, isResponseOutput, isProviderAccount, isFeeTier, indexTxSource, getTransaction, getRawBlock, getNonce, getNftHoldings, getMempoolStats, getMapEntry, getContractSource, getContractAbi, getContract, getBlockHeight, getBlock, getBalance, getAccountInfo, getAccountHistory, extendedApiSource, estimateFee, deployContract, callContract, buildFunctionArgs, WatchTransactionParams, WatchNftEventParams, WatchMempoolParams, WatchBlocksParams, WatchAddressParams, WatchAddressBalanceParams, WaitForTransactionReceiptParams, UnwrapResponse, TransferStxParams, TransactionStatusSource, TransactionStatus, TransactionSnapshot, TransactionReceipt, SponsorTransactionParams, SimulateTransferResult, SimulateTransactionResult, SimulateTransactionParams, SimulateDeployResult, SimulateContractCallResult, SimulateCallSuccess, SimulateCallResult, SimulateCallParams, SimulateCallFailure, SignTransactionParams, SignMessageParams, SendTransactionResult, SendTransactionParams, ReadContractParams, RawBlockResponse, NftHoldingsResponse, MulticallSuccessResult, MulticallResult, MulticallParams, MulticallFailureResult, MulticallCall, IndexTxSourceParams, GetTransactionParams, GetRawBlockParams, GetNonceParams, GetNftHoldingsParams, GetMapEntryParams, GetContractSourceParams, GetContractParams, GetContractAbiParams, GetBlockParams, GetBalanceParams, GetAccountInfoParams, GetAccountHistoryParams, FeeTier, FeeParam, FeeEstimation, EstimateFeeParams, DeployContractParams, ContractSourceResponse, ContractResponseError, ContractInstance, ContractCallOptions, ContractBuildCallOptions, CallContractParams, AccountInfo, AccountHistoryResponse };
|
|
1264
|
+
export { watchTransaction, watchNftEvent, watchMempool, watchBlocks, watchAddressBalance, watchAddress, waitForTransactionReceipt, transferStx, sponsorTransaction, simulateTransaction, simulateCall, signTransactionAction, signMessage2 as signMessage, sendTransaction, resolveFee, readContract, multicall, minimumFee, isResponseOutput, isProviderAccount, isFeeTier, indexTxSource, getTransaction, getRawBlock, getNonce, getNftHoldings, getMempoolStats, getMapEntry, getDataVar, getContractSource, getContractAbi, getContract, getBlockHeight, getBlock, getBalance, getAccountInfo, getAccountHistory, extendedApiSource, estimateFee, deployContract, callContract, buildFunctionArgs, WatchTransactionParams, WatchNftEventParams, WatchMempoolParams, WatchBlocksParams, WatchAddressParams, WatchAddressBalanceParams, WaitForTransactionReceiptParams, UnwrapResponse, TransferStxParams, TransactionStatusSource, TransactionStatus, TransactionSnapshot, TransactionReceipt, SponsorTransactionParams, SimulateTransferResult, SimulateTransactionResult, SimulateTransactionParams, SimulateDeployResult, SimulateContractCallResult, SimulateCallSuccess, SimulateCallResult, SimulateCallParams, SimulateCallFailure, SignTransactionParams, SignMessageParams, SendTransactionResult, SendTransactionParams, ReadContractParams, RawBlockResponse, NftHoldingsResponse, MulticallSuccessResult, MulticallResult, MulticallParams, MulticallFailureResult, MulticallCall, IndexTxSourceParams, GetTransactionParams, GetRawBlockParams, GetNonceParams, GetNftHoldingsParams, GetMapEntryParams, GetDataVarParams, GetContractSourceParams, GetContractParams, GetContractAbiParams, GetBlockParams, GetBalanceParams, GetAccountInfoParams, GetAccountHistoryParams, FeeTier, FeeParam, FeeEstimation, EstimateFeeParams, DeployContractParams, ContractSourceResponse, ContractResponseError, ContractInstance, ContractCallOptions, ContractBuildCallOptions, CallContractParams, AccountInfo, AccountHistoryResponse };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
buildFunctionArgs,
|
|
4
4
|
getContract,
|
|
5
5
|
isResponseOutput
|
|
6
|
-
} from "../../shared/stacks-
|
|
6
|
+
} from "../../shared/stacks-jpt52csy.js";
|
|
7
7
|
import {
|
|
8
8
|
deployContract,
|
|
9
9
|
getAccountHistory,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
getBlock,
|
|
13
13
|
getContractAbi,
|
|
14
14
|
getContractSource,
|
|
15
|
+
getDataVar,
|
|
15
16
|
getMempoolStats,
|
|
16
17
|
getNftHoldings,
|
|
17
18
|
getRawBlock,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
simulateTransaction,
|
|
23
24
|
sponsorTransaction,
|
|
24
25
|
transferStx
|
|
25
|
-
} from "../../shared/stacks-
|
|
26
|
+
} from "../../shared/stacks-rndfw2vh.js";
|
|
26
27
|
import {
|
|
27
28
|
multicall
|
|
28
29
|
} from "../../shared/stacks-2evvn48s.js";
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
resolveFee,
|
|
41
42
|
sendTransaction,
|
|
42
43
|
waitForTransactionReceipt
|
|
43
|
-
} from "../../shared/stacks-
|
|
44
|
+
} from "../../shared/stacks-fb75yew8.js";
|
|
44
45
|
import {
|
|
45
46
|
readContract
|
|
46
47
|
} from "../../shared/stacks-27fmgajb.js";
|
|
@@ -54,8 +55,9 @@ import {
|
|
|
54
55
|
} from "../../shared/stacks-tjjnkt3r.js";
|
|
55
56
|
import"../../shared/stacks-709tra19.js";
|
|
56
57
|
import"../../shared/stacks-4z72akdf.js";
|
|
57
|
-
import"../../shared/stacks-
|
|
58
|
-
import"../../shared/stacks-
|
|
58
|
+
import"../../shared/stacks-1arrcd11.js";
|
|
59
|
+
import"../../shared/stacks-hnqt5rz4.js";
|
|
60
|
+
import"../../shared/stacks-w23294am.js";
|
|
59
61
|
import"../../shared/stacks-ttdk2g2f.js";
|
|
60
62
|
import"../../shared/stacks-bfan7ex7.js";
|
|
61
63
|
import"../../shared/stacks-qs5fzts5.js";
|
|
@@ -88,6 +90,7 @@ export {
|
|
|
88
90
|
getNftHoldings,
|
|
89
91
|
getMempoolStats,
|
|
90
92
|
getMapEntry,
|
|
93
|
+
getDataVar,
|
|
91
94
|
getContractSource,
|
|
92
95
|
getContractAbi,
|
|
93
96
|
getContract,
|
|
@@ -104,5 +107,5 @@ export {
|
|
|
104
107
|
ContractResponseError
|
|
105
108
|
};
|
|
106
109
|
|
|
107
|
-
//# debugId=
|
|
110
|
+
//# debugId=A2F75BA5BCC68EAA64756E2164756E21
|
|
108
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -60,6 +60,35 @@ type StringUtf8CV = {
|
|
|
60
60
|
readonly value: string
|
|
61
61
|
};
|
|
62
62
|
type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
|
|
63
|
+
/** Account derived from a local private key (mnemonic or raw key). */
|
|
64
|
+
type LocalAccount = {
|
|
65
|
+
type: "local"
|
|
66
|
+
address: string
|
|
67
|
+
/** Compressed public key (hex) */
|
|
68
|
+
publicKey: string
|
|
69
|
+
/** Raw ECDSA sign over a hash */
|
|
70
|
+
sign(hash: Uint8Array): Uint8Array
|
|
71
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
72
|
+
signMessage(message: string | Uint8Array): string
|
|
73
|
+
};
|
|
74
|
+
/** Account with a user-provided signing function (sync or async). */
|
|
75
|
+
type CustomAccount = {
|
|
76
|
+
type: "custom"
|
|
77
|
+
address: string
|
|
78
|
+
publicKey: string
|
|
79
|
+
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
80
|
+
};
|
|
81
|
+
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
82
|
+
type StacksProvider = {
|
|
83
|
+
request(method: string, params?: any): Promise<any>
|
|
84
|
+
};
|
|
85
|
+
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
86
|
+
type ProviderAccount = {
|
|
87
|
+
type: "provider"
|
|
88
|
+
address: string
|
|
89
|
+
publicKey: string
|
|
90
|
+
provider: StacksProvider
|
|
91
|
+
};
|
|
63
92
|
/**
|
|
64
93
|
* Bitcoin double-SHA256: `sha256(sha256(bytes))`. This is the hash Bitcoin uses
|
|
65
94
|
* for txids, block headers, and merkle nodes — NOT the same as the Stacks
|
|
@@ -485,35 +514,6 @@ declare const SPV_ADAPTER_ABI: {
|
|
|
485
514
|
}
|
|
486
515
|
}]
|
|
487
516
|
};
|
|
488
|
-
/** Account derived from a local private key (mnemonic or raw key). */
|
|
489
|
-
type LocalAccount = {
|
|
490
|
-
type: "local"
|
|
491
|
-
address: string
|
|
492
|
-
/** Compressed public key (hex) */
|
|
493
|
-
publicKey: string
|
|
494
|
-
/** Raw ECDSA sign over a hash */
|
|
495
|
-
sign(hash: Uint8Array): Uint8Array
|
|
496
|
-
/** Sign a structured message (SIP-018) */
|
|
497
|
-
signMessage(message: string | Uint8Array): string
|
|
498
|
-
};
|
|
499
|
-
/** Account with a user-provided signing function (sync or async). */
|
|
500
|
-
type CustomAccount = {
|
|
501
|
-
type: "custom"
|
|
502
|
-
address: string
|
|
503
|
-
publicKey: string
|
|
504
|
-
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
505
|
-
};
|
|
506
|
-
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
507
|
-
type StacksProvider = {
|
|
508
|
-
request(method: string, params?: any): Promise<any>
|
|
509
|
-
};
|
|
510
|
-
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
511
|
-
type ProviderAccount = {
|
|
512
|
-
type: "provider"
|
|
513
|
-
address: string
|
|
514
|
-
publicKey: string
|
|
515
|
-
provider: StacksProvider
|
|
516
|
-
};
|
|
517
517
|
/** Allocates mempool-safe sequential nonces across rapid broadcasts from one account. */
|
|
518
518
|
type NonceManager = {
|
|
519
519
|
consume(params: {
|
|
@@ -60,6 +60,35 @@ type StringUtf8CV = {
|
|
|
60
60
|
readonly value: string
|
|
61
61
|
};
|
|
62
62
|
type ClarityValue = IntCV | UIntCV | BooleanCV | BufferCV | NoneCV | SomeCV | ResponseOkCV | ResponseErrorCV | StandardPrincipalCV | ContractPrincipalCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
|
|
63
|
+
/** Account derived from a local private key (mnemonic or raw key). */
|
|
64
|
+
type LocalAccount = {
|
|
65
|
+
type: "local"
|
|
66
|
+
address: string
|
|
67
|
+
/** Compressed public key (hex) */
|
|
68
|
+
publicKey: string
|
|
69
|
+
/** Raw ECDSA sign over a hash */
|
|
70
|
+
sign(hash: Uint8Array): Uint8Array
|
|
71
|
+
/** Sign a raw UTF-8 / byte message (`sha256(bytes)`). Not SIP-018. */
|
|
72
|
+
signMessage(message: string | Uint8Array): string
|
|
73
|
+
};
|
|
74
|
+
/** Account with a user-provided signing function (sync or async). */
|
|
75
|
+
type CustomAccount = {
|
|
76
|
+
type: "custom"
|
|
77
|
+
address: string
|
|
78
|
+
publicKey: string
|
|
79
|
+
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
80
|
+
};
|
|
81
|
+
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
82
|
+
type StacksProvider = {
|
|
83
|
+
request(method: string, params?: any): Promise<any>
|
|
84
|
+
};
|
|
85
|
+
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
86
|
+
type ProviderAccount = {
|
|
87
|
+
type: "provider"
|
|
88
|
+
address: string
|
|
89
|
+
publicKey: string
|
|
90
|
+
provider: StacksProvider
|
|
91
|
+
};
|
|
63
92
|
/**
|
|
64
93
|
* Bitcoin double-SHA256: `sha256(sha256(bytes))`. This is the hash Bitcoin uses
|
|
65
94
|
* for txids, block headers, and merkle nodes — NOT the same as the Stacks
|
|
@@ -485,35 +514,6 @@ declare const SPV_ADAPTER_ABI: {
|
|
|
485
514
|
}
|
|
486
515
|
}]
|
|
487
516
|
};
|
|
488
|
-
/** Account derived from a local private key (mnemonic or raw key). */
|
|
489
|
-
type LocalAccount = {
|
|
490
|
-
type: "local"
|
|
491
|
-
address: string
|
|
492
|
-
/** Compressed public key (hex) */
|
|
493
|
-
publicKey: string
|
|
494
|
-
/** Raw ECDSA sign over a hash */
|
|
495
|
-
sign(hash: Uint8Array): Uint8Array
|
|
496
|
-
/** Sign a structured message (SIP-018) */
|
|
497
|
-
signMessage(message: string | Uint8Array): string
|
|
498
|
-
};
|
|
499
|
-
/** Account with a user-provided signing function (sync or async). */
|
|
500
|
-
type CustomAccount = {
|
|
501
|
-
type: "custom"
|
|
502
|
-
address: string
|
|
503
|
-
publicKey: string
|
|
504
|
-
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
505
|
-
};
|
|
506
|
-
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
507
|
-
type StacksProvider = {
|
|
508
|
-
request(method: string, params?: any): Promise<any>
|
|
509
|
-
};
|
|
510
|
-
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
511
|
-
type ProviderAccount = {
|
|
512
|
-
type: "provider"
|
|
513
|
-
address: string
|
|
514
|
-
publicKey: string
|
|
515
|
-
provider: StacksProvider
|
|
516
|
-
};
|
|
517
517
|
/** Allocates mempool-safe sequential nonces across rapid broadcasts from one account. */
|
|
518
518
|
type NonceManager = {
|
|
519
519
|
consume(params: {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
taprootTweakPubkey
|
|
17
17
|
} from "../../shared/stacks-0cdm20eh.js";
|
|
18
18
|
import"../../shared/stacks-5nmz5ad9.js";
|
|
19
|
-
import"../../shared/stacks-
|
|
19
|
+
import"../../shared/stacks-gxq2pbky.js";
|
|
20
20
|
import"../../shared/stacks-kg1npstf.js";
|
|
21
21
|
import {
|
|
22
22
|
MalformedResponseError,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
} from "../../shared/stacks-27fmgajb.js";
|
|
25
25
|
import"../../shared/stacks-709tra19.js";
|
|
26
26
|
import"../../shared/stacks-4z72akdf.js";
|
|
27
|
+
import"../../shared/stacks-1arrcd11.js";
|
|
27
28
|
import {
|
|
28
29
|
bufferCV,
|
|
29
30
|
listCV,
|
|
@@ -567,5 +568,5 @@ export {
|
|
|
567
568
|
BtcReader
|
|
568
569
|
};
|
|
569
570
|
|
|
570
|
-
//# debugId=
|
|
571
|
+
//# debugId=2DC4E8E1293CB33E64756E2164756E21
|
|
571
572
|
//# sourceMappingURL=index.js.map
|