@across-protocol/contracts 4.0.2 → 4.0.3

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 (75) hide show
  1. package/dist/deploy/consts.d.ts +1 -1
  2. package/dist/deploy/consts.js +1 -15
  3. package/dist/deployments/deployments.json +18 -0
  4. package/dist/scripts/svm/fakeFillWithRandomDistribution.js +2 -2
  5. package/dist/scripts/svm/queryEvents.js +1 -1
  6. package/dist/scripts/svm/simpleDeposit.js +3 -3
  7. package/dist/scripts/svm/simpleFakeRelayerRepayment.js +1 -1
  8. package/dist/scripts/svm/simpleFill.js +19 -6
  9. package/dist/src/svm/assets/idl/svm_spoke.json +435 -385
  10. package/dist/src/svm/assets/svm_spoke.d.ts +435 -385
  11. package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.d.ts +31 -0
  12. package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.js +70 -0
  13. package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.d.ts +31 -0
  14. package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.js +67 -0
  15. package/dist/src/svm/clients/SvmSpoke/accounts/index.d.ts +3 -3
  16. package/dist/src/svm/clients/SvmSpoke/accounts/index.js +3 -3
  17. package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.d.ts +27 -0
  18. package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.js +66 -0
  19. package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +35 -15
  20. package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +52 -22
  21. package/dist/src/svm/clients/SvmSpoke/instructions/deposit.d.ts +123 -0
  22. package/dist/src/svm/clients/SvmSpoke/instructions/{depositV3.js → deposit.js} +23 -23
  23. package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.d.ts +119 -0
  24. package/dist/src/svm/clients/SvmSpoke/instructions/{depositV3Now.js → depositNow.js} +23 -23
  25. package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.d.ts +104 -0
  26. package/dist/src/svm/clients/SvmSpoke/instructions/{executeV3SlowRelayLeaf.js → executeSlowRelayLeaf.js} +26 -26
  27. package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.d.ts +104 -0
  28. package/dist/src/svm/clients/SvmSpoke/instructions/{fillV3Relay.js → fillRelay.js} +26 -26
  29. package/dist/src/svm/clients/SvmSpoke/instructions/index.d.ts +6 -6
  30. package/dist/src/svm/clients/SvmSpoke/instructions/index.js +6 -6
  31. package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.d.ts +76 -0
  32. package/dist/src/svm/clients/SvmSpoke/instructions/{requestV3SlowFill.js → requestSlowFill.js} +25 -25
  33. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.d.ts +127 -0
  34. package/dist/src/svm/clients/SvmSpoke/instructions/{unsafeDepositV3.js → unsafeDeposit.js} +23 -23
  35. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.d.ts +23 -23
  36. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.js +29 -29
  37. package/dist/src/svm/clients/SvmSpoke/types/{filledV3Relay.d.ts → filledRelay.d.ts} +8 -8
  38. package/dist/src/svm/clients/SvmSpoke/types/{filledV3Relay.js → filledRelay.js} +9 -9
  39. package/dist/src/svm/clients/SvmSpoke/types/{v3FundsDeposited.d.ts → fundsDeposited.d.ts} +5 -5
  40. package/dist/src/svm/clients/SvmSpoke/types/{v3FundsDeposited.js → fundsDeposited.js} +7 -7
  41. package/dist/src/svm/clients/SvmSpoke/types/index.d.ts +6 -6
  42. package/dist/src/svm/clients/SvmSpoke/types/index.js +6 -6
  43. package/dist/src/svm/clients/SvmSpoke/types/{v3RelayData.d.ts → relayData.d.ts} +5 -5
  44. package/dist/src/svm/clients/SvmSpoke/types/{v3RelayData.js → relayData.js} +7 -7
  45. package/dist/src/svm/clients/SvmSpoke/types/{v3RelayExecutionEventInfo.d.ts → relayExecutionEventInfo.d.ts} +5 -5
  46. package/dist/src/svm/clients/SvmSpoke/types/{v3RelayExecutionEventInfo.js → relayExecutionEventInfo.js} +7 -7
  47. package/dist/src/svm/clients/SvmSpoke/types/{requestedV3SlowFill.d.ts → requestedSlowFill.d.ts} +5 -5
  48. package/dist/src/svm/clients/SvmSpoke/types/{requestedV3SlowFill.js → requestedSlowFill.js} +7 -7
  49. package/dist/src/svm/clients/SvmSpoke/types/{v3SlowFill.d.ts → slowFill.d.ts} +8 -8
  50. package/dist/src/svm/clients/SvmSpoke/types/{v3SlowFill.js → slowFill.js} +9 -9
  51. package/dist/src/svm/web3-v1/instructionParamsUtils.d.ts +8 -8
  52. package/dist/src/svm/web3-v1/instructionParamsUtils.js +16 -16
  53. package/dist/src/types/svm.d.ts +6 -6
  54. package/dist/target/types/svm_spoke.d.ts +435 -385
  55. package/dist/tasks/enableL1TokenAcrossEcosystem.js +14 -10
  56. package/dist/test/svm/SvmSpoke.Deposit.js +48 -47
  57. package/dist/test/svm/SvmSpoke.Fill.AcrossPlus.js +2 -2
  58. package/dist/test/svm/SvmSpoke.Fill.js +28 -56
  59. package/dist/test/svm/SvmSpoke.SlowFill.AcrossPlus.js +13 -13
  60. package/dist/test/svm/SvmSpoke.SlowFill.js +40 -40
  61. package/dist/utils/constants.d.ts +1 -1
  62. package/dist/utils/constants.js +3 -1
  63. package/package.json +2 -2
  64. package/dist/src/svm/clients/SvmSpoke/accounts/executeV3SlowRelayLeafParams.d.ts +0 -31
  65. package/dist/src/svm/clients/SvmSpoke/accounts/executeV3SlowRelayLeafParams.js +0 -70
  66. package/dist/src/svm/clients/SvmSpoke/accounts/fillV3RelayParams.d.ts +0 -31
  67. package/dist/src/svm/clients/SvmSpoke/accounts/fillV3RelayParams.js +0 -67
  68. package/dist/src/svm/clients/SvmSpoke/accounts/requestV3SlowFillParams.d.ts +0 -27
  69. package/dist/src/svm/clients/SvmSpoke/accounts/requestV3SlowFillParams.js +0 -66
  70. package/dist/src/svm/clients/SvmSpoke/instructions/depositV3.d.ts +0 -123
  71. package/dist/src/svm/clients/SvmSpoke/instructions/depositV3Now.d.ts +0 -119
  72. package/dist/src/svm/clients/SvmSpoke/instructions/executeV3SlowRelayLeaf.d.ts +0 -104
  73. package/dist/src/svm/clients/SvmSpoke/instructions/fillV3Relay.d.ts +0 -104
  74. package/dist/src/svm/clients/SvmSpoke/instructions/requestV3SlowFill.d.ts +0 -76
  75. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDepositV3.d.ts +0 -127
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/web3-v2.js';
9
+ import { type SlowFill, type SlowFillArgs } from '../types';
10
+ export declare const EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR: Uint8Array;
11
+ export declare function getExecuteSlowRelayLeafParamsDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type ExecuteSlowRelayLeafParams = {
13
+ discriminator: ReadonlyUint8Array;
14
+ slowFillLeaf: SlowFill;
15
+ rootBundleId: number;
16
+ proof: Array<ReadonlyUint8Array>;
17
+ };
18
+ export type ExecuteSlowRelayLeafParamsArgs = {
19
+ slowFillLeaf: SlowFillArgs;
20
+ rootBundleId: number;
21
+ proof: Array<ReadonlyUint8Array>;
22
+ };
23
+ export declare function getExecuteSlowRelayLeafParamsEncoder(): Encoder<ExecuteSlowRelayLeafParamsArgs>;
24
+ export declare function getExecuteSlowRelayLeafParamsDecoder(): Decoder<ExecuteSlowRelayLeafParams>;
25
+ export declare function getExecuteSlowRelayLeafParamsCodec(): Codec<ExecuteSlowRelayLeafParamsArgs, ExecuteSlowRelayLeafParams>;
26
+ export declare function decodeExecuteSlowRelayLeafParams<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<ExecuteSlowRelayLeafParams, TAddress>;
27
+ export declare function decodeExecuteSlowRelayLeafParams<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<ExecuteSlowRelayLeafParams, TAddress>;
28
+ export declare function fetchExecuteSlowRelayLeafParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<ExecuteSlowRelayLeafParams, TAddress>>;
29
+ export declare function fetchMaybeExecuteSlowRelayLeafParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<ExecuteSlowRelayLeafParams, TAddress>>;
30
+ export declare function fetchAllExecuteSlowRelayLeafParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<ExecuteSlowRelayLeafParams>[]>;
31
+ export declare function fetchAllMaybeExecuteSlowRelayLeafParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<ExecuteSlowRelayLeafParams>[]>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR = void 0;
11
+ exports.getExecuteSlowRelayLeafParamsDiscriminatorBytes = getExecuteSlowRelayLeafParamsDiscriminatorBytes;
12
+ exports.getExecuteSlowRelayLeafParamsEncoder = getExecuteSlowRelayLeafParamsEncoder;
13
+ exports.getExecuteSlowRelayLeafParamsDecoder = getExecuteSlowRelayLeafParamsDecoder;
14
+ exports.getExecuteSlowRelayLeafParamsCodec = getExecuteSlowRelayLeafParamsCodec;
15
+ exports.decodeExecuteSlowRelayLeafParams = decodeExecuteSlowRelayLeafParams;
16
+ exports.fetchExecuteSlowRelayLeafParams = fetchExecuteSlowRelayLeafParams;
17
+ exports.fetchMaybeExecuteSlowRelayLeafParams = fetchMaybeExecuteSlowRelayLeafParams;
18
+ exports.fetchAllExecuteSlowRelayLeafParams = fetchAllExecuteSlowRelayLeafParams;
19
+ exports.fetchAllMaybeExecuteSlowRelayLeafParams = fetchAllMaybeExecuteSlowRelayLeafParams;
20
+ const web3_v2_js_1 = require("@solana/web3-v2.js");
21
+ const types_1 = require("../types");
22
+ exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR = new Uint8Array([
23
+ 135, 208, 119, 251, 14, 222, 66, 155,
24
+ ]);
25
+ function getExecuteSlowRelayLeafParamsDiscriminatorBytes() {
26
+ return (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR);
27
+ }
28
+ function getExecuteSlowRelayLeafParamsEncoder() {
29
+ return (0, web3_v2_js_1.transformEncoder)((0, web3_v2_js_1.getStructEncoder)([
30
+ ['discriminator', (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8)],
31
+ ['slowFillLeaf', (0, types_1.getSlowFillEncoder)()],
32
+ ['rootBundleId', (0, web3_v2_js_1.getU32Encoder)()],
33
+ ['proof', (0, web3_v2_js_1.getArrayEncoder)((0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 32))],
34
+ ]), (value) => ({
35
+ ...value,
36
+ discriminator: exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR,
37
+ }));
38
+ }
39
+ function getExecuteSlowRelayLeafParamsDecoder() {
40
+ return (0, web3_v2_js_1.getStructDecoder)([
41
+ ['discriminator', (0, web3_v2_js_1.fixDecoderSize)((0, web3_v2_js_1.getBytesDecoder)(), 8)],
42
+ ['slowFillLeaf', (0, types_1.getSlowFillDecoder)()],
43
+ ['rootBundleId', (0, web3_v2_js_1.getU32Decoder)()],
44
+ ['proof', (0, web3_v2_js_1.getArrayDecoder)((0, web3_v2_js_1.fixDecoderSize)((0, web3_v2_js_1.getBytesDecoder)(), 32))],
45
+ ]);
46
+ }
47
+ function getExecuteSlowRelayLeafParamsCodec() {
48
+ return (0, web3_v2_js_1.combineCodec)(getExecuteSlowRelayLeafParamsEncoder(), getExecuteSlowRelayLeafParamsDecoder());
49
+ }
50
+ function decodeExecuteSlowRelayLeafParams(encodedAccount) {
51
+ return (0, web3_v2_js_1.decodeAccount)(encodedAccount, getExecuteSlowRelayLeafParamsDecoder());
52
+ }
53
+ async function fetchExecuteSlowRelayLeafParams(rpc, address, config) {
54
+ const maybeAccount = await fetchMaybeExecuteSlowRelayLeafParams(rpc, address, config);
55
+ (0, web3_v2_js_1.assertAccountExists)(maybeAccount);
56
+ return maybeAccount;
57
+ }
58
+ async function fetchMaybeExecuteSlowRelayLeafParams(rpc, address, config) {
59
+ const maybeAccount = await (0, web3_v2_js_1.fetchEncodedAccount)(rpc, address, config);
60
+ return decodeExecuteSlowRelayLeafParams(maybeAccount);
61
+ }
62
+ async function fetchAllExecuteSlowRelayLeafParams(rpc, addresses, config) {
63
+ const maybeAccounts = await fetchAllMaybeExecuteSlowRelayLeafParams(rpc, addresses, config);
64
+ (0, web3_v2_js_1.assertAccountsExist)(maybeAccounts);
65
+ return maybeAccounts;
66
+ }
67
+ async function fetchAllMaybeExecuteSlowRelayLeafParams(rpc, addresses, config) {
68
+ const maybeAccounts = await (0, web3_v2_js_1.fetchEncodedAccounts)(rpc, addresses, config);
69
+ return maybeAccounts.map((maybeAccount) => decodeExecuteSlowRelayLeafParams(maybeAccount));
70
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/web3-v2.js';
9
+ import { type RelayData, type RelayDataArgs } from '../types';
10
+ export declare const FILL_RELAY_PARAMS_DISCRIMINATOR: Uint8Array;
11
+ export declare function getFillRelayParamsDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type FillRelayParams = {
13
+ discriminator: ReadonlyUint8Array;
14
+ relayData: RelayData;
15
+ repaymentChainId: bigint;
16
+ repaymentAddress: Address;
17
+ };
18
+ export type FillRelayParamsArgs = {
19
+ relayData: RelayDataArgs;
20
+ repaymentChainId: number | bigint;
21
+ repaymentAddress: Address;
22
+ };
23
+ export declare function getFillRelayParamsEncoder(): Encoder<FillRelayParamsArgs>;
24
+ export declare function getFillRelayParamsDecoder(): Decoder<FillRelayParams>;
25
+ export declare function getFillRelayParamsCodec(): Codec<FillRelayParamsArgs, FillRelayParams>;
26
+ export declare function decodeFillRelayParams<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<FillRelayParams, TAddress>;
27
+ export declare function decodeFillRelayParams<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<FillRelayParams, TAddress>;
28
+ export declare function fetchFillRelayParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<FillRelayParams, TAddress>>;
29
+ export declare function fetchMaybeFillRelayParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<FillRelayParams, TAddress>>;
30
+ export declare function fetchAllFillRelayParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<FillRelayParams>[]>;
31
+ export declare function fetchAllMaybeFillRelayParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<FillRelayParams>[]>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.FILL_RELAY_PARAMS_DISCRIMINATOR = void 0;
11
+ exports.getFillRelayParamsDiscriminatorBytes = getFillRelayParamsDiscriminatorBytes;
12
+ exports.getFillRelayParamsEncoder = getFillRelayParamsEncoder;
13
+ exports.getFillRelayParamsDecoder = getFillRelayParamsDecoder;
14
+ exports.getFillRelayParamsCodec = getFillRelayParamsCodec;
15
+ exports.decodeFillRelayParams = decodeFillRelayParams;
16
+ exports.fetchFillRelayParams = fetchFillRelayParams;
17
+ exports.fetchMaybeFillRelayParams = fetchMaybeFillRelayParams;
18
+ exports.fetchAllFillRelayParams = fetchAllFillRelayParams;
19
+ exports.fetchAllMaybeFillRelayParams = fetchAllMaybeFillRelayParams;
20
+ const web3_v2_js_1 = require("@solana/web3-v2.js");
21
+ const types_1 = require("../types");
22
+ exports.FILL_RELAY_PARAMS_DISCRIMINATOR = new Uint8Array([
23
+ 50, 243, 51, 185, 89, 60, 43, 202,
24
+ ]);
25
+ function getFillRelayParamsDiscriminatorBytes() {
26
+ return (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(exports.FILL_RELAY_PARAMS_DISCRIMINATOR);
27
+ }
28
+ function getFillRelayParamsEncoder() {
29
+ return (0, web3_v2_js_1.transformEncoder)((0, web3_v2_js_1.getStructEncoder)([
30
+ ['discriminator', (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8)],
31
+ ['relayData', (0, types_1.getRelayDataEncoder)()],
32
+ ['repaymentChainId', (0, web3_v2_js_1.getU64Encoder)()],
33
+ ['repaymentAddress', (0, web3_v2_js_1.getAddressEncoder)()],
34
+ ]), (value) => ({ ...value, discriminator: exports.FILL_RELAY_PARAMS_DISCRIMINATOR }));
35
+ }
36
+ function getFillRelayParamsDecoder() {
37
+ return (0, web3_v2_js_1.getStructDecoder)([
38
+ ['discriminator', (0, web3_v2_js_1.fixDecoderSize)((0, web3_v2_js_1.getBytesDecoder)(), 8)],
39
+ ['relayData', (0, types_1.getRelayDataDecoder)()],
40
+ ['repaymentChainId', (0, web3_v2_js_1.getU64Decoder)()],
41
+ ['repaymentAddress', (0, web3_v2_js_1.getAddressDecoder)()],
42
+ ]);
43
+ }
44
+ function getFillRelayParamsCodec() {
45
+ return (0, web3_v2_js_1.combineCodec)(getFillRelayParamsEncoder(), getFillRelayParamsDecoder());
46
+ }
47
+ function decodeFillRelayParams(encodedAccount) {
48
+ return (0, web3_v2_js_1.decodeAccount)(encodedAccount, getFillRelayParamsDecoder());
49
+ }
50
+ async function fetchFillRelayParams(rpc, address, config) {
51
+ const maybeAccount = await fetchMaybeFillRelayParams(rpc, address, config);
52
+ (0, web3_v2_js_1.assertAccountExists)(maybeAccount);
53
+ return maybeAccount;
54
+ }
55
+ async function fetchMaybeFillRelayParams(rpc, address, config) {
56
+ const maybeAccount = await (0, web3_v2_js_1.fetchEncodedAccount)(rpc, address, config);
57
+ return decodeFillRelayParams(maybeAccount);
58
+ }
59
+ async function fetchAllFillRelayParams(rpc, addresses, config) {
60
+ const maybeAccounts = await fetchAllMaybeFillRelayParams(rpc, addresses, config);
61
+ (0, web3_v2_js_1.assertAccountsExist)(maybeAccounts);
62
+ return maybeAccounts;
63
+ }
64
+ async function fetchAllMaybeFillRelayParams(rpc, addresses, config) {
65
+ const maybeAccounts = await (0, web3_v2_js_1.fetchEncodedAccounts)(rpc, addresses, config);
66
+ return maybeAccounts.map((maybeAccount) => decodeFillRelayParams(maybeAccount));
67
+ }
@@ -7,10 +7,10 @@
7
7
  */
8
8
  export * from './claimAccount';
9
9
  export * from './executeRelayerRefundLeafParams';
10
- export * from './executeV3SlowRelayLeafParams';
10
+ export * from './executeSlowRelayLeafParams';
11
+ export * from './fillRelayParams';
11
12
  export * from './fillStatusAccount';
12
- export * from './fillV3RelayParams';
13
- export * from './requestV3SlowFillParams';
13
+ export * from './requestSlowFillParams';
14
14
  export * from './rootBundle';
15
15
  export * from './route';
16
16
  export * from './state';
@@ -23,10 +23,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  __exportStar(require("./claimAccount"), exports);
25
25
  __exportStar(require("./executeRelayerRefundLeafParams"), exports);
26
- __exportStar(require("./executeV3SlowRelayLeafParams"), exports);
26
+ __exportStar(require("./executeSlowRelayLeafParams"), exports);
27
+ __exportStar(require("./fillRelayParams"), exports);
27
28
  __exportStar(require("./fillStatusAccount"), exports);
28
- __exportStar(require("./fillV3RelayParams"), exports);
29
- __exportStar(require("./requestV3SlowFillParams"), exports);
29
+ __exportStar(require("./requestSlowFillParams"), exports);
30
30
  __exportStar(require("./rootBundle"), exports);
31
31
  __exportStar(require("./route"), exports);
32
32
  __exportStar(require("./state"), exports);
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/web3-v2.js';
9
+ import { type RelayData, type RelayDataArgs } from '../types';
10
+ export declare const REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR: Uint8Array;
11
+ export declare function getRequestSlowFillParamsDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type RequestSlowFillParams = {
13
+ discriminator: ReadonlyUint8Array;
14
+ relayData: RelayData;
15
+ };
16
+ export type RequestSlowFillParamsArgs = {
17
+ relayData: RelayDataArgs;
18
+ };
19
+ export declare function getRequestSlowFillParamsEncoder(): Encoder<RequestSlowFillParamsArgs>;
20
+ export declare function getRequestSlowFillParamsDecoder(): Decoder<RequestSlowFillParams>;
21
+ export declare function getRequestSlowFillParamsCodec(): Codec<RequestSlowFillParamsArgs, RequestSlowFillParams>;
22
+ export declare function decodeRequestSlowFillParams<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<RequestSlowFillParams, TAddress>;
23
+ export declare function decodeRequestSlowFillParams<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<RequestSlowFillParams, TAddress>;
24
+ export declare function fetchRequestSlowFillParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<RequestSlowFillParams, TAddress>>;
25
+ export declare function fetchMaybeRequestSlowFillParams<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<RequestSlowFillParams, TAddress>>;
26
+ export declare function fetchAllRequestSlowFillParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<RequestSlowFillParams>[]>;
27
+ export declare function fetchAllMaybeRequestSlowFillParams(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<RequestSlowFillParams>[]>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /**
3
+ * This code was AUTOGENERATED using the codama library.
4
+ * Please DO NOT EDIT THIS FILE, instead use visitors
5
+ * to add features, then rerun codama to update it.
6
+ *
7
+ * @see https://github.com/codama-idl/codama
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR = void 0;
11
+ exports.getRequestSlowFillParamsDiscriminatorBytes = getRequestSlowFillParamsDiscriminatorBytes;
12
+ exports.getRequestSlowFillParamsEncoder = getRequestSlowFillParamsEncoder;
13
+ exports.getRequestSlowFillParamsDecoder = getRequestSlowFillParamsDecoder;
14
+ exports.getRequestSlowFillParamsCodec = getRequestSlowFillParamsCodec;
15
+ exports.decodeRequestSlowFillParams = decodeRequestSlowFillParams;
16
+ exports.fetchRequestSlowFillParams = fetchRequestSlowFillParams;
17
+ exports.fetchMaybeRequestSlowFillParams = fetchMaybeRequestSlowFillParams;
18
+ exports.fetchAllRequestSlowFillParams = fetchAllRequestSlowFillParams;
19
+ exports.fetchAllMaybeRequestSlowFillParams = fetchAllMaybeRequestSlowFillParams;
20
+ const web3_v2_js_1 = require("@solana/web3-v2.js");
21
+ const types_1 = require("../types");
22
+ exports.REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR = new Uint8Array([
23
+ 5, 54, 214, 89, 197, 37, 118, 28,
24
+ ]);
25
+ function getRequestSlowFillParamsDiscriminatorBytes() {
26
+ return (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(exports.REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR);
27
+ }
28
+ function getRequestSlowFillParamsEncoder() {
29
+ return (0, web3_v2_js_1.transformEncoder)((0, web3_v2_js_1.getStructEncoder)([
30
+ ['discriminator', (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8)],
31
+ ['relayData', (0, types_1.getRelayDataEncoder)()],
32
+ ]), (value) => ({
33
+ ...value,
34
+ discriminator: exports.REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR,
35
+ }));
36
+ }
37
+ function getRequestSlowFillParamsDecoder() {
38
+ return (0, web3_v2_js_1.getStructDecoder)([
39
+ ['discriminator', (0, web3_v2_js_1.fixDecoderSize)((0, web3_v2_js_1.getBytesDecoder)(), 8)],
40
+ ['relayData', (0, types_1.getRelayDataDecoder)()],
41
+ ]);
42
+ }
43
+ function getRequestSlowFillParamsCodec() {
44
+ return (0, web3_v2_js_1.combineCodec)(getRequestSlowFillParamsEncoder(), getRequestSlowFillParamsDecoder());
45
+ }
46
+ function decodeRequestSlowFillParams(encodedAccount) {
47
+ return (0, web3_v2_js_1.decodeAccount)(encodedAccount, getRequestSlowFillParamsDecoder());
48
+ }
49
+ async function fetchRequestSlowFillParams(rpc, address, config) {
50
+ const maybeAccount = await fetchMaybeRequestSlowFillParams(rpc, address, config);
51
+ (0, web3_v2_js_1.assertAccountExists)(maybeAccount);
52
+ return maybeAccount;
53
+ }
54
+ async function fetchMaybeRequestSlowFillParams(rpc, address, config) {
55
+ const maybeAccount = await (0, web3_v2_js_1.fetchEncodedAccount)(rpc, address, config);
56
+ return decodeRequestSlowFillParams(maybeAccount);
57
+ }
58
+ async function fetchAllRequestSlowFillParams(rpc, addresses, config) {
59
+ const maybeAccounts = await fetchAllMaybeRequestSlowFillParams(rpc, addresses, config);
60
+ (0, web3_v2_js_1.assertAccountsExist)(maybeAccounts);
61
+ return maybeAccounts;
62
+ }
63
+ async function fetchAllMaybeRequestSlowFillParams(rpc, addresses, config) {
64
+ const maybeAccounts = await (0, web3_v2_js_1.fetchEncodedAccounts)(rpc, addresses, config);
65
+ return maybeAccounts.map((maybeAccount) => decodeRequestSlowFillParams(maybeAccount));
66
+ }
@@ -6,21 +6,41 @@
6
6
  * @see https://github.com/codama-idl/codama
7
7
  */
8
8
  import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/web3-v2.js';
9
- /** InvalidSelector: Invalid solidity selector */
10
- export declare const SVM_SPOKE_ERROR__INVALID_SELECTOR = 6000;
11
- /** InvalidArgument: Invalid solidity argument */
12
- export declare const SVM_SPOKE_ERROR__INVALID_ARGUMENT = 6001;
13
- /** InvalidBool: Invalid solidity bool argument */
14
- export declare const SVM_SPOKE_ERROR__INVALID_BOOL = 6002;
15
- /** InvalidAddress: Invalid solidity address argument */
16
- export declare const SVM_SPOKE_ERROR__INVALID_ADDRESS = 6003;
17
- /** InvalidUint32: Invalid solidity uint32 argument */
18
- export declare const SVM_SPOKE_ERROR__INVALID_UINT32 = 6004;
19
- /** InvalidUint64: Invalid solidity uint64 argument */
20
- export declare const SVM_SPOKE_ERROR__INVALID_UINT64 = 6005;
21
- /** UnsupportedSelector: Unsupported solidity selector */
22
- export declare const SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR = 6006;
23
- export type SvmSpokeError = typeof SVM_SPOKE_ERROR__INVALID_ADDRESS | typeof SVM_SPOKE_ERROR__INVALID_ARGUMENT | typeof SVM_SPOKE_ERROR__INVALID_BOOL | typeof SVM_SPOKE_ERROR__INVALID_SELECTOR | typeof SVM_SPOKE_ERROR__INVALID_UINT32 | typeof SVM_SPOKE_ERROR__INVALID_UINT64 | typeof SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR;
9
+ /** NotOwner: Only the owner can call this function! */
10
+ export declare const SVM_SPOKE_ERROR__NOT_OWNER = 6000;
11
+ /** InvalidRelayHash: Invalid relay hash! */
12
+ export declare const SVM_SPOKE_ERROR__INVALID_RELAY_HASH = 6001;
13
+ /** CanOnlyCloseFillStatusPdaIfFillDeadlinePassed: The fill deadline has not passed! */
14
+ export declare const SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED = 6002;
15
+ /** NotRelayer: The caller is not the relayer! */
16
+ export declare const SVM_SPOKE_ERROR__NOT_RELAYER = 6003;
17
+ /** CannotSetCurrentTime: Cannot set time if not in test mode! */
18
+ export declare const SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME = 6004;
19
+ /** InvalidRemoteDomain: Invalid remote domain! */
20
+ export declare const SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN = 6005;
21
+ /** InvalidRemoteSender: Invalid remote sender! */
22
+ export declare const SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER = 6006;
23
+ /** InvalidMint: Invalid mint! */
24
+ export declare const SVM_SPOKE_ERROR__INVALID_MINT = 6007;
25
+ /** ExceededPendingBridgeAmount: Exceeded pending bridge amount to HubPool! */
26
+ export declare const SVM_SPOKE_ERROR__EXCEEDED_PENDING_BRIDGE_AMOUNT = 6008;
27
+ /** ParamsWriteOverflow: Overflow writing to parameters account! */
28
+ export declare const SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW = 6009;
29
+ /** InvalidRefund: Invalid refund address! */
30
+ export declare const SVM_SPOKE_ERROR__INVALID_REFUND = 6010;
31
+ /** ZeroRefundClaim: Zero relayer refund claim! */
32
+ export declare const SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM = 6011;
33
+ /** NonZeroRefundClaim: Cannot close non-zero relayer refund claim! */
34
+ export declare const SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM = 6012;
35
+ /** InvalidClaimInitializer: Invalid claim initializer! */
36
+ export declare const SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER = 6013;
37
+ /** InvalidRefundTokenAccount: Invalid refund token account! */
38
+ export declare const SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT = 6014;
39
+ /** InvalidProductionSeed: Seed must be 0 in production! */
40
+ export declare const SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = 6015;
41
+ /** InvalidATACreationAccounts: Invalid remaining accounts for ATA creation! */
42
+ export declare const SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = 6016;
43
+ 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__EXCEEDED_PENDING_BRIDGE_AMOUNT | typeof SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS | typeof SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER | typeof SVM_SPOKE_ERROR__INVALID_MINT | typeof SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED | typeof SVM_SPOKE_ERROR__INVALID_REFUND | typeof SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT | typeof SVM_SPOKE_ERROR__INVALID_RELAY_HASH | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN | typeof SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER | typeof SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM | typeof SVM_SPOKE_ERROR__NOT_OWNER | typeof SVM_SPOKE_ERROR__NOT_RELAYER | typeof SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW | typeof SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM;
24
44
  export declare function getSvmSpokeErrorMessage(code: SvmSpokeError): string;
25
45
  export declare function isSvmSpokeError<TProgramErrorCode extends SvmSpokeError>(error: unknown, transactionMessage: {
26
46
  instructions: Record<number, {
@@ -7,35 +7,65 @@
7
7
  * @see https://github.com/codama-idl/codama
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- 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 = exports.SVM_SPOKE_ERROR__INVALID_SELECTOR = void 0;
10
+ 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__EXCEEDED_PENDING_BRIDGE_AMOUNT = 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__INVALID_RELAY_HASH = exports.SVM_SPOKE_ERROR__NOT_OWNER = void 0;
11
11
  exports.getSvmSpokeErrorMessage = getSvmSpokeErrorMessage;
12
12
  exports.isSvmSpokeError = isSvmSpokeError;
13
13
  const web3_v2_js_1 = require("@solana/web3-v2.js");
14
14
  const programs_1 = require("../programs");
15
- /** InvalidSelector: Invalid solidity selector */
16
- exports.SVM_SPOKE_ERROR__INVALID_SELECTOR = 0x1770; // 6000
17
- /** InvalidArgument: Invalid solidity argument */
18
- exports.SVM_SPOKE_ERROR__INVALID_ARGUMENT = 0x1771; // 6001
19
- /** InvalidBool: Invalid solidity bool argument */
20
- exports.SVM_SPOKE_ERROR__INVALID_BOOL = 0x1772; // 6002
21
- /** InvalidAddress: Invalid solidity address argument */
22
- exports.SVM_SPOKE_ERROR__INVALID_ADDRESS = 0x1773; // 6003
23
- /** InvalidUint32: Invalid solidity uint32 argument */
24
- exports.SVM_SPOKE_ERROR__INVALID_UINT32 = 0x1774; // 6004
25
- /** InvalidUint64: Invalid solidity uint64 argument */
26
- exports.SVM_SPOKE_ERROR__INVALID_UINT64 = 0x1775; // 6005
27
- /** UnsupportedSelector: Unsupported solidity selector */
28
- exports.SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR = 0x1776; // 6006
15
+ /** NotOwner: Only the owner can call this function! */
16
+ exports.SVM_SPOKE_ERROR__NOT_OWNER = 0x1770; // 6000
17
+ /** InvalidRelayHash: Invalid relay hash! */
18
+ exports.SVM_SPOKE_ERROR__INVALID_RELAY_HASH = 0x1771; // 6001
19
+ /** CanOnlyCloseFillStatusPdaIfFillDeadlinePassed: The fill deadline has not passed! */
20
+ exports.SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED = 0x1772; // 6002
21
+ /** NotRelayer: The caller is not the relayer! */
22
+ exports.SVM_SPOKE_ERROR__NOT_RELAYER = 0x1773; // 6003
23
+ /** CannotSetCurrentTime: Cannot set time if not in test mode! */
24
+ exports.SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME = 0x1774; // 6004
25
+ /** InvalidRemoteDomain: Invalid remote domain! */
26
+ exports.SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN = 0x1775; // 6005
27
+ /** InvalidRemoteSender: Invalid remote sender! */
28
+ exports.SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER = 0x1776; // 6006
29
+ /** InvalidMint: Invalid mint! */
30
+ exports.SVM_SPOKE_ERROR__INVALID_MINT = 0x1777; // 6007
31
+ /** ExceededPendingBridgeAmount: Exceeded pending bridge amount to HubPool! */
32
+ exports.SVM_SPOKE_ERROR__EXCEEDED_PENDING_BRIDGE_AMOUNT = 0x1778; // 6008
33
+ /** ParamsWriteOverflow: Overflow writing to parameters account! */
34
+ exports.SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW = 0x1779; // 6009
35
+ /** InvalidRefund: Invalid refund address! */
36
+ exports.SVM_SPOKE_ERROR__INVALID_REFUND = 0x177a; // 6010
37
+ /** ZeroRefundClaim: Zero relayer refund claim! */
38
+ exports.SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM = 0x177b; // 6011
39
+ /** NonZeroRefundClaim: Cannot close non-zero relayer refund claim! */
40
+ exports.SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM = 0x177c; // 6012
41
+ /** InvalidClaimInitializer: Invalid claim initializer! */
42
+ exports.SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER = 0x177d; // 6013
43
+ /** InvalidRefundTokenAccount: Invalid refund token account! */
44
+ exports.SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT = 0x177e; // 6014
45
+ /** InvalidProductionSeed: Seed must be 0 in production! */
46
+ exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED = 0x177f; // 6015
47
+ /** InvalidATACreationAccounts: Invalid remaining accounts for ATA creation! */
48
+ exports.SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS = 0x1780; // 6016
29
49
  let svmSpokeErrorMessages;
30
50
  if (process.env.NODE_ENV !== 'production') {
31
51
  svmSpokeErrorMessages = {
32
- [exports.SVM_SPOKE_ERROR__INVALID_ADDRESS]: `Invalid solidity address argument`,
33
- [exports.SVM_SPOKE_ERROR__INVALID_ARGUMENT]: `Invalid solidity argument`,
34
- [exports.SVM_SPOKE_ERROR__INVALID_BOOL]: `Invalid solidity bool argument`,
35
- [exports.SVM_SPOKE_ERROR__INVALID_SELECTOR]: `Invalid solidity selector`,
36
- [exports.SVM_SPOKE_ERROR__INVALID_UINT32]: `Invalid solidity uint32 argument`,
37
- [exports.SVM_SPOKE_ERROR__INVALID_UINT64]: `Invalid solidity uint64 argument`,
38
- [exports.SVM_SPOKE_ERROR__UNSUPPORTED_SELECTOR]: `Unsupported solidity selector`,
52
+ [exports.SVM_SPOKE_ERROR__CANNOT_SET_CURRENT_TIME]: `Cannot set time if not in test mode!`,
53
+ [exports.SVM_SPOKE_ERROR__CAN_ONLY_CLOSE_FILL_STATUS_PDA_IF_FILL_DEADLINE_PASSED]: `The fill deadline has not passed!`,
54
+ [exports.SVM_SPOKE_ERROR__EXCEEDED_PENDING_BRIDGE_AMOUNT]: `Exceeded pending bridge amount to HubPool!`,
55
+ [exports.SVM_SPOKE_ERROR__INVALID_A_T_A_CREATION_ACCOUNTS]: `Invalid remaining accounts for ATA creation!`,
56
+ [exports.SVM_SPOKE_ERROR__INVALID_CLAIM_INITIALIZER]: `Invalid claim initializer!`,
57
+ [exports.SVM_SPOKE_ERROR__INVALID_MINT]: `Invalid mint!`,
58
+ [exports.SVM_SPOKE_ERROR__INVALID_PRODUCTION_SEED]: `Seed must be 0 in production!`,
59
+ [exports.SVM_SPOKE_ERROR__INVALID_REFUND]: `Invalid refund address!`,
60
+ [exports.SVM_SPOKE_ERROR__INVALID_REFUND_TOKEN_ACCOUNT]: `Invalid refund token account!`,
61
+ [exports.SVM_SPOKE_ERROR__INVALID_RELAY_HASH]: `Invalid relay hash!`,
62
+ [exports.SVM_SPOKE_ERROR__INVALID_REMOTE_DOMAIN]: `Invalid remote domain!`,
63
+ [exports.SVM_SPOKE_ERROR__INVALID_REMOTE_SENDER]: `Invalid remote sender!`,
64
+ [exports.SVM_SPOKE_ERROR__NON_ZERO_REFUND_CLAIM]: `Cannot close non-zero relayer refund claim!`,
65
+ [exports.SVM_SPOKE_ERROR__NOT_OWNER]: `Only the owner can call this function!`,
66
+ [exports.SVM_SPOKE_ERROR__NOT_RELAYER]: `The caller is not the relayer!`,
67
+ [exports.SVM_SPOKE_ERROR__PARAMS_WRITE_OVERFLOW]: `Overflow writing to parameters account!`,
68
+ [exports.SVM_SPOKE_ERROR__ZERO_REFUND_CLAIM]: `Zero relayer refund claim!`,
39
69
  };
40
70
  }
41
71
  function getSvmSpokeErrorMessage(code) {
@@ -0,0 +1,123 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlyUint8Array, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/web3-v2.js';
9
+ import { SVM_SPOKE_PROGRAM_ADDRESS } from '../programs';
10
+ export declare const DEPOSIT_DISCRIMINATOR: Uint8Array;
11
+ export declare function getDepositDiscriminatorBytes(): ReadonlyUint8Array;
12
+ export type DepositInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountSigner extends string | IAccountMeta<string> = string, TAccountState extends string | IAccountMeta<string> = string, TAccountRoute extends string | IAccountMeta<string> = string, TAccountDepositorTokenAccount extends string | IAccountMeta<string> = string, TAccountVault extends string | IAccountMeta<string> = string, TAccountMint extends string | IAccountMeta<string> = string, TAccountTokenProgram extends string | IAccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountEventAuthority extends string | IAccountMeta<string> = string, TAccountProgram extends string | IAccountMeta<string> = string, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<[
13
+ TAccountSigner extends string ? WritableSignerAccount<TAccountSigner> & IAccountSignerMeta<TAccountSigner> : TAccountSigner,
14
+ TAccountState extends string ? WritableAccount<TAccountState> : TAccountState,
15
+ TAccountRoute extends string ? ReadonlyAccount<TAccountRoute> : TAccountRoute,
16
+ TAccountDepositorTokenAccount extends string ? WritableAccount<TAccountDepositorTokenAccount> : TAccountDepositorTokenAccount,
17
+ TAccountVault extends string ? WritableAccount<TAccountVault> : TAccountVault,
18
+ TAccountMint extends string ? ReadonlyAccount<TAccountMint> : TAccountMint,
19
+ TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
20
+ TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
21
+ TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
22
+ ...TRemainingAccounts
23
+ ]>;
24
+ export type DepositInstructionData = {
25
+ discriminator: ReadonlyUint8Array;
26
+ depositor: Address;
27
+ recipient: Address;
28
+ inputToken: Address;
29
+ outputToken: Address;
30
+ inputAmount: bigint;
31
+ outputAmount: bigint;
32
+ destinationChainId: bigint;
33
+ exclusiveRelayer: Address;
34
+ quoteTimestamp: number;
35
+ fillDeadline: number;
36
+ exclusivityParameter: number;
37
+ message: ReadonlyUint8Array;
38
+ };
39
+ export type DepositInstructionDataArgs = {
40
+ depositor: Address;
41
+ recipient: Address;
42
+ inputToken: Address;
43
+ outputToken: Address;
44
+ inputAmount: number | bigint;
45
+ outputAmount: number | bigint;
46
+ destinationChainId: number | bigint;
47
+ exclusiveRelayer: Address;
48
+ quoteTimestamp: number;
49
+ fillDeadline: number;
50
+ exclusivityParameter: number;
51
+ message: ReadonlyUint8Array;
52
+ };
53
+ export declare function getDepositInstructionDataEncoder(): Encoder<DepositInstructionDataArgs>;
54
+ export declare function getDepositInstructionDataDecoder(): Decoder<DepositInstructionData>;
55
+ export declare function getDepositInstructionDataCodec(): Codec<DepositInstructionDataArgs, DepositInstructionData>;
56
+ export type DepositAsyncInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountRoute extends string = string, TAccountDepositorTokenAccount extends string = string, TAccountVault extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
57
+ signer: TransactionSigner<TAccountSigner>;
58
+ state: Address<TAccountState>;
59
+ route: Address<TAccountRoute>;
60
+ depositorTokenAccount?: Address<TAccountDepositorTokenAccount>;
61
+ vault?: Address<TAccountVault>;
62
+ mint: Address<TAccountMint>;
63
+ tokenProgram?: Address<TAccountTokenProgram>;
64
+ eventAuthority?: Address<TAccountEventAuthority>;
65
+ program: Address<TAccountProgram>;
66
+ depositor: DepositInstructionDataArgs['depositor'];
67
+ recipient: DepositInstructionDataArgs['recipient'];
68
+ inputToken: DepositInstructionDataArgs['inputToken'];
69
+ outputToken: DepositInstructionDataArgs['outputToken'];
70
+ inputAmount: DepositInstructionDataArgs['inputAmount'];
71
+ outputAmount: DepositInstructionDataArgs['outputAmount'];
72
+ destinationChainId: DepositInstructionDataArgs['destinationChainId'];
73
+ exclusiveRelayer: DepositInstructionDataArgs['exclusiveRelayer'];
74
+ quoteTimestamp: DepositInstructionDataArgs['quoteTimestamp'];
75
+ fillDeadline: DepositInstructionDataArgs['fillDeadline'];
76
+ exclusivityParameter: DepositInstructionDataArgs['exclusivityParameter'];
77
+ message: DepositInstructionDataArgs['message'];
78
+ };
79
+ export declare function getDepositInstructionAsync<TAccountSigner extends string, TAccountState extends string, TAccountRoute extends string, TAccountDepositorTokenAccount extends string, TAccountVault extends string, TAccountMint extends string, TAccountTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: DepositAsyncInput<TAccountSigner, TAccountState, TAccountRoute, TAccountDepositorTokenAccount, TAccountVault, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountProgram>, config?: {
80
+ programAddress?: TProgramAddress;
81
+ }): Promise<DepositInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountRoute, TAccountDepositorTokenAccount, TAccountVault, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountProgram>>;
82
+ export type DepositInput<TAccountSigner extends string = string, TAccountState extends string = string, TAccountRoute extends string = string, TAccountDepositorTokenAccount extends string = string, TAccountVault extends string = string, TAccountMint extends string = string, TAccountTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
83
+ signer: TransactionSigner<TAccountSigner>;
84
+ state: Address<TAccountState>;
85
+ route: Address<TAccountRoute>;
86
+ depositorTokenAccount: Address<TAccountDepositorTokenAccount>;
87
+ vault: Address<TAccountVault>;
88
+ mint: Address<TAccountMint>;
89
+ tokenProgram?: Address<TAccountTokenProgram>;
90
+ eventAuthority: Address<TAccountEventAuthority>;
91
+ program: Address<TAccountProgram>;
92
+ depositor: DepositInstructionDataArgs['depositor'];
93
+ recipient: DepositInstructionDataArgs['recipient'];
94
+ inputToken: DepositInstructionDataArgs['inputToken'];
95
+ outputToken: DepositInstructionDataArgs['outputToken'];
96
+ inputAmount: DepositInstructionDataArgs['inputAmount'];
97
+ outputAmount: DepositInstructionDataArgs['outputAmount'];
98
+ destinationChainId: DepositInstructionDataArgs['destinationChainId'];
99
+ exclusiveRelayer: DepositInstructionDataArgs['exclusiveRelayer'];
100
+ quoteTimestamp: DepositInstructionDataArgs['quoteTimestamp'];
101
+ fillDeadline: DepositInstructionDataArgs['fillDeadline'];
102
+ exclusivityParameter: DepositInstructionDataArgs['exclusivityParameter'];
103
+ message: DepositInstructionDataArgs['message'];
104
+ };
105
+ export declare function getDepositInstruction<TAccountSigner extends string, TAccountState extends string, TAccountRoute extends string, TAccountDepositorTokenAccount extends string, TAccountVault extends string, TAccountMint extends string, TAccountTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof SVM_SPOKE_PROGRAM_ADDRESS>(input: DepositInput<TAccountSigner, TAccountState, TAccountRoute, TAccountDepositorTokenAccount, TAccountVault, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountProgram>, config?: {
106
+ programAddress?: TProgramAddress;
107
+ }): DepositInstruction<TProgramAddress, TAccountSigner, TAccountState, TAccountRoute, TAccountDepositorTokenAccount, TAccountVault, TAccountMint, TAccountTokenProgram, TAccountEventAuthority, TAccountProgram>;
108
+ export type ParsedDepositInstruction<TProgram extends string = typeof SVM_SPOKE_PROGRAM_ADDRESS, TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[]> = {
109
+ programAddress: Address<TProgram>;
110
+ accounts: {
111
+ signer: TAccountMetas[0];
112
+ state: TAccountMetas[1];
113
+ route: TAccountMetas[2];
114
+ depositorTokenAccount: TAccountMetas[3];
115
+ vault: TAccountMetas[4];
116
+ mint: TAccountMetas[5];
117
+ tokenProgram: TAccountMetas[6];
118
+ eventAuthority: TAccountMetas[7];
119
+ program: TAccountMetas[8];
120
+ };
121
+ data: DepositInstructionData;
122
+ };
123
+ export declare function parseDepositInstruction<TProgram extends string, TAccountMetas extends readonly IAccountMeta[]>(instruction: IInstruction<TProgram> & IInstructionWithAccounts<TAccountMetas> & IInstructionWithData<Uint8Array>): ParsedDepositInstruction<TProgram, TAccountMetas>;