@across-protocol/contracts 6.0.0-beta.2 → 6.0.0-beta.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 (128) hide show
  1. package/README.md +138 -34
  2. package/contracts/chain-adapters/Solana_Adapter.sol +4 -7
  3. package/contracts/handlers/HyperliquidDepositHandler.sol +2 -2
  4. package/contracts/interfaces/SpokePoolPeripheryInterface.sol +16 -4
  5. package/contracts/libraries/HyperCoreLib.sol +113 -20
  6. package/contracts/libraries/PeripherySigningLib.sol +56 -0
  7. package/contracts/periphery/SpokePoolPeriphery.sol +58 -10
  8. package/dist/broadcast/deployed-addresses.json +19 -0
  9. package/dist/evm/artifacts/Constants.sol/Constants.json +1 -1
  10. package/dist/evm/artifacts/DeploymentUtils.sol/DeploymentUtils.json +1 -1
  11. package/dist/evm/artifacts/DstOFTHandler.sol/DstOFTHandler.json +1 -1
  12. package/dist/evm/artifacts/HubPoolTestBase.sol/MockAddressWhitelist.json +1 -1
  13. package/dist/evm/artifacts/HubPoolTestBase.sol/MockFinder.json +1 -1
  14. package/dist/evm/artifacts/HubPoolTestBase.sol/MockIdentifierWhitelist.json +1 -1
  15. package/dist/evm/artifacts/HubPoolTestBase.sol/MockLpTokenFactory.json +1 -1
  16. package/dist/evm/artifacts/HubPoolTestBase.sol/MockOptimisticOracle.json +1 -1
  17. package/dist/evm/artifacts/HubPoolTestBase.sol/MockStore.json +1 -1
  18. package/dist/evm/artifacts/HyperCoreFlowExecutor.sol/HyperCoreFlowExecutor.json +1 -1
  19. package/dist/evm/artifacts/HyperCoreLib.sol/HyperCoreLib.json +1 -1
  20. package/dist/evm/artifacts/HyperliquidDepositHandler.sol/HyperliquidDepositHandler.json +1 -1
  21. package/dist/evm/artifacts/PeripherySigningLib.sol/PeripherySigningLib.json +1 -1
  22. package/dist/evm/artifacts/Solana_Adapter.sol/Solana_Adapter.json +1 -1
  23. package/dist/evm/artifacts/SpokePoolPeriphery.sol/SpokePoolPeriphery.json +1 -1
  24. package/dist/evm/artifacts/SpokePoolPeriphery.sol/SwapProxy.json +1 -1
  25. package/dist/evm/artifacts/SponsoredCCTPDstPeriphery.sol/SponsoredCCTPDstPeriphery.json +1 -1
  26. package/dist/evm/artifacts/SponsoredCCTPSrcPeriphery.sol/SponsoredCCTPSrcPeriphery.json +1 -1
  27. package/dist/evm/artifacts/SponsoredOFTSrcPeriphery.sol/SponsoredOFTSrcPeriphery.json +1 -1
  28. package/dist/evm/artifacts/SwapHandler.sol/SwapHandler.json +1 -1
  29. package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SpokePoolPeriphery.json +1 -1
  30. package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SwapProxy.json +1 -1
  31. package/dist/src/consts.js +1 -0
  32. package/dist/src/svm/assets/idl/sponsored_cctp_src_periphery.json +41 -24
  33. package/dist/src/svm/assets/idl/svm_spoke.json +1001 -2171
  34. package/dist/src/svm/assets/sponsored_cctp_src_periphery.d.ts +41 -24
  35. package/dist/src/svm/assets/svm_spoke.d.ts +996 -2166
  36. package/dist/src/svm/assets/token_messenger_minter_v2.d.ts +18 -18
  37. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.d.ts +0 -1
  38. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.js +0 -1
  39. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.d.ts +24 -12
  40. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.js +30 -12
  41. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.d.ts +4 -5
  42. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.js +4 -8
  43. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.d.ts +1 -0
  44. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.js +1 -0
  45. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.d.ts +21 -0
  46. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.js +30 -0
  47. package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.d.ts +2 -2
  48. package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.js +2 -2
  49. package/dist/src/svm/clients/SvmSpoke/accounts/index.d.ts +0 -3
  50. package/dist/src/svm/clients/SvmSpoke/accounts/index.js +0 -3
  51. package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +94 -22
  52. package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +133 -24
  53. package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.d.ts +75 -0
  54. package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.js +144 -0
  55. package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.d.ts +16 -8
  56. package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.js +3 -3
  57. package/dist/src/svm/clients/SvmSpoke/instructions/index.d.ts +2 -7
  58. package/dist/src/svm/clients/SvmSpoke/instructions/index.js +2 -7
  59. package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.d.ts +58 -0
  60. package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.js +134 -0
  61. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.d.ts +29 -47
  62. package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.js +29 -61
  63. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.d.ts +25 -0
  64. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.js +33 -0
  65. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.d.ts +18 -0
  66. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.js +30 -0
  67. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.d.ts +43 -0
  68. package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.js +48 -0
  69. package/dist/src/svm/clients/SvmSpoke/types/index.d.ts +9 -1
  70. package/dist/src/svm/clients/SvmSpoke/types/index.js +9 -1
  71. package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.d.ts +39 -0
  72. package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.js +59 -0
  73. package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.d.ts +17 -0
  74. package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.js +30 -0
  75. package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.d.ts +19 -0
  76. package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.js +28 -0
  77. package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.d.ts +25 -0
  78. package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.js +30 -0
  79. package/dist/src/svm/clients/SvmSpoke/types/v5FillJit.d.ts +22 -0
  80. package/dist/src/svm/clients/SvmSpoke/types/{slowFill.js → v5FillJit.js} +11 -11
  81. package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.d.ts +29 -0
  82. package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.js +38 -0
  83. package/dist/src/svm/web3-v1/cctpV2Helpers.d.ts +83 -97
  84. package/dist/src/svm/web3-v1/cctpV2Helpers.js +1 -1
  85. package/dist/src/svm/web3-v1/coders.d.ts +1 -1
  86. package/dist/src/svm/web3-v1/coders.js +4 -4
  87. package/dist/src/svm/web3-v1/conversionUtils.d.ts +1 -1
  88. package/dist/src/svm/web3-v1/conversionUtils.js +3 -3
  89. package/dist/src/svm/web3-v1/helpers.d.ts +1 -114
  90. package/dist/src/svm/web3-v1/helpers.js +1 -179
  91. package/dist/src/svm/web3-v1/instructionParamsUtils.d.ts +11 -26
  92. package/dist/src/svm/web3-v1/instructionParamsUtils.js +5 -90
  93. package/dist/src/svm/web3-v1/programConnectors.d.ts +1 -1
  94. package/dist/src/svm/web3-v1/programConnectors.js +2 -2
  95. package/dist/src/svm/web3-v1/relayHashUtils.d.ts +2 -6
  96. package/dist/src/svm/web3-v1/relayHashUtils.js +5 -66
  97. package/dist/src/svm/web3-v1/solanaProgramUtils.d.ts +1 -1
  98. package/dist/src/svm/web3-v1/solanaProgramUtils.js +7 -7
  99. package/dist/src/svm/web3-v1/transactionUtils.js +3 -3
  100. package/dist/src/svm/web3-v2/solanaProgramUtils.d.ts +1 -1
  101. package/dist/src/svm/web3-v2/solanaProgramUtils.js +4 -4
  102. package/dist/src/types/svm.d.ts +1 -46
  103. package/package.json +17 -6
  104. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.d.ts +0 -30
  105. package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.js +0 -66
  106. package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.d.ts +0 -31
  107. package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.js +0 -70
  108. package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.d.ts +0 -31
  109. package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.js +0 -67
  110. package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.d.ts +0 -27
  111. package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.js +0 -66
  112. package/dist/src/svm/clients/SvmSpoke/instructions/deposit.d.ts +0 -131
  113. package/dist/src/svm/clients/SvmSpoke/instructions/deposit.js +0 -241
  114. package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.d.ts +0 -127
  115. package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.js +0 -239
  116. package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.d.ts +0 -104
  117. package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.js +0 -259
  118. package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.d.ts +0 -108
  119. package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.js +0 -265
  120. package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.d.ts +0 -39
  121. package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.js +0 -63
  122. package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.d.ts +0 -76
  123. package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.js +0 -187
  124. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.d.ts +0 -135
  125. package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.js +0 -243
  126. package/dist/src/svm/clients/SvmSpoke/types/slowFill.d.ts +0 -22
  127. package/dist/target/types/svm_spoke.d.ts +0 -5106
  128. package/dist/target/types/svm_spoke.js +0 -2
