Skip to content

Commit

Permalink
fix(fusion-order): accept chainId for getOrderHash method (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk authored Mar 20, 2024
1 parent 4db61a7 commit 8c3951f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@1inch/byte-utils": "2.2.0",
"@1inch/limit-order-sdk": "4.2.0",
"@1inch/limit-order-sdk": "4.5.0",
"@metamask/eth-sig-util": "^5.0.2",
"bn.js": "^5.2.1",
"ethers": "6.11.0",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/fusion-order/fusion-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ export class FusionOrder {
return this.inner.build()
}

public getOrderHash(domain = getLimitOrderV4Domain(1)): string {
return this.inner.getOrderHash(domain)
public getOrderHash(chainId: number): string {
return this.inner.getOrderHash(chainId)
}

public getTypedData(domain = getLimitOrderV4Domain(1)): EIP712TypedData {
Expand Down
5 changes: 2 additions & 3 deletions src/sdk/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ export class FusionSDK {
allowMultipleFills: params.allowMultipleFills
})

const domain = getLimitOrderV4Domain(this.config.network)
const hash = order.getOrderHash(domain)
const hash = order.getOrderHash(this.config.network)

return {order, hash, quoteId: quote.quoteId}
}
Expand Down Expand Up @@ -158,7 +157,7 @@ export class FusionSDK {
order: orderStruct,
signature,
quoteId,
orderHash: order.getOrderHash(domain)
orderHash: order.getOrderHash(this.config.network)
}
}

Expand Down

0 comments on commit 8c3951f

Please sign in to comment.