@across-protocol/contracts 6.0.0-beta.4 → 6.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,7 @@ The latest contract deployments can be found in `/broadcast/deployed-addresses.j
23
23
 
24
24
  ## Requirements
25
25
 
26
- This repository assumes you have [Node](https://nodejs.org/en/download/package-manager) installed, with a minimum version of 22.18.0. Depending on what you want to do with the repo you might also need [foundry](https://book.getfoundry.sh/getting-started/installation) and [anchor](https://www.anchor-lang.com/docs/installation) to also be installed. If you have build issues please ensure these are both installed first.
26
+ This repository assumes you have [Node](https://nodejs.org/en/download/package-manager) installed, using the CI version 22.23.4 or a later patched Node 22 release. Depending on what you want to do with the repo you might also need [foundry](https://book.getfoundry.sh/getting-started/installation) and [anchor](https://www.anchor-lang.com/docs/installation) to also be installed. If you have build issues please ensure these are both installed first.
27
27
 
28
28
  Use Node 22 for SVM development. `Anchor.toml` pins Anchor 1.1.2 and Agave 4.1.2;
29
29
  install these versions instead of selecting a moving `latest` toolchain.
@@ -247,7 +247,7 @@ export MAX_LEN=$(( 2 * $(stat -c %s target/deploy/$PROGRAM.so) )) # Reserve twic
247
247
 
248
248
  #### Initial deployment
249
249
 
250
- Deploy the program and set the upgrade authority to the multisig:
250
+ Deploy the selected program and initialize its canonical IDL while `$KEYPAIR` holds upgrade authority:
251
251
 
252
252
  ```shell
253
253
  solana program deploy \
@@ -264,22 +264,18 @@ anchor idl init \
264
264
  --provider.wallet $KEYPAIR \
265
265
  --filepath target/idl/$PROGRAM.json \
266
266
  $PROGRAM_ID
267
- solana program set-upgrade-authority \
268
- --url $RPC_URL \
269
- --keypair $KEYPAIR \
270
- --skip-new-upgrade-authority-signer-check \
271
- $PROGRAM_ID \
272
- --new-upgrade-authority $MULTISIG
273
267
  ```
274
268
 
275
269
  Update and commit `deployments/legacy-addresses.json` with the deployed program ID and deployment slot.
276
270
 
277
271
  Anchor 1.1.2 stores canonical IDLs in the separate Program Metadata program. Its authority follows the
278
- program upgrade authority; there is no separate `anchor idl set-authority` step. The sequence above initializes
279
- the canonical IDL before transferring program authority. If Squads already holds authority,
272
+ program upgrade authority; there is no separate `anchor idl set-authority` step. Initialize the canonical IDL
273
+ and complete the applicable program setup below before transferring program authority. If Squads already holds authority,
280
274
  perform the canonical metadata write through Squads as described below.
281
275
 
282
- `svm_spoke` also requires initialization and transfer of ownership on the first deployment:
276
+ For `svm_spoke`, initialize the state while `$KEYPAIR` is still the program's upgrade authority.
277
+ The script makes `$KEYPAIR` the initial local owner, then transfers local ownership to `$MULTISIG` via `--svmAdmin`.
278
+ Program upgrade authority is transferred separately after setup. See the [initialization requirements](scripts/svm/README.md#initialize-a-fresh-spoke-deployment).
283
279
 
284
280
  ```shell
285
281
  anchor run initialize \
@@ -303,7 +299,7 @@ anchor run createVault \
303
299
  --originToken $MINT
304
300
  ```
305
301
 
306
- `sponsored_cctp_src_periphery` requires initialization and setting minimum deposit amount for supported burn token:
302
+ For `sponsored_cctp_src_periphery`, initialize and set the minimum deposit amount for the supported burn token:
307
303
 
308
304
  ```shell
309
305
  # Replace --quoteSigner with actual quote signer address
@@ -319,6 +315,23 @@ anchor run setMinimumDepositSponsoredCctpSrc \
319
315
  --amount 0