@@ -1,4 +1,4 @@
1
- import { BN } from "@coral-xyz/anchor";
1
+ import { BN } from "@anchor-lang/core";
2
2
  import { PublicKey } from "@solana/web3.js";
3
3
  import { BigNumber } from "ethers";
4
4
  /**
@@ -23,14 +23,6 @@ export interface RelayerRefundLeafSolana {
23
23
  refundAddresses: PublicKey[];
24
24
  }
25
25
  export type RelayerRefundLeafType = RelayerRefundLeaf | RelayerRefundLeafSolana;
26
- /**
27
- * Slow Fill Leaf Interface
28
- */
29
- export interface SlowFillLeaf {
30
- relayData: RelayData;
31
- chainId: BN;
32
- updatedOutputAmount: BN;
33
- }
34
26
  /**
35
27
  * Relay Data Interface
36
28
  */
@@ -84,16 +76,6 @@ export type DepositDataValues = [
84
76
  */
85
77
  export type FillDataValues = [number[], RelayData, BN, PublicKey];
86
78
  export type FillDataParams = [number[], RelayData | null, BN | null, PublicKey | null];
87
- /**
88
- * Request Slow Fill Data Interfaces
89
- */
90
- export type RequestSlowFillDataValues = [number[], RelayData];
91
- export type RequestSlowFillDataParams = [number[], RelayData | null];
92
- /**
93
- * Execute Slow Relay Leaf Data Interfaces
94
- */
95
- export type ExecuteSlowRelayLeafDataValues = [number[], SlowFillLeaf, number, number[][]];
96
- export type ExecuteSlowRelayLeafDataParams = [number[], SlowFillLeaf | null, number | null, number[][] | null];
97
79
  /**
98
80
  * Across+ Message Interface
99
81
  */
@@ -137,30 +119,3 @@ export type FillAccounts = {
137
119
  systemProgram: PublicKey;
138
120
  program: PublicKey;
139
121
  };
140
- /**
141
- * Request Slow Fill Accounts
142
- */
143
- export type RequestSlowFillAccounts = {
144
- signer: PublicKey;
145
- instructionParams: PublicKey;
146
- state: PublicKey;
147
- fillStatus: PublicKey;
148
- systemProgram: PublicKey;
149
- program: PublicKey;
150
- };
151
- /**
152
- * Execute Slow Relay Leaf Accounts
153
- */
154
- export type ExecuteSlowRelayLeafAccounts = {
155
- signer: PublicKey;
156
- instructionParams: PublicKey;
157
- state: PublicKey;
158
- rootBundle: PublicKey;
159
- fillStatus: PublicKey;
160
- mint: PublicKey;
161
- recipientTokenAccount: PublicKey;
162
- vault: PublicKey;
163
- tokenProgram: PublicKey;
164
- systemProgram: PublicKey;
165
- program: PublicKey;
166
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@across-protocol/contracts",
3
- "version": "6.0.0-beta.2",
3
+ "version": "6.0.0-beta.3",
4
4
  "author": "UMA Team",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -33,10 +33,13 @@
33
33
  "clean-fast": "for dir in node_modules dist cache-foundry out zkout; do mv \"${dir}\" \"_${dir}\"; rm -rf \"_${dir}\" &; done",
34
34
  "clean": "rm -rf node_modules dist cache-foundry out zkout",
35
35
  "generate-svm-artifacts": "bash ./scripts/svm/buildHelpers/buildIdl.sh && sh ./scripts/svm/buildHelpers/generateSvmAssets.sh && yarn generate-svm-clients",
36
+ "generate-svm-test-idls": "bash ./scripts/svm/buildHelpers/buildTestIdls.sh",
36
37
  "generate-svm-clients": "yarn ts-node ./scripts/svm/buildHelpers/generateSvmClients.ts && yarn ts-node ./scripts/svm/buildHelpers/renameClientsImports.ts",
37
38
  "build-svm": "bash ./scripts/svm/buildHelpers/buildSvmLocalToolchain.sh",
38
39
  "build-svm-solana-verify": "bash ./scripts/svm/buildHelpers/buildSolanaVerify.sh",
39
40
  "build-ts": "rm -rf ./dist && tsc",
41
+ "typecheck-tests": "tsc -p tsconfig.test.json",
42
+ "test-svm-build-guard": "ts-mocha -p tsconfig.test.json -t 10000 test/svm/Scripts.SbfBuild.ts",
40
43
  "export-idl": "mkdir -p dist/src/svm/assets/idl && cp src/svm/assets/idl/*.json dist/src/svm/assets/idl/",
41
44
  "export-evm-artifacts": "sh scripts/exportEvmArtifacts.sh",
42
45
  "prepublishOnly": "yarn build-ts && yarn export-idl && yarn export-evm-artifacts",
@@ -46,8 +49,12 @@
46
49
  "build-evm-foundry": "forge build",
47
50
  "test-evm": "yarn test-evm-foundry",
48
51
  "test-evm-foundry": "FOUNDRY_PROFILE=local-test forge test",
49
- "test-svm": "IS_TEST=true yarn build-svm && yarn generate-svm-artifacts && anchor test --skip-build",
50
- "test-svm-solana-verify": "IS_TEST=true yarn build-svm-solana-verify && yarn generate-svm-artifacts && anchor test --skip-build",
52
+ "test-svm": "IS_TEST=true yarn build-svm && yarn generate-svm-artifacts && yarn generate-svm-test-idls && anchor test --skip-build --validator legacy",
53
+ "test-svm-production": "IS_TEST=false yarn build-svm-solana-verify && yarn generate-svm-artifacts && NODE_OPTIONS=--no-experimental-strip-types ts-node scripts/svm/testProduction.ts",
54
+ "test-svm-gateway": "ts-node scripts/svm/testRealGateway.ts",
55
+ "bench-svm-cu": "NODE_OPTIONS=--no-experimental-strip-types ts-node scripts/svm/benchmarkCu.ts",
56
+ "test-svm-gateway-vectors": "NODE_OPTIONS=--no-experimental-strip-types ts-mocha -p tsconfig.json -t 10000 test/svm-gateway/PathVectors.ts",
57
+ "test-svm-solana-verify": "IS_TEST=true yarn build-svm-solana-verify && yarn generate-svm-artifacts && yarn generate-svm-test-idls && anchor test --skip-build --validator legacy",
51
58
  "test": "yarn test-evm && yarn test-svm",
52
59
  "test-verified": "yarn test-evm && yarn test-svm-solana-verify",
53
60
  "evm-contract-sizes": "forge build --sizes",
@@ -77,7 +84,8 @@
77
84
  },
78
85
  "dependencies": {
79
86
  "@across-protocol/constants": "^3.1.124",
80
- "@coral-xyz/anchor": "^0.31.1",
87
+ "@anchor-lang/borsh": "1.1.2",
88
+ "@anchor-lang/core": "1.1.2",
81
89
  "@eth-optimism/contracts": "^0.5.40",
82
90
  "@ethersproject/bignumber": "5.7.0",
83
91
  "@ethersproject/bytes": "5.7.0",
@@ -88,7 +96,7 @@
88
96
  "@openzeppelin/contracts-v4": "npm:@openzeppelin/contracts@4.9.6",
89
97
  "@solana-program/address-lookup-table": "0.10.0",
90
98
  "@solana/kit": "^5.4.0",
91
- "@solana/web3.js": "1.98.2",
99
+ "@solana/web3.js": "1.98.4",
92
100
  "bs58": "^6.0.0",
93
101
  "ethers": "5.7.2"
94
102
  },
@@ -98,7 +106,7 @@
98
106
  "@openzeppelin/foundry-upgrades": "^0.4.0",
99
107
  "@safe-global/protocol-kit": "7.0.0",
100
108
  "@solana-program/token": "0.9.0",
101
- "@solana/spl-token": "0.4.14",
109
+ "@solana/spl-token": "0.4.15",
102
110
  "@types/bn.js": "^5.1.0",
103
111
  "@types/chai": "^4.3.1",
104
112
  "@types/mocha": "^9.1.1",
@@ -148,6 +156,9 @@
148
156
  "secp256k1@5.0.0": "5.0.1"
149
157
  },
