@across-protocol/contracts 4.0.12 → 4.0.14-alpha.1

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.
Files changed (51) hide show
  1. package/README.md +186 -3
  2. package/dist/deployments/deployments.json +8 -6
  3. package/dist/scripts/svm/closeRelayerPdas.js +1 -1
  4. package/dist/scripts/svm/createVault.js +2 -2
  5. package/dist/scripts/svm/fakeFillWithRandomDistribution.js +8 -7
  6. package/dist/scripts/svm/findFillStatusPdaFromEvent.js +1 -1
  7. package/dist/scripts/svm/initialize.js +19 -5
  8. package/dist/scripts/svm/nativeDeposit.js +30 -9
  9. package/dist/scripts/svm/queryEvents.js +1 -1
  10. package/dist/scripts/svm/queryEventsV2.js +1 -1
  11. package/dist/scripts/svm/queryFills.js +1 -1
  12. package/dist/scripts/svm/simpleDeposit.js +30 -9
  13. package/dist/scripts/svm/simpleFakeRelayerRepayment.js +19 -12
  14. package/dist/scripts/svm/simpleFill.js +7 -6
  15. package/dist/scripts/svm/squadsIdlUpgrade.d.ts +1 -0
  16. package/dist/scripts/svm/squadsIdlUpgrade.js +76 -0
  17. package/dist/src/svm/assets/idl/svm_spoke.json +77 -40
  18. package/dist/src/svm/assets/svm_spoke.d.ts +77 -40
  19. package/dist/src/svm/clients/SvmSpoke/instructions/deposit.d.ts +2 -2
  20. package/dist/src/svm/clients/SvmSpoke/instructions/deposit.js +2 -2
  21. package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.d.ts +2 -2
  22. package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.js +2 -2
  23. package/dist/src/svm/clients/SvmSpoke/instructions/handleReceiveMessage.d.ts +1 -1
  24. package/dist/src/svm/clients/SvmSpoke/instructions/handleReceiveMessage.js +5 -5
  25. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.d.ts +2 -2
  26. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.js +2 -2
  27. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.d.ts +2 -2
  28. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.js +1 -1
  29. package/dist/src/svm/clients/SvmSpoke/types/filledRelay.d.ts +2 -2
  30. package/dist/src/svm/clients/SvmSpoke/types/filledRelay.js +2 -2
  31. package/dist/src/svm/clients/SvmSpoke/types/fundsDeposited.d.ts +2 -2
  32. package/dist/src/svm/clients/SvmSpoke/types/fundsDeposited.js +2 -2
  33. package/dist/src/svm/clients/SvmSpoke/types/relayData.d.ts +2 -2
  34. package/dist/src/svm/clients/SvmSpoke/types/relayData.js +2 -2
  35. package/dist/src/svm/clients/SvmSpoke/types/requestedSlowFill.d.ts +2 -2
  36. package/dist/src/svm/clients/SvmSpoke/types/requestedSlowFill.js +2 -2
  37. package/dist/src/svm/web3-v1/helpers.d.ts +6 -6
  38. package/dist/src/svm/web3-v1/helpers.js +2 -2
  39. package/dist/src/svm/web3-v1/relayHashUtils.js +3 -3
  40. package/dist/src/svm/web3-v1/solanaProgramUtils.d.ts +1 -1
  41. package/dist/src/svm/web3-v1/solanaProgramUtils.js +17 -7
  42. package/dist/src/types/svm.d.ts +3 -3
  43. package/dist/target/types/svm_spoke.d.ts +77 -40
  44. package/dist/tasks/enableL1TokenAcrossEcosystem.js +4 -4
  45. package/dist/test/svm/SvmSpoke.Deposit.js +21 -3
  46. package/dist/test/svm/SvmSpoke.Fill.AcrossPlus.js +3 -3
  47. package/dist/test/svm/SvmSpoke.Fill.js +3 -3
  48. package/dist/test/svm/SvmSpoke.SlowFill.AcrossPlus.js +3 -3
  49. package/dist/test/svm/SvmSpoke.SlowFill.js +2 -2
  50. package/dist/test/svm/SvmSpoke.common.js +1 -1
  51. package/package.json +2 -2
