Skip to content

Commit ab4a674

Browse files
committed
update sign cross-chain order types
1 parent 517f127 commit ab4a674

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@orionprotocol/sdk",
3-
"version": "0.22.0-rc16",
3+
"version": "0.22.0-rc19",
44
"description": "Orion Protocol SDK",
55
"main": "./lib/index.cjs",
66
"module": "./lib/index.js",

src/constants/orderTypes/orderTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const CROSS_CHAIN_ORDER_TYPES = {
2020
Order: ORDER_TYPE,
2121
CrossChainOrder: [
2222
{ name: 'limitOrder', type: 'Order' },
23-
{ name: 'chainId', type: 'uint24' },
23+
{ name: 'targetChainId', type: 'uint24' },
2424
{ name: 'secretHash', type: 'bytes32' },
2525
{ name: 'lockOrderExpiration', type: 'uint64' },
2626
]

src/crypt/hashOrders/hashCrossChainOrder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import type { SupportedChainId, CrossChainOrder } from '../../types';
44
const ORDER_TYPEHASH =
55
'0xb5132db62dfceb466f2f8aee7a039db36a99772e5a9771d28388a5f9baad7c54';
66
const CROSS_CHAIN_ORDER_TYPEHASH =
7-
'0xc4666edeecc42a94cf6b87f39e1ca967792e6d738224365e54d7d06ec632b05c';
7+
'0xb0edab98a08b4f5ce4f349d7cb1622bde999112acf1ac4a30cc9f394bd7809a6';
88

9-
export function getOrderHash(order: CrossChainOrder, chainId: SupportedChainId) {
9+
export function getOrderHash(order: CrossChainOrder, targetChainId: SupportedChainId) {
1010
const abiCoder = ethers.AbiCoder.defaultAbiCoder();
1111

1212
// Generate the orderParamsHash
@@ -48,7 +48,7 @@ export function getOrderHash(order: CrossChainOrder, chainId: SupportedChainId)
4848
[
4949
CROSS_CHAIN_ORDER_TYPEHASH,
5050
limitOrderHash,
51-
Number(chainId),
51+
Number(targetChainId),
5252
order.secretHash,
5353
order.lockOrderExpiration,
5454
]

src/crypt/signCrossChainOrder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type SignCrossChainOrderProps = {
2424
serviceFeeAssetAddress: string
2525
signer: ethers.Signer
2626
chainId: SupportedChainId
27-
targetChainId?: SupportedChainId
27+
targetChainId: SupportedChainId
2828
}
2929

3030
export const signCrossChainOrder = async ({
@@ -76,7 +76,7 @@ export const signCrossChainOrder = async ({
7676

7777
const crossChainOrder = {
7878
limitOrder: order,
79-
chainId: Number(targetChainId),
79+
targetChainId: Number(targetChainId),
8080
secretHash,
8181
lockOrderExpiration
8282
}
@@ -100,7 +100,7 @@ export const signCrossChainOrder = async ({
100100
targetChainId: Number(targetChainId),
101101
lockOrderExpiration
102102
}
103-
const orderHash = getOrderHash(signedOrderWithoutId, chainId);
103+
const orderHash = getOrderHash(signedOrderWithoutId, targetChainId);
104104

105105
const signedCrossChainOrder: SignedCrossChainOrder = {
106106
...signedOrderWithoutId,

0 commit comments

Comments
 (0)