@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.
- package/README.md +138 -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/sponsored_cctp_src_periphery.json +41 -24
- package/dist/src/svm/assets/idl/svm_spoke.json +1001 -2171
- 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 +83 -97
- 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 +17 -6
- 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
|
/**
|
|
@@ -58,8 +58,8 @@ export declare const encodeMessageHeaderV2: (header: MessageHeaderV2) => Buffer;
|
|
|
58
58
|
*/
|
|
59
59
|
export declare const decodeTokenMessengerV2MessageBody: (data: Buffer) => TokenMessengerV2MessageBody;
|
|
60
60
|
export declare const DecodedMessageBody: import("superstruct").Struct<{
|
|
61
|
-
amount: string;
|
|
62
61
|
burnToken: string;
|
|
62
|
+
amount: string;
|
|
63
63
|
mintRecipient: string;
|
|
64
64
|
messageSender: string;
|
|
65
65
|
feeExecuted?: string | undefined;
|
|
@@ -77,18 +77,18 @@ export declare const DecodedMessageBody: import("superstruct").Struct<{
|
|
|
77
77
|
hookData: import("superstruct").Struct<string | undefined, null>;
|
|
78
78
|
}>;
|
|
79
79
|
export declare const DecodedMessage: import("superstruct").Struct<{
|
|
80
|
-
recipient: string;
|
|
81
|
-
sender: string;
|
|
82
|
-
messageBody: string;
|
|
83
80
|
sourceDomain: string;
|
|
84
81
|
nonce: string;
|
|
82
|
+
sender: string;
|
|
83
|
+
messageBody: string;
|
|
85
84
|
destinationDomain: string;
|
|
85
|
+
recipient: string;
|
|
86
86
|
destinationCaller: string;
|
|
87
|
-
finalityThresholdExecuted?:
|
|
88
|
-
minFinalityThreshold?:
|
|
87
|
+
finalityThresholdExecuted?: string | undefined;
|
|
88
|
+
minFinalityThreshold?: string | undefined;
|
|
89
89
|
decodedMessageBody?: {
|
|
90
|
-
amount: string;
|
|
91
90
|
burnToken: string;
|
|
91
|
+
amount: string;
|
|
92
92
|
mintRecipient: string;
|
|
93
93
|
messageSender: string;
|
|
94
94
|
feeExecuted?: string | undefined;
|
|
@@ -103,18 +103,16 @@ 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<{
|
|
116
|
-
amount: string;
|
|
117
114
|
burnToken: string;
|
|
115
|
+
amount: string;
|
|
118
116
|
mintRecipient: string;
|
|
119
117
|
messageSender: string;
|
|
120
118
|
feeExecuted?: string | undefined;
|
|
@@ -134,23 +132,23 @@ export declare const DecodedMessage: import("superstruct").Struct<{
|
|
|
134
132
|
}>;
|
|
135
133
|
export declare const AttestationMessage: import("superstruct").Struct<{
|
|
136
134
|
message: string;
|
|
137
|
-
status: "complete" | "pending_confirmations";
|
|
138
135
|
attestation: string;
|
|
136
|
+
status: string;
|
|
139
137
|
eventNonce: string;
|
|
140
|
-
cctpVersion:
|
|
138
|
+
cctpVersion: number;
|
|
141
139
|
decodedMessage?: {
|
|
142
|
-
recipient: string;
|
|
143
|
-
sender: string;
|
|
144
|
-
messageBody: string;
|
|
145
140
|
sourceDomain: string;
|
|
146
141
|
nonce: string;
|
|
142
|
+
sender: string;
|
|
143
|
+
messageBody: string;
|
|
147
144
|
destinationDomain: string;
|
|
145
|
+
recipient: string;
|
|
148
146
|
destinationCaller: string;
|
|
149
|
-
finalityThresholdExecuted?:
|
|
150
|
-
minFinalityThreshold?:
|
|
147
|
+
finalityThresholdExecuted?: string | undefined;
|
|
148
|
+
minFinalityThreshold?: string | undefined;
|
|
151
149
|
decodedMessageBody?: {
|
|
152
|
-
amount: string;
|
|
153
150
|
burnToken: string;
|
|
151
|
+
amount: string;
|
|
154
152
|
mintRecipient: string;
|
|
155
153
|
messageSender: string;
|
|
156
154
|
feeExecuted?: string | undefined;
|
|
@@ -159,24 +157,24 @@ 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>;
|
|
166
164
|
attestation: import("superstruct").Struct<string, null>;
|
|
167
165
|
decodedMessage: import("superstruct").Struct<{
|
|
168
|
-
recipient: string;
|
|
169
|
-
sender: string;
|
|
170
|
-
messageBody: string;
|
|
171
166
|
sourceDomain: string;
|
|
172
167
|
nonce: string;
|
|
168
|
+
sender: string;
|
|
169
|
+
messageBody: string;
|
|
173
170
|
destinationDomain: string;
|
|
171
|
+
recipient: string;
|
|
174
172
|
destinationCaller: string;
|
|
175
|
-
finalityThresholdExecuted?:
|
|
176
|
-
minFinalityThreshold?:
|
|
173
|
+
finalityThresholdExecuted?: string | undefined;
|
|
174
|
+
minFinalityThreshold?: string | undefined;
|
|
177
175
|
decodedMessageBody?: {
|
|
178
|
-
amount: string;
|
|
179
176
|
burnToken: string;
|
|
177
|
+
amount: string;
|
|
180
178
|
mintRecipient: string;
|
|
181
179
|
messageSender: string;
|
|
182
180
|
feeExecuted?: string | undefined;
|
|
@@ -191,18 +189,16 @@ 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<{
|
|
204
|
-
amount: string;
|
|
205
200
|
burnToken: string;
|
|
201
|
+
amount: string;
|
|
206
202
|
mintRecipient: string;
|
|
207
203
|
messageSender: string;
|
|
208
204
|
feeExecuted?: string | undefined;
|
|
@@ -220,40 +216,36 @@ 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: {
|
|
239
231
|
message: string;
|
|
240
|
-
status: "complete" | "pending_confirmations";
|
|
241
232
|
attestation: string;
|
|
233
|
+
status: string;
|
|
242
234
|
eventNonce: string;
|
|
243
|
-
cctpVersion:
|
|
235
|
+
cctpVersion: number;
|
|
244
236
|
decodedMessage?: {
|
|
245
|
-
recipient: string;
|
|
246
|
-
sender: string;
|
|
247
|
-
messageBody: string;
|
|
248
237
|
sourceDomain: string;
|
|
249
238
|
nonce: string;
|
|
239
|
+
sender: string;
|
|
240
|
+
messageBody: string;
|
|
250
241
|
destinationDomain: string;
|
|
242
|
+
recipient: string;
|
|
251
243
|
destinationCaller: string;
|
|
252
|
-
finalityThresholdExecuted?:
|
|
253
|
-
minFinalityThreshold?:
|
|
244
|
+
finalityThresholdExecuted?: string | undefined;
|
|
245
|
+
minFinalityThreshold?: string | undefined;
|
|
254
246
|
decodedMessageBody?: {
|
|
255
|
-
amount: string;
|
|
256
247
|
burnToken: string;
|
|
248
|
+
amount: string;
|
|
257
249
|
mintRecipient: string;
|
|
258
250
|
messageSender: string;
|
|
259
251
|
feeExecuted?: string | undefined;
|
|
@@ -262,28 +254,28 @@ 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<{
|
|
269
261
|
message: string;
|
|
270
|
-
status: "complete" | "pending_confirmations";
|
|
271
262
|
attestation: string;
|
|
263
|
+
status: string;
|
|
272
264
|
eventNonce: string;
|
|
273
|
-
cctpVersion:
|
|
265
|
+
cctpVersion: number;
|
|
274
266
|
decodedMessage?: {
|
|
275
|
-
recipient: string;
|
|
276
|
-
sender: string;
|
|
277
|
-
messageBody: string;
|
|
278
267
|
sourceDomain: string;
|
|
279
268
|
nonce: string;
|
|
269
|
+
sender: string;
|
|
270
|
+
messageBody: string;
|
|
280
271
|
destinationDomain: string;
|
|
272
|
+
recipient: string;
|
|
281
273
|
destinationCaller: string;
|
|
282
|
-
finalityThresholdExecuted?:
|
|
283
|
-
minFinalityThreshold?:
|
|
274
|
+
finalityThresholdExecuted?: string | undefined;
|
|
275
|
+
minFinalityThreshold?: string | undefined;
|
|
284
276
|
decodedMessageBody?: {
|
|
285
|
-
amount: string;
|
|
286
277
|
burnToken: string;
|
|
278
|
+
amount: string;
|
|
287
279
|
mintRecipient: string;
|
|
288
280
|
messageSender: string;
|
|
289
281
|
feeExecuted?: string | undefined;
|
|
@@ -292,26 +284,26 @@ 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<{
|
|
297
289
|
message: string;
|
|
298
|
-
status: "complete" | "pending_confirmations";
|
|
299
290
|
attestation: string;
|
|
291
|
+
status: string;
|
|
300
292
|
eventNonce: string;
|
|
301
|
-
cctpVersion:
|
|
293
|
+
cctpVersion: number;
|
|
302
294
|
decodedMessage?: {
|
|
303
|
-
recipient: string;
|
|
304
|
-
sender: string;
|
|
305
|
-
messageBody: string;
|
|
306
295
|
sourceDomain: string;
|
|
307
296
|
nonce: string;
|
|
297
|
+
sender: string;
|
|
298
|
+
messageBody: string;
|
|
308
299
|
destinationDomain: string;
|
|
300
|
+
recipient: string;
|
|
309
301
|
destinationCaller: string;
|
|
310
|
-
finalityThresholdExecuted?:
|
|
311
|
-
minFinalityThreshold?:
|
|
302
|
+
finalityThresholdExecuted?: string | undefined;
|
|
303
|
+
minFinalityThreshold?: string | undefined;
|
|
312
304
|
decodedMessageBody?: {
|
|
313
|
-
amount: string;
|
|
314
305
|
burnToken: string;
|
|
306
|
+
amount: string;
|
|
315
307
|
mintRecipient: string;
|
|
316
308
|
messageSender: string;
|
|
317
309
|
feeExecuted?: string | undefined;
|
|
@@ -320,24 +312,24 @@ 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>;
|
|
327
319
|
attestation: import("superstruct").Struct<string, null>;
|
|
328
320
|
decodedMessage: import("superstruct").Struct<{
|
|
329
|
-
recipient: string;
|
|
330
|
-
sender: string;
|
|
331
|
-
messageBody: string;
|
|
332
321
|
sourceDomain: string;
|
|
333
322
|
nonce: string;
|
|
323
|
+
sender: string;
|
|
324
|
+
messageBody: string;
|
|
334
325
|
destinationDomain: string;
|
|
326
|
+
recipient: string;
|
|
335
327
|
destinationCaller: string;
|
|
336
|
-
finalityThresholdExecuted?:
|
|
337
|
-
minFinalityThreshold?:
|
|
328
|
+
finalityThresholdExecuted?: string | undefined;
|
|
329
|
+
minFinalityThreshold?: string | undefined;
|
|
338
330
|
decodedMessageBody?: {
|
|
339
|
-
amount: string;
|
|
340
331
|
burnToken: string;
|
|
332
|
+
amount: string;
|
|
341
333
|
mintRecipient: string;
|
|
342
334
|
messageSender: string;
|
|
343
335
|
feeExecuted?: string | undefined;
|
|
@@ -352,18 +344,16 @@ 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<{
|
|
365
|
-
amount: string;
|
|
366
355
|
burnToken: string;
|
|
356
|
+
amount: string;
|
|
367
357
|
mintRecipient: string;
|
|
368
358
|
messageSender: string;
|
|
369
359
|
feeExecuted?: string | undefined;
|
|
@@ -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
|
-
};
|