@@ -48,7 +48,7 @@ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
48
48
  .option("exclusiveRelayer", { type: "string", demandOption: false, describe: "Exclusive relayer public key" })
49
49
  .option("inputToken", { type: "string", demandOption: true, describe: "Input token public key" })
50
50
  .option("outputToken", { type: "string", demandOption: true, describe: "Output token public key" })
51
- .option("inputAmount", { type: "number", demandOption: true, describe: "Input amount" })
51
+ .option("inputAmount", { type: "string", demandOption: true, describe: "Input amount" })
52
52
  .option("outputAmount", { type: "number", demandOption: true, describe: "Output amount" })
53
53
  .option("originChainId", { type: "string", demandOption: true, describe: "Origin chain ID" })
54
54
  .option("depositId", { type: "string", demandOption: true, describe: "Deposit ID" })
@@ -61,12 +61,12 @@ async function fillRelay() {
61
61
  const exclusiveRelayer = new web3_js_1.PublicKey(resolvedArgv.exclusiveRelayer || "11111111111111111111111111111111");
62
62
  const inputToken = new web3_js_1.PublicKey(resolvedArgv.inputToken);
63
63
  const outputToken = new web3_js_1.PublicKey(resolvedArgv.outputToken);
64
- const inputAmount = new anchor_1.BN(resolvedArgv.inputAmount);
64
+ const inputAmount = (0, web3_v1_1.intToU8Array32)(new anchor_1.BN(resolvedArgv.inputAmount));
65
65
  const outputAmount = new anchor_1.BN(resolvedArgv.outputAmount);
66
66
  const originChainId = new anchor_1.BN(resolvedArgv.originChainId);
67
67
  const depositId = (0, web3_v1_1.intToU8Array32)(new anchor_1.BN(resolvedArgv.depositId));
68
68
  const fillDeadline = resolvedArgv.fillDeadline || Math.floor(Date.now() / 1000) + 60; // Current time + 1 minute
69
- const exclusivityDeadline = resolvedArgv.exclusivityDeadline || Math.floor(Date.now() / 1000) + 30; // Current time + 30 seconds
69
+ const exclusivityDeadline = resolvedArgv.exclusivityDeadline ?? 0; // default to 0
70
70
  const message = Buffer.from("");
71
71
  const seed = new anchor_1.BN(resolvedArgv.seed);
72
72
  const relayData = {
@@ -123,13 +123,14 @@ async function fillRelay() {
123
123
  { pubkey: recipientTokenAccount, isWritable: true, isSigner: false },
124
124
  ])
125
125
  .instruction();
126
- // Delegate state PDA to pull relayer tokens.
127
- const approveIx = await (0, spl_token_1.createApproveCheckedInstruction)(relayerTokenAccount, outputToken, statePda, signer.publicKey, BigInt(relayData.outputAmount.toString()), tokenDecimals, undefined, spl_token_1.TOKEN_PROGRAM_ID);
126
+ const delegate = (0, web3_v1_1.getFillRelayDelegatePda)(relayHashUint8Array, chainId, signer.publicKey, program.programId).pda;
127
+ // Delegate fill delegate PDA to pull relayer tokens.
128
+ const approveIx = await (0, spl_token_1.createApproveCheckedInstruction)(relayerTokenAccount, outputToken, delegate, signer.publicKey, BigInt(relayData.outputAmount.toString()), tokenDecimals, undefined, spl_token_1.TOKEN_PROGRAM_ID);
128
129
  const fillDataValues = [Array.from(relayHashUint8Array), relayData, chainId, signer.publicKey];
129
130
  const fillAccounts = {
130
131
  state: statePda,
131
132
  signer: signer.publicKey,
132
- delegate: (0, web3_v1_1.getFillRelayDelegatePda)(relayHashUint8Array, chainId, signer.publicKey, program.programId).pda,
133
+ delegate,
133
134
  instructionParams: program.programId,
134
135
  mint: outputToken,
135
136
  relayerTokenAccount: relayerTokenAccount,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ // This script prepares transaction for finalizing IDL upgrade and prints out Base58 encoded transaction that can be
3
+ // imported in the Squads transaction builder. This requires one first to have written the upgraded IDL to the buffer
4
+ // account (anchor idl write-buffer) and set its authority to the Squads multisig (anchor idl set-authority).
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const web3_js_1 = require("@solana/web3.js");
10
+ const yargs_1 = __importDefault(require("yargs"));
11
+ const helpers_1 = require("yargs/helpers");
12
+ const web3_js_2 = require("@solana/web3.js");
13
+ const sha2_1 = require("@noble/hashes/sha2");
14
+ const bs58_1 = __importDefault(require("bs58"));
15
+ // Parse arguments
16
+ const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
17
+ .option("programId", { type: "string", demandOption: true, describe: "Upgrade IDL for the given program ID" })
18
+ .option("idlBuffer", { type: "string", demandOption: true, describe: "Buffer account where IDL has been written" })
19
+ .option("closeRecipient", { type: "string", demandOption: true, describe: "Account to receive closed buffer SOL" })
20
+ .option("multisig", { type: "string", demandOption: true, describe: "Multisig controlling the upgrade" }).argv;
21
+ async function squadsIdlUpgrade() {
22
+ const resolvedArgv = await argv;
23
+ const programId = new web3_js_1.PublicKey(resolvedArgv.programId);
24
+ const idlBuffer = new web3_js_1.PublicKey(resolvedArgv.idlBuffer);
25
+ const multisig = new web3_js_1.PublicKey(resolvedArgv.multisig);
26
+ const closeRecipient = new web3_js_1.PublicKey(resolvedArgv.closeRecipient);
27
+ // Get the deterministic IDL address for the program:
28
+ const base = web3_js_1.PublicKey.findProgramAddressSync([], programId)[0];
29
+ const idlAddress = await web3_js_1.PublicKey.createWithSeed(base, "anchor:idl", programId);
30
+ console.log("Creating IDL upgrade transaction...");
31
+ console.table([
32
+ { Property: "programId", Value: programId.toString() },
33
+ { Property: "idlBuffer", Value: idlBuffer.toString() },
34
+ { Property: "idlAddress", Value: idlAddress.toString() },
35
+ { Property: "multisig", Value: multisig.toString() },
36
+ { Property: "closeRecipient", Value: closeRecipient.toString() },
37
+ ]);
38
+ const idlSetBufferAccounts = [
39
+ { pubkey: idlBuffer, isSigner: false, isWritable: true },
40
+ { pubkey: idlAddress, isSigner: false, isWritable: true },
41
+ { pubkey: multisig, isSigner: true, isWritable: false },
42
+ ];
43
+ const idlSetBufferInstructionData = Buffer.concat([
44
+ Buffer.from((0, sha2_1.sha256)("anchor:idl")).slice(0, 8).reverse(),
45
+ Buffer.from([3]), // IdlInstruction::SetBuffer
46
+ ]);
47
+ const idlSetBufferInstructionCtorFields = {
48
+ keys: idlSetBufferAccounts,
49
+ programId: programId,
50
+ data: idlSetBufferInstructionData,
51
+ };
52
+ const idlSetBufferInstruction = new web3_js_2.TransactionInstruction(idlSetBufferInstructionCtorFields);
53
+ const idlCloseAccounts = [
54
+ { pubkey: idlBuffer, isSigner: false, isWritable: true },
55
+ { pubkey: multisig, isSigner: true, isWritable: false },
56
+ { pubkey: closeRecipient, isSigner: false, isWritable: true },
57
+ ];
58
+ const idlCloseData = Buffer.concat([
59
+ Buffer.from((0, sha2_1.sha256)("anchor:idl")).slice(0, 8).reverse(),
60
+ Buffer.from([5]), // IdlInstruction::Close
61
+ ]);
62
+ const idlCloseCtorFields = {
63
+ keys: idlCloseAccounts,
64
+ programId: programId,
65
+ data: idlCloseData,
66
+ };
67
+ const idlCloseInstruction = new web3_js_2.TransactionInstruction(idlCloseCtorFields);
68
+ const multisigTransaction = new web3_js_2.Transaction().add(idlSetBufferInstruction).add(idlCloseInstruction);
69
+ multisigTransaction.recentBlockhash = "11111111111111111111111111111111"; // Placeholder blockhash
70
+ multisigTransaction.feePayer = programId; // Placeholder fee payer as we are not signing the transaction
71
+ const serializedMultisigTransaction = multisigTransaction.serializeMessage();
72
+ console.log("IDL upgrade transaction, import it into the multisig:");
73
+ console.log(bs58_1.default.encode(serializedMultisigTransaction));
74
+ }
75
+ // Run the squadsIdlUpgrade function
76
+ squadsIdlUpgrade();
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq",
2
+ "address": "4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu",
3
3
  "metadata": {
4
4
  "name": "svm_spoke",
5
5
  "version": "0.1.0",
@@ -745,6 +745,7 @@
745
745
  "amount will be sent to the relayer on their repayment chain of choice as a refund following an optimistic",
746
746
  "challenge window in the HubPool, less a system fee.",
747
747
  "- output_amount: The amount of output tokens that the relayer will send to the recipient on the destination.",
748
+ "This is big-endian encoded as a 32-byte array to match its underlying byte representation on EVM side.",
748
749
  "- destination_chain_id: The destination chain identifier where the fill should be made.",
749
750
  "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the exclusivity",
750
751
  "deadline timestamp. This must be a valid, non-zero address if the exclusivity deadline is greater than the",
@@ -986,7 +987,12 @@
986
987
  },
987
988
  {
988
989
  "name": "output_amount",
989
- "type": "u64"
990
+ "type": {
991
+ "array": [
992
+ "u8",
993
+ 32
994
+ ]
995
+ }
990
996
  },
991
997
  {
992
998
  "name": "destination_chain_id",
@@ -1246,7 +1252,12 @@
1246
1252
  },
1247
1253
  {
1248
1254
  "name": "output_amount",
1249
- "type": "u64"
1255
+ "type": {
1256
+ "array": [
1257
+ "u8",
1258
+ 32
1259
+ ]
1260
+ }
1250
1261
  },
1251
1262
  {
1252
1263
  "name": "destination_chain_id",
@@ -2338,6 +2349,7 @@
2338
2349
  "token on the repayment chain will be sent as a refund to the caller.",
2339
2350
  "- output_token: The token that the caller will send to the recipient on this chain.",
2340
2351
  "- input_amount: This amount, less a system fee, will be sent to the caller on their repayment chain.",
2352
+ "This is big-endian encoded as a 32-byte array to match its underlying byte representation on EVM side",
2341
2353
  "- output_amount: The amount of output tokens that the caller will send to the recipient.",
2342
2354
  "- origin_chain_id: The origin chain identifier.",
2343
2355
  "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the",
@@ -2717,38 +2729,38 @@
2717
2729
  {
2718
2730
  "kind": "const",
2719
2731
  "value": [
2720
- 255,
2721
- 9,
2722
- 170,
2723
- 45,
2724
- 62,
2725
- 177,
2726
- 188,
2727
- 157,
2728
- 161,
2729
- 158,
2730
- 130,
2731
- 38,
2732
- 73,
2733
- 48,
2734
- 225,
2735
- 61,
2736
- 57,
2737
- 147,
2738
- 225,
2739
- 22,
2740
- 15,
2741
- 48,
2742
- 57,
2732
+ 49,
2733
+ 26,
2734
+ 43,
2735
+ 82,
2736
+ 76,
2743
2737
  239,
2744
- 33,
2745
- 175,
2746
- 209,
2747
- 86,
2748
- 83,
2749
- 118,
2750
- 239,
2751
- 202
2738
+ 117,
2739
+ 32,
2740
+ 212,
2741
+ 230,
2742
+ 107,
2743
+ 40,
2744
+ 205,
2745
+ 152,
2746
+ 207,
2747
+ 87,
2748
+ 23,
2749
+ 16,
2750
+ 110,
2751
+ 169,
2752
+ 19,
2753
+ 114,
2754
+ 44,
2755
+ 25,
2756
+ 207,
2757
+ 28,
2758
+ 149,
2759
+ 223,
2760
+ 193,
2761
+ 138,
2762
+ 247,
2763
+ 52
2752
2764
  ]
2753
2765
  }
2754
2766
  ],
@@ -2841,7 +2853,7 @@
2841
2853
  },
2842
2854
  {
2843
2855
  "name": "program",
2844
- "address": "JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq"
2856
+ "address": "4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu"
2845
2857
  }
2846
2858
  ],
