@secondlayer/stacks 0.2.0 → 0.2.2
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/dist/shared/stacks-2ar4prfz.cjs +328 -0
- package/dist/shared/stacks-2ar4prfz.cjs.map +11 -0
- package/dist/shared/{stacks-ph4a6322.js → stacks-6m1z4j07.js} +26 -24
- package/dist/shared/stacks-6m1z4j07.js.map +10 -0
- package/dist/shared/{stacks-0hqzpm29.js → stacks-96gaxfcf.js} +9 -13
- package/dist/shared/{stacks-0hqzpm29.js.map → stacks-96gaxfcf.js.map} +2 -2
- package/dist/shared/stacks-dr5en54r.cjs +119 -0
- package/dist/shared/stacks-dr5en54r.cjs.map +10 -0
- package/dist/shared/{stacks-v3zy6zds.cjs → stacks-etf219gs.cjs} +11 -7
- package/dist/shared/stacks-etf219gs.cjs.map +10 -0
- package/dist/shared/stacks-je937aas.js +121 -0
- package/dist/shared/stacks-je937aas.js.map +10 -0
- package/dist/shared/stacks-jrnmh4kc.js +282 -0
- package/dist/shared/stacks-jrnmh4kc.js.map +11 -0
- package/dist/shared/{stacks-8qhfd37f.js → stacks-k9p8m3wf.js} +15 -19
- package/dist/shared/{stacks-8qhfd37f.js.map → stacks-k9p8m3wf.js.map} +2 -2
- package/dist/shared/{stacks-j2cy7qtt.js → stacks-ky14tdf6.cjs} +109 -24
- package/dist/shared/stacks-ky14tdf6.cjs.map +13 -0
- package/dist/shared/stacks-mrk6tkkh.cjs +41 -0
- package/dist/shared/{stacks-2gdt3aqj.cjs.map → stacks-mrk6tkkh.cjs.map} +1 -1
- package/dist/shared/{stacks-d1fmkv3p.js → stacks-p93g814f.js} +3 -3
- package/dist/shared/{stacks-zhd20wgz.js → stacks-q79dx28x.js} +3 -3
- package/dist/shared/{stacks-r1t6g3c3.cjs → stacks-ra02bpny.cjs} +8 -3
- package/dist/shared/{stacks-r1t6g3c3.cjs.map → stacks-ra02bpny.cjs.map} +3 -3
- package/dist/shared/{stacks-b008c3w8.cjs → stacks-rg1g0fja.js} +134 -2
- package/dist/shared/stacks-rg1g0fja.js.map +13 -0
- package/dist/shared/{stacks-bycy6t9k.js → stacks-rwfgts3s.js} +2 -2
- package/dist/shared/{stacks-gjvbq6w7.js → stacks-s10yb9gz.js} +2 -2
- package/dist/shared/{stacks-nqytwfcc.js → stacks-s7z5q8be.js} +8 -3
- package/dist/shared/{stacks-nqytwfcc.js.map → stacks-s7z5q8be.js.map} +3 -3
- package/dist/shared/{stacks-hfem9dck.cjs → stacks-v6ja2eh7.cjs} +342 -91
- package/dist/shared/stacks-v6ja2eh7.cjs.map +15 -0
- package/dist/shared/{stacks-xtz0n62y.js → stacks-xp9n3r0t.js} +357 -112
- package/dist/shared/stacks-xp9n3r0t.js.map +15 -0
- package/dist/src/accounts/index.js +3 -4
- package/dist/src/accounts/index.js.map +2 -2
- package/dist/src/actions/index.d.cts +7 -0
- package/dist/src/actions/index.d.ts +7 -0
- package/dist/src/actions/index.js +11 -14
- package/dist/src/actions/index.js.map +1 -1
- package/dist/src/bns/index.js +13 -16
- package/dist/src/bns/index.js.map +2 -2
- package/dist/src/chains/index.js +1 -2
- package/dist/src/chains/index.js.map +1 -1
- package/dist/src/clarity/index.cjs +1 -326
- package/dist/src/clarity/index.cjs.map +3 -5
- package/dist/src/clarity/index.js +19 -273
- package/dist/src/clarity/index.js.map +3 -5
- package/dist/src/connect/index.cjs +19 -9
- package/dist/src/connect/index.cjs.map +3 -3
- package/dist/src/connect/index.js.map +2 -2
- package/dist/src/connect/walletconnect/index.cjs +19 -9
- package/dist/src/connect/walletconnect/index.cjs.map +3 -3
- package/dist/src/connect/walletconnect/index.js.map +1 -1
- package/dist/src/index.cjs +1 -2
- package/dist/src/index.cjs.map +3 -3
- package/dist/src/index.d.cts +7 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +12 -19
- package/dist/src/index.js.map +3 -3
- package/dist/src/postconditions/index.cjs +1 -117
- package/dist/src/postconditions/index.cjs.map +3 -4
- package/dist/src/postconditions/index.js +5 -119
- package/dist/src/postconditions/index.js.map +3 -4
- package/dist/src/pox/index.js +12 -15
- package/dist/src/pox/index.js.map +2 -2
- package/dist/src/stackingdao/index.js +11 -14
- package/dist/src/stackingdao/index.js.map +2 -2
- package/dist/src/subscriptions/index.js +1 -2
- package/dist/src/subscriptions/index.js.map +1 -1
- package/dist/src/transactions/index.d.cts +7 -0
- package/dist/src/transactions/index.d.ts +7 -0
- package/dist/src/transactions/index.js +18 -22
- package/dist/src/transactions/index.js.map +1 -1
- package/dist/src/utils/index.js +4 -5
- package/dist/src/utils/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/shared/stacks-1aqm7c2h.cjs +0 -110
- package/dist/shared/stacks-1aqm7c2h.cjs.map +0 -11
- package/dist/shared/stacks-2gdt3aqj.cjs +0 -44
- package/dist/shared/stacks-8yykgdww.js +0 -125
- package/dist/shared/stacks-8yykgdww.js.map +0 -11
- package/dist/shared/stacks-b008c3w8.cjs.map +0 -11
- package/dist/shared/stacks-hfem9dck.cjs.map +0 -13
- package/dist/shared/stacks-j2cy7qtt.js.map +0 -11
- package/dist/shared/stacks-kgesjxq4.cjs +0 -247
- package/dist/shared/stacks-kgesjxq4.cjs.map +0 -11
- package/dist/shared/stacks-nbz193yk.js +0 -282
- package/dist/shared/stacks-nbz193yk.js.map +0 -11
- package/dist/shared/stacks-njvyj3ab.js +0 -23
- package/dist/shared/stacks-njvyj3ab.js.map +0 -9
- package/dist/shared/stacks-ph4a6322.js.map +0 -10
- package/dist/shared/stacks-v3zy6zds.cjs.map +0 -10
- package/dist/shared/stacks-xtz0n62y.js.map +0 -13
- /package/dist/shared/{stacks-d1fmkv3p.js.map → stacks-p93g814f.js.map} +0 -0
- /package/dist/shared/{stacks-zhd20wgz.js.map → stacks-q79dx28x.js.map} +0 -0
- /package/dist/shared/{stacks-bycy6t9k.js.map → stacks-rwfgts3s.js.map} +0 -0
- /package/dist/shared/{stacks-gjvbq6w7.js.map → stacks-s10yb9gz.js.map} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/transactions/types.ts", "../src/transactions/wire/serialize.ts", "../src/transactions/authorization.ts", "../src/transactions/multisig.ts", "../src/transactions/signer.ts", "../src/transactions/build.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ClarityValue } from \"../clarity/types.ts\";\n\n// Auth types\nexport const AuthType = {\n Standard: 0x04,\n Sponsored: 0x05,\n} as const;\nexport type AuthType = (typeof AuthType)[keyof typeof AuthType];\n\n// Payload types\nexport const PayloadType = {\n TokenTransfer: 0x00,\n SmartContract: 0x01,\n ContractCall: 0x02,\n PoisonMicroblock: 0x03,\n Coinbase: 0x04,\n CoinbaseToAltRecipient: 0x05,\n VersionedSmartContract: 0x06,\n TenureChange: 0x07,\n NakamotoCoinbase: 0x08,\n} as const;\nexport type PayloadType = (typeof PayloadType)[keyof typeof PayloadType];\n\n// Clarity version\nexport const ClarityVersion = {\n Clarity1: 1,\n Clarity2: 2,\n Clarity3: 3,\n Clarity4: 4,\n Clarity5: 5,\n} as const;\nexport type ClarityVersion = (typeof ClarityVersion)[keyof typeof ClarityVersion];\n\n// Anchor mode (deprecated post-Nakamoto, but needed for wire format)\nexport const AnchorMode = {\n OnChainOnly: 0x01,\n OffChainOnly: 0x02,\n Any: 0x03,\n} as const;\nexport type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode];\n\n// Post condition mode\nexport const PostConditionModeWire = {\n Allow: 0x01,\n Deny: 0x02,\n} as const;\nexport type PostConditionModeWire =\n (typeof PostConditionModeWire)[keyof typeof PostConditionModeWire];\n\n// Address hash modes\nexport const AddressHashMode = {\n P2PKH: 0x00,\n P2SH: 0x01,\n P2WPKH: 0x02,\n P2WSH: 0x03,\n P2SH_NonSequential: 0x05, // SIP-027\n P2WSH_P2SH_NonSequential: 0x07, // SIP-027\n} as const;\nexport type AddressHashMode = (typeof AddressHashMode)[keyof typeof AddressHashMode];\n\n// Pub key encoding\nexport const PubKeyEncoding = {\n Compressed: 0x00,\n Uncompressed: 0x01,\n} as const;\nexport type PubKeyEncoding = (typeof PubKeyEncoding)[keyof typeof PubKeyEncoding];\n\n// Fungible condition codes (wire format)\nexport const FungibleConditionCode = {\n Equal: 0x01,\n Greater: 0x02,\n GreaterEqual: 0x03,\n Less: 0x04,\n LessEqual: 0x05,\n} as const;\n\n// Non-fungible condition codes (wire format)\nexport const NonFungibleConditionCode = {\n Sends: 0x10,\n DoesNotSend: 0x11,\n} as const;\n\n// Post condition principal types\nexport const PostConditionPrincipalId = {\n Origin: 0x01,\n Standard: 0x02,\n Contract: 0x03,\n} as const;\n\n// Post condition asset types\nexport const AssetType = {\n STX: 0x00,\n Fungible: 0x01,\n NonFungible: 0x02,\n} as const;\n\n// Auth field types\nexport const AuthFieldType = {\n PublicKeyCompressed: 0x00,\n PublicKeyUncompressed: 0x01,\n SignatureCompressed: 0x02,\n SignatureUncompressed: 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 BlockFound: 0x00,\n Extended: 0x01,\n ExtendedRuntime: 0x02,\n ExtendedReadCount: 0x03,\n ExtendedReadLength: 0x04,\n ExtendedWriteCount: 0x05,\n ExtendedWriteLength: 0x06,\n} as const;\nexport type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];\n\n// Token transfer payload\nexport type TokenTransferPayload = {\n payloadType: typeof PayloadType.TokenTransfer;\n recipient: ClarityValue; // PrincipalCV\n amount: bigint;\n memo: string;\n};\n\n// Contract call payload\nexport type ContractCallPayload = {\n payloadType: typeof PayloadType.ContractCall;\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: ClarityValue[];\n};\n\n// Smart contract deploy payload\nexport type SmartContractPayload = {\n payloadType: typeof PayloadType.SmartContract | typeof PayloadType.VersionedSmartContract;\n clarityVersion?: ClarityVersion;\n contractName: string;\n codeBody: string;\n};\n\n// Coinbase payload (appears in every pre-Nakamoto block)\nexport type CoinbasePayload = {\n payloadType: typeof PayloadType.Coinbase;\n coinbaseBuffer: string; // 32 bytes hex\n};\n\n// Coinbase to alt recipient payload\nexport type CoinbaseToAltRecipientPayload = {\n payloadType: typeof PayloadType.CoinbaseToAltRecipient;\n coinbaseBuffer: string; // 32 bytes hex\n recipient: ClarityValue; // PrincipalCV\n};\n\n// Poison microblock payload\nexport type PoisonMicroblockPayload = {\n payloadType: typeof PayloadType.PoisonMicroblock;\n header1: string; // 132 bytes hex (raw microblock header)\n header2: string; // 132 bytes hex (raw microblock header)\n};\n\n// Tenure change payload (Nakamoto)\nexport type TenureChangePayload = {\n payloadType: typeof PayloadType.TenureChange;\n tenureConsensusHash: string; // 20 bytes hex\n prevTenureConsensusHash: string; // 20 bytes hex\n burnViewConsensusHash: string; // 20 bytes hex\n previousTenureEnd: string; // 32 bytes hex\n previousTenureBlocks: number; // u32\n cause: TenureChangeCause;\n pubkeyHash: string; // 20 bytes hex\n};\n\n// Nakamoto coinbase payload\nexport type NakamotoCoinbasePayload = {\n payloadType: typeof PayloadType.NakamotoCoinbase;\n coinbaseBuffer: string; // 32 bytes hex\n recipient: ClarityValue | null; // Optional PrincipalCV\n vrfProof: string; // 80 bytes hex\n};\n\nexport type TransactionPayload =\n | TokenTransferPayload\n | ContractCallPayload\n | SmartContractPayload\n | CoinbasePayload\n | CoinbaseToAltRecipientPayload\n | PoisonMicroblockPayload\n | TenureChangePayload\n | NakamotoCoinbasePayload;\n\n// Spending condition\nexport type SingleSigSpendingCondition = {\n hashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH;\n signer: string; // hash160 hex\n nonce: bigint;\n fee: bigint;\n keyEncoding: PubKeyEncoding;\n signature: string; // 65-byte recoverable sig hex\n};\n\nexport type TransactionAuthField = {\n pubKeyEncoding: PubKeyEncoding;\n type: \"publicKey\" | \"signature\";\n data: string; // hex\n};\n\nexport type MultiSigHashMode =\n | typeof AddressHashMode.P2SH\n | typeof AddressHashMode.P2WSH\n | typeof AddressHashMode.P2SH_NonSequential\n | typeof AddressHashMode.P2WSH_P2SH_NonSequential;\n\nexport type MultiSigSpendingCondition = {\n hashMode: MultiSigHashMode;\n signer: string;\n nonce: bigint;\n fee: bigint;\n fields: TransactionAuthField[];\n signaturesRequired: number;\n};\n\nexport type SpendingCondition = SingleSigSpendingCondition | MultiSigSpendingCondition;\n\nexport type StandardAuthorization = {\n authType: typeof AuthType.Standard;\n spendingCondition: SpendingCondition;\n};\n\nexport type SponsoredAuthorization = {\n authType: typeof AuthType.Sponsored;\n spendingCondition: SpendingCondition;\n sponsorSpendingCondition: SpendingCondition;\n};\n\nexport type Authorization = StandardAuthorization | SponsoredAuthorization;\n\n// Full transaction\nexport type StacksTransaction = {\n version: number;\n chainId: number;\n auth: Authorization;\n anchorMode: AnchorMode;\n postConditionMode: PostConditionModeWire;\n postConditions: PostConditionWire[];\n payload: TransactionPayload;\n};\n\n// Wire post condition types\nexport type PostConditionWire = StxPostConditionWire | FtPostConditionWire | NftPostConditionWire;\n\nexport type StxPostConditionWire = {\n type: \"stx\";\n principal: PostConditionPrincipalWire;\n conditionCode: number;\n amount: bigint;\n};\n\nexport type FtPostConditionWire = {\n type: \"ft\";\n principal: PostConditionPrincipalWire;\n asset: AssetInfoWire;\n conditionCode: number;\n amount: bigint;\n};\n\nexport type NftPostConditionWire = {\n type: \"nft\";\n principal: PostConditionPrincipalWire;\n asset: AssetInfoWire;\n conditionCode: number;\n assetId: ClarityValue;\n};\n\nexport type PostConditionPrincipalWire =\n | { type: \"origin\" }\n | { type: \"standard\"; address: string }\n | { type: \"contract\"; address: string; contractName: string };\n\nexport type AssetInfoWire = {\n address: string;\n contractName: string;\n assetName: string;\n};\n",
|
|
6
|
+
"import {\n bytesToHex,\n hexToBytes,\n concatBytes,\n intToBytes,\n intToHex,\n utf8ToBytes,\n asciiToBytes,\n writeUInt32BE,\n writeUInt16BE,\n writeUInt8,\n} from \"../../utils/encoding.ts\";\nimport { c32addressDecode } from \"../../utils/c32.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport {\n AuthType,\n PayloadType,\n PostConditionPrincipalId,\n AssetType,\n MEMO_MAX_LENGTH_BYTES,\n type StacksTransaction,\n type Authorization,\n type SpendingCondition,\n type SingleSigSpendingCondition,\n type MultiSigSpendingCondition,\n type TransactionPayload,\n type PostConditionWire,\n type PostConditionPrincipalWire,\n type AssetInfoWire,\n type TransactionAuthField,\n type CoinbasePayload,\n type CoinbaseToAltRecipientPayload,\n type PoisonMicroblockPayload,\n type TenureChangePayload as TenureChangePayloadType,\n type NakamotoCoinbasePayload,\n} from \"../types.ts\";\n\n// Address serialization: version (1 byte) + hash160 (20 bytes)\nfunction serializeAddress(c32Address: string): Uint8Array {\n const [version, hash160] = c32addressDecode(c32Address);\n return 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 const content = utf8ToBytes(str);\n const prefix = hexToBytes(intToHex(content.byteLength, prefixBytes));\n return concatBytes(prefix, content);\n}\n\n// LP string for code body (4-byte prefix)\nfunction serializeLPStringLong(str: string): Uint8Array {\n return serializeLPString(str, 4);\n}\n\n// Memo: flat 34-byte field (no length prefix) per SIP-005\nfunction serializeMemo(memo: string): Uint8Array {\n const content = asciiToBytes(memo);\n const padded = new Uint8Array(MEMO_MAX_LENGTH_BYTES);\n padded.set(content.slice(0, MEMO_MAX_LENGTH_BYTES));\n return padded;\n}\n\nfunction serializeSpendingCondition(condition: SpendingCondition): Uint8Array {\n const parts: Uint8Array[] = [\n writeUInt8(condition.hashMode),\n hexToBytes(condition.signer), // 20 bytes\n intToBytes(condition.nonce, 8),\n intToBytes(condition.fee, 8),\n ];\n\n if (\"signature\" in condition) {\n // Single sig\n const sc = condition as SingleSigSpendingCondition;\n parts.push(writeUInt8(sc.keyEncoding));\n parts.push(hexToBytes(sc.signature)); // 65 bytes\n } else {\n // Multi sig\n const mc = condition as MultiSigSpendingCondition;\n // Fields as LP list\n parts.push(writeUInt32BE(mc.fields.length));\n for (const field of mc.fields) {\n parts.push(serializeAuthField(field));\n }\n parts.push(writeUInt16BE(mc.signaturesRequired));\n }\n\n return concatBytes(...parts);\n}\n\nfunction serializeAuthField(field: TransactionAuthField): Uint8Array {\n if (field.type === \"publicKey\") {\n const typeId = field.pubKeyEncoding === 0x00 ? 0x00 : 0x01;\n return concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n } else {\n const typeId = field.pubKeyEncoding === 0x00 ? 0x02 : 0x03;\n return concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n }\n}\n\nfunction serializeAuthorization(auth: Authorization): Uint8Array {\n const parts: Uint8Array[] = [writeUInt8(auth.authType)];\n parts.push(serializeSpendingCondition(auth.spendingCondition));\n if (auth.authType === AuthType.Sponsored) {\n parts.push(serializeSpendingCondition(auth.sponsorSpendingCondition));\n }\n return concatBytes(...parts);\n}\n\nfunction serializePrincipal(principal: PostConditionPrincipalWire): Uint8Array {\n switch (principal.type) {\n case \"origin\":\n return writeUInt8(PostConditionPrincipalId.Origin);\n case \"standard\":\n return concatBytes(\n writeUInt8(PostConditionPrincipalId.Standard),\n serializeAddress(principal.address)\n );\n case \"contract\":\n return concatBytes(\n writeUInt8(PostConditionPrincipalId.Contract),\n serializeAddress(principal.address),\n serializeLPString(principal.contractName)\n );\n }\n}\n\nfunction serializeAssetInfo(asset: AssetInfoWire): Uint8Array {\n return concatBytes(\n serializeAddress(asset.address),\n serializeLPString(asset.contractName),\n serializeLPString(asset.assetName)\n );\n}\n\nfunction serializePostCondition(pc: PostConditionWire): Uint8Array {\n // Wire order: asset_type first, then principal (per SIP-005)\n const parts: Uint8Array[] = [];\n\n switch (pc.type) {\n case \"stx\":\n parts.push(writeUInt8(AssetType.STX));\n parts.push(serializePrincipal(pc.principal));\n parts.push(writeUInt8(pc.conditionCode));\n parts.push(intToBytes(pc.amount, 8));\n break;\n case \"ft\":\n parts.push(writeUInt8(AssetType.Fungible));\n parts.push(serializePrincipal(pc.principal));\n parts.push(serializeAssetInfo(pc.asset));\n parts.push(writeUInt8(pc.conditionCode));\n parts.push(intToBytes(pc.amount, 8));\n break;\n case \"nft\":\n parts.push(writeUInt8(AssetType.NonFungible));\n parts.push(serializePrincipal(pc.principal));\n parts.push(serializeAssetInfo(pc.asset));\n parts.push(serializeCVBytes(pc.assetId));\n parts.push(writeUInt8(pc.conditionCode));\n break;\n }\n\n return concatBytes(...parts);\n}\n\nfunction serializePostConditions(pcs: PostConditionWire[]): Uint8Array {\n const parts: Uint8Array[] = [writeUInt32BE(pcs.length)];\n for (const pc of pcs) {\n parts.push(serializePostCondition(pc));\n }\n return concatBytes(...parts);\n}\n\nexport function serializePayload(payload: TransactionPayload): Uint8Array {\n const parts: Uint8Array[] = [writeUInt8(payload.payloadType)];\n\n switch (payload.payloadType) {\n case PayloadType.TokenTransfer:\n parts.push(serializeCVBytes(payload.recipient));\n parts.push(intToBytes(payload.amount, 8));\n parts.push(serializeMemo(payload.memo));\n break;\n\n case PayloadType.ContractCall:\n parts.push(serializeAddress(payload.contractAddress));\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPString(payload.functionName));\n parts.push(writeUInt32BE(payload.functionArgs.length));\n for (const arg of payload.functionArgs) {\n parts.push(serializeCVBytes(arg));\n }\n break;\n\n case PayloadType.SmartContract:\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPStringLong(payload.codeBody));\n break;\n\n case PayloadType.VersionedSmartContract:\n parts.push(writeUInt8(payload.clarityVersion ?? 2));\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPStringLong(payload.codeBody));\n break;\n\n case PayloadType.Coinbase:\n parts.push(hexToBytes((payload as CoinbasePayload).coinbaseBuffer));\n break;\n\n case PayloadType.CoinbaseToAltRecipient: {\n const cbAlt = payload as CoinbaseToAltRecipientPayload;\n parts.push(hexToBytes(cbAlt.coinbaseBuffer));\n parts.push(serializeCVBytes(cbAlt.recipient));\n break;\n }\n\n case PayloadType.PoisonMicroblock: {\n const pm = payload as PoisonMicroblockPayload;\n parts.push(hexToBytes(pm.header1));\n parts.push(hexToBytes(pm.header2));\n break;\n }\n\n case PayloadType.TenureChange: {\n const tc = payload as TenureChangePayloadType;\n parts.push(hexToBytes(tc.tenureConsensusHash));\n parts.push(hexToBytes(tc.prevTenureConsensusHash));\n parts.push(hexToBytes(tc.burnViewConsensusHash));\n parts.push(hexToBytes(tc.previousTenureEnd));\n parts.push(writeUInt32BE(tc.previousTenureBlocks));\n parts.push(writeUInt8(tc.cause));\n parts.push(hexToBytes(tc.pubkeyHash));\n break;\n }\n\n case PayloadType.NakamotoCoinbase: {\n const nc = payload as NakamotoCoinbasePayload;\n parts.push(hexToBytes(nc.coinbaseBuffer));\n if (nc.recipient) {\n parts.push(serializeCVBytes({ type: \"some\", value: nc.recipient }));\n } else {\n parts.push(serializeCVBytes({ type: \"none\" }));\n }\n parts.push(hexToBytes(nc.vrfProof));\n break;\n }\n }\n\n return concatBytes(...parts);\n}\n\nexport function serializeTransaction(tx: StacksTransaction): Uint8Array {\n return concatBytes(\n writeUInt8(tx.version),\n writeUInt32BE(tx.chainId),\n serializeAuthorization(tx.auth),\n writeUInt8(tx.anchorMode),\n writeUInt8(tx.postConditionMode),\n serializePostConditions(tx.postConditions),\n serializePayload(tx.payload)\n );\n}\n\nexport function serializeTransactionHex(tx: StacksTransaction): string {\n return bytesToHex(serializeTransaction(tx));\n}\n",
|
|
7
|
+
"import {\n getPublicKey as nobleGetPublicKey,\n sign,\n etc,\n} from \"@noble/secp256k1\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport {\n bytesToHex,\n hexToBytes,\n intToBytes,\n intToHex,\n concatBytes,\n} from \"../utils/encoding.ts\";\nimport { hashP2PKH, txidFromBytes } from \"../utils/hash.ts\";\nimport {\n AuthType,\n AddressHashMode,\n PubKeyEncoding,\n RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n type SingleSigSpendingCondition,\n type SpendingCondition,\n type Authorization,\n type StandardAuthorization,\n type SponsoredAuthorization,\n} from \"./types.ts\";\n\n// Ensure sync signing is available\netc.hmacSha256Sync = (key: Uint8Array, ...msgs: Uint8Array[]) => {\n const h = hmac.create(sha256, key);\n msgs.forEach((msg) => h.update(msg));\n return h.digest();\n};\n\nconst EMPTY_SIG = bytesToHex(new Uint8Array(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES));\n\nexport function createSingleSigSpendingCondition(\n publicKey: string,\n nonce: bigint,\n fee: bigint\n): SingleSigSpendingCondition {\n const pubKeyBytes = hexToBytes(publicKey);\n const signer = hashP2PKH(pubKeyBytes);\n const isCompressed = pubKeyBytes.length === 33;\n\n return {\n hashMode: AddressHashMode.P2PKH,\n signer,\n nonce,\n fee,\n keyEncoding: isCompressed ? PubKeyEncoding.Compressed : PubKeyEncoding.Uncompressed,\n signature: EMPTY_SIG,\n };\n}\n\nexport function createStandardAuth(\n spendingCondition: SpendingCondition\n): StandardAuthorization {\n return { authType: AuthType.Standard, spendingCondition };\n}\n\nexport function createSponsoredAuth(\n spendingCondition: SpendingCondition,\n sponsorSpendingCondition?: SpendingCondition\n): SponsoredAuthorization {\n return {\n authType: AuthType.Sponsored,\n spendingCondition,\n sponsorSpendingCondition: sponsorSpendingCondition ?? createSingleSigSpendingCondition(\n \"0\".repeat(66),\n 0n,\n 0n\n ),\n };\n}\n\nfunction clearCondition(condition: SpendingCondition): SpendingCondition {\n if (\"signature\" in condition) {\n return {\n ...condition,\n nonce: 0n,\n fee: 0n,\n signature: EMPTY_SIG,\n };\n }\n return {\n ...condition,\n nonce: 0n,\n fee: 0n,\n fields: [],\n };\n}\n\nexport function intoInitialSighashAuth(auth: Authorization): Authorization {\n if (auth.authType === AuthType.Standard) {\n return createStandardAuth(clearCondition(auth.spendingCondition));\n }\n return createSponsoredAuth(\n clearCondition(auth.spendingCondition),\n clearCondition(createSingleSigSpendingCondition(\"0\".repeat(66), 0n, 0n))\n );\n}\n\n/** Compute pre-sign sighash = sha512/256(prevSigHash + authType + fee + nonce) */\nexport function sigHashPreSign(\n curSigHash: string,\n authType: number,\n fee: bigint,\n nonce: bigint\n): string {\n const data = concatBytes(\n hexToBytes(curSigHash),\n new Uint8Array([authType]),\n intToBytes(fee, 8),\n intToBytes(nonce, 8)\n );\n return txidFromBytes(data);\n}\n\n/** Compute post-sign sighash = sha512/256(preSigHash + pubKeyEncoding + signature) */\nexport function sigHashPostSign(\n curSigHash: string,\n pubKeyEncoding: number,\n signature: string\n): string {\n const data = concatBytes(\n hexToBytes(curSigHash),\n new Uint8Array([pubKeyEncoding]),\n hexToBytes(signature)\n );\n return txidFromBytes(data);\n}\n\n/** Sign with private key and return VRS signature (recoveryId + r + s) */\nfunction signWithKey(privateKey: string, messageHash: string): string {\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const sig = sign(messageHash, keyBytes, { lowS: true });\n const recoveryIdHex = intToHex(sig.recovery, 1);\n return recoveryIdHex + sig.toCompactHex();\n}\n\nexport function nextSignature(\n curSigHash: string,\n authType: number,\n fee: bigint,\n nonce: bigint,\n privateKey: string\n): { nextSig: string; nextSigHash: string } {\n const sigHashPre = sigHashPreSign(curSigHash, authType, fee, nonce);\n\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const pubKey = nobleGetPublicKey(keyBytes, true);\n const isCompressed = pubKey.length === 33;\n const pubKeyEncoding = isCompressed\n ? PubKeyEncoding.Compressed\n : PubKeyEncoding.Uncompressed;\n\n const nextSig = signWithKey(privateKey, sigHashPre);\n const nextSigHash = sigHashPostSign(sigHashPre, pubKeyEncoding, nextSig);\n\n return { nextSig, nextSigHash };\n}\n",
|
|
8
|
+
"import {\n getPublicKey as nobleGetPublicKey,\n sign as nobleSign,\n} from \"@noble/secp256k1\";\nimport { c32address } from \"../utils/c32.ts\";\nimport { bytesToHex, hexToBytes, intToHex, concatBytes } from \"../utils/encoding.ts\";\nimport { hash160 } from \"../utils/hash.ts\";\nimport {\n sigHashPreSign,\n sigHashPostSign,\n intoInitialSighashAuth,\n nextSignature,\n} from \"./authorization.ts\";\nimport { txidFromBytes } from \"../utils/hash.ts\";\nimport { serializeTransaction } from \"./wire/serialize.ts\";\nimport {\n AuthType,\n AddressHashMode,\n PubKeyEncoding,\n type MultiSigSpendingCondition,\n type MultiSigHashMode,\n type TransactionAuthField,\n type StacksTransaction,\n} from \"./types.ts\";\nimport type { StacksChain } from \"../chains/types.ts\";\nimport type { LocalAccount, CustomAccount } from \"../accounts/types.ts\";\n\n// OP codes for redeem script\nconst OP_CHECKMULTISIG = 0xae;\n\n/** Check if hash mode is non-sequential (SIP-027) */\nexport function isNonSequential(hashMode: number): boolean {\n return (hashMode & 0x04) !== 0;\n}\n\n/** Build a Bitcoin-style redeem script for m-of-n multi-sig */\nfunction makeRedeemScript(publicKeys: string[], signaturesRequired: number): Uint8Array {\n const parts: Uint8Array[] = [];\n parts.push(new Uint8Array([0x50 + signaturesRequired])); // OP_n\n for (const pk of publicKeys) {\n const pkBytes = hexToBytes(pk);\n parts.push(new Uint8Array([pkBytes.length])); // length prefix (0x21 for compressed)\n parts.push(pkBytes);\n }\n parts.push(new Uint8Array([0x50 + publicKeys.length])); // OP_m\n parts.push(new Uint8Array([OP_CHECKMULTISIG]));\n return concatBytes(...parts);\n}\n\n/** Derive a multi-sig address from public keys */\nexport function makeMultiSigAddress(\n publicKeys: string[],\n signaturesRequired: number,\n chain?: StacksChain\n): string {\n if (signaturesRequired < 1 || signaturesRequired > publicKeys.length) {\n throw new Error(`signaturesRequired must be between 1 and ${publicKeys.length}`);\n }\n const redeemScript = makeRedeemScript(publicKeys, signaturesRequired);\n const signer = hash160(redeemScript);\n const version = chain?.addressVersion?.multiSig ?? 20; // mainnet default\n return c32address(version, bytesToHex(signer));\n}\n\n/** Create an empty multi-sig spending condition */\nexport function createMultiSigSpendingCondition(\n publicKeys: string[],\n signaturesRequired: number,\n nonce: bigint,\n fee: bigint,\n hashMode: MultiSigHashMode = AddressHashMode.P2SH\n): MultiSigSpendingCondition {\n const redeemScript = makeRedeemScript(publicKeys, signaturesRequired);\n const signer = bytesToHex(hash160(redeemScript));\n\n return {\n hashMode,\n signer,\n nonce,\n fee,\n fields: [],\n signaturesRequired,\n };\n}\n\n/** Compute the initial sighash for a transaction (same as signBegin) */\nfunction initialSigHash(tx: StacksTransaction): string {\n const cleared: StacksTransaction = {\n ...tx,\n auth: intoInitialSighashAuth(tx.auth),\n };\n return txidFromBytes(serializeTransaction(cleared));\n}\n\n/** Compute the presign-sighash used by all non-sequential signers */\nfunction nonSequentialPreSignHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n const initHash = initialSigHash(tx);\n return sigHashPreSign(initHash, AuthType.Standard, condition.fee, condition.nonce);\n}\n\n/** Replay sighash through existing auth fields of a multi-sig tx */\nexport function replayMultiSigSigHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n\n // Non-sequential: all signers sign the same presign-sighash, no field chaining\n if (isNonSequential(condition.hashMode)) {\n const preSign = nonSequentialPreSignHash(tx);\n // Chain through all fields to get the final sighash\n let curSigHash = preSign;\n for (const field of condition.fields) {\n curSigHash = sigHashPostSign(curSigHash, field.pubKeyEncoding, field.data);\n }\n return curSigHash;\n }\n\n // Sequential: chain through all fields\n let curSigHash = initialSigHash(tx);\n for (const field of condition.fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n return curSigHash;\n}\n\n/** Sign one position of a multi-sig transaction with a private key */\nexport function signMultiSig(\n tx: StacksTransaction,\n privateKey: string,\n publicKeys: string[]\n): StacksTransaction {\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const signerPubKey = bytesToHex(nobleGetPublicKey(keyBytes, true));\n\n const signerIndex = publicKeys.findIndex((pk) => pk === signerPubKey);\n if (signerIndex === -1) {\n throw new Error(\"Private key does not correspond to any signer in the multi-sig\");\n }\n\n const condition = { ...(tx.auth.spendingCondition as MultiSigSpendingCondition) };\n\n // Non-sequential: all signers sign the same presign-sighash independently\n if (isNonSequential(condition.hashMode)) {\n return signNonSequential(tx, condition, privateKey);\n }\n\n // Sequential: existing P2SH behavior\n return signSequential(tx, condition, privateKey, publicKeys, signerIndex);\n}\n\n/** Non-sequential signing: compute presign-sighash from initial tx, sign, append */\nfunction signNonSequential(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n privateKey: string\n): StacksTransaction {\n const fields = [...condition.fields];\n const preSignHash = nonSequentialPreSignHash(tx);\n\n // Sign the presign-sighash directly\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const sig = nobleSign(preSignHash, keyBytes, { lowS: true });\n const recoveryIdHex = intToHex(sig.recovery, 1);\n const nextSig = recoveryIdHex + sig.toCompactHex();\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n\n // Auto-finalize: non-sequential needs no pubkey gap-filling\n if (sigCount >= condition.signaturesRequired) {\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n }\n\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n}\n\n/** Sequential signing: existing P2SH behavior */\nfunction signSequential(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n privateKey: string,\n publicKeys: string[],\n signerIndex: number\n): StacksTransaction {\n const fields = [...condition.fields];\n\n // Replay sighash through existing fields\n let curSigHash = initialSigHash(tx);\n for (const field of fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n\n // Fill intervening positions with pubkey fields\n for (let i = fields.length; i < signerIndex; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n // Sign at signerIndex\n const { nextSig, nextSigHash } = nextSignature(\n curSigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce,\n privateKey\n );\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n curSigHash = nextSigHash;\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n // Count signatures so far\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n let finalCondition = newCondition;\n\n // Auto-finalize if enough signatures collected\n if (sigCount >= condition.signaturesRequired) {\n finalCondition = finalizeMultiSigCondition(newCondition, publicKeys, curSigHash);\n }\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Sign one position of a multi-sig transaction with an account */\nexport async function signMultiSigWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount,\n publicKeys: string[]\n): Promise<StacksTransaction> {\n const signerPubKey = account.publicKey;\n\n const signerIndex = publicKeys.findIndex((pk) => pk === signerPubKey);\n if (signerIndex === -1) {\n throw new Error(\"Account does not correspond to any signer in the multi-sig\");\n }\n\n const condition = { ...(tx.auth.spendingCondition as MultiSigSpendingCondition) };\n\n // Non-sequential: all signers sign the same presign-sighash independently\n if (isNonSequential(condition.hashMode)) {\n return signNonSequentialWithAccount(tx, condition, account);\n }\n\n // Sequential: existing behavior\n return signSequentialWithAccount(tx, condition, account, publicKeys, signerIndex);\n}\n\n/** Non-sequential signing with account */\nasync function signNonSequentialWithAccount(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n const fields = [...condition.fields];\n const preSignHash = nonSequentialPreSignHash(tx);\n\n const sigBytes = await account.sign(hexToBytes(preSignHash));\n const nextSig = bytesToHex(sigBytes);\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n}\n\n/** Sequential signing with account */\nasync function signSequentialWithAccount(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n account: LocalAccount | CustomAccount,\n publicKeys: string[],\n signerIndex: number\n): Promise<StacksTransaction> {\n const fields = [...condition.fields];\n\n // Replay sighash through existing fields\n let curSigHash = initialSigHash(tx);\n for (const field of fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n\n // Fill intervening positions with pubkey fields\n for (let i = fields.length; i < signerIndex; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n // Sign at signerIndex\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n const sigBytes = await account.sign(hexToBytes(preSign));\n const nextSig = bytesToHex(sigBytes);\n const nextSigHash = sigHashPostSign(preSign, PubKeyEncoding.Compressed, nextSig);\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n curSigHash = nextSigHash;\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n // Count signatures so far\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n let finalCondition = newCondition;\n\n // Auto-finalize if enough signatures collected\n if (sigCount >= condition.signaturesRequired) {\n finalCondition = finalizeMultiSigCondition(newCondition, publicKeys, curSigHash);\n }\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Fill remaining slots with pubkey fields after all signatures are collected */\nexport function finalizeMultiSig(\n tx: StacksTransaction,\n publicKeys: string[]\n): StacksTransaction {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n\n // Non-sequential: no pubkey gap-filling needed\n if (isNonSequential(condition.hashMode)) {\n return tx;\n }\n\n const curSigHash = replayMultiSigSigHash(tx);\n const finalCondition = finalizeMultiSigCondition(condition, publicKeys, curSigHash);\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Internal: finalize remaining pubkey slots (sequential only) */\nfunction finalizeMultiSigCondition(\n condition: MultiSigSpendingCondition,\n publicKeys: string[],\n curSigHash: string\n): MultiSigSpendingCondition {\n const fields = [...condition.fields];\n let sigHash = curSigHash;\n\n // Fill remaining positions\n for (let i = fields.length; i < publicKeys.length; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(sigHash, AuthType.Standard, condition.fee, condition.nonce);\n sigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n return { ...condition, fields };\n}\n\n/** Combine independently-signed non-sequential multi-sig transactions */\nexport function combineMultiSigSignatures(\n baseTx: StacksTransaction,\n signedTxs: StacksTransaction[]\n): StacksTransaction {\n const condition = baseTx.auth.spendingCondition as MultiSigSpendingCondition;\n\n if (!isNonSequential(condition.hashMode)) {\n throw new Error(\"combineMultiSigSignatures only works with non-sequential hash modes (SIP-027)\");\n }\n\n // Collect all signature fields from each signed tx\n const seenSigs = new Set<string>();\n const signatures: TransactionAuthField[] = [];\n\n for (const stx of signedTxs) {\n const stxCondition = stx.auth.spendingCondition as MultiSigSpendingCondition;\n for (const field of stxCondition.fields) {\n if (field.type === \"signature\" && !seenSigs.has(field.data)) {\n seenSigs.add(field.data);\n signatures.push(field);\n }\n }\n }\n\n if (signatures.length === 0) {\n throw new Error(\"No signatures found in the provided transactions\");\n }\n\n const newCondition: MultiSigSpendingCondition = {\n ...condition,\n fields: signatures,\n };\n\n return {\n ...baseTx,\n auth: { ...baseTx.auth, spendingCondition: newCondition },\n };\n}\n",
|
|
9
|
+
"import { bytesToHex, hexToBytes } from \"../utils/encoding.ts\";\nimport { txidFromBytes } from \"../utils/hash.ts\";\nimport {\n intoInitialSighashAuth,\n nextSignature,\n sigHashPreSign,\n sigHashPostSign,\n} from \"./authorization.ts\";\nimport { replayMultiSigSigHash } from \"./multisig.ts\";\nimport { serializeTransaction } from \"./wire/serialize.ts\";\nimport {\n AuthType,\n type StacksTransaction,\n type SingleSigSpendingCondition,\n type SponsoredAuthorization,\n} from \"./types.ts\";\nimport type { LocalAccount, CustomAccount } from \"../accounts/types.ts\";\n\nfunction txid(tx: StacksTransaction): string {\n return txidFromBytes(serializeTransaction(tx));\n}\n\n/** Compute the initial sighash for a transaction */\nexport function signBegin(tx: StacksTransaction): string {\n const cleared: StacksTransaction = {\n ...tx,\n auth: intoInitialSighashAuth(tx.auth),\n };\n return txid(cleared);\n}\n\n/** Sign a single-sig transaction with a private key, returning the signed transaction */\nexport function signTransaction(\n tx: StacksTransaction,\n privateKey: string\n): StacksTransaction {\n const sigHash = signBegin(tx);\n const condition = tx.auth.spendingCondition as SingleSigSpendingCondition;\n\n // Origin always signs with AuthType.Standard (even for sponsored txs)\n const { nextSig } = nextSignature(\n sigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce,\n privateKey\n );\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: {\n ...condition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Sign a single-sig transaction using an account (LocalAccount or CustomAccount) */\nexport async function signTransactionWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n const sigHash = signBegin(tx);\n const condition = tx.auth.spendingCondition as SingleSigSpendingCondition;\n\n // Origin always signs with AuthType.Standard (even for sponsored txs)\n const sigHashPre = sigHashPreSign(\n sigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce\n );\n\n // account.sign returns 65-byte VRS (recovery + r + s)\n const sigBytes = await account.sign(hexToBytes(sigHashPre));\n const nextSig = bytesToHex(sigBytes);\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: {\n ...condition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Get the txid of a transaction */\nexport function getTransactionId(tx: StacksTransaction): string {\n return txid(tx);\n}\n\n/** Reconstruct the sighash after origin signing (needed for sponsor signing) */\nexport function getOriginSigHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition;\n\n // Multi-sig: replay through all fields\n if (\"fields\" in condition) {\n return replayMultiSigSigHash(tx);\n }\n\n // Single-sig\n const initialSigHash = signBegin(tx);\n const sc = condition as SingleSigSpendingCondition;\n const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);\n return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);\n}\n\n/** Sign a sponsored transaction as the sponsor with a private key */\nexport function signSponsor(tx: StacksTransaction, privateKey: string): StacksTransaction {\n if (tx.auth.authType !== AuthType.Sponsored) {\n throw new Error(\"Transaction must be sponsored\");\n }\n const auth = tx.auth as SponsoredAuthorization;\n const sponsorCondition = auth.sponsorSpendingCondition as SingleSigSpendingCondition;\n const originSigHash = getOriginSigHash(tx);\n\n const { nextSig } = nextSignature(\n originSigHash,\n AuthType.Sponsored,\n sponsorCondition.fee,\n sponsorCondition.nonce,\n privateKey\n );\n\n return {\n ...tx,\n auth: {\n ...auth,\n sponsorSpendingCondition: {\n ...sponsorCondition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Sign a sponsored transaction as the sponsor using an account */\nexport async function signSponsorWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n if (tx.auth.authType !== AuthType.Sponsored) {\n throw new Error(\"Transaction must be sponsored\");\n }\n const auth = tx.auth as SponsoredAuthorization;\n const sponsorCondition = auth.sponsorSpendingCondition as SingleSigSpendingCondition;\n const originSigHash = getOriginSigHash(tx);\n\n const sigHashPre = sigHashPreSign(\n originSigHash,\n AuthType.Sponsored,\n sponsorCondition.fee,\n sponsorCondition.nonce\n );\n\n const sigBytes = await account.sign(hexToBytes(sigHashPre));\n const nextSig = bytesToHex(sigBytes);\n\n return {\n ...tx,\n auth: {\n ...auth,\n sponsorSpendingCondition: {\n ...sponsorCondition,\n signature: nextSig,\n },\n },\n };\n}\n",
|
|
10
|
+
"import type { StacksChain } from \"../chains/types.ts\";\nimport type { ClarityValue } from \"../clarity/types.ts\";\nimport type { PostCondition } from \"../postconditions/types.ts\";\nimport type { MultiSigHashMode, SpendingCondition } from \"./types.ts\";\nimport {\n createSingleSigSpendingCondition,\n createStandardAuth,\n createSponsoredAuth,\n} from \"./authorization.ts\";\nimport { createMultiSigSpendingCondition } from \"./multisig.ts\";\nimport {\n PayloadType,\n AnchorMode,\n PostConditionModeWire,\n FungibleConditionCode,\n NonFungibleConditionCode,\n type StacksTransaction,\n type PostConditionWire,\n type PostConditionPrincipalWire,\n type ClarityVersion,\n} from \"./types.ts\";\nimport { Cl } from \"../clarity/values.ts\";\nimport { intToBigInt, type IntegerType } from \"../utils/encoding.ts\";\nimport { parseContractId } from \"../utils/address.ts\";\n\ntype MultiSigOptions = {\n publicKeys?: string[];\n signaturesRequired?: number;\n hashMode?: MultiSigHashMode;\n};\n\nexport type BuildTokenTransferOptions = MultiSigOptions & {\n recipient: string;\n amount: IntegerType;\n memo?: string;\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nexport type BuildContractCallOptions = MultiSigOptions & {\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: ClarityValue[];\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nexport type BuildContractDeployOptions = MultiSigOptions & {\n contractName: string;\n codeBody: string;\n clarityVersion?: ClarityVersion;\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nfunction resolvePcMode(mode?: \"allow\" | \"deny\"): PostConditionModeWire {\n return mode === \"allow\" ? PostConditionModeWire.Allow : PostConditionModeWire.Deny;\n}\n\nfunction convertPostConditions(pcs?: PostCondition[]): PostConditionWire[] {\n if (!pcs || pcs.length === 0) return [];\n return pcs.map(convertPostCondition);\n}\n\nfunction resolvePrincipal(address: string): PostConditionPrincipalWire {\n if (address === \"origin\") return { type: \"origin\" };\n const [addr, name] = address.split(\".\");\n if (name) {\n return { type: \"contract\", address: addr!, contractName: name };\n }\n return { type: \"standard\", address: addr! };\n}\n\nconst FUNGIBLE_CODE_MAP: Record<string, number> = {\n eq: FungibleConditionCode.Equal,\n gt: FungibleConditionCode.Greater,\n gte: FungibleConditionCode.GreaterEqual,\n lt: FungibleConditionCode.Less,\n lte: FungibleConditionCode.LessEqual,\n};\n\nfunction convertPostCondition(pc: PostCondition): PostConditionWire {\n switch (pc.type) {\n case \"stx-postcondition\":\n return {\n type: \"stx\",\n principal: resolvePrincipal(pc.address),\n conditionCode: FUNGIBLE_CODE_MAP[pc.condition]!,\n amount: intToBigInt(pc.amount),\n };\n case \"ft-postcondition\": {\n const [contractId, tokenName] = pc.asset.split(\"::\");\n const [addr, name] = parseContractId(contractId!);\n return {\n type: \"ft\",\n principal: resolvePrincipal(pc.address),\n asset: { address: addr, contractName: name, assetName: tokenName! },\n conditionCode: FUNGIBLE_CODE_MAP[pc.condition]!,\n amount: intToBigInt(pc.amount),\n };\n }\n case \"nft-postcondition\": {\n const [contractId, tokenName] = pc.asset.split(\"::\");\n const [addr, name] = parseContractId(contractId!);\n return {\n type: \"nft\",\n principal: resolvePrincipal(pc.address),\n asset: { address: addr, contractName: name, assetName: tokenName! },\n conditionCode: pc.condition === \"sent\" ? NonFungibleConditionCode.Sends : NonFungibleConditionCode.DoesNotSend,\n assetId: pc.assetId,\n };\n }\n }\n}\n\nimport type { Authorization } from \"./types.ts\";\n\nfunction resolveSpendingCondition(\n opts: MultiSigOptions & { publicKey?: string },\n nonce: bigint,\n fee: bigint\n): SpendingCondition {\n if (opts.publicKeys) {\n return createMultiSigSpendingCondition(\n opts.publicKeys,\n opts.signaturesRequired!,\n nonce,\n fee,\n opts.hashMode\n );\n }\n return createSingleSigSpendingCondition(opts.publicKey!, nonce, fee);\n}\n\nfunction resolveAuth(spendingCondition: any, sponsored?: boolean): Authorization {\n return sponsored\n ? createSponsoredAuth(spendingCondition)\n : createStandardAuth(spendingCondition);\n}\n\nfunction resolveVersionAndChainId(chain?: StacksChain): { version: number; chainId: number } {\n if (!chain) return { version: 0x00, chainId: 0x00000001 }; // mainnet defaults\n return { version: chain.transactionVersion, chainId: chain.id };\n}\n\nexport function buildTokenTransfer(options: BuildTokenTransferOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n const recipient = Cl.principal(options.recipient);\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: PayloadType.TokenTransfer,\n recipient,\n amount: intToBigInt(options.amount),\n memo: options.memo ?? \"\",\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n\nexport function buildContractCall(options: BuildContractCallOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: PayloadType.ContractCall,\n contractAddress: options.contractAddress,\n contractName: options.contractName,\n functionName: options.functionName,\n functionArgs: options.functionArgs,\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n\nexport function buildContractDeploy(options: BuildContractDeployOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n const useVersioned = options.clarityVersion !== undefined;\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: useVersioned ? PayloadType.VersionedSmartContract : PayloadType.SmartContract,\n clarityVersion: options.clarityVersion,\n contractName: options.contractName,\n codeBody: options.codeBody,\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n"
|
|
11
|
+
],
|
|
12
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,WAAW;AACb;AAIO,IAAM,cAAc;AAAA,EACzB,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;AACpB;AAIO,IAAM,iBAAiB;AAAA,EAC5B,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAIO,IAAM,aAAa;AAAA,EACxB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AACP;AAIO,IAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AACR;AAKO,IAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,0BAA0B;AAC5B;AAIO,IAAM,iBAAiB;AAAA,EAC5B,YAAY;AAAA,EACZ,cAAc;AAChB;AAIO,IAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,MAAM;AAAA,EACN,WAAW;AACb;AAGO,IAAM,2BAA2B;AAAA,EACtC,OAAO;AAAA,EACP,aAAa;AACf;AAGO,IAAM,2BAA2B;AAAA,EACtC,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,IAAM,YAAY;AAAA,EACvB,KAAK;AAAA,EACL,UAAU;AAAA,EACV,aAAa;AACf;AAGO,IAAM,gBAAgB;A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MACtB,cAAc,QAAQ;AAAA,MACtB,cAAc,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA,EAEA,IAAI,QAAQ,YAAY;AAAA,IACrB,GAAW,YAAY,EAAE,YAAY,QAAQ,WAAW;AAAA,EAC3D;AAAA,EACA,OAAO;AAAA;AAGF,SAAS,mBAAmB,CAAC,SAAwD;AAAA,EAC1F,QAAQ,SAAS,YAAY,yBAAyB,QAAQ,KAAK;AAAA,EACnE,MAAM,MAAM,YAAY,QAAQ,GAAG;AAAA,EACnC,MAAM,QAAQ,YAAY,QAAQ,KAAK;AAAA,EAEvC,MAAM,oBAAoB,yBAAyB,SAAS,OAAO,GAAG;AAAA,EACtE,MAAM,eAAe,QAAQ,mBAAmB;AAAA,EAEhD,MAAM,KAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,MAAM,YAAY,mBAAmB,QAAQ,SAAS;AAAA,IACtD,YAAY,WAAW;AAAA,IACvB,mBAAmB,cAAc,QAAQ,iBAAiB;AAAA,IAC1D,gBAAgB,sBAAsB,QAAQ,cAAc;AAAA,IAC5D,SAAS;AAAA,MACP,aAAa,eAAe,YAAY,yBAAyB,YAAY;AAAA,MAC7E,gBAAgB,QAAQ;AAAA,MACxB,cAAc,QAAQ;AAAA,MACtB,UAAU,QAAQ;AAAA,IACpB;AAAA,EACF;AAAA,EAEA,IAAI,QAAQ,YAAY;AAAA,IACrB,GAAW,YAAY,EAAE,YAAY,QAAQ,WAAW;AAAA,EAC3D;AAAA,EACA,OAAO;AAAA;",
|
|
13
|
+
"debugId": "9CEDB9079783463964756E2164756E21",
|
|
14
|
+
"names": []
|
|
15
|
+
}
|
|
@@ -3,14 +3,13 @@ import {
|
|
|
3
3
|
} from "../../shared/stacks-qcae5852.js";
|
|
4
4
|
import {
|
|
5
5
|
hash160
|
|
6
|
-
} from "../../shared/stacks-
|
|
6
|
+
} from "../../shared/stacks-rwfgts3s.js";
|
|
7
7
|
import {
|
|
8
8
|
bytesToHex,
|
|
9
9
|
c32address,
|
|
10
10
|
hexToBytes,
|
|
11
11
|
without0x
|
|
12
|
-
} from "../../shared/stacks-
|
|
13
|
-
import"../../shared/stacks-njvyj3ab.js";
|
|
12
|
+
} from "../../shared/stacks-s7z5q8be.js";
|
|
14
13
|
|
|
15
14
|
// src/accounts/privateKeyToAccount.ts
|
|
16
15
|
import {
|
|
@@ -100,5 +99,5 @@ export {
|
|
|
100
99
|
compressPrivateKey
|
|
101
100
|
};
|
|
102
101
|
|
|
103
|
-
//# debugId=
|
|
102
|
+
//# debugId=7A617EF207440E2164756E2164756E21
|
|
104
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"import { HDKey } from \"@scure/bip32\";\nimport { mnemonicToSeedSync } from \"@scure/bip39\";\nimport { bytesToHex } from \"../utils/encoding.ts\";\nimport { privateKeyToAccount, compressPrivateKey } from \"./privateKeyToAccount.ts\";\nimport type { LocalAccount } from \"./types.ts\";\n\nconst STX_DERIVATION_PATH = \"m/44'/5757'/0'/0\";\n\nexport function mnemonicToAccount(\n mnemonic: string,\n options?: {\n accountIndex?: number;\n addressVersion?: number;\n }\n): LocalAccount {\n const { accountIndex = 0, addressVersion } = options ?? {};\n\n const seed = mnemonicToSeedSync(mnemonic);\n const root = HDKey.fromMasterSeed(seed);\n const child = root.derive(`${STX_DERIVATION_PATH}/${accountIndex}`);\n\n if (!child.privateKey) throw new Error(\"Failed to derive private key\");\n\n const privateKeyHex = compressPrivateKey(bytesToHex(child.privateKey));\n return privateKeyToAccount(privateKeyHex, { addressVersion });\n}\n",
|
|
7
7
|
"import type { AccountSource, CustomAccount } from \"./types.ts\";\n\nexport function toAccount(source: AccountSource): CustomAccount {\n return {\n type: \"custom\",\n address: source.address,\n publicKey: source.publicKey,\n sign: source.sign,\n };\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA,kBACE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F,SAAS,mBAAmB,CAAC,KAAsC;AAAA,EACjE,IAAI,OAAO,QAAQ,UAAU;AAAA,IAC3B,OAAO,WAAW,UAAU,GAAG,CAAC;AAAA,EAClC;AAAA,EACA,OAAO;AAAA;AAIF,SAAS,kBAAkB,CAAC,KAAkC;AAAA,EACnE,MAAM,MAAM,OAAO,QAAQ,WAAW,UAAU,GAAG,IAAI,WAAW,GAAG;AAAA,EACrE,IAAI,IAAI,WAAW,gCAAgC;AAAA,IAAG,OAAO;AAAA,EAC7D,OAAO,GAAG;AAAA;;AC5EZ;AACA;AAKA,IAAM,sBAAsB;AAErB,SAAS,iBAAiB,CAC/B,UACA,SAIc;AAAA,EACd,QAAQ,eAAe,GAAG,mBAAmB,WAAW,CAAC;AAAA,EAEzD,MAAM,OAAO,mBAAmB,QAAQ;AAAA,EACxC,MAAM,OAAO,MAAM,eAAe,IAAI;AAAA,EACtC,MAAM,QAAQ,KAAK,OAAO,GAAG,uBAAuB,cAAc;AAAA,EAElE,IAAI,CAAC,MAAM;AAAA,IAAY,MAAM,IAAI,MAAM,8BAA8B;AAAA,EAErE,MAAM,gBAAgB,mBAAmB,WAAW,MAAM,UAAU,CAAC;AAAA,EACrE,OAAO,oBAAoB,eAAe,EAAE,eAAe,CAAC;AAAA;;ACtBvD,SAAS,SAAS,CAAC,QAAsC;AAAA,EAC9D,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,OAAO;AAAA,IAChB,WAAW,OAAO;AAAA,IAClB,MAAM,OAAO;AAAA,EACf;AAAA;",
|
|
10
|
+
"debugId": "7A617EF207440E2164756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -230,6 +230,8 @@ declare const ClarityVersion: {
|
|
|
230
230
|
readonly Clarity1: 1
|
|
231
231
|
readonly Clarity2: 2
|
|
232
232
|
readonly Clarity3: 3
|
|
233
|
+
readonly Clarity4: 4
|
|
234
|
+
readonly Clarity5: 5
|
|
233
235
|
};
|
|
234
236
|
type ClarityVersion = (typeof ClarityVersion)[keyof typeof ClarityVersion];
|
|
235
237
|
declare const AnchorMode: {
|
|
@@ -260,6 +262,11 @@ type PubKeyEncoding = (typeof PubKeyEncoding)[keyof typeof PubKeyEncoding];
|
|
|
260
262
|
declare const TenureChangeCause: {
|
|
261
263
|
readonly BlockFound: 0x00
|
|
262
264
|
readonly Extended: 0x01
|
|
265
|
+
readonly ExtendedRuntime: 0x02
|
|
266
|
+
readonly ExtendedReadCount: 0x03
|
|
267
|
+
readonly ExtendedReadLength: 0x04
|
|
268
|
+
readonly ExtendedWriteCount: 0x05
|
|
269
|
+
readonly ExtendedWriteLength: 0x06
|
|
263
270
|
};
|
|
264
271
|
type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];
|
|
265
272
|
type TokenTransferPayload = {
|
|
@@ -230,6 +230,8 @@ declare const ClarityVersion: {
|
|
|
230
230
|
readonly Clarity1: 1
|
|
231
231
|
readonly Clarity2: 2
|
|
232
232
|
readonly Clarity3: 3
|
|
233
|
+
readonly Clarity4: 4
|
|
234
|
+
readonly Clarity5: 5
|
|
233
235
|
};
|
|
234
236
|
type ClarityVersion = (typeof ClarityVersion)[keyof typeof ClarityVersion];
|
|
235
237
|
declare const AnchorMode: {
|
|
@@ -260,6 +262,11 @@ type PubKeyEncoding = (typeof PubKeyEncoding)[keyof typeof PubKeyEncoding];
|
|
|
260
262
|
declare const TenureChangeCause: {
|
|
261
263
|
readonly BlockFound: 0x00
|
|
262
264
|
readonly Extended: 0x01
|
|
265
|
+
readonly ExtendedRuntime: 0x02
|
|
266
|
+
readonly ExtendedReadCount: 0x03
|
|
267
|
+
readonly ExtendedReadLength: 0x04
|
|
268
|
+
readonly ExtendedWriteCount: 0x05
|
|
269
|
+
readonly ExtendedWriteLength: 0x06
|
|
263
270
|
};
|
|
264
271
|
type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];
|
|
265
272
|
type TokenTransferPayload = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContractResponseError,
|
|
3
3
|
getContract
|
|
4
|
-
} from "../../shared/stacks-
|
|
4
|
+
} from "../../shared/stacks-q79dx28x.js";
|
|
5
5
|
import {
|
|
6
6
|
deployContract,
|
|
7
7
|
getAccountInfo,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
simulateTransaction,
|
|
17
17
|
sponsorTransaction,
|
|
18
18
|
transferStx
|
|
19
|
-
} from "../../shared/stacks-
|
|
19
|
+
} from "../../shared/stacks-k9p8m3wf.js";
|
|
20
20
|
import {
|
|
21
21
|
callContract,
|
|
22
22
|
estimateFee,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isProviderAccount,
|
|
26
26
|
readContract,
|
|
27
27
|
sendTransaction
|
|
28
|
-
} from "../../shared/stacks-
|
|
28
|
+
} from "../../shared/stacks-96gaxfcf.js";
|
|
29
29
|
import {
|
|
30
30
|
watchAddress,
|
|
31
31
|
watchAddressBalance,
|
|
@@ -35,17 +35,14 @@ import {
|
|
|
35
35
|
watchTransaction
|
|
36
36
|
} from "../../shared/stacks-y3dh7hv1.js";
|
|
37
37
|
import"../../shared/stacks-709tra19.js";
|
|
38
|
-
import"../../shared/stacks-
|
|
39
|
-
import"../../shared/stacks-
|
|
40
|
-
import"../../shared/stacks-
|
|
41
|
-
import"../../shared/stacks-
|
|
42
|
-
import"../../shared/stacks-8yykgdww.js";
|
|
38
|
+
import"../../shared/stacks-p93g814f.js";
|
|
39
|
+
import"../../shared/stacks-6m1z4j07.js";
|
|
40
|
+
import"../../shared/stacks-xp9n3r0t.js";
|
|
41
|
+
import"../../shared/stacks-rg1g0fja.js";
|
|
43
42
|
import"../../shared/stacks-v9jqcpd4.js";
|
|
44
|
-
import"../../shared/stacks-
|
|
45
|
-
import"../../shared/stacks-
|
|
46
|
-
import"../../shared/stacks-
|
|
47
|
-
import"../../shared/stacks-njvyj3ab.js";
|
|
48
|
-
import"../../shared/stacks-xtz0n62y.js";
|
|
43
|
+
import"../../shared/stacks-rwfgts3s.js";
|
|
44
|
+
import"../../shared/stacks-s10yb9gz.js";
|
|
45
|
+
import"../../shared/stacks-s7z5q8be.js";
|
|
49
46
|
export {
|
|
50
47
|
watchTransaction,
|
|
51
48
|
watchNftEvent,
|
|
@@ -77,5 +74,5 @@ export {
|
|
|
77
74
|
ContractResponseError
|
|
78
75
|
};
|
|
79
76
|
|
|
80
|
-
//# debugId=
|
|
77
|
+
//# debugId=1F3515003973BE3864756E2164756E21
|
|
81
78
|
//# sourceMappingURL=index.js.map
|
package/dist/src/bns/index.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
+
import"../../shared/stacks-jrnmh4kc.js";
|
|
1
2
|
import"../../shared/stacks-k58k970n.js";
|
|
2
3
|
import {
|
|
3
4
|
ContractResponseError,
|
|
4
5
|
getContract
|
|
5
|
-
} from "../../shared/stacks-
|
|
6
|
-
import"../../shared/stacks-
|
|
6
|
+
} from "../../shared/stacks-q79dx28x.js";
|
|
7
|
+
import"../../shared/stacks-96gaxfcf.js";
|
|
7
8
|
import"../../shared/stacks-709tra19.js";
|
|
8
|
-
import"../../shared/stacks-
|
|
9
|
-
import
|
|
9
|
+
import"../../shared/stacks-p93g814f.js";
|
|
10
|
+
import {
|
|
11
|
+
Pc
|
|
12
|
+
} from "../../shared/stacks-je937aas.js";
|
|
13
|
+
import"../../shared/stacks-xp9n3r0t.js";
|
|
10
14
|
import {
|
|
11
15
|
Cl
|
|
12
|
-
} from "../../shared/stacks-
|
|
13
|
-
import"../../shared/stacks-8yykgdww.js";
|
|
16
|
+
} from "../../shared/stacks-rg1g0fja.js";
|
|
14
17
|
import"../../shared/stacks-v9jqcpd4.js";
|
|
15
18
|
import {
|
|
16
19
|
hash160
|
|
17
|
-
} from "../../shared/stacks-
|
|
18
|
-
import"../../shared/stacks-
|
|
19
|
-
import"../../shared/stacks-
|
|
20
|
-
import"../../shared/stacks-njvyj3ab.js";
|
|
21
|
-
import"../clarity/index.js";
|
|
22
|
-
import {
|
|
23
|
-
Pc
|
|
24
|
-
} from "../postconditions/index.js";
|
|
25
|
-
import"../../shared/stacks-xtz0n62y.js";
|
|
20
|
+
} from "../../shared/stacks-rwfgts3s.js";
|
|
21
|
+
import"../../shared/stacks-s10yb9gz.js";
|
|
22
|
+
import"../../shared/stacks-s7z5q8be.js";
|
|
26
23
|
|
|
27
24
|
// src/bns/abi.ts
|
|
28
25
|
var BNS_ABI = {
|
|
@@ -625,5 +622,5 @@ export {
|
|
|
625
622
|
BNS_CONTRACTS
|
|
626
623
|
};
|
|
627
624
|
|
|
628
|
-
//# debugId=
|
|
625
|
+
//# debugId=DDACC0BEE24F57B364756E2164756E21
|
|
629
626
|
//# sourceMappingURL=index.js.map
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"import type { Client } from \"../clients/types.ts\";\nimport { getContract } from \"../actions/getContract.ts\";\nimport { BNS_ABI } from \"./abi.ts\";\nimport { ZONEFILE_RESOLVER_ABI } from \"./zonefile-abi.ts\";\nimport { BNS_CONTRACTS, ZONEFILE_RESOLVER_CONTRACTS } from \"./constants.ts\";\nimport {\n parseFQN,\n validateFQN,\n formatFQN,\n generateSalt,\n hashPreorder,\n} from \"./utils.ts\";\nimport type {\n ClaimFastParams,\n TransferParams,\n SetPrimaryParams,\n PreorderParams,\n RegisterParams,\n UpdateZonefileParams,\n} from \"./types.ts\";\nimport { Pc } from \"../postconditions/index.ts\";\nimport { Cl } from \"../clarity/index.ts\";\nimport { ContractResponseError } from \"../actions/getContract.ts\";\n\nfunction getBnsContract(client: Client) {\n if (!client.chain) {\n throw new Error(\"Client must have a chain configured\");\n }\n const network = client.chain.network;\n const contract =\n network === \"mainnet\" ? BNS_CONTRACTS.mainnet : BNS_CONTRACTS.testnet;\n\n return getContract({\n client,\n address: contract.address,\n name: contract.name,\n abi: BNS_ABI,\n });\n}\n\nfunction getZonefileContract(client: Client) {\n if (!client.chain) {\n throw new Error(\"Client must have a chain configured\");\n }\n const network = client.chain.network;\n const contract =\n network === \"mainnet\"\n ? ZONEFILE_RESOLVER_CONTRACTS.mainnet\n : ZONEFILE_RESOLVER_CONTRACTS.testnet;\n\n return getContract({\n client,\n address: contract.address,\n name: contract.name,\n abi: ZONEFILE_RESOLVER_ABI,\n });\n}\n\nfunction stringToBytes(str: string): Uint8Array {\n return new TextEncoder().encode(str);\n}\n\n/**\n * Resolve a BNS name to its owner address.\n * @example\n * const owner = await resolveName(client, \"alice.btc\");\n */\nexport async function resolveName(\n client: Client,\n nameOrFQN: string\n): Promise<string | null> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const bns = getBnsContract(client);\n\n try {\n return (await bns.read.getOwnerName({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n })) as string | null;\n } catch (e) {\n if (e instanceof ContractResponseError) return null;\n throw e;\n }\n}\n\n/**\n * Get the primary name for an address.\n * @example\n * const primary = await getPrimaryName(client, \"SP2J6...\");\n */\nexport async function getPrimaryName(\n client: Client,\n address: string\n): Promise<string | null> {\n const bns = getBnsContract(client);\n\n try {\n const result = (await bns.read.getPrimary({\n owner: address,\n })) as { name: Uint8Array; namespace: Uint8Array } | null;\n\n if (result === null) return null;\n\n const name = new TextDecoder().decode(result.name);\n const namespace = new TextDecoder().decode(result.namespace);\n\n return formatFQN(name, namespace);\n } catch (e) {\n if (e instanceof ContractResponseError) return null;\n throw e;\n }\n}\n\n/**\n * Check if a name is available for registration.\n * @example\n * const available = await canRegister(client, \"bob.btc\");\n */\nexport async function canRegister(\n client: Client,\n nameOrFQN: string\n): Promise<boolean> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const bns = getBnsContract(client);\n\n // No can-register-name function — use can-resolve-name instead.\n // If it resolves, the name is taken. If it errors, it's available.\n try {\n await bns.read.canResolveName({\n namespace: stringToBytes(namespace),\n name: stringToBytes(name),\n });\n return false; // resolved = taken\n } catch {\n return true; // error = available\n }\n}\n\n/**\n * Get the price to register a name in microSTX.\n * @example\n * const price = await getNamePrice(client, \"bob.btc\");\n */\nexport async function getNamePrice(\n client: Client,\n nameOrFQN: string\n): Promise<bigint> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const bns = getBnsContract(client);\n\n // get-name-price returns a nested response: (ok (ok uint))\n const result = (await bns.read.getNamePrice({\n namespace: stringToBytes(namespace),\n name: stringToBytes(name),\n })) as { ok: bigint } | { err: bigint };\n\n if (\"ok\" in result) return result.ok;\n throw new Error(`Failed to get name price for ${nameOrFQN}`);\n}\n\n/**\n * Get the NFT token ID for a name.\n * @example\n * const id = await getNameId(client, \"alice.btc\");\n */\nexport async function getNameId(\n client: Client,\n nameOrFQN: string\n): Promise<bigint | null> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const bns = getBnsContract(client);\n\n try {\n return (await bns.read.getIdFromBns({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n })) as bigint | null;\n } catch (e) {\n if (e instanceof ContractResponseError) return null;\n throw e;\n }\n}\n\n/**\n * Preorder a name (step 1 of secure registration).\n * Commits to a name with a salted hash, preventing front-running.\n * Must wait 1 Bitcoin block (~10 min) before calling register().\n *\n * @example\n * const { txid, salt } = await preorder(client, {\n * name: \"bob.btc\",\n * });\n * // Save salt! You'll need it for register()\n * // Wait ~10 minutes (1 Bitcoin block)\n * await register(client, { name: \"bob.btc\", salt });\n */\nexport async function preorder(\n client: Client,\n params: PreorderParams\n): Promise<{ txid: string; salt: Uint8Array }> {\n const { name: nameInput, namespace: namespaceInput, salt: providedSalt } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const { name, namespace } = parseFQN(fqn);\n\n // Check availability\n const available = await canRegister(client, fqn);\n if (!available) {\n throw new Error(`Name ${fqn} is not available for registration`);\n }\n\n // Get price\n const price = await getNamePrice(client, fqn);\n\n // Generate or use provided salt\n const salt = providedSalt ?? generateSalt();\n\n // Calculate hash commitment\n const hashedSaltedFqn = hashPreorder(name, namespace, salt);\n\n const bns = getBnsContract(client);\n\n const txid = await bns.call.namePreorder(\n {\n hashedSaltedFqn,\n stxToBurn: price,\n },\n {\n postConditions: [Pc.principal(client.account!.address).willSendLte(price).ustx()],\n }\n );\n\n return { txid, salt };\n}\n\n/**\n * Register a name (step 2 of secure registration).\n * Reveals the name after preorder. Must wait 1 Bitcoin block after preorder.\n *\n * @example\n * const { txid } = await register(client, {\n * name: \"bob.btc\",\n * salt, // from preorder()\n * });\n */\nexport async function register(\n client: Client,\n params: RegisterParams\n): Promise<string> {\n const { name: nameInput, namespace: namespaceInput, salt } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const { name, namespace } = parseFQN(fqn);\n\n const bns = getBnsContract(client);\n\n return bns.call.nameRegister({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n salt,\n });\n}\n\n/**\n * Claim a name instantly (fast but snipeable).\n * Burns STX to register the name immediately.\n * @example\n * const txid = await claimFast(client, {\n * name: \"bob.btc\",\n * recipient: account.address,\n * });\n */\nexport async function claimFast(\n client: Client,\n params: ClaimFastParams\n): Promise<string> {\n const { name: nameInput, namespace: namespaceInput, recipient } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const { name, namespace } = parseFQN(fqn);\n\n // Check availability\n const available = await canRegister(client, fqn);\n if (!available) {\n throw new Error(`Name ${fqn} is not available for registration`);\n }\n\n // Get price\n const price = await getNamePrice(client, fqn);\n\n const bns = getBnsContract(client);\n\n return bns.call.nameClaimFast(\n {\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n sendTo: recipient,\n },\n {\n postConditions: [Pc.principal(recipient).willSendLte(price).ustx()],\n }\n );\n}\n\n/**\n * Transfer a name to a new owner.\n * @example\n * const txid = await transfer(client, {\n * name: \"alice.btc\",\n * recipient: \"SP3FBR...\",\n * });\n */\nexport async function transfer(\n client: Client,\n params: TransferParams\n): Promise<string> {\n const { name: nameInput, namespace: namespaceInput, recipient } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const id = await getNameId(client, fqn);\n if (id === null) {\n throw new Error(`Name ${fqn} does not exist`);\n }\n\n const currentOwner = await resolveName(client, fqn);\n if (!currentOwner) {\n throw new Error(`Cannot determine owner of ${fqn}`);\n }\n\n const bns = getBnsContract(client);\n if (!client.chain) {\n throw new Error(\"Client must have a chain configured\");\n }\n const network = client.chain.network;\n const contract =\n network === \"mainnet\" ? BNS_CONTRACTS.mainnet : BNS_CONTRACTS.testnet;\n\n return bns.call.transfer(\n {\n id,\n owner: currentOwner,\n recipient,\n },\n {\n postConditions: [\n Pc.principal(currentOwner)\n .willSendAsset()\n .nft(`${contract.address}.${contract.name}::BNS-V2`, Cl.uint(id)),\n ],\n }\n );\n}\n\n/**\n * Set a name as your primary name.\n * @example\n * const txid = await setPrimary(client, {\n * name: \"alice.btc\",\n * });\n */\nexport async function setPrimary(\n client: Client,\n params: SetPrimaryParams\n): Promise<string> {\n const { name: nameInput, namespace: namespaceInput } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const id = await getNameId(client, fqn);\n if (id === null) {\n throw new Error(`Name ${fqn} does not exist`);\n }\n\n const bns = getBnsContract(client);\n\n return bns.call.setPrimaryName({ primaryNameId: id });\n}\n\n/**\n * Get the zonefile for a name.\n * Zonefiles contain DNS-like records (up to 8192 bytes).\n *\n * @example\n * const zonefile = await getZonefile(client, \"alice.btc\");\n * if (zonefile) {\n * console.log(new TextDecoder().decode(zonefile));\n * }\n */\nexport async function getZonefile(\n client: Client,\n nameOrFQN: string\n): Promise<Uint8Array | null> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const zonefile = getZonefileContract(client);\n\n try {\n const result = (await zonefile.read.resolveName({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n })) as Uint8Array | null;\n\n return result;\n } catch {\n // Contract returns (err 101) when no zonefile is set\n return null;\n }\n}\n\n/**\n * Update or clear the zonefile for a name.\n * Only the name owner can update the zonefile.\n *\n * @example\n * // Update zonefile\n * await updateZonefile(client, {\n * name: \"alice.btc\",\n * zonefile: \"$ORIGIN alice.btc\\n$TTL 3600\\n...\",\n * });\n *\n * // Clear zonefile\n * await updateZonefile(client, {\n * name: \"alice.btc\",\n * zonefile: null,\n * });\n */\nexport async function updateZonefile(\n client: Client,\n params: UpdateZonefileParams\n): Promise<string> {\n const { name: nameInput, namespace: namespaceInput, zonefile } = params;\n const fqn = namespaceInput ? `${nameInput}.${namespaceInput}` : nameInput;\n\n if (!validateFQN(fqn)) {\n throw new Error(`Invalid name format: ${fqn}`);\n }\n\n const { name, namespace } = parseFQN(fqn);\n\n // Verify ownership\n const currentOwner = await resolveName(client, fqn);\n if (!currentOwner) {\n throw new Error(`Name ${fqn} does not exist`);\n }\n\n const zonefileContract = getZonefileContract(client);\n\n // Convert zonefile to Uint8Array or null\n let zonefileBytes: Uint8Array | null = null;\n if (zonefile !== null) {\n zonefileBytes =\n typeof zonefile === \"string\"\n ? new TextEncoder().encode(zonefile)\n : zonefile;\n\n if (zonefileBytes.length > 8192) {\n throw new Error(\n `Zonefile too large: ${zonefileBytes.length} bytes (max 8192)`\n );\n }\n }\n\n return zonefileContract.call.updateZonefile({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n newZonefile: zonefileBytes,\n });\n}\n\n/**\n * Revoke (clear) the zonefile for a name.\n * Alias for updateZonefile with zonefile: null.\n *\n * @example\n * await revokeZonefile(client, \"alice.btc\");\n */\nexport async function revokeZonefile(\n client: Client,\n nameOrFQN: string\n): Promise<string> {\n if (!validateFQN(nameOrFQN)) {\n throw new Error(`Invalid name format: ${nameOrFQN}`);\n }\n\n const { name, namespace } = parseFQN(nameOrFQN);\n const zonefileContract = getZonefileContract(client);\n\n return zonefileContract.call.revokeName({\n name: stringToBytes(name),\n namespace: stringToBytes(namespace),\n });\n}\n",
|
|
10
10
|
"import type { Client } from \"../clients/types.ts\";\nimport {\n resolveName,\n getPrimaryName,\n canRegister,\n getNamePrice,\n getNameId,\n preorder,\n register,\n claimFast,\n transfer,\n setPrimary,\n getZonefile,\n updateZonefile,\n revokeZonefile,\n} from \"./actions.ts\";\nimport type {\n ClaimFastParams,\n TransferParams,\n SetPrimaryParams,\n PreorderParams,\n RegisterParams,\n UpdateZonefileParams,\n} from \"./types.ts\";\n\nexport type {\n ClaimFastParams,\n TransferParams,\n SetPrimaryParams,\n PreorderParams,\n RegisterParams,\n UpdateZonefileParams,\n};\n\n/** Actions provided by the BNS extension. */\nexport type BnsActions = {\n bns: {\n resolveName: (name: string) => Promise<string | null>;\n getPrimaryName: (address: string) => Promise<string | null>;\n canRegister: (name: string) => Promise<boolean>;\n getNamePrice: (name: string) => Promise<bigint>;\n getNameId: (name: string) => Promise<bigint | null>;\n preorder: (params: PreorderParams) => Promise<{ txid: string; salt: Uint8Array }>;\n register: (params: RegisterParams) => Promise<string>;\n claimFast: (params: ClaimFastParams) => Promise<string>;\n transfer: (params: TransferParams) => Promise<string>;\n setPrimary: (params: SetPrimaryParams) => Promise<string>;\n getZonefile: (name: string) => Promise<Uint8Array | null>;\n updateZonefile: (params: UpdateZonefileParams) => Promise<string>;\n revokeZonefile: (name: string) => Promise<string>;\n };\n};\n\nexport { BNS_CONTRACTS, ZONEFILE_RESOLVER_CONTRACTS } from \"./constants.ts\";\nexport {\n parseFQN,\n formatFQN,\n validateName,\n validateNamespace,\n validateFQN,\n generateSalt,\n hashPreorder,\n} from \"./utils.ts\";\n\n/**\n * BNS v2 extension for Stacks client.\n * Provides name resolution, registration, and management.\n *\n * @example\n * import { createWalletClient, http, mainnet } from \"stacks\";\n * import { bns } from \"stacks/bns\";\n * import { privateKeyToAccount } from \"stacks/accounts\";\n *\n * const account = privateKeyToAccount(\"0x...\");\n * const client = createWalletClient({\n * account,\n * chain: mainnet,\n * transport: http(),\n * }).extend(bns());\n *\n * // Resolve names\n * const owner = await client.bns.resolveName(\"alice.btc\");\n *\n * // Register names\n * const txid = await client.bns.claimFast({\n * name: \"bob.btc\",\n * recipient: account.address,\n * });\n *\n * // Transfer names\n * await client.bns.transfer({\n * name: \"alice.btc\",\n * recipient: \"SP3FBR...\",\n * });\n */\nexport function bns(): (client: Client) => BnsActions {\n return (client: Client) => ({\n bns: {\n /**\n * Resolve a BNS name to its owner address.\n * @param name - Fully qualified name (e.g., \"alice.btc\" or \"alice\")\n * @returns Owner address or null if name doesn't exist\n */\n resolveName: (name: string) => resolveName(client, name),\n\n /**\n * Get the primary name for an address.\n * @param address - Stacks address\n * @returns Primary name or null if no primary set\n */\n getPrimaryName: (address: string) => getPrimaryName(client, address),\n\n /**\n * Check if a name is available for registration.\n * @param name - Fully qualified name to check\n * @returns True if available, false otherwise\n */\n canRegister: (name: string) => canRegister(client, name),\n\n /**\n * Get the price to register a name in microSTX.\n * @param name - Fully qualified name\n * @returns Price in microSTX\n */\n getNamePrice: (name: string) => getNamePrice(client, name),\n\n /**\n * Get the NFT token ID for a name.\n * @param name - Fully qualified name\n * @returns Token ID or null if name doesn't exist\n */\n getNameId: (name: string) => getNameId(client, name),\n\n /**\n * Preorder a name (step 1 of secure registration).\n * Commits to a name with a salted hash, preventing front-running.\n * Must wait 1 Bitcoin block (~10 min) before calling register().\n * Requires wallet client with account.\n * @param params - Preorder parameters\n * @returns Transaction ID and salt (save salt for register step!)\n */\n preorder: (params: PreorderParams) => preorder(client, params),\n\n /**\n * Register a name (step 2 of secure registration).\n * Reveals the name after preorder. Must wait 1 Bitcoin block after preorder.\n * Requires wallet client with account.\n * @param params - Register parameters (must include salt from preorder)\n * @returns Transaction ID\n */\n register: (params: RegisterParams) => register(client, params),\n\n /**\n * Claim a name instantly (fast but snipeable).\n * Burns STX to register the name immediately.\n * Requires wallet client with account.\n * @param params - Registration parameters\n * @returns Transaction ID\n */\n claimFast: (params: ClaimFastParams) => claimFast(client, params),\n\n /**\n * Transfer a name to a new owner.\n * Requires wallet client with account.\n * @param params - Transfer parameters\n * @returns Transaction ID\n */\n transfer: (params: TransferParams) => transfer(client, params),\n\n /**\n * Set a name as your primary name.\n * Requires wallet client with account.\n * @param params - Primary name parameters\n * @returns Transaction ID\n */\n setPrimary: (params: SetPrimaryParams) => setPrimary(client, params),\n\n /**\n * Get the zonefile for a name.\n * Zonefiles contain DNS-like records (up to 8192 bytes).\n * @param name - Fully qualified name\n * @returns Zonefile bytes or null if not set\n */\n getZonefile: (name: string) => getZonefile(client, name),\n\n /**\n * Update or clear the zonefile for a name.\n * Only the name owner can update the zonefile.\n * Requires wallet client with account.\n * @param params - Zonefile update parameters\n * @returns Transaction ID\n */\n updateZonefile: (params: UpdateZonefileParams) =>\n updateZonefile(client, params),\n\n /**\n * Revoke (clear) the zonefile for a name.\n * Requires wallet client with account.\n * @param name - Fully qualified name\n * @returns Transaction ID\n */\n revokeZonefile: (name: string) => revokeZonefile(client, name),\n },\n });\n}\n"
|
|
11
11
|
],
|
|
12
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAM,UAAU;AAAA,EACrB,WAAW;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MAC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Q,MAAM;AAAA,MAQ/B,gBAAgB,CAAC,SAAiB,eAAe,QAAQ,IAAI;AAAA,IAC/D;AAAA,EACF;AAAA;",
|
|
13
|
+
"debugId": "DDACC0BEE24F57B364756E2164756E21",
|
|
14
14
|
"names": []
|
|
15
15
|
}
|
package/dist/src/chains/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
mocknet,
|
|
6
6
|
testnet
|
|
7
7
|
} from "../../shared/stacks-qt8ehebn.js";
|
|
8
|
-
import"../../shared/stacks-njvyj3ab.js";
|
|
9
8
|
export {
|
|
10
9
|
testnet,
|
|
11
10
|
mocknet,
|
|
@@ -14,5 +13,5 @@ export {
|
|
|
14
13
|
defineChain
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
//# debugId=
|
|
16
|
+
//# debugId=6872B500468EAE2864756E2164756E21
|
|
18
17
|
//# sourceMappingURL=index.js.map
|