150
158
  "resolutions": {
159
+ "@anchor-lang/borsh": "1.1.2",
160
+ "@anchor-lang/errors": "1.1.2",
161
+ "@solana/web3.js": "1.98.4",
151
162
  "**/eccrypto/secp256k1": "3.8.1",
152
163
  "**/eth-crypto/secp256k1": "5.0.1",
153
164
  "**/create-hash/sha.js": "2.4.12",
@@ -1,30 +0,0 @@
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/kit';
9
- export declare const MESSAGE_SENT_DISCRIMINATOR: Uint8Array;
10
- export declare function getMessageSentDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
11
- export type MessageSent = {
12
- discriminator: ReadonlyUint8Array;
13
- rentPayer: Address;
14
- createdAt: bigint;
15
- message: ReadonlyUint8Array;
16
- };
17
- export type MessageSentArgs = {
18
- rentPayer: Address;
19
- createdAt: number | bigint;
20
- message: ReadonlyUint8Array;
21
- };
22
- export declare function getMessageSentEncoder(): Encoder<MessageSentArgs>;
23
- export declare function getMessageSentDecoder(): Decoder<MessageSent>;
24
- export declare function getMessageSentCodec(): Codec<MessageSentArgs, MessageSent>;
25
- export declare function decodeMessageSent<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<MessageSent, TAddress>;
26
- export declare function decodeMessageSent<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<MessageSent, TAddress>;
27
- export declare function fetchMessageSent<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<MessageSent, TAddress>>;
28
- export declare function fetchMaybeMessageSent<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<MessageSent, TAddress>>;
29
- export declare function fetchAllMessageSent(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<MessageSent>[]>;
30
- export declare function fetchAllMaybeMessageSent(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<MessageSent>[]>;
@@ -1,66 +0,0 @@
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.MESSAGE_SENT_DISCRIMINATOR = void 0;
11
- exports.getMessageSentDiscriminatorBytes = getMessageSentDiscriminatorBytes;
12
- exports.getMessageSentEncoder = getMessageSentEncoder;
13
- exports.getMessageSentDecoder = getMessageSentDecoder;
14
- exports.getMessageSentCodec = getMessageSentCodec;
15
- exports.decodeMessageSent = decodeMessageSent;
16
- exports.fetchMessageSent = fetchMessageSent;
17
- exports.fetchMaybeMessageSent = fetchMaybeMessageSent;
18
- exports.fetchAllMessageSent = fetchAllMessageSent;
19
- exports.fetchAllMaybeMessageSent = fetchAllMaybeMessageSent;
20
- const kit_1 = require("@solana/kit");
21
- exports.MESSAGE_SENT_DISCRIMINATOR = new Uint8Array([
22
- 131, 100, 133, 56, 166, 225, 151, 60,
23
- ]);
24
- function getMessageSentDiscriminatorBytes() {
25
- return (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.MESSAGE_SENT_DISCRIMINATOR);
26
- }
27
- function getMessageSentEncoder() {
28
- return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
29
- ['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
30
- ['rentPayer', (0, kit_1.getAddressEncoder)()],
31
- ['createdAt', (0, kit_1.getI64Encoder)()],
32
- ['message', (0, kit_1.addEncoderSizePrefix)((0, kit_1.getBytesEncoder)(), (0, kit_1.getU32Encoder)())],
33
- ]), (value) => ({ ...value, discriminator: exports.MESSAGE_SENT_DISCRIMINATOR }));
34
- }
35
- function getMessageSentDecoder() {
36
- return (0, kit_1.getStructDecoder)([
37
- ['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
38
- ['rentPayer', (0, kit_1.getAddressDecoder)()],
39
- ['createdAt', (0, kit_1.getI64Decoder)()],
40
- ['message', (0, kit_1.addDecoderSizePrefix)((0, kit_1.getBytesDecoder)(), (0, kit_1.getU32Decoder)())],
41
- ]);
42
- }
43
- function getMessageSentCodec() {
44
- return (0, kit_1.combineCodec)(getMessageSentEncoder(), getMessageSentDecoder());
45
- }
46
- function decodeMessageSent(encodedAccount) {
47
- return (0, kit_1.decodeAccount)(encodedAccount, getMessageSentDecoder());
48
- }
49
- async function fetchMessageSent(rpc, address, config) {
50
- const maybeAccount = await fetchMaybeMessageSent(rpc, address, config);
51
- (0, kit_1.assertAccountExists)(maybeAccount);
52
- return maybeAccount;
53
- }
54
- async function fetchMaybeMessageSent(rpc, address, config) {
55
- const maybeAccount = await (0, kit_1.fetchEncodedAccount)(rpc, address, config);
56
- return decodeMessageSent(maybeAccount);
57
- }
58
- async function fetchAllMessageSent(rpc, addresses, config) {
59
- const maybeAccounts = await fetchAllMaybeMessageSent(rpc, addresses, config);
60
- (0, kit_1.assertAccountsExist)(maybeAccounts);
61
- return maybeAccounts;
62
- }
63
- async function fetchAllMaybeMessageSent(rpc, addresses, config) {
64
- const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
65
- return maybeAccounts.map((maybeAccount) => decodeMessageSent(maybeAccount));
66
- }
@@ -1,31 +0,0 @@
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/kit';
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<ArrayBuffer>;
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>[]>;
@@ -1,70 +0,0 @@
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 kit_1 = require("@solana/kit");
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, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR);
27
- }
28
- function getExecuteSlowRelayLeafParamsEncoder() {
29
- return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
30
- ['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
31
- ['slowFillLeaf', (0, types_1.getSlowFillEncoder)()],
32
- ['rootBundleId', (0, kit_1.getU32Encoder)()],
33
- ['proof', (0, kit_1.getArrayEncoder)((0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 32))],
34
- ]), (value) => ({
35
- ...value,
36
- discriminator: exports.EXECUTE_SLOW_RELAY_LEAF_PARAMS_DISCRIMINATOR,
37
- }));
38
- }
39
- function getExecuteSlowRelayLeafParamsDecoder() {
40
- return (0, kit_1.getStructDecoder)([
41
- ['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
42
- ['slowFillLeaf', (0, types_1.getSlowFillDecoder)()],
43
- ['rootBundleId', (0, kit_1.getU32Decoder)()],
44
- ['proof', (0, kit_1.getArrayDecoder)((0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 32))],
45
- ]);
46
- }
47
- function getExecuteSlowRelayLeafParamsCodec() {
48
- return (0, kit_1.combineCodec)(getExecuteSlowRelayLeafParamsEncoder(), getExecuteSlowRelayLeafParamsDecoder());
49
- }
50
- function decodeExecuteSlowRelayLeafParams(encodedAccount) {
51
- return (0, kit_1.decodeAccount)(encodedAccount, getExecuteSlowRelayLeafParamsDecoder());
52
- }
53
- async function fetchExecuteSlowRelayLeafParams(rpc, address, config) {
54
- const maybeAccount = await fetchMaybeExecuteSlowRelayLeafParams(rpc, address, config);
55
- (0, kit_1.assertAccountExists)(maybeAccount);
56
- return maybeAccount;
57
- }
58
- async function fetchMaybeExecuteSlowRelayLeafParams(rpc, address, config) {
59
- const maybeAccount = await (0, kit_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, kit_1.assertAccountsExist)(maybeAccounts);
65
- return maybeAccounts;
66
- }
67
- async function fetchAllMaybeExecuteSlowRelayLeafParams(rpc, addresses, config) {
68
- const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
69
- return maybeAccounts.map((maybeAccount) => decodeExecuteSlowRelayLeafParams(maybeAccount));
70
- }
@@ -1,31 +0,0 @@
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/kit';
9
- import { type RelayData, type RelayDataArgs } from '../types';
10
- export declare const FILL_RELAY_PARAMS_DISCRIMINATOR: Uint8Array;
11
- export declare function getFillRelayParamsDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
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>[]>;
@@ -1,67 +0,0 @@
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 kit_1 = require("@solana/kit");
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, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.FILL_RELAY_PARAMS_DISCRIMINATOR);
27
- }
28
- function getFillRelayParamsEncoder() {
29
- return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
30
- ['discriminator', (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8)],
31
- ['relayData', (0, types_1.getRelayDataEncoder)()],
32
- ['repaymentChainId', (0, kit_1.getU64Encoder)()],
33
- ['repaymentAddress', (0, kit_1.getAddressEncoder)()],
34
- ]), (value) => ({ ...value, discriminator: exports.FILL_RELAY_PARAMS_DISCRIMINATOR }));
35
- }
36
- function getFillRelayParamsDecoder() {
37
- return (0, kit_1.getStructDecoder)([
38
- ['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
39
- ['relayData', (0, types_1.getRelayDataDecoder)()],
40
- ['repaymentChainId', (0, kit_1.getU64Decoder)()],
41
- ['repaymentAddress', (0, kit_1.getAddressDecoder)()],
42
- ]);
43
- }
44
- function getFillRelayParamsCodec() {
45
- return (0, kit_1.combineCodec)(getFillRelayParamsEncoder(), getFillRelayParamsDecoder());
46
- }
47
- function decodeFillRelayParams(encodedAccount) {
48
- return (0, kit_1.decodeAccount)(encodedAccount, getFillRelayParamsDecoder());
49
- }
50
- async function fetchFillRelayParams(rpc, address, config) {
51
- const maybeAccount = await fetchMaybeFillRelayParams(rpc, address, config);
52
- (0, kit_1.assertAccountExists)(maybeAccount);
53
- return maybeAccount;
54
- }
55
- async function fetchMaybeFillRelayParams(rpc, address, config) {
56
- const maybeAccount = await (0, kit_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, kit_1.assertAccountsExist)(maybeAccounts);
62
- return maybeAccounts;
63
- }
64
- async function fetchAllMaybeFillRelayParams(rpc, addresses, config) {
65
- const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
66
- return maybeAccounts.map((maybeAccount) => decodeFillRelayParams(maybeAccount));
67
- }
@@ -1,27 +0,0 @@
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/kit';
9
- import { type RelayData, type RelayDataArgs } from '../types';
10
- export declare const REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR: Uint8Array;
11
- export declare function getRequestSlowFillParamsDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
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>[]>;
@@ -1,66 +0,0 @@
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 kit_1 = require("@solana/kit");
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, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(exports.REQUEST_SLOW_FILL_PARAMS_DISCRIMINATOR);
27
- }
28
- function getRequestSlowFillParamsEncoder() {
29
- return (0, kit_1.transformEncoder)((0, kit_1.getStructEncoder)([
30
- ['discriminator', (0, kit_1.fixEncoderSize)((0, kit_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, kit_1.getStructDecoder)([
39
- ['discriminator', (0, kit_1.fixDecoderSize)((0, kit_1.getBytesDecoder)(), 8)],
40
- ['relayData', (0, types_1.getRelayDataDecoder)()],
41
- ]);
42
- }
43
- function getRequestSlowFillParamsCodec() {
44
- return (0, kit_1.combineCodec)(getRequestSlowFillParamsEncoder(), getRequestSlowFillParamsDecoder());
45
- }
46
- function decodeRequestSlowFillParams(encodedAccount) {
47
- return (0, kit_1.decodeAccount)(encodedAccount, getRequestSlowFillParamsDecoder());
48
- }
49
- async function fetchRequestSlowFillParams(rpc, address, config) {
50
- const maybeAccount = await fetchMaybeRequestSlowFillParams(rpc, address, config);
51
- (0, kit_1.assertAccountExists)(maybeAccount);
52
- return maybeAccount;
53
- }
54
- async function fetchMaybeRequestSlowFillParams(rpc, address, config) {
55
- const maybeAccount = await (0, kit_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, kit_1.assertAccountsExist)(maybeAccounts);
61
- return maybeAccounts;
62
- }
63
- async function fetchAllMaybeRequestSlowFillParams(rpc, addresses, config) {
64
- const maybeAccounts = await (0, kit_1.fetchEncodedAccounts)(rpc, addresses, config);
65
- return maybeAccounts.map((maybeAccount) => decodeRequestSlowFillParams(maybeAccount));
66
- }