2847
2859
  "args": [
@@ -4096,7 +4108,12 @@
4096
4108
  },
4097
4109
  {
4098
4110
  "name": "output_amount",
4099
- "type": "u64"
4111
+ "type": {
4112
+ "array": [
4113
+ "u8",
4114
+ 32
4115
+ ]
4116
+ }
4100
4117
  },
4101
4118
  {
4102
4119
  "name": "destination_chain_id",
@@ -4866,7 +4883,12 @@
4866
4883
  },
4867
4884
  {
4868
4885
  "name": "input_amount",
4869
- "type": "u64"
4886
+ "type": {
4887
+ "array": [
4888
+ "u8",
4889
+ 32
4890
+ ]
4891
+ }
4870
4892
  },
4871
4893
  {
4872
4894
  "name": "output_amount",
@@ -4952,7 +4974,12 @@
4952
4974
  },
4953
4975
  {
4954
4976
  "name": "output_amount",
4955
- "type": "u64"
4977
+ "type": {
4978
+ "array": [
4979
+ "u8",
4980
+ 32
4981
+ ]
4982
+ }
4956
4983
  },
4957
4984
  {
4958
4985
  "name": "destination_chain_id",
@@ -5073,7 +5100,12 @@
5073
5100
  },
5074
5101
  {
5075
5102
  "name": "input_amount",
5076
- "type": "u64"
5103
+ "type": {
5104
+ "array": [
5105
+ "u8",
5106
+ 32
5107
+ ]
5108
+ }
5077
5109
  },
