@across-protocol/contracts 6.0.0-beta.2 → 6.0.0-beta.4
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 +195 -34
- package/contracts/chain-adapters/Solana_Adapter.sol +4 -7
- package/contracts/handlers/HyperliquidDepositHandler.sol +2 -2
- package/contracts/interfaces/SpokePoolPeripheryInterface.sol +16 -4
- package/contracts/libraries/HyperCoreLib.sol +113 -20
- package/contracts/libraries/PeripherySigningLib.sol +56 -0
- package/contracts/periphery/SpokePoolPeriphery.sol +58 -10
- package/dist/broadcast/deployed-addresses.json +19 -0
- package/dist/evm/artifacts/Constants.sol/Constants.json +1 -1
- package/dist/evm/artifacts/DeploymentUtils.sol/DeploymentUtils.json +1 -1
- package/dist/evm/artifacts/DstOFTHandler.sol/DstOFTHandler.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockAddressWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockFinder.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockIdentifierWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockLpTokenFactory.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockOptimisticOracle.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockStore.json +1 -1
- package/dist/evm/artifacts/HyperCoreFlowExecutor.sol/HyperCoreFlowExecutor.json +1 -1
- package/dist/evm/artifacts/HyperCoreLib.sol/HyperCoreLib.json +1 -1
- package/dist/evm/artifacts/HyperliquidDepositHandler.sol/HyperliquidDepositHandler.json +1 -1
- package/dist/evm/artifacts/PeripherySigningLib.sol/PeripherySigningLib.json +1 -1
- package/dist/evm/artifacts/Solana_Adapter.sol/Solana_Adapter.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SwapProxy.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPDstPeriphery.sol/SponsoredCCTPDstPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPSrcPeriphery.sol/SponsoredCCTPSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredOFTSrcPeriphery.sol/SponsoredOFTSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SwapHandler.sol/SwapHandler.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SwapProxy.json +1 -1
- package/dist/src/consts.js +1 -0
- package/dist/src/svm/assets/idl/index.d.ts +5 -7
- package/dist/src/svm/assets/idl/index.js +6 -14
- package/dist/src/svm/assets/idl/sponsored_cctp_src_periphery.json +41 -24
- package/dist/src/svm/assets/idl/svm_spoke.json +1001 -2171
- package/dist/src/svm/assets/index.d.ts +2 -3
- package/dist/src/svm/assets/index.js +0 -1
- package/dist/src/svm/assets/sponsored_cctp_src_periphery.d.ts +41 -24
- package/dist/src/svm/assets/svm_spoke.d.ts +996 -2166
- package/dist/src/svm/assets/token_messenger_minter_v2.d.ts +18 -18
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.d.ts +0 -1
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/index.js +0 -1
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.d.ts +24 -12
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.js +30 -12
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.d.ts +4 -5
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/programs/sponsoredCctpSrcPeriphery.js +4 -8
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.d.ts +1 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/index.js +1 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.d.ts +21 -0
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/types/messageSent.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.d.ts +2 -2
- package/dist/src/svm/clients/SvmSpoke/accounts/fillStatusAccount.js +2 -2
- package/dist/src/svm/clients/SvmSpoke/accounts/index.d.ts +0 -3
- package/dist/src/svm/clients/SvmSpoke/accounts/index.js +0 -3
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +94 -22
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +133 -24
- package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.d.ts +75 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/adapterExecuteAcrossV5.js +144 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.d.ts +16 -8
- package/dist/src/svm/clients/SvmSpoke/instructions/closeFillPda.js +3 -3
- package/dist/src/svm/clients/SvmSpoke/instructions/index.d.ts +2 -7
- package/dist/src/svm/clients/SvmSpoke/instructions/index.js +2 -7
- package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.d.ts +58 -0
- package/dist/src/svm/clients/SvmSpoke/instructions/withdrawV5FillPayer.js +134 -0
- package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.d.ts +29 -47
- package/dist/src/svm/clients/SvmSpoke/programs/svmSpoke.js +29 -61
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.d.ts +25 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositInput.js +33 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.d.ts +18 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositJitParams.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.d.ts +43 -0
- package/dist/src/svm/clients/SvmSpoke/types/acrossDepositParams.js +48 -0
- package/dist/src/svm/clients/SvmSpoke/types/index.d.ts +9 -1
- package/dist/src/svm/clients/SvmSpoke/types/index.js +9 -1
- package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.d.ts +39 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5AdapterInput.js +59 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.d.ts +17 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5DepositModificationRules.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.d.ts +19 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillFloatWithdrawn.js +28 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.d.ts +25 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillInput.js +30 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5FillJit.d.ts +22 -0
- package/dist/src/svm/clients/SvmSpoke/types/{slowFill.js → v5FillJit.js} +11 -11
- package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.d.ts +29 -0
- package/dist/src/svm/clients/SvmSpoke/types/v5InputAmountMode.js +38 -0
- package/dist/src/svm/web3-v1/cctpV2Helpers.d.ts +51 -65
- package/dist/src/svm/web3-v1/cctpV2Helpers.js +1 -1
- package/dist/src/svm/web3-v1/coders.d.ts +1 -1
- package/dist/src/svm/web3-v1/coders.js +4 -4
- package/dist/src/svm/web3-v1/conversionUtils.d.ts +1 -1
- package/dist/src/svm/web3-v1/conversionUtils.js +3 -3
- package/dist/src/svm/web3-v1/helpers.d.ts +1 -114
- package/dist/src/svm/web3-v1/helpers.js +1 -179
- package/dist/src/svm/web3-v1/instructionParamsUtils.d.ts +11 -26
- package/dist/src/svm/web3-v1/instructionParamsUtils.js +5 -90
- package/dist/src/svm/web3-v1/programConnectors.d.ts +1 -1
- package/dist/src/svm/web3-v1/programConnectors.js +2 -2
- package/dist/src/svm/web3-v1/relayHashUtils.d.ts +2 -6
- package/dist/src/svm/web3-v1/relayHashUtils.js +5 -66
- package/dist/src/svm/web3-v1/solanaProgramUtils.d.ts +1 -1
- package/dist/src/svm/web3-v1/solanaProgramUtils.js +7 -7
- package/dist/src/svm/web3-v1/transactionUtils.js +3 -3
- package/dist/src/svm/web3-v2/solanaProgramUtils.d.ts +1 -1
- package/dist/src/svm/web3-v2/solanaProgramUtils.js +4 -4
- package/dist/src/types/svm.d.ts +1 -46
- package/package.json +28 -13
- package/svm/idl/multicall_handler.json +31 -0
- package/svm/idl/sponsored_cctp_src_periphery.json +1982 -0
- package/svm/idl/svm_spoke.json +3930 -0
- package/dist/src/svm/assets/idl/test.json +0 -243
- package/dist/src/svm/assets/test.d.ts +0 -249
- package/dist/src/svm/assets/test.js +0 -2
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.d.ts +0 -30
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/accounts/messageSent.js +0 -66
- package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.d.ts +0 -31
- package/dist/src/svm/clients/SvmSpoke/accounts/executeSlowRelayLeafParams.js +0 -70
- package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.d.ts +0 -31
- package/dist/src/svm/clients/SvmSpoke/accounts/fillRelayParams.js +0 -67
- package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.d.ts +0 -27
- package/dist/src/svm/clients/SvmSpoke/accounts/requestSlowFillParams.js +0 -66
- package/dist/src/svm/clients/SvmSpoke/instructions/deposit.d.ts +0 -131
- package/dist/src/svm/clients/SvmSpoke/instructions/deposit.js +0 -241
- package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.d.ts +0 -127
- package/dist/src/svm/clients/SvmSpoke/instructions/depositNow.js +0 -239
- package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.d.ts +0 -104
- package/dist/src/svm/clients/SvmSpoke/instructions/executeSlowRelayLeaf.js +0 -259
- package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.d.ts +0 -108
- package/dist/src/svm/clients/SvmSpoke/instructions/fillRelay.js +0 -265
- package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.d.ts +0 -39
- package/dist/src/svm/clients/SvmSpoke/instructions/getUnsafeDepositId.js +0 -63
- package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.d.ts +0 -76
- package/dist/src/svm/clients/SvmSpoke/instructions/requestSlowFill.js +0 -187
- package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.d.ts +0 -135
- package/dist/src/svm/clients/SvmSpoke/instructions/unsafeDeposit.js +0 -243
- package/dist/src/svm/clients/SvmSpoke/types/slowFill.d.ts +0 -22
- package/dist/target/types/svm_spoke.d.ts +0 -5106
- package/dist/target/types/svm_spoke.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as anchor from "@
|
|
1
|
+
import * as anchor from "@anchor-lang/core";
|
|
2
2
|
import { Infer } from "superstruct";
|
|
3
3
|
export declare const EVENT_ACCOUNT_WINDOW_SECONDS: number;
|
|
4
4
|
/**
|
|
@@ -84,8 +84,8 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
84
84
|
nonce: string;
|
|
85
85
|
destinationDomain: string;
|
|
86
86
|
destinationCaller: string;
|
|
87
|
-
finalityThresholdExecuted?:
|
|
88
|
-
minFinalityThreshold?:
|
|
87
|
+
finalityThresholdExecuted?: string | undefined;
|
|
88
|
+
minFinalityThreshold?: string | undefined;
|
|
89
89
|
decodedMessageBody?: {
|
|
90
90
|
amount: string;
|
|
91
91
|
burnToken: string;
|
|
@@ -103,13 +103,11 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
103
103
|
sender: import("superstruct").Struct<string, null>;
|
|
104
104
|
recipient: import("superstruct").Struct<string, null>;
|
|
105
105
|
destinationCaller: import("superstruct").Struct<string, null>;
|
|
106
|
-
minFinalityThreshold: import("superstruct").Struct<
|
|
107
|
-
|
|
108
|
-
2000: "2000";
|
|
106
|
+
minFinalityThreshold: import("superstruct").Struct<string | undefined, {
|
|
107
|
+
[x: string]: string;
|
|
109
108
|
}>;
|
|
110
|
-
finalityThresholdExecuted: import("superstruct").Struct<
|
|
111
|
-
|
|
112
|
-
2000: "2000";
|
|
109
|
+
finalityThresholdExecuted: import("superstruct").Struct<string | undefined, {
|
|
110
|
+
[x: string]: string;
|
|
113
111
|
}>;
|
|
114
112
|
messageBody: import("superstruct").Struct<string, null>;
|
|
115
113
|
decodedMessageBody: import("superstruct").Struct<{
|
|
@@ -133,11 +131,11 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
133
131
|
}>;
|
|
134
132
|
}>;
|
|
135
133
|
export declare const AttestationMessage: import("superstruct").Struct<{
|
|
134
|
+
status: string;
|
|
136
135
|
message: string;
|
|
137
|
-
status: "complete" | "pending_confirmations";
|
|
138
136
|
attestation: string;
|
|
139
137
|
eventNonce: string;
|
|
140
|
-
cctpVersion:
|
|
138
|
+
cctpVersion: number;
|
|
141
139
|
decodedMessage?: {
|
|
142
140
|
recipient: string;
|
|
143
141
|
sender: string;
|
|
@@ -146,8 +144,8 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
146
144
|
nonce: string;
|
|
147
145
|
destinationDomain: string;
|
|
148
146
|
destinationCaller: string;
|
|
149
|
-
finalityThresholdExecuted?:
|
|
150
|
-
minFinalityThreshold?:
|
|
147
|
+
finalityThresholdExecuted?: string | undefined;
|
|
148
|
+
minFinalityThreshold?: string | undefined;
|
|
151
149
|
decodedMessageBody?: {
|
|
152
150
|
amount: string;
|
|
153
151
|
burnToken: string;
|
|
@@ -159,7 +157,7 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
159
157
|
hookData?: string | undefined;
|
|
160
158
|
} | null | undefined;
|
|
161
159
|
} | null | undefined;
|
|
162
|
-
delayReason?:
|
|
160
|
+
delayReason?: string | null | undefined;
|
|
163
161
|
}, {
|
|
164
162
|
message: import("superstruct").Struct<string, null>;
|
|
165
163
|
eventNonce: import("superstruct").Struct<string, null>;
|
|
@@ -172,8 +170,8 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
172
170
|
nonce: string;
|
|
173
171
|
destinationDomain: string;
|
|
174
172
|
destinationCaller: string;
|
|
175
|
-
finalityThresholdExecuted?:
|
|
176
|
-
minFinalityThreshold?:
|
|
173
|
+
finalityThresholdExecuted?: string | undefined;
|
|
174
|
+
minFinalityThreshold?: string | undefined;
|
|
177
175
|
decodedMessageBody?: {
|
|
178
176
|
amount: string;
|
|
179
177
|
burnToken: string;
|
|
@@ -191,13 +189,11 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
191
189
|
sender: import("superstruct").Struct<string, null>;
|
|
192
190
|
recipient: import("superstruct").Struct<string, null>;
|
|
193
191
|
destinationCaller: import("superstruct").Struct<string, null>;
|
|
194
|
-
minFinalityThreshold: import("superstruct").Struct<
|
|
195
|
-
|
|
196
|
-
2000: "2000";
|
|
192
|
+
minFinalityThreshold: import("superstruct").Struct<string | undefined, {
|
|
193
|
+
[x: string]: string;
|
|
197
194
|
}>;
|
|
198
|
-
finalityThresholdExecuted: import("superstruct").Struct<
|
|
199
|
-
|
|
200
|
-
2000: "2000";
|
|
195
|
+
finalityThresholdExecuted: import("superstruct").Struct<string | undefined, {
|
|
196
|
+
[x: string]: string;
|
|
201
197
|
}>;
|
|
202
198
|
messageBody: import("superstruct").Struct<string, null>;
|
|
203
199
|
decodedMessageBody: import("superstruct").Struct<{
|
|
@@ -220,27 +216,23 @@ export declare const AttestationMessage: import("superstruct").Struct<{
|
|
|
220
216
|
hookData: import("superstruct").Struct<string | undefined, null>;
|
|
221
217
|
}>;
|
|
222
218
|
}>;
|
|
223
|
-
cctpVersion: import("superstruct").Struct<
|
|
224
|
-
|
|
225
|
-
2: 2;
|
|
219
|
+
cctpVersion: import("superstruct").Struct<number, {
|
|
220
|
+
[x: number]: number;
|
|
226
221
|
}>;
|
|
227
|
-
status: import("superstruct").Struct<
|
|
228
|
-
|
|
229
|
-
pending_confirmations: "pending_confirmations";
|
|
222
|
+
status: import("superstruct").Struct<string, {
|
|
223
|
+
[x: string]: string;
|
|
230
224
|
}>;
|
|
231
|
-
delayReason: import("superstruct").Struct<
|
|
232
|
-
|
|
233
|
-
amount_above_max: "amount_above_max";
|
|
234
|
-
insufficient_allowance_available: "insufficient_allowance_available";
|
|
225
|
+
delayReason: import("superstruct").Struct<string | null | undefined, {
|
|
226
|
+
[x: string]: string;
|
|
235
227
|
}>;
|
|
236
228
|
}>;
|
|
237
229
|
export declare const AttestationResponse: import("superstruct").Struct<{
|
|
238
230
|
messages: {
|
|
231
|
+
status: string;
|
|
239
232
|
message: string;
|
|
240
|
-
status: "complete" | "pending_confirmations";
|
|
241
233
|
attestation: string;
|
|
242
234
|
eventNonce: string;
|
|
243
|
-
cctpVersion:
|
|
235
|
+
cctpVersion: number;
|
|
244
236
|
decodedMessage?: {
|
|
245
237
|
recipient: string;
|
|
246
238
|
sender: string;
|
|
@@ -249,8 +241,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
249
241
|
nonce: string;
|
|
250
242
|
destinationDomain: string;
|
|
251
243
|
destinationCaller: string;
|
|
252
|
-
finalityThresholdExecuted?:
|
|
253
|
-
minFinalityThreshold?:
|
|
244
|
+
finalityThresholdExecuted?: string | undefined;
|
|
245
|
+
minFinalityThreshold?: string | undefined;
|
|
254
246
|
decodedMessageBody?: {
|
|
255
247
|
amount: string;
|
|
256
248
|
burnToken: string;
|
|
@@ -262,15 +254,15 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
262
254
|
hookData?: string | undefined;
|
|
263
255
|
} | null | undefined;
|
|
264
256
|
} | null | undefined;
|
|
265
|
-
delayReason?:
|
|
257
|
+
delayReason?: string | null | undefined;
|
|
266
258
|
}[];
|
|
267
259
|
}, {
|
|
268
260
|
messages: import("superstruct").Struct<{
|
|
261
|
+
status: string;
|
|
269
262
|
message: string;
|
|
270
|
-
status: "complete" | "pending_confirmations";
|
|
271
263
|
attestation: string;
|
|
272
264
|
eventNonce: string;
|
|
273
|
-
cctpVersion:
|
|
265
|
+
cctpVersion: number;
|
|
274
266
|
decodedMessage?: {
|
|
275
267
|
recipient: string;
|
|
276
268
|
sender: string;
|
|
@@ -279,8 +271,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
279
271
|
nonce: string;
|
|
280
272
|
destinationDomain: string;
|
|
281
273
|
destinationCaller: string;
|
|
282
|
-
finalityThresholdExecuted?:
|
|
283
|
-
minFinalityThreshold?:
|
|
274
|
+
finalityThresholdExecuted?: string | undefined;
|
|
275
|
+
minFinalityThreshold?: string | undefined;
|
|
284
276
|
decodedMessageBody?: {
|
|
285
277
|
amount: string;
|
|
286
278
|
burnToken: string;
|
|
@@ -292,13 +284,13 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
292
284
|
hookData?: string | undefined;
|
|
293
285
|
} | null | undefined;
|
|
294
286
|
} | null | undefined;
|
|
295
|
-
delayReason?:
|
|
287
|
+
delayReason?: string | null | undefined;
|
|
296
288
|
}[], import("superstruct").Struct<{
|
|
289
|
+
status: string;
|
|
297
290
|
message: string;
|
|
298
|
-
status: "complete" | "pending_confirmations";
|
|
299
291
|
attestation: string;
|
|
300
292
|
eventNonce: string;
|
|
301
|
-
cctpVersion:
|
|
293
|
+
cctpVersion: number;
|
|
302
294
|
decodedMessage?: {
|
|
303
295
|
recipient: string;
|
|
304
296
|
sender: string;
|
|
@@ -307,8 +299,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
307
299
|
nonce: string;
|
|
308
300
|
destinationDomain: string;
|
|
309
301
|
destinationCaller: string;
|
|
310
|
-
finalityThresholdExecuted?:
|
|
311
|
-
minFinalityThreshold?:
|
|
302
|
+
finalityThresholdExecuted?: string | undefined;
|
|
303
|
+
minFinalityThreshold?: string | undefined;
|
|
312
304
|
decodedMessageBody?: {
|
|
313
305
|
amount: string;
|
|
314
306
|
burnToken: string;
|
|
@@ -320,7 +312,7 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
320
312
|
hookData?: string | undefined;
|
|
321
313
|
} | null | undefined;
|
|
322
314
|
} | null | undefined;
|
|
323
|
-
delayReason?:
|
|
315
|
+
delayReason?: string | null | undefined;
|
|
324
316
|
}, {
|
|
325
317
|
message: import("superstruct").Struct<string, null>;
|
|
326
318
|
eventNonce: import("superstruct").Struct<string, null>;
|
|
@@ -333,8 +325,8 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
333
325
|
nonce: string;
|
|
334
326
|
destinationDomain: string;
|
|
335
327
|
destinationCaller: string;
|
|
336
|
-
finalityThresholdExecuted?:
|
|
337
|
-
minFinalityThreshold?:
|
|
328
|
+
finalityThresholdExecuted?: string | undefined;
|
|
329
|
+
minFinalityThreshold?: string | undefined;
|
|
338
330
|
decodedMessageBody?: {
|
|
339
331
|
amount: string;
|
|
340
332
|
burnToken: string;
|
|
@@ -352,13 +344,11 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
352
344
|
sender: import("superstruct").Struct<string, null>;
|
|
353
345
|
recipient: import("superstruct").Struct<string, null>;
|
|
354
346
|
destinationCaller: import("superstruct").Struct<string, null>;
|
|
355
|
-
minFinalityThreshold: import("superstruct").Struct<
|
|
356
|
-
|
|
357
|
-
2000: "2000";
|
|
347
|
+
minFinalityThreshold: import("superstruct").Struct<string | undefined, {
|
|
348
|
+
[x: string]: string;
|
|
358
349
|
}>;
|
|
359
|
-
finalityThresholdExecuted: import("superstruct").Struct<
|
|
360
|
-
|
|
361
|
-
2000: "2000";
|
|
350
|
+
finalityThresholdExecuted: import("superstruct").Struct<string | undefined, {
|
|
351
|
+
[x: string]: string;
|
|
362
352
|
}>;
|
|
363
353
|
messageBody: import("superstruct").Struct<string, null>;
|
|
364
354
|
decodedMessageBody: import("superstruct").Struct<{
|
|
@@ -381,18 +371,14 @@ export declare const AttestationResponse: import("superstruct").Struct<{
|
|
|
381
371
|
hookData: import("superstruct").Struct<string | undefined, null>;
|
|
382
372
|
}>;
|
|
383
373
|
}>;
|
|
384
|
-
cctpVersion: import("superstruct").Struct<
|
|
385
|
-
|
|
386
|
-
2: 2;
|
|
374
|
+
cctpVersion: import("superstruct").Struct<number, {
|
|
375
|
+
[x: number]: number;
|
|
387
376
|
}>;
|
|
388
|
-
status: import("superstruct").Struct<
|
|
389
|
-
|
|
390
|
-
pending_confirmations: "pending_confirmations";
|
|
377
|
+
status: import("superstruct").Struct<string, {
|
|
378
|
+
[x: string]: string;
|
|
391
379
|
}>;
|
|
392
|
-
delayReason: import("superstruct").Struct<
|
|
393
|
-
|
|
394
|
-
amount_above_max: "amount_above_max";
|
|
395
|
-
insufficient_allowance_available: "insufficient_allowance_available";
|
|
380
|
+
delayReason: import("superstruct").Struct<string | null | undefined, {
|
|
381
|
+
[x: string]: string;
|
|
396
382
|
}>;
|
|
397
383
|
}>>;
|
|
398
384
|
}>;
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.AttestationResponse = exports.AttestationMessage = exports.DecodedMessage = exports.DecodedMessageBody = exports.decodeTokenMessengerV2MessageBody = exports.encodeMessageHeaderV2 = exports.decodeMessageHeaderV2 = exports.decodeMessageSentDataV2 = exports.EVENT_ACCOUNT_WINDOW_SECONDS = void 0;
|
|
27
27
|
exports.getV2BurnAttestation = getV2BurnAttestation;
|
|
28
28
|
exports.getV2Messages = getV2Messages;
|
|
29
|
-
const anchor = __importStar(require("@
|
|
29
|
+
const anchor = __importStar(require("@anchor-lang/core"));
|
|
30
30
|
const superstruct_1 = require("superstruct");
|
|
31
31
|
const ethers_1 = require("ethers");
|
|
32
32
|
const superstruct_2 = require("superstruct");
|
|
@@ -27,15 +27,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.AcrossPlusMessageCoder = exports.MulticallHandlerCoder = exports.LargeAccountsCoder = void 0;
|
|
30
|
-
const
|
|
31
|
-
const idl_1 = require("@
|
|
32
|
-
const borsh = __importStar(require("@
|
|
30
|
+
const core_1 = require("@anchor-lang/core");
|
|
31
|
+
const idl_1 = require("@anchor-lang/core/dist/cjs/coder/borsh/idl");
|
|
32
|
+
const borsh = __importStar(require("@anchor-lang/borsh"));
|
|
33
33
|
const web3_js_1 = require("@solana/web3.js");
|
|
34
34
|
const bs58_1 = __importDefault(require("bs58"));
|
|
35
35
|
/**
|
|
36
36
|
* Extended Anchor accounts coder to handle large account data.
|
|
37
37
|
*/
|
|
38
|
-
class LargeAccountsCoder extends
|
|
38
|
+
class LargeAccountsCoder extends core_1.BorshAccountsCoder {
|
|
39
39
|
// Getter to access the private accountLayouts property from base class.
|
|
40
40
|
getAccountLayouts() {
|
|
41
41
|
// Base class has `Map<A, { discriminator: IdlDiscriminator; layout: Layout }`, but we only use layout here.
|
|
@@ -5,14 +5,14 @@ exports.intToU8Array32 = intToU8Array32;
|
|
|
5
5
|
exports.u8Array32ToInt = u8Array32ToInt;
|
|
6
6
|
exports.u8Array32ToBigNumber = u8Array32ToBigNumber;
|
|
7
7
|
exports.strPublicKey = strPublicKey;
|
|
8
|
-
const
|
|
8
|
+
const core_1 = require("@anchor-lang/core");
|
|
9
9
|
const web3_js_1 = require("@solana/web3.js");
|
|
10
10
|
const ethers_1 = require("ethers");
|
|
11
11
|
/**
|
|
12
12
|
* Converts an integer to a 32-byte Uint8Array.
|
|
13
13
|
*/
|
|
14
14
|
function intToU8Array32(num) {
|
|
15
|
-
const bigIntValue = BigInt(num instanceof
|
|
15
|
+
const bigIntValue = BigInt(num instanceof core_1.BN ? num.toString() : num);
|
|
16
16
|
if (bigIntValue < 0)
|
|
17
17
|
throw new Error("Input must be a non-negative integer or BN");
|
|
18
18
|
const hexString = bigIntValue.toString(16).padStart(64, "0"); // 32 bytes = 64 hex chars
|
|
@@ -70,7 +70,7 @@ exports.publicKeyToEvmAddress = publicKeyToEvmAddress;
|
|
|
70
70
|
* Converts a base58 string to a bytes32 string.
|
|
71
71
|
*/
|
|
72
72
|
const fromBase58ToBytes32 = (input) => {
|
|
73
|
-
const decodedBytes =
|
|
73
|
+
const decodedBytes = core_1.utils.bytes.bs58.decode(input);
|
|
74
74
|
return "0x" + Buffer.from(decodedBytes).toString("hex");
|
|
75
75
|
};
|
|
76
76
|
exports.fromBase58ToBytes32 = fromBase58ToBytes32;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AnchorProvider
|
|
1
|
+
import { AnchorProvider } from "@anchor-lang/core";
|
|
2
2
|
import { BigNumber } from "@ethersproject/bignumber";
|
|
3
|
-
import { PublicKey } from "@solana/web3.js";
|
|
4
3
|
/**
|
|
5
4
|
* Returns the chainId for a given solana cluster.
|
|
6
5
|
*/
|
|
@@ -9,115 +8,3 @@ export declare const getSolanaChainId: (cluster: "devnet" | "mainnet") => BigNum
|
|
|
9
8
|
* Returns true if the provider is on the devnet cluster.
|
|
10
9
|
*/
|
|
11
10
|
export declare const isSolanaDevnet: (provider: AnchorProvider) => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* “Absolute‐deadline” deposit data
|
|
14
|
-
*/
|
|
15
|
-
export declare class DepositSeedData {
|
|
16
|
-
depositor: Uint8Array;
|
|
17
|
-
recipient: Uint8Array;
|
|
18
|
-
inputToken: Uint8Array;
|
|
19
|
-
outputToken: Uint8Array;
|
|
20
|
-
inputAmount: BN;
|
|
21
|
-
outputAmount: number[];
|
|
22
|
-
destinationChainId: BN;
|
|
23
|
-
exclusiveRelayer: Uint8Array;
|
|
24
|
-
quoteTimestamp: BN;
|
|
25
|
-
fillDeadline: BN;
|
|
26
|
-
exclusivityParameter: BN;
|
|
27
|
-
message: Uint8Array;
|
|
28
|
-
constructor(fields: {
|
|
29
|
-
depositor: Uint8Array;
|
|
30
|
-
recipient: Uint8Array;
|
|
31
|
-
inputToken: Uint8Array;
|
|
32
|
-
outputToken: Uint8Array;
|
|
33
|
-
inputAmount: BN;
|
|
34
|
-
outputAmount: number[];
|
|
35
|
-
destinationChainId: BN;
|
|
36
|
-
exclusiveRelayer: Uint8Array;
|
|
37
|
-
quoteTimestamp: BN;
|
|
38
|
-
fillDeadline: BN;
|
|
39
|
-
exclusivityParameter: BN;
|
|
40
|
-
message: Uint8Array;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Hash for the standard `deposit(...)` flow
|
|
45
|
-
*/
|
|
46
|
-
export declare function getDepositSeedHash(depositData: {
|
|
47
|
-
depositor: PublicKey;
|
|
48
|
-
recipient: PublicKey;
|
|
49
|
-
inputToken: PublicKey;
|
|
50
|
-
outputToken: PublicKey;
|
|
51
|
-
inputAmount: BN;
|
|
52
|
-
outputAmount: number[];
|
|
53
|
-
destinationChainId: BN;
|
|
54
|
-
exclusiveRelayer: PublicKey;
|
|
55
|
-
quoteTimestamp: BN;
|
|
56
|
-
fillDeadline: BN;
|
|
57
|
-
exclusivityParameter: BN;
|
|
58
|
-
message: Uint8Array;
|
|
59
|
-
}): Uint8Array;
|
|
60
|
-
/**
|
|
61
|
-
* Returns the delegate PDA for `deposit(...)`
|
|
62
|
-
*/
|
|
63
|
-
export declare function getDepositPda(depositData: Parameters<typeof getDepositSeedHash>[0], programId: PublicKey): PublicKey;
|
|
64
|
-
/**
|
|
65
|
-
* “Offset/now” deposit data
|
|
66
|
-
*/
|
|
67
|
-
export declare class DepositNowSeedData {
|
|
68
|
-
depositor: Uint8Array;
|
|
69
|
-
recipient: Uint8Array;
|
|
70
|
-
inputToken: Uint8Array;
|
|
71
|
-
outputToken: Uint8Array;
|
|
72
|
-
inputAmount: BN;
|
|
73
|
-
outputAmount: number[];
|
|
74
|
-
destinationChainId: BN;
|
|
75
|
-
exclusiveRelayer: Uint8Array;
|
|
76
|
-
fillDeadlineOffset: BN;
|
|
77
|
-
exclusivityPeriod: BN;
|
|
78
|
-
message: Uint8Array;
|
|
79
|
-
constructor(fields: {
|
|
80
|
-
depositor: Uint8Array;
|
|
81
|
-
recipient: Uint8Array;
|
|
82
|
-
inputToken: Uint8Array;
|
|
83
|
-
outputToken: Uint8Array;
|
|
84
|
-
inputAmount: BN;
|
|
85
|
-
outputAmount: number[];
|
|
86
|
-
destinationChainId: BN;
|
|
87
|
-
exclusiveRelayer: Uint8Array;
|
|
88
|
-
fillDeadlineOffset: BN;
|
|
89
|
-
exclusivityPeriod: BN;
|
|
90
|
-
message: Uint8Array;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Hash for the `deposit_now(...)` flow
|
|
95
|
-
*/
|
|
96
|
-
export declare function getDepositNowSeedHash(depositData: {
|
|
97
|
-
depositor: PublicKey;
|
|
98
|
-
recipient: PublicKey;
|
|
99
|
-
inputToken: PublicKey;
|
|
100
|
-
outputToken: PublicKey;
|
|
101
|
-
inputAmount: BN;
|
|
102
|
-
outputAmount: number[];
|
|
103
|
-
destinationChainId: BN;
|
|
104
|
-
exclusiveRelayer: PublicKey;
|
|
105
|
-
fillDeadlineOffset: BN;
|
|
106
|
-
exclusivityPeriod: BN;
|
|
107
|
-
message: Uint8Array;
|
|
108
|
-
}): Uint8Array;
|
|
109
|
-
/**
|
|
110
|
-
* Returns the delegate PDA for `deposit_now(...)`
|
|
111
|
-
*/
|
|
112
|
-
export declare function getDepositNowPda(depositData: Parameters<typeof getDepositNowSeedHash>[0], programId: PublicKey): PublicKey;
|
|
113
|
-
/**
|
|
114
|
-
* Returns the fill delegate seed hash.
|
|
115
|
-
*/
|
|
116
|
-
export declare function getFillRelayDelegateSeedHash(relayHash: Uint8Array, repaymentChainId: BN, repaymentAddress: PublicKey): Uint8Array;
|
|
117
|
-
/**
|
|
118
|
-
* Returns the fill delegate PDA.
|
|
119
|
-
*/
|
|
120
|
-
export declare function getFillRelayDelegatePda(relayHash: Uint8Array, repaymentChainId: BN, repaymentAddress: PublicKey, programId: PublicKey): {
|
|
121
|
-
seedHash: Uint8Array;
|
|
122
|
-
pda: PublicKey;
|
|
123
|
-
};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.getDepositSeedHash = getDepositSeedHash;
|
|
5
|
-
exports.getDepositPda = getDepositPda;
|
|
6
|
-
exports.getDepositNowSeedHash = getDepositNowSeedHash;
|
|
7
|
-
exports.getDepositNowPda = getDepositNowPda;
|
|
8
|
-
exports.getFillRelayDelegateSeedHash = getFillRelayDelegateSeedHash;
|
|
9
|
-
exports.getFillRelayDelegatePda = getFillRelayDelegatePda;
|
|
3
|
+
exports.isSolanaDevnet = exports.getSolanaChainId = void 0;
|
|
10
4
|
const bignumber_1 = require("@ethersproject/bignumber");
|
|
11
5
|
const ethers_1 = require("ethers");
|
|
12
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
13
|
-
const borsh_1 = require("borsh");
|
|
14
|
-
const utils_1 = require("ethers/lib/utils");
|
|
15
6
|
/**
|
|
16
7
|
* Returns the chainId for a given solana cluster.
|
|
17
8
|
*/
|
|
@@ -32,172 +23,3 @@ const isSolanaDevnet = (provider) => {
|
|
|
32
23
|
throw new Error(`Unsupported solanaCluster endpoint: ${solanaRpcEndpoint}`);
|
|
33
24
|
};
|
|
34
25
|
exports.isSolanaDevnet = isSolanaDevnet;
|
|
35
|
-
/**
|
|
36
|
-
* Generic helper: serialize + keccak256 → 32‑byte Uint8Array
|
|
37
|
-
*/
|
|
38
|
-
function deriveSeedHash(schema, seedObj) {
|
|
39
|
-
const serialized = (0, borsh_1.serialize)(schema, seedObj);
|
|
40
|
-
const hashHex = (0, utils_1.keccak256)(serialized);
|
|
41
|
-
return Buffer.from(hashHex.slice(2), "hex");
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* “Absolute‐deadline” deposit data
|
|
45
|
-
*/
|
|
46
|
-
class DepositSeedData {
|
|
47
|
-
constructor(fields) {
|
|
48
|
-
Object.assign(this, fields);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.DepositSeedData = DepositSeedData;
|
|
52
|
-
const depositSeedSchema = new Map([
|
|
53
|
-
[
|
|
54
|
-
DepositSeedData,
|
|
55
|
-
{
|
|
56
|
-
kind: "struct",
|
|
57
|
-
fields: [
|
|
58
|
-
["depositor", [32]],
|
|
59
|
-
["recipient", [32]],
|
|
60
|
-
["inputToken", [32]],
|
|
61
|
-
["outputToken", [32]],
|
|
62
|
-
["inputAmount", "u64"],
|
|
63
|
-
["outputAmount", [32]],
|
|
64
|
-
["destinationChainId", "u64"],
|
|
65
|
-
["exclusiveRelayer", [32]],
|
|
66
|
-
["quoteTimestamp", "u32"],
|
|
67
|
-
["fillDeadline", "u32"],
|
|
68
|
-
["exclusivityParameter", "u32"],
|
|
69
|
-
["message", ["u8"]],
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
]);
|
|
74
|
-
/**
|
|
75
|
-
* Hash for the standard `deposit(...)` flow
|
|
76
|
-
*/
|
|
77
|
-
function getDepositSeedHash(depositData) {
|
|
78
|
-
const ds = new DepositSeedData({
|
|
79
|
-
depositor: depositData.depositor.toBuffer(),
|
|
80
|
-
recipient: depositData.recipient.toBuffer(),
|
|
81
|
-
inputToken: depositData.inputToken.toBuffer(),
|
|
82
|
-
outputToken: depositData.outputToken.toBuffer(),
|
|
83
|
-
inputAmount: depositData.inputAmount,
|
|
84
|
-
outputAmount: depositData.outputAmount,
|
|
85
|
-
destinationChainId: depositData.destinationChainId,
|
|
86
|
-
exclusiveRelayer: depositData.exclusiveRelayer.toBuffer(),
|
|
87
|
-
quoteTimestamp: depositData.quoteTimestamp,
|
|
88
|
-
fillDeadline: depositData.fillDeadline,
|
|
89
|
-
exclusivityParameter: depositData.exclusivityParameter,
|
|
90
|
-
message: depositData.message,
|
|
91
|
-
});
|
|
92
|
-
return deriveSeedHash(depositSeedSchema, ds);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Returns the delegate PDA for `deposit(...)`
|
|
96
|
-
*/
|
|
97
|
-
function getDepositPda(depositData, programId) {
|
|
98
|
-
const seedHash = getDepositSeedHash(depositData);
|
|
99
|
-
const [pda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("delegate"), seedHash], programId);
|
|
100
|
-
return pda;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* “Offset/now” deposit data
|
|
104
|
-
*/
|
|
105
|
-
class DepositNowSeedData {
|
|
106
|
-
constructor(fields) {
|
|
107
|
-
Object.assign(this, fields);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.DepositNowSeedData = DepositNowSeedData;
|
|
111
|
-
const depositNowSeedSchema = new Map([
|
|
112
|
-
[
|
|
113
|
-
DepositNowSeedData,
|
|
114
|
-
{
|
|
115
|
-
kind: "struct",
|
|
116
|
-
fields: [
|
|
117
|
-
["depositor", [32]],
|
|
118
|
-
["recipient", [32]],
|
|
119
|
-
["inputToken", [32]],
|
|
120
|
-
["outputToken", [32]],
|
|
121
|
-
["inputAmount", "u64"],
|
|
122
|
-
["outputAmount", [32]],
|
|
123
|
-
["destinationChainId", "u64"],
|
|
124
|
-
["exclusiveRelayer", [32]],
|
|
125
|
-
["fillDeadlineOffset", "u32"],
|
|
126
|
-
["exclusivityPeriod", "u32"],
|
|
127
|
-
["message", ["u8"]],
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
]);
|
|
132
|
-
/**
|
|
133
|
-
* Hash for the `deposit_now(...)` flow
|
|
134
|
-
*/
|
|
135
|
-
function getDepositNowSeedHash(depositData) {
|
|
136
|
-
const dns = new DepositNowSeedData({
|
|
137
|
-
depositor: depositData.depositor.toBuffer(),
|
|
138
|
-
recipient: depositData.recipient.toBuffer(),
|
|
139
|
-
inputToken: depositData.inputToken.toBuffer(),
|
|
140
|
-
outputToken: depositData.outputToken.toBuffer(),
|
|
141
|
-
inputAmount: depositData.inputAmount,
|
|
142
|
-
outputAmount: depositData.outputAmount,
|
|
143
|
-
destinationChainId: depositData.destinationChainId,
|
|
144
|
-
exclusiveRelayer: depositData.exclusiveRelayer.toBuffer(),
|
|
145
|
-
fillDeadlineOffset: depositData.fillDeadlineOffset,
|
|
146
|
-
exclusivityPeriod: depositData.exclusivityPeriod,
|
|
147
|
-
message: depositData.message,
|
|
148
|
-
});
|
|
149
|
-
return deriveSeedHash(depositNowSeedSchema, dns);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Returns the delegate PDA for `deposit_now(...)`
|
|
153
|
-
*/
|
|
154
|
-
function getDepositNowPda(depositData, programId) {
|
|
155
|
-
const seedHash = getDepositNowSeedHash(depositData);
|
|
156
|
-
const [pda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("delegate"), seedHash], programId);
|
|
157
|
-
return pda;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Fill Delegate Seed Data
|
|
161
|
-
*/
|
|
162
|
-
class FillDelegateSeedData {
|
|
163
|
-
constructor(fields) {
|
|
164
|
-
this.relayHash = fields.relayHash;
|
|
165
|
-
this.repaymentChainId = fields.repaymentChainId;
|
|
166
|
-
this.repaymentAddress = fields.repaymentAddress;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Borsh schema for FillDelegateSeedData
|
|
171
|
-
*/
|
|
172
|
-
const fillDelegateSeedSchema = new Map([
|
|
173
|
-
[
|
|
174
|
-
FillDelegateSeedData,
|
|
175
|
-
{
|
|
176
|
-
kind: "struct",
|
|
177
|
-
fields: [
|
|
178
|
-
["relayHash", [32]],
|
|
179
|
-
["repaymentChainId", "u64"],
|
|
180
|
-
["repaymentAddress", [32]],
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
]);
|
|
185
|
-
/**
|
|
186
|
-
* Returns the fill delegate seed hash.
|
|
187
|
-
*/
|
|
188
|
-
function getFillRelayDelegateSeedHash(relayHash, repaymentChainId, repaymentAddress) {
|
|
189
|
-
const ds = new FillDelegateSeedData({
|
|
190
|
-
relayHash,
|
|
191
|
-
repaymentChainId,
|
|
192
|
-
repaymentAddress: repaymentAddress.toBuffer(),
|
|
193
|
-
});
|
|
194
|
-
return deriveSeedHash(fillDelegateSeedSchema, ds);
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Returns the fill delegate PDA.
|
|
198
|
-
*/
|
|
199
|
-
function getFillRelayDelegatePda(relayHash, repaymentChainId, repaymentAddress, programId) {
|
|
200
|
-
const seedHash = getFillRelayDelegateSeedHash(relayHash, repaymentChainId, repaymentAddress);
|
|
201
|
-
const [pda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("delegate"), seedHash], programId);
|
|
202
|
-
return { seedHash, pda };
|
|
203
|
-
}
|