@across-protocol/sdk 3.3.26 → 3.3.27
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/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +28 -28
- package/dist/cjs/clients/SpokePoolClient.d.ts +0 -4
- package/dist/cjs/clients/SpokePoolClient.js +1 -4
- package/dist/cjs/clients/SpokePoolClient.js.map +1 -1
- package/dist/cjs/constants.d.ts +1 -0
- package/dist/cjs/constants.js +2 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/utils/Multicall.js +2 -0
- package/dist/cjs/utils/Multicall.js.map +1 -1
- package/dist/cjs/utils/SpokeUtils.d.ts +1 -0
- package/dist/cjs/utils/SpokeUtils.js +6 -1
- package/dist/cjs/utils/SpokeUtils.js.map +1 -1
- package/dist/cjs/utils/common.d.ts +0 -51
- package/dist/cjs/utils/common.js +1 -55
- package/dist/cjs/utils/common.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +28 -28
- package/dist/esm/clients/SpokePoolClient.d.ts +0 -19
- package/dist/esm/clients/SpokePoolClient.js +1 -19
- package/dist/esm/clients/SpokePoolClient.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.js +3 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/utils/Multicall.js +2 -0
- package/dist/esm/utils/Multicall.js.map +1 -1
- package/dist/esm/utils/SpokeUtils.d.ts +1 -0
- package/dist/esm/utils/SpokeUtils.js +10 -1
- package/dist/esm/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/utils/common.d.ts +0 -62
- package/dist/esm/utils/common.js +0 -63
- package/dist/esm/utils/common.js.map +1 -1
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +28 -28
- package/dist/types/clients/SpokePoolClient.d.ts +0 -19
- package/dist/types/clients/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/utils/Multicall.d.ts.map +1 -1
- package/dist/types/utils/SpokeUtils.d.ts +1 -0
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
- package/dist/types/utils/common.d.ts +0 -62
- package/dist/types/utils/common.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/clients/BundleDataClient/BundleDataClient.ts +7 -0
- package/src/clients/SpokePoolClient.ts +3 -29
- package/src/constants.ts +4 -0
- package/src/utils/Multicall.ts +2 -0
- package/src/utils/SpokeUtils.ts +11 -1
- package/src/utils/common.ts +0 -101
package/src/utils/common.ts
CHANGED
|
@@ -4,7 +4,6 @@ import assert from "assert";
|
|
|
4
4
|
import Decimal from "decimal.js";
|
|
5
5
|
import { ethers, PopulatedTransaction, providers, VoidSigner } from "ethers";
|
|
6
6
|
import { getGasPriceEstimate } from "../gasPriceOracle";
|
|
7
|
-
import { TypedMessage } from "../interfaces/TypedData";
|
|
8
7
|
import { BigNumber, BigNumberish, BN, formatUnits, parseUnits, toBN } from "./BigNumberUtils";
|
|
9
8
|
import { ConvertDecimals } from "./FormattingUtils";
|
|
10
9
|
import { chainIsOPStack } from "./NetworkUtils";
|
|
@@ -323,106 +322,6 @@ async function getLineaGasFees(chainId: number, transport: Transport | undefined
|
|
|
323
322
|
};
|
|
324
323
|
}
|
|
325
324
|
|
|
326
|
-
export type UpdateDepositDetailsMessageType = {
|
|
327
|
-
UpdateDepositDetails: [
|
|
328
|
-
{
|
|
329
|
-
name: "depositId";
|
|
330
|
-
type: "uint32";
|
|
331
|
-
},
|
|
332
|
-
{ name: "originChainId"; type: "uint256" },
|
|
333
|
-
{ name: "updatedRelayerFeePct"; type: "int64" },
|
|
334
|
-
{ name: "updatedRecipient"; type: "address" },
|
|
335
|
-
{ name: "updatedMessage"; type: "bytes" },
|
|
336
|
-
];
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
export type UpdateV3DepositDetailsMessageType = {
|
|
340
|
-
UpdateDepositDetails: [
|
|
341
|
-
{ name: "depositId"; type: "uint32" },
|
|
342
|
-
{ name: "originChainId"; type: "uint256" },
|
|
343
|
-
{ name: "updatedOutputAmount"; type: "uint256" },
|
|
344
|
-
{ name: "updatedRecipient"; type: "address" },
|
|
345
|
-
{ name: "updatedMessage"; type: "bytes" },
|
|
346
|
-
];
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Utility function to get EIP-712 compliant typed data that can be signed with the JSON-RPC method
|
|
351
|
-
* `eth_signedTypedDataV4` in MetaMask (https://docs.metamask.io/guide/signing-data.html). The resulting signature
|
|
352
|
-
* can then be used to call the method `speedUpDeposit` of a `SpokePool.sol` contract.
|
|
353
|
-
* @param depositId The deposit ID to speed up.
|
|
354
|
-
* @param originChainId The chain ID of the origin chain.
|
|
355
|
-
* @param updatedRelayerFeePct The new relayer fee percentage.
|
|
356
|
-
* @param updatedRecipient The new recipient address.
|
|
357
|
-
* @param updatedMessage The new message that should be provided to the recipient.
|
|
358
|
-
* @return EIP-712 compliant typed data.
|
|
359
|
-
*/
|
|
360
|
-
export function getUpdateDepositTypedData(
|
|
361
|
-
depositId: number,
|
|
362
|
-
originChainId: number,
|
|
363
|
-
updatedRelayerFeePct: BigNumber,
|
|
364
|
-
updatedRecipient: string,
|
|
365
|
-
updatedMessage: string
|
|
366
|
-
): TypedMessage<UpdateDepositDetailsMessageType> {
|
|
367
|
-
return {
|
|
368
|
-
types: {
|
|
369
|
-
UpdateDepositDetails: [
|
|
370
|
-
{ name: "depositId", type: "uint32" },
|
|
371
|
-
{ name: "originChainId", type: "uint256" },
|
|
372
|
-
{ name: "updatedRelayerFeePct", type: "int64" },
|
|
373
|
-
{ name: "updatedRecipient", type: "address" },
|
|
374
|
-
{ name: "updatedMessage", type: "bytes" },
|
|
375
|
-
],
|
|
376
|
-
},
|
|
377
|
-
primaryType: "UpdateDepositDetails",
|
|
378
|
-
domain: {
|
|
379
|
-
name: "ACROSS-V2",
|
|
380
|
-
version: "1.0.0",
|
|
381
|
-
chainId: originChainId,
|
|
382
|
-
},
|
|
383
|
-
message: {
|
|
384
|
-
depositId,
|
|
385
|
-
originChainId,
|
|
386
|
-
updatedRelayerFeePct,
|
|
387
|
-
updatedRecipient,
|
|
388
|
-
updatedMessage,
|
|
389
|
-
},
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
export function getUpdateV3DepositTypedData(
|
|
394
|
-
depositId: number,
|
|
395
|
-
originChainId: number,
|
|
396
|
-
updatedOutputAmount: BigNumber,
|
|
397
|
-
updatedRecipient: string,
|
|
398
|
-
updatedMessage: string
|
|
399
|
-
): TypedMessage<UpdateV3DepositDetailsMessageType> {
|
|
400
|
-
return {
|
|
401
|
-
types: {
|
|
402
|
-
UpdateDepositDetails: [
|
|
403
|
-
{ name: "depositId", type: "uint32" },
|
|
404
|
-
{ name: "originChainId", type: "uint256" },
|
|
405
|
-
{ name: "updatedOutputAmount", type: "uint256" },
|
|
406
|
-
{ name: "updatedRecipient", type: "address" },
|
|
407
|
-
{ name: "updatedMessage", type: "bytes" },
|
|
408
|
-
],
|
|
409
|
-
},
|
|
410
|
-
primaryType: "UpdateDepositDetails",
|
|
411
|
-
domain: {
|
|
412
|
-
name: "ACROSS-V2",
|
|
413
|
-
version: "1.0.0",
|
|
414
|
-
chainId: originChainId,
|
|
415
|
-
},
|
|
416
|
-
message: {
|
|
417
|
-
depositId,
|
|
418
|
-
originChainId,
|
|
419
|
-
updatedOutputAmount,
|
|
420
|
-
updatedRecipient,
|
|
421
|
-
updatedMessage,
|
|
422
|
-
},
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
|
|
426
325
|
export function randomAddress() {
|
|
427
326
|
return ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
|
|
428
327
|
}
|