5078
5110
  {
5079
5111
  "name": "output_amount",
@@ -5237,7 +5269,12 @@
5237
5269
  },
5238
5270
  {
5239
5271
  "name": "input_amount",
5240
- "type": "u64"
5272
+ "type": {
5273
+ "array": [
5274
+ "u8",
5275
+ 32
5276
+ ]
5277
+ }
5241
5278
  },
5242
5279
  {
5243
5280
  "name": "output_amount",
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/svm_spoke.json`.
6
6
  */
7
7
  export type SvmSpoke = {
8
- "address": "JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq";
8
+ "address": "4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu";
9
9
  "metadata": {
10
10
  "name": "svmSpoke";
11
11
  "version": "0.1.0";
@@ -751,6 +751,7 @@ export type SvmSpoke = {
751
751
  "amount will be sent to the relayer on their repayment chain of choice as a refund following an optimistic",
752
752
  "challenge window in the HubPool, less a system fee.",
753
753
  "- output_amount: The amount of output tokens that the relayer will send to the recipient on the destination.",
754
+ "This is big-endian encoded as a 32-byte array to match its underlying byte representation on EVM side.",
754
755
  "- destination_chain_id: The destination chain identifier where the fill should be made.",
755
756
  "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the exclusivity",
756
757
  "deadline timestamp. This must be a valid, non-zero address if the exclusivity deadline is greater than the",
@@ -992,7 +993,12 @@ export type SvmSpoke = {
992
993
  },
993
994
  {
994
995
  "name": "outputAmount";
995
- "type": "u64";
996
+ "type": {
997
+ "array": [
998
+ "u8",
999
+ 32
1000
+ ];
1001
+ };
996
1002
  },
997
1003
  {
998
1004
  "name": "destinationChainId";
@@ -1252,7 +1258,12 @@ export type SvmSpoke = {
1252
1258
  },
1253
1259
  {
1254
1260
  "name": "outputAmount";
1255
- "type": "u64";
1261
+ "type": {
1262
+ "array": [
1263
+ "u8",
1264
+ 32
1265
+ ];
1266
+ };
1256
1267
  },
1257
1268
  {
1258
1269
  "name": "destinationChainId";
@@ -2344,6 +2355,7 @@ export type SvmSpoke = {
2344
2355
  "token on the repayment chain will be sent as a refund to the caller.",
2345
2356
  "- output_token: The token that the caller will send to the recipient on this chain.",
2346
2357
  "- input_amount: This amount, less a system fee, will be sent to the caller on their repayment chain.",
2358
+ "This is big-endian encoded as a 32-byte array to match its underlying byte representation on EVM side",
2347
2359
  "- output_amount: The amount of output tokens that the caller will send to the recipient.",
2348
2360
  "- origin_chain_id: The origin chain identifier.",
2349
2361
  "- exclusive_relayer: The relayer that will be exclusively allowed to fill this deposit before the",
@@ -2723,38 +2735,38 @@ export type SvmSpoke = {
2723
2735
  {
2724
2736
  "kind": "const";
2725
2737
  "value": [
2726
- 255,
2727
- 9,
2728
- 170,
2729
- 45,
2730
- 62,
2731
- 177,
2732
- 188,
2733
- 157,
2734
- 161,
2735
- 158,
2736
- 130,
2737
- 38,
2738
- 73,
2739
- 48,
2740
- 225,
2741
- 61,
2742
- 57,
2743
- 147,
2744
- 225,
2745
- 22,
2746
- 15,
2747
- 48,
2748
- 57,
2738
+ 49,
2739
+ 26,
2740
+ 43,
2741
+ 82,
2742
+ 76,
2749
2743
  239,
2750
- 33,
2751
- 175,
2752
- 209,
2753
- 86,
2754
- 83,
2755
- 118,
2756
- 239,
2757
- 202
2744
+ 117,
2745
+ 32,
2746
+ 212,
2747
+ 230,
2748
+ 107,
2749
+ 40,
2750
+ 205,
2751
+ 152,
2752
+ 207,
2753
+ 87,
2754
+ 23,
2755
+ 16,
2756
+ 110,
2757
+ 169,
2758
+ 19,
2759
+ 114,
2760
+ 44,
2761
+ 25,
2762
+ 207,
2763
+ 28,
2764
+ 149,
2765
+ 223,
2766
+ 193,
2767
+ 138,
2768
+ 247,
2769
+ 52
2758
2770
  ];
2759
2771
  }
2760
2772
  ];
@@ -2847,7 +2859,7 @@ export type SvmSpoke = {
2847
2859
  },
2848
2860
  {
2849
2861
  "name": "program";
2850
- "address": "JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq";
2862
+ "address": "4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu";
2851
2863
  }
2852
2864
  ];
2853
2865
  "args": [
@@ -4102,7 +4114,12 @@ export type SvmSpoke = {
4102
4114
  },
4103
4115
  {
4104
4116
  "name": "outputAmount";
4105
- "type": "u64";
4117
+ "type": {
4118
+ "array": [
4119
+ "u8",
4120
+ 32
4121
+ ];
4122
+ };
4106
4123
  },
4107
4124
  {
4108
4125
  "name": "destinationChainId";
@@ -4872,7 +4889,12 @@ export type SvmSpoke = {
4872
4889
  },
4873
4890
  {
4874
4891
  "name": "inputAmount";
4875
- "type": "u64";
4892
+ "type": {
4893
+ "array": [
4894
+ "u8",
4895
+ 32
4896
+ ];
4897
+ };
4876
4898
  },
4877
4899
  {
4878
4900
  "name": "outputAmount";
@@ -4958,7 +4980,12 @@ export type SvmSpoke = {
4958
4980
  },
4959
4981
  {
4960
4982
  "name": "outputAmount";
4961
- "type": "u64";
4983
+ "type": {
4984
+ "array": [
4985
+ "u8",
4986
+ 32
4987
+ ];
4988
+ };
4962
4989
  },
4963
4990
  {
4964
4991
  "name": "destinationChainId";
@@ -5079,7 +5106,12 @@ export type SvmSpoke = {
5079
5106
  },
5080
5107
  {
5081
5108
  "name": "inputAmount";
5082
- "type": "u64";
5109
+ "type": {
5110
+ "array": [
5111
+ "u8",
5112
+ 32
5113
+ ];
5114
+ };
5083
5115
  },
5084
5116
  {
5085
5117
  "name": "outputAmount";
@@ -5243,7 +5275,12 @@ export type SvmSpoke = {
5243
5275
  },
5244
5276
  {
5245
5277
  "name": "inputAmount";
5246
- "type": "u64";
5278
+ "type": {
5279
+ "array": [
5280
+ "u8",
5281
+ 32
5282
+ ];
5283
+ };
5247
5284
  },
5248
5285
  {
5249
5286
  "name": "outputAmount";
@@ -30,7 +30,7 @@ export type DepositInstructionData = {
30
30
  inputToken: Address;
31
31
  outputToken: Address;
32
32
  inputAmount: bigint;
33
- outputAmount: bigint;
33
+ outputAmount: ReadonlyUint8Array;
34
34
  destinationChainId: bigint;
35
35
  exclusiveRelayer: Address;
36
36
  quoteTimestamp: number;
@@ -44,7 +44,7 @@ export type DepositInstructionDataArgs = {
44
44
  inputToken: Address;
45
45
  outputToken: Address;
46
46
  inputAmount: number | bigint;
47
- outputAmount: number | bigint;
47
+ outputAmount: ReadonlyUint8Array;
48
48
  destinationChainId: number | bigint;
49
49
  exclusiveRelayer: Address;
50
50
  quoteTimestamp: number;
@@ -32,7 +32,7 @@ function getDepositInstructionDataEncoder() {
32
32
  ['inputToken', (0, kit_1.getAddressEncoder)()],
33
33
  ['outputToken', (0, kit_1.getAddressEncoder)()],
34
34
  ['inputAmount', (0, kit_1.getU64Encoder)()],
35
- ['outputAmount', (0, kit_1.getU64Encoder)()],
35
+ ['outputAmount', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 32)],
36
36
  ['destinationChainId', (0, kit_1.getU64Encoder)()],
37
37
  ['exclusiveRelayer', (0, kit_1.getAddressEncoder)()],
38
38
  ['quoteTimestamp', (0, kit_1.getU32Encoder)()],
@@ -49,7 +49,7 @@ function getDepositInstructionDataDecoder() {
49
49
  ['inputToken', (0, kit_1.getAddressDecoder)()],
50
50
  ['outputToken', (0, kit_1.getAddressDecoder)()],
51
51
  ['inputAmount', (0, kit_1.getU64Decoder)()],
52
- ['outputAmount', (0, kit_1.getU64Decoder)()],
52
+ ['outputAmount', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32)],
53
53
  ['destinationChainId', (0, kit_1.getU64Decoder)()],
54
54
  ['exclusiveRelayer', (0, kit_1.getAddressDecoder)()],
55
55
  ['quoteTimestamp', (0, kit_1.getU32Decoder)()],
@@ -30,7 +30,7 @@ export type DepositNowInstructionData = {
30
30
  inputToken: Address;
31
31
  outputToken: Address;
32
32
  inputAmount: bigint;
33
- outputAmount: bigint;
33
+ outputAmount: ReadonlyUint8Array;
34
34
  destinationChainId: bigint;
35
35
  exclusiveRelayer: Address;
36
36
  fillDeadlineOffset: number;
@@ -43,7 +43,7 @@ export type DepositNowInstructionDataArgs = {
43
43
  inputToken: Address;
44
44
  outputToken: Address;
45
45
  inputAmount: number | bigint;
46
- outputAmount: number | bigint;
46
+ outputAmount: ReadonlyUint8Array;
47
47
  destinationChainId: number | bigint;
48
48
  exclusiveRelayer: Address;
49
49
  fillDeadlineOffset: number;
@@ -32,7 +32,7 @@ function getDepositNowInstructionDataEncoder() {
32
32
  ['inputToken', (0, kit_1.getAddressEncoder)()],
33
33
  ['outputToken', (0, kit_1.getAddressEncoder)()],
34
34
  ['inputAmount', (0, kit_1.getU64Encoder)()],
35
- ['outputAmount', (0, kit_1.getU64Encoder)()],
35
+ ['outputAmount', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 32)],
36
36
  ['destinationChainId', (0, kit_1.getU64Encoder)()],
37
37
  ['exclusiveRelayer', (0, kit_1.getAddressEncoder)()],
38
38
  ['fillDeadlineOffset', (0, kit_1.getU32Encoder)()],
@@ -48,7 +48,7 @@ function getDepositNowInstructionDataDecoder() {
48
48
  ['inputToken', (0, kit_1.getAddressDecoder)()],
49
49
  ['outputToken', (0, kit_1.getAddressDecoder)()],
50
50
  ['inputAmount', (0, kit_1.getU64Decoder)()],
51
- ['outputAmount', (0, kit_1.getU64Decoder)()],
51
+ ['outputAmount', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32)],
52
52
  ['destinationChainId', (0, kit_1.getU64Decoder)()],
53
53
  ['exclusiveRelayer', (0, kit_1.getAddressDecoder)()],
54
54
  ['fillDeadlineOffset', (0, kit_1.getU32Decoder)()],
@@ -9,7 +9,7 @@ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta
9
9
  import { SVM_SPOKE_PROGRAM_ADDRESS } from '../programs';
10
10
  export declare const HANDLE_RECEIVE_MESSAGE_DISCRIMINATOR: Uint8Array;
11
11
  export declare function getHandleReceiveMessageDiscriminatorBytes(): ReadonlyUint8Array;
12
- export type HandleReceiveMessageInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountAuthorityPda extends string | IAccountMeta<string> = string, TAccountState extends string | IAccountMeta<string> = string, TAccountSelfAuthority extends string | IAccountMeta<string> = string, TAccountProgram extends string | IAccountMeta<string> = 'JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
12
+ export type HandleReceiveMessageInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountAuthorityPda extends string | IAccountMeta<string> = string, TAccountState extends string | IAccountMeta<string> = string, TAccountSelfAuthority extends string | IAccountMeta<string> = string, TAccountProgram extends string | IAccountMeta<string> = '4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu', TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
13
13
  TAccountAuthorityPda extends string ? ReadonlySignerAccount<TAccountAuthorityPda> & IAccountSignerMeta<TAccountAuthorityPda> : TAccountAuthorityPda,
14
14
  TAccountState extends string ? ReadonlyAccount<TAccountState> : TAccountState,
15
15
  TAccountSelfAuthority extends string ? ReadonlyAccount<TAccountSelfAuthority> : TAccountSelfAuthority,
@@ -72,9 +72,9 @@ async function getHandleReceiveMessageInstructionAsync(input, config) {
72
72
  121,
73
73
  ])),
74
74
  (0, kit_1.getBytesEncoder)().encode(new Uint8Array([
75
- 255, 9, 170, 45, 62, 177, 188, 157, 161, 158, 130, 38, 73, 48, 225,
76
- 61, 57, 147, 225, 22, 15, 48, 57, 239, 33, 175, 209, 86, 83, 118,
77
- 239, 202,
75
+ 49, 26, 43, 82, 76, 239, 117, 32, 212, 230, 107, 40, 205, 152, 207,
76
+ 87, 23, 16, 110, 169, 19, 114, 44, 25, 207, 28, 149, 223, 193, 138,
77
+ 247, 52,
78
78
  ])),
79
79
  ],
80
80
  });
@@ -91,7 +91,7 @@ async function getHandleReceiveMessageInstructionAsync(input, config) {
91
91
  }
92
92
  if (!accounts.program.value) {
93
93
  accounts.program.value =
94
- 'JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq';
94
+ '4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu';
95
95
  }
96
96
  const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
97
97
  const instruction = {
@@ -122,7 +122,7 @@ function getHandleReceiveMessageInstruction(input, config) {
122
122
  // Resolve default values.
123
123
  if (!accounts.program.value) {
124
124
  accounts.program.value =
125
- 'JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq';
125
+ '4Jg83Lhggz2EdzSsDX2NVcEK56F25jJKK5btUbHAU4Xu';
126
126
  }
127
127
  const getAccountMeta = (0, shared_1.getAccountMetaFactory)(programAddress, 'programId');
128
128
  const instruction = {
@@ -30,7 +30,7 @@ export type UnsafeDepositInstructionData = {
30
30
  inputToken: Address;
31
31
  outputToken: Address;
32
32
  inputAmount: bigint;
33
- outputAmount: bigint;
33
+ outputAmount: ReadonlyUint8Array;
34
34
  destinationChainId: bigint;
35
35
  exclusiveRelayer: Address;
36
36
  depositNonce: bigint;
@@ -45,7 +45,7 @@ export type UnsafeDepositInstructionDataArgs = {
45
45
  inputToken: Address;
46
46
  outputToken: Address;
47
47
  inputAmount: number | bigint;
48
- outputAmount: number | bigint;
48
+ outputAmount: ReadonlyUint8Array;
49
49
  destinationChainId: number | bigint;
50
50
  exclusiveRelayer: Address;
51
51
  depositNonce: number | bigint;