320
316
  ```
321
317
 
318
+ These sponsored CCTP scripts submit directly when `$KEYPAIR` holds upgrade authority. If authority has already
319
+ been transferred to Squads, they simulate and export transactions for multisig execution instead. Execute and
320
+ confirm the initialization transaction through Squads before running the minimum-deposit script, then execute
321
+ its exported transaction through Squads as well; simulation alone does not update on-chain state.
322
+
323
+ After completing the setup for the selected program, transfer its upgrade authority to the multisig if `$KEYPAIR`
324
+ still holds it:
325
+
326
+ ```shell
327
+ solana program set-upgrade-authority \
328
+ --url $RPC_URL \
329
+ --keypair $KEYPAIR \
330
+ --skip-new-upgrade-authority-signer-check \
331
+ $PROGRAM_ID \
332
+ --new-upgrade-authority $MULTISIG
333
+ ```
334
+
322
335
  #### Upgrades
323
336
 
324
337
  Initiate the program upgrade:
@@ -1390,12 +1390,14 @@
1390
1390
  "Initializes the state for the SVM Spoke Pool. Only callable once.",
1391
1391
  "",
1392
1392
  "### Required Accounts:",
1393
- "- signer (Writable, Signer): The account that pays for the transaction and will own the state.",
1394
- "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.",
1393
+ "- signer (Writable, Signer): The program's current upgrade authority, which pays for and will own the state.",
1394
+ "- state (Writable): Spoke state PDA. Seeds: [\"state\", seed], where seed is 0 in production.",
1395
+ "- this_program: This SVM Spoke program's executable account.",
1396
+ "- program_data: This program's ProgramData account, which must name signer as upgrade authority.",
1395
1397
  "- system_program: The system program required for account creation.",
1396
1398
  "",
1397
1399
  "### Parameters:",
1398
- "- seed: A unique seed used to derive the state account's address. Must be 0 on Mainnet.",
1400
+ "- seed: A unique seed used to derive the state account's address. Must be 0 in production.",
1399
1401
  "- initial_number_of_deposits: The initial number of deposits. Used to offset in upgrades.",
1400
1402
  "- chain_id: The chain ID for Solana, used to identify the Solana spoke in the rest of the Across protocol.",
1401
1403
  "- remote_domain: The CCTP domain for Mainnet Ethereum.",
@@ -1441,6 +1443,13 @@
1441
1443
  ]
1442
1444
  }
1443
1445
  },
1446
+ {
1447
+ "name": "this_program",
1448
+ "address": "DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru"
1449
+ },
1450
+ {
1451
+ "name": "program_data"
1452
+ },
1444
1453
  {
1445
1454
  "name": "system_program",
1446
1455
  "address": "11111111111111111111111111111111"
@@ -2745,6 +2754,16 @@
2745
2754
  "name": "InvalidDelegatePda",
2746
2755
  "msg": "Invalid delegate PDA!"
2747
2756
  },
2757
+ {
2758
+ "code": 7017,
2759
+ "name": "InvalidProgramData",
2760
+ "msg": "Invalid program data account!"
2761
+ },
2762
+ {
2763
+ "code": 7018,
2764
+ "name": "NotUpgradeAuthority",
2765
+ "msg": "Only the program upgrade authority can initialize!"
2766
+ },
2748
2767
  {
2749
2768
  "code": 8000,
2750
2769
  "name": "InvalidWireFormat",
@@ -2787,36 +2806,31 @@
2787
2806
  },
2788
2807
  {
2789
2808
  "code": 8008,
2790
- "name": "UnsupportedMode",
2791
- "msg": "Across V5 adapter mode is not enabled!"
2792
- },
2793
- {
2794
- "code": 8009,
2795
2809
  "name": "InvalidTokenAccount",
2796
2810
  "msg": "Invalid Across V5 token account!"
2797
2811
  },
2798
2812
  {
2799
- "code": 8010,
2813
+ "code": 8009,
2800
2814
  "name": "UnsupportedTokenExtension",
2801
2815
  "msg": "Unsupported Across V5 token extension!"
2802
2816
  },
2803
2817
  {
2804
- "code": 8011,
2818
+ "code": 8010,
2805
2819
  "name": "InvalidFillPayer",
2806
2820
  "msg": "Invalid Across V5 fill payer!"
2807
2821
  },
2808
2822
  {
2809
- "code": 8012,
2823
+ "code": 8011,
2810
2824
  "name": "InvalidFillStatusAccount",
2811
2825
  "msg": "Invalid Across V5 fill status account!"
2812
2826
  },
2813
2827
  {
2814
- "code": 8013,
2828
+ "code": 8012,
2815
2829
  "name": "FillCommitmentMismatch",
2816
2830
  "msg": "Across V5 fill data does not match the committed input!"
2817
2831
  },
2818
2832
  {
2819
- "code": 8014,
2833
+ "code": 8013,
2820
2834
  "name": "FillOutputAmountTooLow",
2821
2835
  "msg": "Across V5 fill output amount is below the committed floor!"
2822
2836
  },
@@ -3878,6 +3892,9 @@
3878
3892
  },
3879
3893
  {
3880
3894
  "name": "V5FillJit",
3895
+ "docs": [
3896
+ "The funder must validate the relay against the source deposit and both repayment fields before signing the fill tx."
3897
+ ],
3881
3898
  "type": {
3882
3899
  "kind": "struct",
3883
3900
  "fields": [
@@ -1396,12 +1396,14 @@ export type SvmSpoke = {
1396
1396
  "Initializes the state for the SVM Spoke Pool. Only callable once.",
1397
1397
  "",
1398
1398
  "### Required Accounts:",
1399
- "- signer (Writable, Signer): The account that pays for the transaction and will own the state.",
1400
- "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.",
1399
+ "- signer (Writable, Signer): The program's current upgrade authority, which pays for and will own the state.",
1400
+ "- state (Writable): Spoke state PDA. Seeds: [\"state\", seed], where seed is 0 in production.",
1401
+ "- this_program: This SVM Spoke program's executable account.",
1402
+ "- program_data: This program's ProgramData account, which must name signer as upgrade authority.",
1401
1403
  "- system_program: The system program required for account creation.",
1402
1404
  "",
1403
1405
  "### Parameters:",
1404
- "- seed: A unique seed used to derive the state account's address. Must be 0 on Mainnet.",
1406
+ "- seed: A unique seed used to derive the state account's address. Must be 0 in production.",
1405
1407
  "- initial_number_of_deposits: The initial number of deposits. Used to offset in upgrades.",
1406
1408
  "- chain_id: The chain ID for Solana, used to identify the Solana spoke in the rest of the Across protocol.",
1407
1409
  "- remote_domain: The CCTP domain for Mainnet Ethereum.",
@@ -1447,6 +1449,13 @@ export type SvmSpoke = {
1447
1449
  ];
1448
1450
  };
1449
1451
  },
1452
+ {
1453
+ "name": "thisProgram";
1454
+ "address": "DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru";
1455
+ },
1456
+ {
1457
+ "name": "programData";
1458
+ },
1450
1459
  {
1451
1460
  "name": "systemProgram";
1452
1461
  "address": "11111111111111111111111111111111";
@@ -2751,6 +2760,16 @@ export type SvmSpoke = {
2751
2760
  "name": "invalidDelegatePda";
2752
2761
  "msg": "Invalid delegate PDA!";
2753
2762
  },
2763
+ {
2764
+ "code": 7017;
2765
+ "name": "invalidProgramData";
2766
+ "msg": "Invalid program data account!";
2767
+ },
2768
+ {
2769
+ "code": 7018;
2770
+ "name": "notUpgradeAuthority";
2771
+ "msg": "Only the program upgrade authority can initialize!";
2772
+ },
2754
2773
  {
2755
2774
  "code": 8000;
2756
2775
  "name": "invalidWireFormat";
@@ -2793,36 +2812,31 @@ export type SvmSpoke = {
2793
2812
  },
2794
2813
  {
2795
2814
  "code": 8008;
2796
- "name": "unsupportedMode";
2797
- "msg": "Across V5 adapter mode is not enabled!";
2798
- },
2799
- {
2800
- "code": 8009;
2801
2815
  "name": "invalidTokenAccount";
2802
2816
  "msg": "Invalid Across V5 token account!";
2803
2817
  },
2804
2818
  {
2805
- "code": 8010;
2819
+ "code": 8009;
2806
2820
  "name": "unsupportedTokenExtension";
2807
2821
  "msg": "Unsupported Across V5 token extension!";
2808
2822
  },
2809
2823
  {
2810
- "code": 8011;
2824
+ "code": 8010;
2811
2825
  "name": "invalidFillPayer";
2812
2826
  "msg": "Invalid Across V5 fill payer!";
2813
2827
  },
2814
2828
  {
2815
- "code": 8012;
2829
+ "code": 8011;
2816
2830
  "name": "invalidFillStatusAccount";
2817
2831
  "msg": "Invalid Across V5 fill status account!";
2818
2832
  },
2819
2833
  {
2820
- "code": 8013;
2834
+ "code": 8012;
2821
2835
  "name": "fillCommitmentMismatch";
2822
2836
  "msg": "Across V5 fill data does not match the committed input!";
2823
2837
  },
2824
2838
  {
2825
- "code": 8014;
2839
+ "code": 8013;
2826
2840
  "name": "fillOutputAmountTooLow";
2827
2841
  "msg": "Across V5 fill output amount is below the committed floor!";
2828
2842
  },
@@ -3884,6 +3898,9 @@ export type SvmSpoke = {
3884
3898
  },
3885
3899
  {
3886
3900
  "name": "v5FillJit";
3901
+ "docs": [
3902
+ "The funder must validate the relay against the source deposit and both repayment fields before signing the fill tx."
3903
+ ];
3887
3904
  "type": {
3888
3905
  "kind": "struct";
3889
3906
  "fields": [
@@ -72,6 +72,10 @@ export declare const SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = 7014;
72
72
  export declare const SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = 7015;
73
73
  /** InvalidDelegatePda: Invalid delegate PDA! */
74
74
  export declare const SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA = 7016;
75
+ /** InvalidProgramData: Invalid program data account! */
76
+ export declare const SVM_SPOKE_ERROR__INVALID_PROGRAM_DATA = 7017;
77
+ /** NotUpgradeAuthority: Only the program upgrade authority can initialize! */
78
+ export declare const SVM_SPOKE_ERROR__NOT_UPGRADE_AUTHORITY = 7018;
75
79
  /** InvalidWireFormat: Malformed Across V5 wire data! */
76
80
  export declare const SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT = 8000;
77
81
  /** InvalidParamModificationSignature: Invalid Across V5 parameter modification signature! */
@@ -88,20 +92,18 @@ export declare const SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED = 80
88
92
  export declare const SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT = 8006;
89
93
  /** InvalidAmountBips: Across V5 input amount bips exceed the denominator! */
90
94
  export declare const SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS = 8007;
91
- /** UnsupportedMode: Across V5 adapter mode is not enabled! */
92
- export declare const SVM_SPOKE_ERROR__UNSUPPORTED_MODE = 8008;
93
95
  /** InvalidTokenAccount: Invalid Across V5 token account! */
94
- export declare const SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = 8009;
96
+ export declare const SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = 8008;
95
97
  /** UnsupportedTokenExtension: Unsupported Across V5 token extension! */
96
- export declare const SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 8010;
98
+ export declare const SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 8009;
97
99
  /** InvalidFillPayer: Invalid Across V5 fill payer! */
98
- export declare const SVM_SPOKE_ERROR__INVALID_FILL_PAYER = 8011;
100
+ export declare const SVM_SPOKE_ERROR__INVALID_FILL_PAYER = 8010;
99
101
  /** InvalidFillStatusAccount: Invalid Across V5 fill status account! */
100
- export declare const SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = 8012;
102
+ export declare const SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = 8011;
101
103
  /** FillCommitmentMismatch: Across V5 fill data does not match the committed input! */
102
- export declare const SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = 8013;
104
+ export declare const SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = 8012;
103
105
  /** FillOutputAmountTooLow: Across V5 fill output amount is below the committed floor! */
104
- export declare const SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = 8014;
106
+ export declare const SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = 8013;
105
107
  /** InvalidSelector: Invalid solidity selector */
106
108
  export declare const SVM_SPOKE_ERROR__INVALID_SELECTOR = 9000;
107
109
  /** InvalidArgument: Invalid solidity argument */
@@ -116,7 +118,7 @@ export declare const SVM_SPOKE_ERROR__INVALID_UINT32 = 9004;
116
118
  export declare const SVM_SPOKE_ERROR__INVALID_UINT64 = 9005;
117
119
  /** UnsupportedSelector: Unsupported solidity selector */
118
120
  export declare const SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR = 9006;
119
- export type SvmSpokeError = typeof SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME | typeof SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED | typeof SVM_SPOKE_ERROR__CLAIMED_MERKLE_LEAF | typeof SVM_SPOKE_ERROR__DEPOSITS_ARE_PAUSED | typeof SVM_SPOKE_ERROR__EXPIRED_FILL_DEADLINE | typeof SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH | typeof SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW | typeof SVM_SPOKE_ERROR__FILLS_ARE_PAUSED | typeof SVM_SPOKE_ERROR__INSUFFICIENT_SPOKE_POOL_BALANCE_TO_EXECUTE_LEAF | typeof SVM_SPOKE_ERROR__INVALID_ACCOUNT_MUTABILITY | typeof SVM_SPOKE_ERROR__INVALID_ADDRESS | typeof SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS | typeof SVM_SPOKE_ERROR__INVALID_ARGUMENT | typeof SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS | typeof SVM_SPOKE_ERROR__INVALID_BOOL | typeof SVM_SPOKE_ERROR__INVALID_CHAIN_ID | typeof SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER | typeof SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA | typeof SVM_SPOKE_ERROR__INVALID_DISPATCH_AUTHORITY | typeof SVM_SPOKE_ERROR__INVALID_EXCLUSIVE_RELAYER | typeof SVM_SPOKE_ERROR__INVALID_FILL_DEADLINE | typeof SVM_SPOKE_ERROR__INVALID_FILL_PAYER | typeof SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_MERKLE_LEAF | typeof SVM_SPOKE_ERROR__INVALID_MERKLE_PROOF | typeof SVM_SPOKE_ERROR__INVALID_MINT | typeof SVM_SPOKE_ERROR__INVALID_OUTPUT_TOKEN | typeof SVM_SPOKE_ERROR__INVALID_PARAM_MODIFICATION_SIGNATURE | typeof SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED | typeof SVM_SPOKE_ERROR__INVALID_QUOTE_TIMESTAMP | typeof SVM_SPOKE_ERROR__INVALID_REFUND | typeof SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER | typeof SVM_SPOKE_ERROR__INVALID_SELECTOR | typeof SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_UINT32 | typeof SVM_SPOKE_ERROR__INVALID_UINT64 | typeof SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT | typeof SVM_SPOKE_ERROR__MISSING_ACCOUNT | typeof SVM_SPOKE_ERROR__NON_ZERO_AMOUNT_TO_RETURN | typeof SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM | typeof SVM_SPOKE_ERROR__NOT_EXCLUSIVE_RELAYER | typeof SVM_SPOKE_ERROR__NOT_OWNER | typeof SVM_SPOKE_ERROR__NOT_RELAYER | typeof SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT | typeof SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW | typeof SVM_SPOKE_ERROR__RELAY_FILLED | typeof SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED | typeof SVM_SPOKE_ERROR__RETIRED_INVALID_SLOW_FILL_REQUEST | typeof SVM_SPOKE_ERROR__RETIRED_NO_SLOW_FILLS_IN_EXCLUSIVITY_WINDOW | typeof SVM_SPOKE_ERROR__UNSUPPORTED_MODE | typeof SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR | typeof SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION | typeof SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM;
121
+ export type SvmSpokeError = typeof SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME | typeof SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED | typeof SVM_SPOKE_ERROR__CLAIMED_MERKLE_LEAF | typeof SVM_SPOKE_ERROR__DEPOSITS_ARE_PAUSED | typeof SVM_SPOKE_ERROR__EXPIRED_FILL_DEADLINE | typeof SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH | typeof SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW | typeof SVM_SPOKE_ERROR__FILLS_ARE_PAUSED | typeof SVM_SPOKE_ERROR__INSUFFICIENT_SPOKE_POOL_BALANCE_TO_EXECUTE_LEAF | typeof SVM_SPOKE_ERROR__INVALID_ACCOUNT_MUTABILITY | typeof SVM_SPOKE_ERROR__INVALID_ADDRESS | typeof SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS | typeof SVM_SPOKE_ERROR__INVALID_ARGUMENT | typeof SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS | typeof SVM_SPOKE_ERROR__INVALID_BOOL | typeof SVM_SPOKE_ERROR__INVALID_CHAIN_ID | typeof SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER | typeof SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA | typeof SVM_SPOKE_ERROR__INVALID_DISPATCH_AUTHORITY | typeof SVM_SPOKE_ERROR__INVALID_EXCLUSIVE_RELAYER | typeof SVM_SPOKE_ERROR__INVALID_FILL_DEADLINE | typeof SVM_SPOKE_ERROR__INVALID_FILL_PAYER | typeof SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_MERKLE_LEAF | typeof SVM_SPOKE_ERROR__INVALID_MERKLE_PROOF | typeof SVM_SPOKE_ERROR__INVALID_MINT | typeof SVM_SPOKE_ERROR__INVALID_OUTPUT_TOKEN | typeof SVM_SPOKE_ERROR__INVALID_PARAM_MODIFICATION_SIGNATURE | typeof SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED | typeof SVM_SPOKE_ERROR__INVALID_PROGRAM_DATA | typeof SVM_SPOKE_ERROR__INVALID_QUOTE_TIMESTAMP | typeof SVM_SPOKE_ERROR__INVALID_REFUND | typeof SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER | typeof SVM_SPOKE_ERROR__INVALID_SELECTOR | typeof SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_UINT32 | typeof SVM_SPOKE_ERROR__INVALID_UINT64 | typeof SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT | typeof SVM_SPOKE_ERROR__MISSING_ACCOUNT | typeof SVM_SPOKE_ERROR__NON_ZERO_AMOUNT_TO_RETURN | typeof SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM | typeof SVM_SPOKE_ERROR__NOT_EXCLUSIVE_RELAYER | typeof SVM_SPOKE_ERROR__NOT_OWNER | typeof SVM_SPOKE_ERROR__NOT_RELAYER | typeof SVM_SPOKE_ERROR__NOT_UPGRADE_AUTHORITY | typeof SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT | typeof SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW | typeof SVM_SPOKE_ERROR__RELAY_FILLED | typeof SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED | typeof SVM_SPOKE_ERROR__RETIRED_INVALID_SLOW_FILL_REQUEST | typeof SVM_SPOKE_ERROR__RETIRED_NO_SLOW_FILLS_IN_EXCLUSIVITY_WINDOW | typeof SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR | typeof SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION | typeof SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM;
120
122
  export declare function getSvmSpokeErrorMessage(code: SvmSpokeError): string;
121
123
  export declare function isSvmSpokeError<TProgramErrorCode extends SvmSpokeError>(error: unknown, transactionMessage: {
122
124
  instructions: Record<number, {
@@ -7,8 +7,8 @@
7
7
  * @see https://github.com/codama-idl/codama
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SVM_SPOKE_ERROR__INVALID_ARGUMENT = exports.SVM_SPOKE_ERROR__INVALID_SELECTOR = exports.SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = exports.SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = exports.SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_FILL_PAYER = exports.SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = exports.SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = exports.SVM_SPOKE_ERROR__UNSUPPORTED_MODE = exports.SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS = exports.SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT = exports.SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED = exports.SVM_SPOKE_ERROR__INVALID_ACCOUNT_MUTABILITY = exports.SVM_SPOKE_ERROR__INVALID_DISPATCH_AUTHORITY = exports.SVM_SPOKE_ERROR__MISSING_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_PARAM_MODIFICATION_SIGNATURE = exports.SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT = exports.SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA = exports.SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = exports.SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER = exports.SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM = exports.SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM = exports.SVM_SPOKE_ERROR__INVALID_REFUND = exports.SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW = exports.SVM_SPOKE_ERROR__NON_ZERO_AMOUNT_TO_RETURN = exports.SVM_SPOKE_ERROR__INVALID_MINT = exports.SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER = exports.SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN = exports.SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME = exports.SVM_SPOKE_ERROR__NOT_RELAYER = exports.SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED = exports.SVM_SPOKE_ERROR__NOT_OWNER = exports.SVM_SPOKE_ERROR__INVALID_OUTPUT_TOKEN = exports.SVM_SPOKE_ERROR__INVALID_EXCLUSIVE_RELAYER = exports.SVM_SPOKE_ERROR__INSUFFICIENT_SPOKE_POOL_BALANCE_TO_EXECUTE_LEAF = exports.SVM_SPOKE_ERROR__FILLS_ARE_PAUSED = exports.SVM_SPOKE_ERROR__DEPOSITS_ARE_PAUSED = exports.SVM_SPOKE_ERROR__CLAIMED_MERKLE_LEAF = exports.SVM_SPOKE_ERROR__INVALID_MERKLE_LEAF = exports.SVM_SPOKE_ERROR__INVALID_CHAIN_ID = exports.SVM_SPOKE_ERROR__INVALID_MERKLE_PROOF = exports.SVM_SPOKE_ERROR__EXPIRED_FILL_DEADLINE = exports.SVM_SPOKE_ERROR__RETIRED_INVALID_SLOW_FILL_REQUEST = exports.SVM_SPOKE_ERROR__RELAY_FILLED = exports.SVM_SPOKE_ERROR__RETIRED_NO_SLOW_FILLS_IN_EXCLUSIVITY_WINDOW = exports.SVM_SPOKE_ERROR__NOT_EXCLUSIVE_RELAYER = exports.SVM_SPOKE_ERROR__INVALID_FILL_DEADLINE = exports.SVM_SPOKE_ERROR__INVALID_QUOTE_TIMESTAMP = void 0;
11
- exports.SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR = exports.SVM_SPOKE_ERROR__INVALID_UINT64 = exports.SVM_SPOKE_ERROR__INVALID_UINT32 = exports.SVM_SPOKE_ERROR__INVALID_ADDRESS = exports.SVM_SPOKE_ERROR__INVALID_BOOL = void 0;
10
+ exports.SVM_SPOKE_ERROR__INVALID_SELECTOR = exports.SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = exports.SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = exports.SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_FILL_PAYER = exports.SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = exports.SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS = exports.SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT = exports.SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED = exports.SVM_SPOKE_ERROR__INVALID_ACCOUNT_MUTABILITY = exports.SVM_SPOKE_ERROR__INVALID_DISPATCH_AUTHORITY = exports.SVM_SPOKE_ERROR__MISSING_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_PARAM_MODIFICATION_SIGNATURE = exports.SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT = exports.SVM_SPOKE_ERROR__NOT_UPGRADE_AUTHORITY = exports.SVM_SPOKE_ERROR__INVALID_PROGRAM_DATA = exports.SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA = exports.SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = exports.SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT = exports.SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER = exports.SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM = exports.SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM = exports.SVM_SPOKE_ERROR__INVALID_REFUND = exports.SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW = exports.SVM_SPOKE_ERROR__NON_ZERO_AMOUNT_TO_RETURN = exports.SVM_SPOKE_ERROR__INVALID_MINT = exports.SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER = exports.SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN = exports.SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME = exports.SVM_SPOKE_ERROR__NOT_RELAYER = exports.SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED = exports.SVM_SPOKE_ERROR__NOT_OWNER = exports.SVM_SPOKE_ERROR__INVALID_OUTPUT_TOKEN = exports.SVM_SPOKE_ERROR__INVALID_EXCLUSIVE_RELAYER = exports.SVM_SPOKE_ERROR__INSUFFICIENT_SPOKE_POOL_BALANCE_TO_EXECUTE_LEAF = exports.SVM_SPOKE_ERROR__FILLS_ARE_PAUSED = exports.SVM_SPOKE_ERROR__DEPOSITS_ARE_PAUSED = exports.SVM_SPOKE_ERROR__CLAIMED_MERKLE_LEAF = exports.SVM_SPOKE_ERROR__INVALID_MERKLE_LEAF = exports.SVM_SPOKE_ERROR__INVALID_CHAIN_ID = exports.SVM_SPOKE_ERROR__INVALID_MERKLE_PROOF = exports.SVM_SPOKE_ERROR__EXPIRED_FILL_DEADLINE = exports.SVM_SPOKE_ERROR__RETIRED_INVALID_SLOW_FILL_REQUEST = exports.SVM_SPOKE_ERROR__RELAY_FILLED = exports.SVM_SPOKE_ERROR__RETIRED_NO_SLOW_FILLS_IN_EXCLUSIVITY_WINDOW = exports.SVM_SPOKE_ERROR__NOT_EXCLUSIVE_RELAYER = exports.SVM_SPOKE_ERROR__INVALID_FILL_DEADLINE = exports.SVM_SPOKE_ERROR__INVALID_QUOTE_TIMESTAMP = void 0;
11
+ exports.SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR = exports.SVM_SPOKE_ERROR__INVALID_UINT64 = exports.SVM_SPOKE_ERROR__INVALID_UINT32 = exports.SVM_SPOKE_ERROR__INVALID_ADDRESS = exports.SVM_SPOKE_ERROR__INVALID_BOOL = exports.SVM_SPOKE_ERROR__INVALID_ARGUMENT = void 0;
12
12
  exports.getSvmSpokeErrorMessage = getSvmSpokeErrorMessage;
13
13
  exports.isSvmSpokeError = isSvmSpokeError;
14
14
  const kit_1 = require("@solana/kit");
@@ -79,6 +79,10 @@ exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = 0x1b66; // 7014
79
79
  exports.SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = 0x1b67; // 7015
80
80
  /** InvalidDelegatePda: Invalid delegate PDA! */
81
81
  exports.SVM_SPOKE_ERROR__INVALID_DELEGATE_PDA = 0x1b68; // 7016
82
+ /** InvalidProgramData: Invalid program data account! */
83
+ exports.SVM_SPOKE_ERROR__INVALID_PROGRAM_DATA = 0x1b69; // 7017
84
+ /** NotUpgradeAuthority: Only the program upgrade authority can initialize! */
85
+ exports.SVM_SPOKE_ERROR__NOT_UPGRADE_AUTHORITY = 0x1b6a; // 7018
82
86
  /** InvalidWireFormat: Malformed Across V5 wire data! */
83
87
  exports.SVM_SPOKE_ERROR__INVALID_WIRE_FORMAT = 0x1f40; // 8000
84
88
  /** InvalidParamModificationSignature: Invalid Across V5 parameter modification signature! */
@@ -95,20 +99,18 @@ exports.SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED = 0x1f45; // 8005
95
99
  exports.SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT = 0x1f46; // 8006
96
100
  /** InvalidAmountBips: Across V5 input amount bips exceed the denominator! */
97
101
  exports.SVM_SPOKE_ERROR__INVALID_AMOUNT_BIPS = 0x1f47; // 8007
98
- /** UnsupportedMode: Across V5 adapter mode is not enabled! */
99
- exports.SVM_SPOKE_ERROR__UNSUPPORTED_MODE = 0x1f48; // 8008
100
102
  /** InvalidTokenAccount: Invalid Across V5 token account! */
101
- exports.SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = 0x1f49; // 8009
103
+ exports.SVM_SPOKE_ERROR__INVALID_TOKEN_ACCOUNT = 0x1f48; // 8008
102
104
  /** UnsupportedTokenExtension: Unsupported Across V5 token extension! */
103
- exports.SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 0x1f4a; // 8010
105
+ exports.SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 0x1f49; // 8009
104
106
  /** InvalidFillPayer: Invalid Across V5 fill payer! */
105
- exports.SVM_SPOKE_ERROR__INVALID_FILL_PAYER = 0x1f4b; // 8011
107
+ exports.SVM_SPOKE_ERROR__INVALID_FILL_PAYER = 0x1f4a; // 8010
106
108
  /** InvalidFillStatusAccount: Invalid Across V5 fill status account! */
107
- exports.SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = 0x1f4c; // 8012
109
+ exports.SVM_SPOKE_ERROR__INVALID_FILL_STATUS_ACCOUNT = 0x1f4b; // 8011
108
110
  /** FillCommitmentMismatch: Across V5 fill data does not match the committed input! */
109
- exports.SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = 0x1f4d; // 8013
111
+ exports.SVM_SPOKE_ERROR__FILL_COMMITMENT_MISMATCH = 0x1f4c; // 8012
110
112
  /** FillOutputAmountTooLow: Across V5 fill output amount is below the committed floor! */
111
- exports.SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = 0x1f4e; // 8014
113
+ exports.SVM_SPOKE_ERROR__FILL_OUTPUT_AMOUNT_TOO_LOW = 0x1f4d; // 8013
112
114
  /** InvalidSelector: Invalid solidity selector */
113
115
  exports.SVM_SPOKE_ERROR__INVALID_SELECTOR = 0x2328; // 9000
114
116
  /** InvalidArgument: Invalid solidity argument */
@@ -155,6 +157,7 @@ if (process.env.NODE_ENV !== 'production') {
155
157
  [exports.SVM_SPOKE_ERROR__INVALID_OUTPUT_TOKEN]: `Invalid output token!`,
156
158
  [exports.SVM_SPOKE_ERROR__INVALID_PARAM_MODIFICATION_SIGNATURE]: `Invalid Across V5 parameter modification signature!`,
157
159
  [exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED]: `Seed must be 0 in production!`,
160
+ [exports.SVM_SPOKE_ERROR__INVALID_PROGRAM_DATA]: `Invalid program data account!`,
158
161
  [exports.SVM_SPOKE_ERROR__INVALID_QUOTE_TIMESTAMP]: `Invalid quote timestamp!`,
159
162
  [exports.SVM_SPOKE_ERROR__INVALID_REFUND]: `Invalid refund address!`,
160
163
  [exports.SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT]: `Invalid refund token account!`,
@@ -171,13 +174,13 @@ if (process.env.NODE_ENV !== 'production') {
171
174
  [exports.SVM_SPOKE_ERROR__NOT_EXCLUSIVE_RELAYER]: `Caller is not the exclusive relayer and exclusivity deadline has not passed!`,
172
175
  [exports.SVM_SPOKE_ERROR__NOT_OWNER]: `Only the owner can call this function!`,
173
176
  [exports.SVM_SPOKE_ERROR__NOT_RELAYER]: `The caller is not the relayer!`,
177
+ [exports.SVM_SPOKE_ERROR__NOT_UPGRADE_AUTHORITY]: `Only the program upgrade authority can initialize!`,
174
178
  [exports.SVM_SPOKE_ERROR__PARAM_MODIFICATION_NOT_AN_IMPROVEMENT]: `Across V5 parameter modification is not an improvement!`,
175
179
  [exports.SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW]: `Overflow writing to parameters account!`,
176
180
  [exports.SVM_SPOKE_ERROR__RELAY_FILLED]: `The relay has already been filled!`,
177
181
  [exports.SVM_SPOKE_ERROR__RESOLVED_INPUT_AMOUNT_BELOW_COMMITTED]: `Resolved Across V5 input amount is below the committed floor!`,
178
182
  [exports.SVM_SPOKE_ERROR__RETIRED_INVALID_SLOW_FILL_REQUEST]: `Slow fill requires status of Unfilled!`,
179
183
  [exports.SVM_SPOKE_ERROR__RETIRED_NO_SLOW_FILLS_IN_EXCLUSIVITY_WINDOW]: `The Deposit is still within the exclusivity window!`,
180
- [exports.SVM_SPOKE_ERROR__UNSUPPORTED_MODE]: `Across V5 adapter mode is not enabled!`,
181
184
  [exports.SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR]: `Unsupported solidity selector`,
182
185
  [exports.SVM_SPOKE_ERROR__UNSUPPORTED_TOKEN_EXTENSION]: `Unsupported Across V5 token extension!`,
183
186
  [exports.SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM]: `Zero relayer refund claim!`,
@@ -9,9 +9,11 @@ import { type AccountMeta, type AccountSignerMeta, type Address, type Codec, typ
9
9
  import { SVM_SPOKE_PROGRAM_ADDRESS } from '../programs';
10
10
  export declare const INITIALIZE_DISCRIMINATOR: Uint8Array;
11
11
  export declare function getInitializeDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
12
- export type InitializeInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountSigner extends string | AccountMeta<string> = string, TAccountState extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
12
+ export type InitializeInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountSigner extends string | AccountMeta<string> = string, TAccountState extends string | AccountMeta<string> = string, TAccountThisProgram extends string | AccountMeta<string> = 'DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru', TAccountProgramData extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
13
13
  TAccountSigner extends string ? WritableSignerAccount<TAccountSigner> & AccountSignerMeta<TAccountSigner> : TAccountSigner,
14
14
  TAccountState extends string ? WritableAccount<TAccountState> : TAccountState,
15
+ TAccountThisProgram extends string ? ReadonlyAccount<TAccountThisProgram> : TAccountThisProgram,
16
+ TAccountProgramData extends string ? ReadonlyAccount<TAccountProgramData> : TAccountProgramData,
15
17
  TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
16
18
  ...TRemainingAccounts
17
19
  ]>;
@@ -37,9 +39,11 @@ export type InitializeInstructionDataArgs = {
37
39
  export declare function getInitializeInstructionDataEncoder(): Encoder<InitializeInstructionDataArgs>;
38
40
  export declare function getInitializeInstructionDataDecoder(): Decoder<InitializeInstructionData>;
39
41
  export declare function getInitializeInstructionDataCodec(): Codec<InitializeInstructionDataArgs, InitializeInstructionData>;
40
- export type InitializeAsyncInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountSystemProgram extends string = string> = {
42
+ export type InitializeAsyncInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountThisProgram extends string = string, TAccountProgramData extends string = string, TAccountSystemProgram extends string = string> = {
41
43
  signer: TransactionSigner<TAccountSigner>;
42
44
  state?: Address<TAccountState>;
45
+ thisProgram?: Address<TAccountThisProgram>;
46
+ programData: Address<TAccountProgramData>;
43
47
  systemProgram?: Address<TAccountSystemProgram>;
44
48
  seed: InitializeInstructionDataArgs['seed'];
45
49
  initialNumberOfDeposits: InitializeInstructionDataArgs['initialNumberOfDeposits'];
@@ -49,12 +53,14 @@ export type InitializeAsyncInput<TAccountSigner extends string = string, TAccoun
49
53
  depositQuoteTimeBuffer: InitializeInstructionDataArgs['depositQuoteTimeBuffer'];
50
54
  fillDeadlineBuffer: InitializeInstructionDataArgs['fillDeadlineBuffer'];
51
55
  };
52
- export declare function getInitializeInstructionAsync<TAccountSigner extends string, TAccountState extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: InitializeAsyncInput<TAccountSigner, TAccountState, TAccountSystemProgram>, config?: {
56
+ export declare function getInitializeInstructionAsync<TAccountSigner extends string, TAccountState extends string, TAccountThisProgram extends string, TAccountProgramData extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: InitializeAsyncInput<TAccountSigner, TAccountState, TAccountThisProgram, TAccountProgramData, TAccountSystemProgram>, config?: {
53
57
  programAddress?: TProgramAddress;
54
- }): Promise<InitializeInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountSystemProgram>>;
55
- export type InitializeInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountSystemProgram extends string = string> = {
58
+ }): Promise<InitializeInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountThisProgram, TAccountProgramData, TAccountSystemProgram>>;
59
+ export type InitializeInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountThisProgram extends string = string, TAccountProgramData extends string = string, TAccountSystemProgram extends string = string> = {
56
60
  signer: TransactionSigner<TAccountSigner>;
57
61
  state: Address<TAccountState>;
62
+ thisProgram?: Address<TAccountThisProgram>;
63
+ programData: Address<TAccountProgramData>;
58
64
  systemProgram?: Address<TAccountSystemProgram>;
59
65
  seed: InitializeInstructionDataArgs['seed'];
60
66
  initialNumberOfDeposits: InitializeInstructionDataArgs['initialNumberOfDeposits'];
@@ -64,15 +70,17 @@ export type InitializeInput<TAccountSigner extends string = string, TAccountStat
64
70
  depositQuoteTimeBuffer: InitializeInstructionDataArgs['depositQuoteTimeBuffer'];
65
71
  fillDeadlineBuffer: InitializeInstructionDataArgs['fillDeadlineBuffer'];
66
72
  };
67
- export declare function getInitializeInstruction<TAccountSigner extends string, TAccountState extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: InitializeInput<TAccountSigner, TAccountState, TAccountSystemProgram>, config?: {
73
+ export declare function getInitializeInstruction<TAccountSigner extends string, TAccountState extends string, TAccountThisProgram extends string, TAccountProgramData extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: InitializeInput<TAccountSigner, TAccountState, TAccountThisProgram, TAccountProgramData, TAccountSystemProgram>, config?: {
68
74
  programAddress?: TProgramAddress;
69
- }): InitializeInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountSystemProgram>;
75
+ }): InitializeInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountThisProgram, TAccountProgramData, TAccountSystemProgram>;
70
76
  export type ParsedInitializeInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
71
77
  programAddress: Address<TProgram>;
72
78
  accounts: {
73
79
  signer: TAccountMetas[0];
74
80
  state: TAccountMetas[1];
75
- systemProgram: TAccountMetas[2];
81
+ thisProgram: TAccountMetas[2];
82
+ programData: TAccountMetas[3];
83
+ systemProgram: TAccountMetas[4];
76
84
  };
77
85
  data: InitializeInstructionData;
78
86
  };
@@ -58,6 +58,8 @@ async function getInitializeInstructionAsync(input, config) {
58
58
  const originalAccounts = {
59
59
  signer: { value: input.signer ?? null, isWritable: true },
60
60
  state: { value: input.state ?? null, isWritable: true },
61
+ thisProgram: { value: input.thisProgram ?? null, isWritable: false },
62
+ programData: { value: input.programData ?? null, isWritable: false },
61
63
  systemProgram: { value: input.systemProgram ?? null, isWritable: false },
62
64
  };
63
65
  const accounts = originalAccounts;
@@ -73,6 +75,10 @@ async function getInitializeInstructionAsync(input, config) {
73
75
  ],
74
76
  });
75
77
  }
78
+ if (!accounts.thisProgram.value) {
79
+ accounts.thisProgram.value =
80
+ 'DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru';
81
+ }
76
82
  if (!accounts.systemProgram.value) {
77
83
  accounts.systemProgram.value =
78
84
  '11111111111111111111111111111111';
@@ -82,6 +88,8 @@ async function getInitializeInstructionAsync(input, config) {
82
88
  accounts: [
83
89
  getAccountMeta(accounts.signer),
84
90
  getAccountMeta(accounts.state),
91
+ getAccountMeta(accounts.thisProgram),
92
+ getAccountMeta(accounts.programData),
85
93
  getAccountMeta(accounts.systemProgram),
86
94
  ],
87
95
  programAddress,
@@ -96,12 +104,18 @@ function getInitializeInstruction(input, config) {
96
104
  const originalAccounts = {
97
105
  signer: { value: input.signer ?? null, isWritable: true },
98
106
  state: { value: input.state ?? null, isWritable: true },
107
+ thisProgram: { value: input.thisProgram ?? null, isWritable: false },
108
+ programData: { value: input.programData ?? null, isWritable: false },
99
109
  systemProgram: { value: input.systemProgram ?? null, isWritable: false },
100
110
  };
101
111
  const accounts = originalAccounts;
102
112
  // Original args.
103
113
  const args = { ...input };
104
114
  // Resolve default values.
115
+ if (!accounts.thisProgram.value) {
116
+ accounts.thisProgram.value =
117
+ 'DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru';
118
+ }
105
119
  if (!accounts.systemProgram.value) {
106
120
  accounts.systemProgram.value =
107
121
  '11111111111111111111111111111111';
@@ -111,6 +125,8 @@ function getInitializeInstruction(input, config) {
111
125
  accounts: [
112
126
  getAccountMeta(accounts.signer),
113
127
  getAccountMeta(accounts.state),
128
+ getAccountMeta(accounts.thisProgram),
129
+ getAccountMeta(accounts.programData),
114
130
  getAccountMeta(accounts.systemProgram),
115
131
  ],
116
132
  programAddress,
@@ -119,7 +135,7 @@ function getInitializeInstruction(input, config) {
119
135
  return instruction;
120
136
  }
121
137
  function parseInitializeInstruction(instruction) {
122
- if (instruction.accounts.length < 3) {
138
+ if (instruction.accounts.length < 5) {
123
139
  // TODO: Coded error.
124
140
  throw new Error('Not enough accounts');
125
141
  }
@@ -134,6 +150,8 @@ function parseInitializeInstruction(instruction) {
134
150
  accounts: {
135
151
  signer: getNextAccount(),
136
152
  state: getNextAccount(),
153
+ thisProgram: getNextAccount(),
154
+ programData: getNextAccount(),
137
155
  systemProgram: getNextAccount(),
138
156
  },
139
157
  data: getInitializeInstructionDataDecoder().decode(instruction.data),
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { type Address, type Codec, type Decoder, type Encoder } from '@solana/kit';
9
9
  import { type RelayData, type RelayDataArgs } from '.';
10
+ /** The funder must validate the relay against the source deposit and both repayment fields before signing the fill tx. */
10
11
  export type V5FillJit = {
11
12
  relayData: RelayData;
12
13
  repaymentChainId: bigint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@across-protocol/contracts",
3
- "version": "6.0.0-beta.4",
3
+ "version": "6.0.0-beta.5",
4
4
  "author": "UMA Team",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -1390,12 +1390,14 @@
1390
1390
  "Initializes the state for the SVM Spoke Pool. Only callable once.",
1391
1391
  "",
1392
1392
  "### Required Accounts:",
1393
- "- signer (Writable, Signer): The account that pays for the transaction and will own the state.",
1394
- "- state (Writable): Spoke state PDA. Seed: [\"state\",state.seed] where seed is 0 on mainnet.",
1393
+ "- signer (Writable, Signer): The program's current upgrade authority, which pays for and will own the state.",
1394
+ "- state (Writable): Spoke state PDA. Seeds: [\"state\", seed], where seed is 0 in production.",
1395
+ "- this_program: This SVM Spoke program's executable account.",
1396
+ "- program_data: This program's ProgramData account, which must name signer as upgrade authority.",
1395
1397
  "- system_program: The system program required for account creation.",
1396
1398
  "",
1397
1399
  "### Parameters:",
1398
- "- seed: A unique seed used to derive the state account's address. Must be 0 on Mainnet.",
1400
+ "- seed: A unique seed used to derive the state account's address. Must be 0 in production.",
1399
1401
  "- initial_number_of_deposits: The initial number of deposits. Used to offset in upgrades.",
1400
1402
  "- chain_id: The chain ID for Solana, used to identify the Solana spoke in the rest of the Across protocol.",
1401
1403
  "- remote_domain: The CCTP domain for Mainnet Ethereum.",
@@ -1441,6 +1443,13 @@
1441
1443
  ]
1442
1444
  }
1443
1445
  },
1446
+ {
1447
+ "name": "this_program",
1448
+ "address": "DLv3NggMiSaef97YCkew5xKUHDh13tVGZ7tydt3ZeAru"
1449
+ },
1450
+ {
1451
+ "name": "program_data"
1452
+ },
1444
1453
  {
1445
1454
  "name": "system_program",
1446
1455
  "address": "11111111111111111111111111111111"
@@ -2745,6 +2754,16 @@
2745
2754
  "name": "InvalidDelegatePda",
2746
2755
  "msg": "Invalid delegate PDA!"
2747
2756
  },
2757
+ {
2758
+ "code": 7017,
2759
+ "name": "InvalidProgramData",
2760
+ "msg": "Invalid program data account!"
2761
+ },
2762
+ {
2763
+ "code": 7018,
2764
+ "name": "NotUpgradeAuthority",
2765
+ "msg": "Only the program upgrade authority can initialize!"
2766
+ },
2748
2767
  {
2749
2768
  "code": 8000,
2750
2769
  "name": "InvalidWireFormat",
@@ -2787,36 +2806,31 @@
2787
2806
  },
2788
2807
  {
2789
2808
  "code": 8008,
2790
- "name": "UnsupportedMode",
2791
- "msg": "Across V5 adapter mode is not enabled!"
2792
- },
2793
- {
2794
- "code": 8009,
2795
2809
  "name": "InvalidTokenAccount",
2796
2810
  "msg": "Invalid Across V5 token account!"
2797
2811
  },
2798
2812
  {
2799
- "code": 8010,
2813
+ "code": 8009,
2800
2814
  "name": "UnsupportedTokenExtension",
2801
2815
  "msg": "Unsupported Across V5 token extension!"
2802
2816
  },
2803
2817
  {
2804
- "code": 8011,
2818
+ "code": 8010,
2805
2819
  "name": "InvalidFillPayer",
2806
2820
  "msg": "Invalid Across V5 fill payer!"
2807
2821
  },
2808
2822
  {
2809
- "code": 8012,
2823
+ "code": 8011,
2810
2824
  "name": "InvalidFillStatusAccount",
2811
2825
  "msg": "Invalid Across V5 fill status account!"
2812
2826
  },
2813
2827
  {
2814
- "code": 8013,
2828
+ "code": 8012,
2815
2829
  "name": "FillCommitmentMismatch",
2816
2830
  "msg": "Across V5 fill data does not match the committed input!"
2817
2831
  },
2818
2832
  {
2819
- "code": 8014,
2833
+ "code": 8013,
2820
2834
  "name": "FillOutputAmountTooLow",
2821
2835
  "msg": "Across V5 fill output amount is below the committed floor!"
2822
2836
  },
@@ -3878,6 +3892,9 @@
3878
3892
  },
3879
3893
  {
3880
3894
  "name": "V5FillJit",
3895
+ "docs": [
3896
+ "The funder must validate the relay against the source deposit and both repayment fields before signing the fill tx."
3897
+ ],
3881
3898
  "type": {
3882
3899
  "kind": "struct",
3883
3900
  "fields": [