@usewhisk/cctp 0.0.0 → 0.1.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.
@@ -0,0 +1,940 @@
1
+ import { I as InvalidInputError } from './index-BIerSvES.cjs';
2
+ export { A as Arbitrum, a as ArbitrumSepolia, b as Arc, c as ArcTestnet, d as Avalanche, e as AvalancheFuji, B as Base, f as BaseSepolia, C as CCTP_FORWARDER_STELLAR_MAINNET, g as CCTP_FORWARDER_STELLAR_TESTNET, h as CCTP_USDC_DECIMALS, i as CHAINS, j as CctpError, k as CctpErrorCode, l as ChainId, m as Codex, n as CodexTestnet, o as Cronos, p as CronosTestnet, E as EVM_MAINNET_CHAINS, q as EVM_TESTNET_CHAINS, r as Edge, s as EdgeTestnet, t as Ethereum, u as EthereumSepolia, H as HyperEVM, v as HyperEVMTestnet, w as Injective, x as InjectiveTestnet, y as Ink, z as InkTestnet, D as IrisAbortedError, F as IrisError, G as IrisHttpError, J as IrisNetworkError, K as IrisParseError, L as IrisRateLimitedError, M as Linea, N as LineaSepolia, O as MESSAGE_TRANSMITTER_STELLAR_MAINNET, P as MESSAGE_TRANSMITTER_STELLAR_TESTNET, Q as MESSAGE_TRANSMITTER_V2_EVM_MAINNET, R as MESSAGE_TRANSMITTER_V2_EVM_TESTNET, S as MESSAGE_TRANSMITTER_V2_SOLANA, T as MESSAGE_TRANSMITTER_V2_STARKNET_MAINNET, U as MESSAGE_TRANSMITTER_V2_STARKNET_SEPOLIA, V as Monad, W as MonadTestnet, X as Morph, Y as MorphTestnet, Z as Optimism, _ as OptimismSepolia, $ as Pharos, a0 as PharosTestnet, a1 as Plasma, a2 as PlasmaTestnet, a3 as Plume, a4 as PlumeTestnet, a5 as Polygon, a6 as PolygonAmoyTestnet, a7 as ProtocolError, a8 as SOLANA_CCTP_DOMAIN, a9 as STARKNET_CCTP_DOMAIN, aa as STARKNET_CHAIN_ID_MAINNET, ab as STARKNET_CHAIN_ID_SEPOLIA, ac as STELLAR_CCTP_DOMAIN, ad as STELLAR_NETWORK_PASSPHRASE_MAINNET, ae as STELLAR_NETWORK_PASSPHRASE_TESTNET, af as STELLAR_USDC_DECIMALS, ag as Sei, ah as SeiTestnet, ai as Solana, aj as SolanaDevnet, ak as Sonic, al as SonicTestnet, am as Starknet, an as StarknetSepolia, ao as Stellar, ap as StellarTestnet, aq as TOKEN_MESSENGER_MINTER_STELLAR_MAINNET, ar as TOKEN_MESSENGER_MINTER_STELLAR_TESTNET, as as TOKEN_MESSENGER_MINTER_V2_SOLANA, at as TOKEN_MESSENGER_MINTER_V2_STARKNET_MAINNET, au as TOKEN_MESSENGER_MINTER_V2_STARKNET_SEPOLIA, av as TOKEN_MESSENGER_V2_EVM_MAINNET, aw as TOKEN_MESSENGER_V2_EVM_TESTNET, ax as TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET, ay as TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET, az as USDC_ISSUER_STELLAR_MAINNET, aA as USDC_ISSUER_STELLAR_TESTNET, aB as USDC_SPL_DEVNET, aC as USDC_SPL_MAINNET, aD as USDC_STARKNET_MAINNET, aE as USDC_STARKNET_SEPOLIA, aF as Unichain, aG as UnichainSepolia, aH as UnknownChainError, aI as UnsupportedError, aJ as WorldChain, aK as WorldChainSepolia, aL as XDC, aM as XDCApothem, aN as XLayer, aO as XLayerTestnet, aP as chainByDomain, aQ as chainByEvmChainId, aR as chainsByNetwork, aS as explorerAddressUrl, aT as explorerTxUrl, aU as getChain, aV as isCctpError, aW as isChainId, aX as isEvmChain, aY as isSolanaChain, aZ as isStarknetChain, a_ as isStellarChain, a$ as tryChainByEvmChainId } from './index-BIerSvES.cjs';
3
+ import { E as EvmChain, S as StarknetChain, a as StellarChain, A as Address, B as BurnFeeTier, F as ForwarderFeeTier, C as CctpChain, b as FinalityThreshold, c as StarknetFelt, d as SolanaChain } from './attestation-D52iUV0y.cjs';
4
+ export { e as CctpDomain, f as ChainCapabilities, g as Ecosystem, h as EvmChainId, i as FINALITY_FAST, j as FINALITY_STANDARD, k as ForwardState, G as GetMessagesQuery, I as IrisAttestationStatus, l as IrisDelayReason, m as IrisMessage, n as IrisMessagesResponse, N as Network, o as SecondsRange, p as SolanaCluster, q as SolanaPubkey, r as StarknetNetwork, s as StellarNetwork, t as StellarStrkey, T as TransferSpeed, u as attestationSeconds } from './attestation-D52iUV0y.cjs';
5
+ export { messageTransmitterV2Abi, tokenMessengerV2Abi, tokenMessengerWithFeesAbi, usdcAbi } from './abi.cjs';
6
+ export { FetchJsonOptions, GetBurnFeesOptions, GetMessagesOptions, IRIS_MAINNET_URL, IRIS_SANDBOX_URL, IrisLimiter, IrisLimiterOptions, PollMessageOptions, ReattestOptions, SignedBurnQuote, SignedBurnQuoteRequest, SignedQuoteExpiry, UpfrontFeeType, createIrisLimiter, defaultIrisLimiter, fetchIrisJson, getBurnFees, getFastBurnAllowance, getMessages, getSignedBurnQuote, irisBaseUrl, isForwardDone, pickFeeTier, pickForwarderFee, pollBudget, pollMessages, reattest } from './iris.cjs';
7
+ import { xdr } from '@stellar/stellar-sdk';
8
+ import { PublicKey, AccountMeta, TransactionInstruction } from '@solana/web3.js';
9
+
10
+ type RpcOptions = {
11
+ /** Tried in order before the chain's default RPCs. */
12
+ rpcUrls?: readonly string[];
13
+ fetch?: typeof fetch;
14
+ };
15
+ /** `eth_gasPrice`, in wei. */
16
+ declare function getGasPrice(chain: EvmChain, options?: RpcOptions): Promise<bigint>;
17
+ declare function getBlockNumber(chain: EvmChain, options?: RpcOptions): Promise<bigint>;
18
+ /**
19
+ * Whether `MessageTransmitterV2.usedNonces(nonce)` is set: the message was
20
+ * already received on this chain and minting it again would revert.
21
+ */
22
+ declare function isNonceUsed(chain: EvmChain, nonce: `0x${string}`, options?: RpcOptions): Promise<boolean>;
23
+ type TransactionStatus = "success" | "reverted" | "unknown";
24
+ /** `unknown` until the transaction is mined, or if the node never saw it. */
25
+ declare function getTransactionStatus(chain: EvmChain, hash: `0x${string}`, options?: RpcOptions): Promise<TransactionStatus>;
26
+ /** The USDC ERC-20 balance of `owner`, in subunits. */
27
+ declare function getUsdcBalance(chain: EvmChain, owner: `0x${string}`, options?: RpcOptions): Promise<bigint>;
28
+
29
+ /** `MessageTransmitter.is_nonce_used(u256)` on Starknet. */
30
+ declare function isStarknetNonceUsed(chain: StarknetChain, nonce: `0x${string}`, options?: RpcOptions): Promise<boolean>;
31
+ /**
32
+ * `MessageTransmitter.is_nonce_used(BytesN<32>)` on Stellar, read by
33
+ * simulating the call. Simulation needs a source account but no signature,
34
+ * so the USDC issuer, which always exists, stands in.
35
+ */
36
+ declare function isStellarNonceUsed(chain: StellarChain, nonce: `0x${string}`, options?: RpcOptions): Promise<boolean>;
37
+
38
+ /** `pending` until the sequencer has accepted the transaction on L2. */
39
+ type StarknetTransactionStatus = {
40
+ state: "pending";
41
+ } | {
42
+ state: "success" | "reverted";
43
+ blockNumber: number;
44
+ };
45
+ /**
46
+ * Reads the receipt over plain JSON-RPC. starknet.js refuses nodes on a spec
47
+ * version it does not know, and public nodes move ahead of it, so the
48
+ * receipt is read here instead. The fields used are the same from 0.8 to 0.10.
49
+ */
50
+ declare function getStarknetTransactionStatus(chain: StarknetChain, hash: string, options?: RpcOptions): Promise<StarknetTransactionStatus>;
51
+
52
+ /**
53
+ * Forwarder hookData.
54
+ *
55
+ * Including this 32-byte hookData in `depositForBurnWithHook` tells
56
+ * Circle's Orbit relayer to fetch the attestation and submit the
57
+ * destination mint on the user's behalf.
58
+ *
59
+ * Layout:
60
+ * bytes 0..11: ASCII "cctp-forward"
61
+ * bytes 12..23: zero pad
62
+ * bytes 24..27: uint32 BE version (0)
63
+ * bytes 28..31: uint32 BE payload length (0 for basic forwarding)
64
+ */
65
+ /** Static hex string used for every Whisk bridge with forwarder enabled. */
66
+ declare const CCTP_FORWARD_HOOK_DATA: `0x${string}`;
67
+ declare const CCTP_FORWARD_HOOK_DATA_LENGTH = 32;
68
+ /**
69
+ * Encodes the same bytes as `CCTP_FORWARD_HOOK_DATA` field by field. Stellar
70
+ * destinations need a payload and use `buildStellarForwarderHookData`.
71
+ */
72
+ declare function buildForwarderHookData(): `0x${string}`;
73
+ /** True when `hex` starts with the 32-byte basic forwarder hookData. */
74
+ declare function isForwarderHookData(hex: string): boolean;
75
+ /** bytes32(0) as `destinationCaller` lets anyone submit the mint. */
76
+ declare const ANY_DESTINATION_CALLER$1: `0x${string}`;
77
+
78
+ /**
79
+ * Address encoding for CCTP message fields.
80
+ *
81
+ * CCTP uses 32-byte (`bytes32`) values for `mintRecipient` and
82
+ * `destinationCaller` so it can carry both 20-byte EVM addresses and
83
+ * 32-byte non-EVM addresses. The encoders here are EVM only.
84
+ */
85
+
86
+ declare class InvalidAddressError extends InvalidInputError {
87
+ constructor(input: string);
88
+ }
89
+ declare class InvalidBytes32Error extends InvalidInputError {
90
+ constructor(input: string);
91
+ }
92
+ /**
93
+ * Left-pad a 20-byte EVM address to 32 bytes for use as a CCTP
94
+ * `bytes32` field.
95
+ *
96
+ * 0xabcd...1234 → 0x000000000000000000000000abcd...1234
97
+ *
98
+ * Output is lowercase; `getAddress(fromBytes32(value))` restores the
99
+ * checksum.
100
+ */
101
+ declare function toBytes32(address: Address | string): `0x${string}`;
102
+ /**
103
+ * Reverse of `toBytes32`. Strips the 12-byte zero pad and returns a
104
+ * lowercase 20-byte address.
105
+ *
106
+ * Throws if the upper 12 bytes are not zero (i.e. the value isn't an
107
+ * EVM address). Callers can use `tryFromBytes32` for a non-throwing
108
+ * variant.
109
+ */
110
+ declare function fromBytes32(value: `0x${string}` | string): Address;
111
+ declare function tryFromBytes32(value: string): Address | undefined;
112
+ declare function isAddress(value: string): value is Address;
113
+
114
+ /**
115
+ * Fee math for CCTP V2 bridges.
116
+ *
117
+ * Two protocol-level fees stack on a Fast Transfer + Forwarder bridge:
118
+ *
119
+ * 1. Burn fee: a rate on the transfer amount, charged by CCTP. Iris
120
+ * returns `minimumFee` in basis points with up to two decimals
121
+ * (`1.3` is 0.013%). Whisk holds it as hundredths of a basis
122
+ * point, so `1.3` becomes `130n`.
123
+ *
124
+ * 2. Forwarder fee: a flat USDC fee that pays for destination gas
125
+ * and the relayer. Iris returns low, med and high levels in USDC
126
+ * subunits. Whisk defaults to `med`.
127
+ *
128
+ * `maxFee` on `depositForBurnWithHook` must cover both. Every step
129
+ * rounds up: a `maxFee` one subunit short turns a Fast transfer into a
130
+ * Standard one.
131
+ */
132
+
133
+ /** Iris's `minimumFee` as hundredths of a basis point: `1.3` is `130n`. */
134
+ declare function parseFeeBps(raw: unknown): bigint;
135
+ /** An Iris forwarder fee in USDC subunits, rounded up. */
136
+ declare function parseForwarderFee(raw: unknown): bigint;
137
+ /**
138
+ * The CCTP burn fee on `amount` subunits at `feeCentiBps` hundredths of
139
+ * a basis point, rounded up.
140
+ */
141
+ declare function computeBurnFee(amount: bigint, feeCentiBps: bigint): bigint;
142
+ /** The forwarder fee for a level, in USDC subunits. */
143
+ declare function selectForwarderFee(tier: BurnFeeTier, level?: keyof ForwarderFeeTier): bigint;
144
+ type ComputeMaxFeeInput = {
145
+ /** Transfer amount in USDC subunits. */
146
+ amount: bigint;
147
+ /** Selected tier (Fast or Standard). */
148
+ tier: BurnFeeTier;
149
+ /** Forwarder fee level; defaults to `"med"`. */
150
+ forwarderLevel?: keyof ForwarderFeeTier;
151
+ /**
152
+ * Whole basis points added to the forwarder fee (0 to 10000). Iris's
153
+ * `high` level already carries a buffer, so this defaults to 0.
154
+ */
155
+ forwarderBufferBps?: number;
156
+ /** Whether to include the forwarder fee. Defaults to `true`. */
157
+ includeForwarder?: boolean;
158
+ /**
159
+ * Whole basis points added to the protocol fee in `maxFee` only. Circle
160
+ * takes the fee it executes, so the buffer is a ceiling, not a charge.
161
+ */
162
+ burnFeeBufferBps?: number;
163
+ /** The on-chain minimum from `getMinFeeAmount`, in USDC subunits. */
164
+ minBurnFee?: bigint;
165
+ };
166
+ type ComputeMaxFeeResult = {
167
+ /** The protocol fee, raised to `minBurnFee` if lower, before any buffer. */
168
+ burnFee: bigint;
169
+ forwarderFee: bigint;
170
+ /** Total cap to pass as `maxFee` on `depositForBurnWithHook`. */
171
+ maxFee: bigint;
172
+ };
173
+ /**
174
+ * maxFee = burnFee (+ buffer) + forwarderFee (+ buffer)
175
+ *
176
+ * The result is a cap; the actual deducted fee can be less.
177
+ */
178
+ declare function computeMaxFee(input: ComputeMaxFeeInput): ComputeMaxFeeResult;
179
+
180
+ type GetStandardMinFeeOptions = RpcOptions;
181
+ /**
182
+ * `TokenMessengerV2.getMinFeeAmount(amount)`: the least `maxFee` a Standard
183
+ * burn of `amount` may carry on a chain with Circle's fee switch.
184
+ */
185
+ declare function getStandardMinFee(chain: EvmChain, amount: bigint, options?: GetStandardMinFeeOptions): Promise<bigint>;
186
+
187
+ /** A CCTP V2 message carrying a burn, read from the attested bytes. */
188
+ type DecodedBurnMessage = {
189
+ version: number;
190
+ sourceDomain: number;
191
+ destinationDomain: number;
192
+ nonce: `0x${string}`;
193
+ sender: `0x${string}`;
194
+ recipient: `0x${string}`;
195
+ destinationCaller: `0x${string}`;
196
+ minFinalityThreshold: number;
197
+ finalityThresholdExecuted: number;
198
+ body: {
199
+ version: number;
200
+ burnToken: `0x${string}`;
201
+ mintRecipient: `0x${string}`;
202
+ amount: bigint;
203
+ messageSender: `0x${string}`;
204
+ maxFee: bigint;
205
+ feeExecuted: bigint;
206
+ /** In the destination chain's own height; `0n` once finalized. */
207
+ expirationBlock: bigint;
208
+ hookData: `0x${string}`;
209
+ };
210
+ };
211
+ /**
212
+ * Splits a message into its fields. Every address is the 32-byte form CCTP
213
+ * carries; an EVM address is its last 20 bytes.
214
+ */
215
+ declare function decodeBurnMessage(message: `0x${string}`): DecodedBurnMessage;
216
+
217
+ /**
218
+ * A burn intent is the chain-bound call(s) the wallet adapter signs
219
+ * and submits. It contains no transaction-level data (gas, nonce);
220
+ * the adapter fills those in.
221
+ */
222
+
223
+ /**
224
+ * One on-chain call. A bridge is usually an `approve` followed by the burn;
225
+ * the wallet adapter may batch them via EIP-5792 when supported.
226
+ */
227
+ type EvmCall = {
228
+ to: Address;
229
+ data: `0x${string}`;
230
+ /** Always `0n`: USDC burns carry no native value. */
231
+ value: bigint;
232
+ };
233
+ type BurnIntent = {
234
+ source: CctpChain;
235
+ destination: CctpChain;
236
+ /** Executed in order. */
237
+ calls: EvmCall[];
238
+ /** USDC subunits, 6 decimals. */
239
+ amount: bigint;
240
+ /** `maxFee` cap that was packed into the burn call. */
241
+ maxFee: bigint;
242
+ /** Computed protocol fee, for a fee breakdown. */
243
+ burnFee: bigint;
244
+ /** Computed forwarder fee. `0n` when the forwarder is off. */
245
+ forwarderFee: bigint;
246
+ mintRecipientBytes32: `0x${string}`;
247
+ /** Whether the burn call set `hookData` for Forwarder use. */
248
+ withForwarder: boolean;
249
+ finalityThreshold: FinalityThreshold;
250
+ };
251
+
252
+ type BuildBurnIntentInput = {
253
+ source: CctpChain;
254
+ destination: CctpChain;
255
+ /** USDC subunits (6 decimals). Must be > 0 and ≤ 10M USDC. */
256
+ amount: bigint;
257
+ /**
258
+ * Recipient in the destination's format: a 20-byte EVM address, a base58
259
+ * Solana pubkey, or 0x-prefixed 32-byte hex for Stellar and Starknet.
260
+ */
261
+ mintRecipient: Address | string;
262
+ /**
263
+ * Restrict who can call `receiveMessage` on the destination. Defaults
264
+ * to `bytes32(0)` (any caller) so the forwarder can mint without
265
+ * extra coordination. Pass a specific 32-byte value if you need to
266
+ * lock the mint down.
267
+ */
268
+ destinationCaller?: `0x${string}`;
269
+ /**
270
+ * Approve allowance to set on USDC. Defaults to `amount`. Set higher
271
+ * to skip the approve call across multiple bridges (allowance
272
+ * caching).
273
+ */
274
+ approveAmount?: bigint;
275
+ /**
276
+ * If `true`, skip the approve call entirely (the wallet already has
277
+ * sufficient allowance). Defaults to `false`.
278
+ */
279
+ skipApprove?: boolean;
280
+ /**
281
+ * Trigger Circle's Orbit forwarder by including the
282
+ * `cctp-forward` hookData. Defaults to `true`. Set to `false` to
283
+ * make the user mint manually on the destination chain.
284
+ */
285
+ withForwarder?: boolean;
286
+ /**
287
+ * Override the hookData. When `withForwarder` is true and this is
288
+ * unset, the EVM-side `cctp-forward` magic bytes are used (Circle's
289
+ * Orbit relayer). For Stellar destinations, pass the Stellar
290
+ * `CctpForwarder` hookData instead. The EVM relayer is irrelevant
291
+ * because the Stellar Forwarder is what reads this field on chain.
292
+ */
293
+ customHookData?: `0x${string}`;
294
+ /** Fee math inputs. See `computeMaxFee`. */
295
+ fee: Pick<ComputeMaxFeeInput, "tier" | "forwarderLevel" | "forwarderBufferBps"> & {
296
+ /**
297
+ * Burn with exactly this cap instead of one computed from the tier. Pass
298
+ * the `maxFee` the payer confirmed.
299
+ */
300
+ maxFee?: bigint;
301
+ };
302
+ };
303
+ declare function buildBurnIntent(input: BuildBurnIntentInput): BurnIntent;
304
+
305
+ type BuildBurnWithFeesIntentInput = {
306
+ source: CctpChain;
307
+ destination: CctpChain;
308
+ /** Exactly the amount the signed quote was requested for. */
309
+ amount: bigint;
310
+ /** The quote's USDC fee, collected by the contract on top of `amount`. */
311
+ fee: bigint;
312
+ mintRecipient: Address | string;
313
+ signedQuote: `0x${string}`;
314
+ /** Reserved by Circle for refunds it does not make today. */
315
+ refundAddress: Address | string;
316
+ /** Defaults to `amount + fee`. */
317
+ approveAmount?: bigint;
318
+ };
319
+ type BurnWithFeesIntent = {
320
+ calls: EvmCall[];
321
+ amount: bigint;
322
+ fee: bigint;
323
+ mintRecipientBytes32: `0x${string}`;
324
+ };
325
+ /**
326
+ * Approve and `depositForBurnWithFees` calls for a burn whose Fast and
327
+ * forwarding fees were paid upfront from a signed quote. The contract adds
328
+ * Circle's forwarding hook itself when the quote includes a `FORWARD` fee.
329
+ */
330
+ declare function buildBurnWithFeesIntent(input: BuildBurnWithFeesIntentInput): BurnWithFeesIntent;
331
+
332
+ type MintIntent = {
333
+ destination: CctpChain;
334
+ call: EvmCall;
335
+ };
336
+ type BuildMintIntentInput = {
337
+ destination: CctpChain;
338
+ /** Raw 0x-prefixed CCTP message bytes from Iris. */
339
+ message: `0x${string}`;
340
+ /** Raw 0x-prefixed attestation bytes from Iris. */
341
+ attestation: `0x${string}`;
342
+ };
343
+ /**
344
+ * `receiveMessage` on the destination's `MessageTransmitterV2`. EVM
345
+ * destinations only. Whoever submits the call pays destination gas.
346
+ */
347
+ declare function buildMintIntent(input: BuildMintIntentInput): MintIntent;
348
+
349
+ /**
350
+ * Starknet address / mintRecipient helpers.
351
+ *
352
+ * Starknet uses 252-bit field elements, but CCTP messages carry 32-byte
353
+ * `mintRecipient` / `destinationCaller` fields. Whisk normalizes to two
354
+ * forms:
355
+ *
356
+ * - bytes32 hex (`0x` + 64 hex): what other ecosystems pack into the
357
+ * CCTP message envelope.
358
+ * - u256 bigint: what Starknet's `deposit_for_burn` expects in
359
+ * calldata.
360
+ *
361
+ * Conversion is just zero-extending the felt to 32 bytes or reading the
362
+ * bigint back from it.
363
+ */
364
+
365
+ declare function isValidStarknetFelt(s: string): boolean;
366
+ /** Throws on a malformed felt. */
367
+ declare function assertStarknetFelt(s: string): StarknetFelt;
368
+ /**
369
+ * Zero-pads a felt to 0x-prefixed 32-byte hex. Used for `mintRecipient`
370
+ * when bridging to Starknet from another ecosystem.
371
+ */
372
+ declare function feltToBytes32Hex(felt: StarknetFelt): `0x${string}`;
373
+ /** Leading zeros are stripped. */
374
+ declare function bytes32HexToFelt(hex: `0x${string}` | string): StarknetFelt;
375
+ /** For packing into u256 calldata args. */
376
+ declare function feltToBigInt(felt: StarknetFelt): bigint;
377
+
378
+ /** Encode a u256 as `[lo, hi]` felt strings (decimal). */
379
+ declare function u256ToFelts(value: bigint): [string, string];
380
+ /** Encode a u32 / u64 / felt252 as a single felt string (decimal). */
381
+ declare function feltToString(value: number | bigint | string): string;
382
+ /**
383
+ * Encode a `ByteArray` from raw bytes.
384
+ *
385
+ * Cairo `ByteArray` calldata serialization:
386
+ *
387
+ * [ data.length: u32,
388
+ * ...data: felt252 (31 bytes each, big-endian),
389
+ * pending_word: felt252 (< 31 bytes, big-endian),
390
+ * pending_word_len: u32 ]
391
+ *
392
+ * Each 31-byte block becomes one felt whose value is the big-endian
393
+ * integer of those bytes. The trailing (bytes.length % 31) bytes go
394
+ * into `pending_word`, again as a big-endian integer of exactly that
395
+ * many bytes.
396
+ *
397
+ * starknet.js's `byteArray.byteArrayFromString` is no substitute: it
398
+ * treats the input as a UTF-8 string, which mangles raw bytes like
399
+ * CCTP attestation blobs.
400
+ */
401
+ declare function bytesToByteArrayFelts(bytes: Uint8Array): string[];
402
+ /** Encode a 0x-prefixed hex blob (any length) as a Cairo ByteArray. */
403
+ declare function hexToByteArrayFelts(hex: string): string[];
404
+
405
+ /**
406
+ * Starknet CCTP V2 `deposit_for_burn` / `deposit_for_burn_with_hook`
407
+ * Call builder.
408
+ *
409
+ * Cairo signatures (from `circlefin/starknet-cctp`):
410
+ *
411
+ * fn deposit_for_burn(
412
+ * amount: u256,
413
+ * destination_domain: u32,
414
+ * mint_recipient: u256,
415
+ * burn_token: ContractAddress,
416
+ * destination_caller: u256,
417
+ * max_fee: u256,
418
+ * min_finality_threshold: u32,
419
+ * )
420
+ *
421
+ * fn deposit_for_burn_with_hook(
422
+ * ...same...
423
+ * hook_data: ByteArray,
424
+ * )
425
+ *
426
+ * USDC on Starknet behaves like ERC-20: burn pulls funds via
427
+ * `transferFrom`, so the caller must `approve(TMM, amount)` first with
428
+ * `buildStarknetApproveCall`.
429
+ */
430
+
431
+ type StarknetCall = {
432
+ contractAddress: StarknetFelt;
433
+ /** Cairo function name (snake_case). */
434
+ entrypoint: string;
435
+ /** Pre-serialized calldata as a flat felt array (decimal strings). */
436
+ calldata: string[];
437
+ };
438
+ type BuildStarknetBurnIntentInput = {
439
+ source: StarknetChain;
440
+ destinationDomain: number;
441
+ /** USDC subunits (6 decimals), the canonical CCTP amount. */
442
+ amount: bigint;
443
+ /** `maxFee` cap in 6-decimal subunits. */
444
+ maxFee: bigint;
445
+ /**
446
+ * 32-byte mintRecipient, packed by Starknet into a single u256. The
447
+ * caller is responsible for encoding correctly:
448
+ * - EVM 20-byte address left-padded to 32 bytes
449
+ * - Solana recipient USDC ATA pubkey (32 bytes raw)
450
+ * - Stellar CctpForwarder strkey decoded to 32 bytes
451
+ * - Starknet contract felt
452
+ */
453
+ mintRecipient: bigint;
454
+ /** `destinationCaller` u256. Zero = any caller. */
455
+ destinationCaller: bigint;
456
+ /** Optional hookData; when set, builds `deposit_for_burn_with_hook`. */
457
+ hookData?: Uint8Array;
458
+ /** Take it from the fee tier. */
459
+ minFinalityThreshold: FinalityThreshold;
460
+ };
461
+ type StarknetBurnIntent = {
462
+ source: StarknetChain;
463
+ destinationDomain: number;
464
+ amount: bigint;
465
+ maxFee: bigint;
466
+ call: StarknetCall;
467
+ withHook: boolean;
468
+ };
469
+ declare function buildStarknetBurnIntent(input: BuildStarknetBurnIntentInput): StarknetBurnIntent;
470
+ /**
471
+ * Starknet's USDC follows the standard ERC-20 / SNIP-2 interface:
472
+ * `approve(spender, amount: u256)`.
473
+ */
474
+ declare function buildStarknetApproveCall(args: {
475
+ source: StarknetChain;
476
+ spender: StarknetFelt;
477
+ amount: bigint;
478
+ }): StarknetCall;
479
+
480
+ /**
481
+ * Starknet CCTP V2 `receive_message` Call builder.
482
+ *
483
+ * Cairo signature:
484
+ *
485
+ * fn receive_message(message: ByteArray, attestation: ByteArray) -> bool
486
+ *
487
+ * Same two-byte-array shape as EVM's `receiveMessage`. The recipient
488
+ * (or any third party) signs this on the destination side after Iris
489
+ * attests the burn.
490
+ */
491
+
492
+ type BuildStarknetReceiveIntentInput = {
493
+ destination: StarknetChain;
494
+ /** 0x-prefixed CCTP message bytes from Iris. */
495
+ message: `0x${string}`;
496
+ /** 0x-prefixed attestation bytes from Iris. */
497
+ attestation: `0x${string}`;
498
+ };
499
+ type StarknetReceiveIntent = {
500
+ destination: StarknetChain;
501
+ call: StarknetCall;
502
+ };
503
+ declare function buildStarknetReceiveIntent(input: BuildStarknetReceiveIntentInput): StarknetReceiveIntent;
504
+
505
+ type StellarStrkeyType = "G" | "M" | "C";
506
+ declare function isValidStellarStrkey(s: string): boolean;
507
+ /** Throws if `s` is not a valid strkey. */
508
+ declare function strkeyType(s: string): StellarStrkeyType;
509
+ /** The raw 32-byte payload of a G, M or C strkey, as CCTP carries it. */
510
+ declare function decodeStrkeyToBytes32(s: string): Uint8Array;
511
+ /** Encode a 32-byte payload as a contract strkey (C…). */
512
+ declare function encodeContractStrkey(bytes: Uint8Array): string;
513
+ /**
514
+ * Convert a Stellar contract strkey (C…) to its 0x-prefixed bytes32
515
+ * hex form. Used when an EVM `depositForBurn` needs to encode a
516
+ * Stellar contract as `mintRecipient` / `destinationCaller`.
517
+ */
518
+ declare function contractStrkeyToBytes32Hex(s: string): `0x${string}`;
519
+
520
+ /**
521
+ * Convert from Stellar's 7-decimal subunit amount to CCTP's 6-decimal
522
+ * canonical amount. Drops the 7th decimal (rounds toward zero). The
523
+ * dust stays on Stellar; it's not lost in the bridge.
524
+ *
525
+ * @returns 6-decimal subunits (canonical amount for the CCTP message)
526
+ */
527
+ declare function stellarSubunitsToCanonical(stellarSubunits: bigint): bigint;
528
+ /**
529
+ * Convert from CCTP's 6-decimal canonical amount to Stellar's 7-decimal
530
+ * subunit amount. Scales by 10, as the inbound mint does.
531
+ *
532
+ * @returns 7-decimal subunits (the on-chain amount minted on Stellar)
533
+ */
534
+ declare function canonicalToStellarSubunits(canonicalSubunits: bigint): bigint;
535
+ /**
536
+ * The fractional 7th decimal that a burn from Stellar drops and leaves
537
+ * in the sender's account.
538
+ */
539
+ declare function stellarBurnDust(stellarSubunits: bigint): bigint;
540
+
541
+ /**
542
+ * @param forwardRecipientStrkey - Stellar strkey of the final recipient
543
+ * (G…, C…, or M… address). The Forwarder will atomically transfer
544
+ * minted USDC to this address after the on-chain mint.
545
+ * @param integratorPayload - Optional extra bytes appended after the
546
+ * strkey. Whisk doesn't use it.
547
+ * @returns 0x-prefixed hex string ready for the EVM/Solana burn call.
548
+ */
549
+ declare function buildStellarForwarderHookData(forwardRecipientStrkey: string, integratorPayload?: Uint8Array): `0x${string}`;
550
+
551
+ /**
552
+ * Stellar CCTP V2 `deposit_for_burn` invocation builder.
553
+ *
554
+ * Soroban contract entry points (from `circlefin/stellar-cctp`):
555
+ *
556
+ * deposit_for_burn(
557
+ * caller: Address,
558
+ * amount: i128, // 7-decimal subunits (local USDC)
559
+ * destination_domain: u32,
560
+ * mint_recipient: BytesN<32>,
561
+ * burn_token: Address, // USDC SAC contract
562
+ * destination_caller: BytesN<32>,
563
+ * max_fee: i128, // 7-decimal subunits
564
+ * min_finality_threshold: u32,
565
+ * )
566
+ *
567
+ * deposit_for_burn_with_hook(
568
+ * ...same as above plus...
569
+ * hook_data: Bytes,
570
+ * )
571
+ *
572
+ * The contract internally normalizes 7-decimal local amounts to
573
+ * 6-decimal canonical for the message. Dust below 0.0000001 USDC stays
574
+ * on the user's Stellar balance.
575
+ *
576
+ * `amount` and `max_fee` here are expressed in Stellar's 7-decimal
577
+ * subunits: multiply 6-decimal CCTP amounts by 10 before passing in.
578
+ */
579
+
580
+ type StellarInvocation = {
581
+ ecosystem: "stellar";
582
+ contractId: string;
583
+ functionName: string;
584
+ args: xdr.ScVal[];
585
+ /** Pre-built XDR operation the adapter wraps in a Soroban transaction. */
586
+ operation: xdr.Operation;
587
+ };
588
+ type BuildStellarBurnIntentInput = {
589
+ source: StellarChain;
590
+ destinationDomain: number;
591
+ /**
592
+ * `mintRecipient` 32-byte payload as encoded into the CCTP message.
593
+ * The caller is responsible for encoding it correctly:
594
+ * - EVM 20-byte address left-padded to 32 bytes
595
+ * - Solana recipient USDC ATA pubkey (32 bytes raw)
596
+ * - Starknet felt zero-padded to 32 bytes
597
+ */
598
+ mintRecipientBytes32: Uint8Array;
599
+ /** Amount in 7-decimal Stellar USDC subunits. */
600
+ amount: bigint;
601
+ /** Max fee in 7-decimal Stellar USDC subunits. */
602
+ maxFee: bigint;
603
+ /**
604
+ * `destinationCaller` 32-byte payload. For Stellar destinations this
605
+ * MUST equal the `CctpForwarder` decoded to bytes32; for other
606
+ * destinations this is typically 32 zero bytes (any caller).
607
+ */
608
+ destinationCallerBytes32: Uint8Array;
609
+ /** Caller strkey (G or C). The wallet that authorizes the burn. */
610
+ caller: string;
611
+ /**
612
+ * Optional hookData. When set, the builder targets
613
+ * `deposit_for_burn_with_hook`; when unset, it targets the plain
614
+ * `deposit_for_burn`.
615
+ */
616
+ hookData?: Uint8Array;
617
+ /** 2000 on Stellar, which has no Fast Transfer. Take it from the fee tier. */
618
+ minFinalityThreshold: FinalityThreshold;
619
+ };
620
+ type StellarBurnIntent = {
621
+ source: StellarChain;
622
+ destinationDomain: number;
623
+ amount: bigint;
624
+ maxFee: bigint;
625
+ invocation: StellarInvocation;
626
+ withHook: boolean;
627
+ };
628
+ declare function buildStellarBurnIntent(input: BuildStellarBurnIntentInput): StellarBurnIntent;
629
+ /** The 32-byte payload of a strkey, as CCTP message fields carry it. */
630
+ declare function strkeyTo32Bytes(strkey: string): Uint8Array;
631
+
632
+ type BuildStellarApproveInvocationInput = {
633
+ source: StellarChain;
634
+ /** Owner strkey (G/M/C): the wallet authorizing TMM to spend USDC. */
635
+ owner: string;
636
+ /** Usually the chain's TMM contract (C...). */
637
+ spender: string;
638
+ /** Amount in 7-decimal Stellar USDC subunits. */
639
+ amount: bigint;
640
+ /**
641
+ * Ledger sequence at which the allowance expires. The SAC rejects a
642
+ * nonzero allowance that expires before the current ledger, so pass the
643
+ * latest ledger plus a short window.
644
+ */
645
+ expirationLedger: number;
646
+ };
647
+ declare function buildStellarApproveInvocation(input: BuildStellarApproveInvocationInput): StellarInvocation;
648
+
649
+ type BuildStellarMintIntentInput = {
650
+ destination: StellarChain;
651
+ /** Raw CCTP message bytes from Iris. */
652
+ message: Uint8Array;
653
+ /** Raw attestation bytes from Iris. */
654
+ attestation: Uint8Array;
655
+ };
656
+ type StellarMintIntent = {
657
+ destination: StellarChain;
658
+ invocation: StellarInvocation;
659
+ };
660
+ declare function buildStellarMintIntent(input: BuildStellarMintIntentInput): StellarMintIntent;
661
+
662
+ /**
663
+ * Program-Derived Address (PDA) helpers for CCTP V2 on Solana.
664
+ *
665
+ * Seed conventions verified against Circle's
666
+ * `circlefin/solana-cctp-contracts` (programs/v2). Two key gotchas:
667
+ *
668
+ * - `remote_token_messenger` uses the destination domain encoded as
669
+ * its *decimal string* bytes, NOT u32 LE. So domain 0 →
670
+ * `Buffer.from("0", "utf8")`, not `Buffer.from([0, 0, 0, 0])`.
671
+ * - `token_pair` uses the source domain as decimal string too,
672
+ * plus the 32-byte source-token pubkey (left-padded EVM address
673
+ * for non-Solana sources).
674
+ */
675
+
676
+ /** Seed prefix bytes for each PDA we need. */
677
+ declare const SEEDS: {
678
+ readonly tokenMessenger: Uint8Array<ArrayBuffer>;
679
+ readonly tokenMinter: Uint8Array<ArrayBuffer>;
680
+ readonly senderAuthority: Uint8Array<ArrayBuffer>;
681
+ readonly remoteTokenMessenger: Uint8Array<ArrayBuffer>;
682
+ readonly localToken: Uint8Array<ArrayBuffer>;
683
+ readonly tokenPair: Uint8Array<ArrayBuffer>;
684
+ readonly custody: Uint8Array<ArrayBuffer>;
685
+ readonly denylistAccount: Uint8Array<ArrayBuffer>;
686
+ readonly messageTransmitter: Uint8Array<ArrayBuffer>;
687
+ readonly messageTransmitterAuthority: Uint8Array<ArrayBuffer>;
688
+ readonly usedNonce: Uint8Array<ArrayBuffer>;
689
+ readonly eventAuthority: Uint8Array<ArrayBuffer>;
690
+ };
691
+ /** `token_messenger` PDA on the TokenMessengerMinter program. */
692
+ declare function deriveTokenMessenger(tokenMessengerMinterProgram: PublicKey): PublicKey;
693
+ /** `token_minter` PDA on the TokenMessengerMinter program. */
694
+ declare function deriveTokenMinter(tokenMessengerMinterProgram: PublicKey): PublicKey;
695
+ /** `sender_authority` PDA on the TokenMessengerMinter program. */
696
+ declare function deriveSenderAuthority(tokenMessengerMinterProgram: PublicKey): PublicKey;
697
+ /**
698
+ * `remote_token_messenger` PDA, keyed by the **destination domain**
699
+ * as its decimal string representation (Circle's convention).
700
+ */
701
+ declare function deriveRemoteTokenMessenger(tokenMessengerMinterProgram: PublicKey, domain: number): PublicKey;
702
+ /** `local_token` PDA, keyed by the local USDC SPL mint. */
703
+ declare function deriveLocalToken(tokenMessengerMinterProgram: PublicKey, mint: PublicKey): PublicKey;
704
+ /**
705
+ * `token_pair` PDA, used on the receive (mint) side to map a
706
+ * (source domain, source token) pair to the local mint. Source token
707
+ * is 32 bytes (left-padded for EVM sources).
708
+ */
709
+ declare function deriveTokenPair(tokenMessengerMinterProgram: PublicKey, sourceDomain: number, sourceTokenBytes32: Uint8Array): PublicKey;
710
+ /** `custody` token account PDA, keyed by the local USDC mint. */
711
+ declare function deriveCustodyTokenAccount(tokenMessengerMinterProgram: PublicKey, mint: PublicKey): PublicKey;
712
+ /**
713
+ * `denylist_account` PDA, owner-keyed. Burn fails if this PDA exists
714
+ * with data; the user's denylist record is "absence of data."
715
+ */
716
+ declare function deriveDenylistAccount(tokenMessengerMinterProgram: PublicKey, owner: PublicKey): PublicKey;
717
+ /** `message_transmitter` config PDA on the MessageTransmitter program. */
718
+ declare function deriveMessageTransmitter(messageTransmitterProgram: PublicKey): PublicKey;
719
+ /**
720
+ * `message_transmitter_authority` PDA, keyed by the *receiver*
721
+ * program. For CCTP burns, the receiver is the TokenMessengerMinter.
722
+ */
723
+ declare function deriveMessageTransmitterAuthority(messageTransmitterProgram: PublicKey, receiverProgram: PublicKey): PublicKey;
724
+ /**
725
+ * `used_nonce` PDA, seeded by the 32-byte nonce in the CCTP message
726
+ * header: `message[12..44]` per Circle's `Message::NONCE_INDEX` /
727
+ * `Message::SENDER_INDEX` layout.
728
+ */
729
+ declare function deriveUsedNonce(messageTransmitterProgram: PublicKey, messageBytes: Uint8Array): PublicKey;
730
+ /** `__event_authority` PDA, used by Anchor's `#[event_cpi]`. */
731
+ declare function deriveEventAuthority(programId: PublicKey): PublicKey;
732
+
733
+ /**
734
+ * Snake-case the name as the Rust function declares it
735
+ * (`deposit_for_burn`, not `depositForBurn`).
736
+ *
737
+ * Uses `@noble/hashes` because this runs at module load in browser
738
+ * bundles, where `node:crypto` isn't available.
739
+ */
740
+ declare function anchorDiscriminator(snakeCaseName: string): Uint8Array;
741
+ /** TokenMessengerMinterV2 `deposit_for_burn` (no hook data). */
742
+ declare const DISCRIMINATOR_DEPOSIT_FOR_BURN: Uint8Array;
743
+ /** TokenMessengerMinterV2 `deposit_for_burn_with_hook`. */
744
+ declare const DISCRIMINATOR_DEPOSIT_FOR_BURN_WITH_HOOK: Uint8Array;
745
+ /** MessageTransmitterV2 `receive_message`. */
746
+ declare const DISCRIMINATOR_RECEIVE_MESSAGE: Uint8Array;
747
+
748
+ /**
749
+ * Solana CCTP V2 `deposit_for_burn` / `deposit_for_burn_with_hook`
750
+ * instruction builder.
751
+ *
752
+ * Account list verified against
753
+ * `circlefin/solana-cctp-contracts/programs/v2/token-messenger-minter-v2`:
754
+ *
755
+ * 1. owner (signer, ro)
756
+ * 2. event_rent_payer (signer, writable)
757
+ * 3. sender_authority_pda (ro) PDA["sender_authority"] on TMM
758
+ * 4. burn_token_account (writable) user's USDC ATA
759
+ * 5. denylist_account (ro) PDA["denylist_account", owner] on TMM
760
+ * 6. message_transmitter (writable) PDA["message_transmitter"] on MT
761
+ * 7. token_messenger (ro) PDA["token_messenger"] on TMM
762
+ * 8. remote_token_messenger (ro) PDA["remote_token_messenger", destDomain.toString()] on TMM
763
+ * 9. token_minter (ro) PDA["token_minter"] on TMM
764
+ * 10. local_token (writable) PDA["local_token", burnTokenMint] on TMM
765
+ * 11. burn_token_mint (writable)
766
+ * 12. message_sent_event_data (signer, writable) fresh keypair, generated client-side
767
+ * 13. message_transmitter_program (ro)
768
+ * 14. token_messenger_minter_program (ro)
769
+ * 15. token_program (ro)
770
+ * 16. system_program (ro)
771
+ * 17. event_authority (ro) PDA["__event_authority"] on TMM (added by #[event_cpi])
772
+ * 18. program (ro) TMM program ID (added by #[event_cpi])
773
+ *
774
+ * Encoding (Borsh):
775
+ * amount: u64 LE
776
+ * destination_domain: u32 LE
777
+ * mint_recipient: Pubkey (32 bytes)
778
+ * destination_caller: Pubkey (32 bytes)
779
+ * max_fee: u64 LE
780
+ * min_finality_threshold: u32 LE
781
+ * hook_data: Vec<u8> [only for deposit_for_burn_with_hook]
782
+ */
783
+
784
+ declare const ANY_DESTINATION_CALLER: PublicKey;
785
+ type BuildSolanaBurnIntentInput = {
786
+ source: SolanaChain;
787
+ /** Destination chain CCTP domain (0=Eth, 1=Avax, 3=Arb, 6=Base, etc.). */
788
+ destinationDomain: number;
789
+ /** USDC subunits (6 decimals). Must be > 0 and ≤ 10M USDC. */
790
+ amount: bigint;
791
+ /**
792
+ * Recipient on the destination chain, as 32 bytes (bytes32-encoded).
793
+ * EVM addresses are left-padded; Solana addresses pass through.
794
+ */
795
+ mintRecipientBytes32: Uint8Array;
796
+ /** USDC subunits; caps the protocol + forwarder fees. */
797
+ maxFee: bigint;
798
+ owner: PublicKey;
799
+ /** Fresh keypair pubkey for `message_sent_event_data`. */
800
+ messageSentEventDataKey: PublicKey;
801
+ /** User's USDC ATA on the source chain. */
802
+ ownerUsdcAta: PublicKey;
803
+ /** `destinationCaller` as bytes32. Defaults to any caller. */
804
+ destinationCallerBytes32?: Uint8Array;
805
+ /**
806
+ * Non-empty bytes (the `cctp-forward` hookData, or the Stellar
807
+ * Forwarder's) select `deposit_for_burn_with_hook`. Leave unset for
808
+ * the plain burn.
809
+ */
810
+ hookData?: Uint8Array;
811
+ /** Take it from the fee tier. */
812
+ minFinalityThreshold: FinalityThreshold;
813
+ };
814
+ type SolanaInstruction = {
815
+ programId: PublicKey;
816
+ keys: AccountMeta[];
817
+ data: Buffer;
818
+ ecosystem: "solana";
819
+ };
820
+ type SolanaBurnIntent = {
821
+ source: SolanaChain;
822
+ destinationDomain: number;
823
+ amount: bigint;
824
+ maxFee: bigint;
825
+ instruction: SolanaInstruction;
826
+ /** Pubkey the caller must include as a fresh signer. */
827
+ messageSentEventDataKey: PublicKey;
828
+ withHook: boolean;
829
+ };
830
+ declare function buildSolanaBurnIntent(input: BuildSolanaBurnIntentInput): SolanaBurnIntent;
831
+ /**
832
+ * Convenience: build a `TransactionInstruction` directly from the
833
+ * intent. Most callers will want this; the raw `instruction` shape
834
+ * keeps the type stable across `@solana/web3.js` minor versions.
835
+ */
836
+ declare function burnIntentToTransactionInstruction(intent: SolanaBurnIntent): TransactionInstruction;
837
+
838
+ /**
839
+ * Solana CCTP V2 `receive_message` instruction builder.
840
+ *
841
+ * `receive_message` is dispatched on `MessageTransmitterV2`. It does
842
+ * its own attestation verification, opens a `used_nonce` PDA, then
843
+ * CPIs into the receiver program (TokenMessengerMinterV2) via
844
+ * `handle_receive_finalized_message`. All accounts the receiver needs
845
+ * are appended after MessageTransmitter's own.
846
+ *
847
+ * Account list verified against
848
+ * `circlefin/solana-cctp-contracts/programs/v2`:
849
+ *
850
+ * MessageTransmitterV2 ReceiveMessageContext (with #[event_cpi]):
851
+ * 1. payer (signer, writable)
852
+ * 2. caller (signer, ro)
853
+ * 3. authority_pda (ro)
854
+ * 4. message_transmitter (ro)
855
+ * 5. used_nonce (writable, init)
856
+ * 6. receiver (ro) TMM program
857
+ * 7. system_program (ro)
858
+ * 8. event_authority (MT) (ro)
859
+ * 9. program (MT) (ro)
860
+ *
861
+ * Remaining accounts, from TokenMessengerMinterV2's
862
+ * HandleReceiveMessageContext (with #[event_cpi]):
863
+ * 10. token_messenger (ro)
864
+ * 11. remote_token_messenger (ro)
865
+ * 12. token_minter (writable)
866
+ * 13. local_token (writable)
867
+ * 14. token_pair (ro)
868
+ * 15. fee_recipient_token_account (writable)
869
+ * 16. recipient_token_account (writable)
870
+ * 17. custody_token_account (writable)
871
+ * 18. token_program (ro)
872
+ * 19. event_authority (TMM) (ro)
873
+ * 20. program (TMM) (ro)
874
+ */
875
+
876
+ type BuildSolanaReceiveIntentInput = {
877
+ destination: SolanaChain;
878
+ /** Raw CCTP message bytes from Iris. */
879
+ message: Uint8Array;
880
+ /** Raw attestation bytes from Iris. */
881
+ attestation: Uint8Array;
882
+ /** Source CCTP domain (the chain the burn came from). */
883
+ sourceDomain: number;
884
+ /** Source-chain USDC token, 32-byte left-padded. */
885
+ sourceTokenBytes32: Uint8Array;
886
+ /** The `fee_recipient` ATA, read from the on-chain TokenMessenger state. */
887
+ feeRecipientUsdcAta: PublicKey;
888
+ /** End-recipient's USDC ATA on Solana. Must be pre-created. */
889
+ recipientUsdcAta: PublicKey;
890
+ /** Pays for and signs the receive. Also passed as `caller`. */
891
+ payer: PublicKey;
892
+ };
893
+ type SolanaReceiveIntent = {
894
+ destination: SolanaChain;
895
+ instruction: {
896
+ programId: PublicKey;
897
+ keys: AccountMeta[];
898
+ data: Buffer;
899
+ ecosystem: "solana";
900
+ };
901
+ };
902
+ declare function buildSolanaReceiveIntent(input: BuildSolanaReceiveIntentInput): SolanaReceiveIntent;
903
+ /** Convenience: produce a `TransactionInstruction` from the intent. */
904
+ declare function receiveIntentToTransactionInstruction(intent: SolanaReceiveIntent): TransactionInstruction;
905
+
906
+ /**
907
+ * Solana CCTP on-chain state parsing.
908
+ *
909
+ * The TokenMessenger account holds the `fee_recipient` pubkey that
910
+ * `receive_message` requires as a remaining-account constraint. The
911
+ * account isn't derived: it's an arbitrary owner-configured pubkey
912
+ * stored in state, so the executor must read it from chain.
913
+ *
914
+ * Account layout (Anchor, verified against Circle's
915
+ * `programs/v2/token-messenger-minter/src/token_messenger/state.rs`):
916
+ *
917
+ * 0..8 discriminator
918
+ * 8..40 denylister Pubkey
919
+ * 40..72 owner Pubkey
920
+ * 72..104 pending_owner Pubkey
921
+ * 104..108 message_body_version u32 LE
922
+ * 108..109 authority_bump u8
923
+ * 109..141 fee_recipient Pubkey
924
+ * 141..173 min_fee_controller Pubkey
925
+ * 173..177 min_fee u32 LE
926
+ */
927
+
928
+ /** Throws if the account data ends before `fee_recipient` does. */
929
+ declare function parseTokenMessengerFeeRecipient(accountData: Uint8Array): PublicKey;
930
+
931
+ /**
932
+ * CCTP V2 protocol layer.
933
+ *
934
+ * Owns the direct integration with CCTP V2 contracts and Circle's Iris
935
+ * attestation API. Pure protocol builders and HTTP client; no wallet
936
+ * state, no transaction submission.
937
+ */
938
+ declare const VERSION = "0.1.0";
939
+
940
+ export { ANY_DESTINATION_CALLER$1 as ANY_DESTINATION_CALLER, Address, type BuildBurnIntentInput, type BuildBurnWithFeesIntentInput, type BuildMintIntentInput, type BuildSolanaBurnIntentInput, type BuildSolanaReceiveIntentInput, type BuildStarknetBurnIntentInput, type BuildStarknetReceiveIntentInput, type BuildStellarBurnIntentInput, type BuildStellarMintIntentInput, BurnFeeTier, type BurnIntent, type BurnWithFeesIntent, CCTP_FORWARD_HOOK_DATA, CCTP_FORWARD_HOOK_DATA_LENGTH, CctpChain, type ComputeMaxFeeInput, type ComputeMaxFeeResult, DISCRIMINATOR_DEPOSIT_FOR_BURN, DISCRIMINATOR_DEPOSIT_FOR_BURN_WITH_HOOK, DISCRIMINATOR_RECEIVE_MESSAGE, type DecodedBurnMessage, type EvmCall, EvmChain, FinalityThreshold, ForwarderFeeTier, type GetStandardMinFeeOptions, InvalidAddressError, InvalidBytes32Error, InvalidInputError, type MintIntent, type RpcOptions, ANY_DESTINATION_CALLER as SOLANA_ANY_DESTINATION_CALLER, SEEDS as SOLANA_CCTP_PDA_SEEDS, type SolanaBurnIntent, SolanaChain, type SolanaInstruction, type SolanaReceiveIntent, type StarknetBurnIntent, type StarknetCall, StarknetChain, StarknetFelt, type StarknetReceiveIntent, type StarknetTransactionStatus, type StellarBurnIntent, StellarChain, type StellarInvocation, type StellarMintIntent, type StellarStrkeyType, type TransactionStatus, VERSION, anchorDiscriminator, assertStarknetFelt, buildBurnIntent, buildBurnWithFeesIntent, buildForwarderHookData, buildMintIntent, buildSolanaBurnIntent, buildSolanaReceiveIntent, buildStarknetApproveCall, buildStarknetBurnIntent, buildStarknetReceiveIntent, buildStellarApproveInvocation, buildStellarBurnIntent, buildStellarForwarderHookData, buildStellarMintIntent, burnIntentToTransactionInstruction, bytes32HexToFelt, bytesToByteArrayFelts, canonicalToStellarSubunits, computeBurnFee, computeMaxFee, contractStrkeyToBytes32Hex, decodeBurnMessage, decodeStrkeyToBytes32, deriveCustodyTokenAccount, deriveDenylistAccount, deriveEventAuthority, deriveLocalToken, deriveMessageTransmitter, deriveMessageTransmitterAuthority, deriveRemoteTokenMessenger, deriveSenderAuthority, deriveTokenMessenger, deriveTokenMinter, deriveTokenPair, deriveUsedNonce, encodeContractStrkey, feltToBigInt, feltToBytes32Hex, fromBytes32, getBlockNumber, getGasPrice, getStandardMinFee, getStarknetTransactionStatus, getTransactionStatus, getUsdcBalance, hexToByteArrayFelts, isAddress, isForwarderHookData, isNonceUsed, isStarknetNonceUsed, isStellarNonceUsed, isValidStarknetFelt, isValidStellarStrkey, parseFeeBps, parseForwarderFee, parseTokenMessengerFeeRecipient, receiveIntentToTransactionInstruction, selectForwarderFee, feltToString as starknetFeltToString, stellarBurnDust, stellarSubunitsToCanonical, strkeyTo32Bytes, strkeyType, toBytes32, tryFromBytes32, u256ToFelts };