@@ -22,11 +22,11 @@ export async function signQuote(quote: Quote, privateKey: `0x${string}`) {
22
22
}
23
23
24
24
export function getTotalGasLimitAndMsgValue (
25
- relayInstructionsHex : `0x${string } `
25
+ relayInstructionsHex : `0x${string } `,
26
26
) {
27
27
const relayInstructions = deserialize (
28
28
relayInstructionsLayout ,
29
- fromHex ( relayInstructionsHex , "bytes" )
29
+ fromHex ( relayInstructionsHex , "bytes" ) ,
30
30
) ;
31
31
32
32
return totalGasLimitAndMsgValue ( relayInstructions ) ;
@@ -60,44 +60,44 @@ export function estimateQuote(
60
60
msgValue : bigint ,
61
61
dstGasPriceDecimals : number ,
62
62
srcTokenDecimals : number ,
63
- dstNativeDecimals : number
63
+ dstNativeDecimals : number ,
64
64
) : bigint {
65
65
const r = 18 ;
66
66
const srcChainValueForBaseFee = ScaledMath . normalize (
67
67
quote . baseFee ,
68
68
SIGNED_QUOTE_DECIMALS ,
69
- srcTokenDecimals
69
+ srcTokenDecimals ,
70
70
) ;
71
71
72
72
const nSrcPrice = ScaledMath . normalize (
73
73
quote . srcPrice ,
74
74
SIGNED_QUOTE_DECIMALS ,
75
- r
75
+ r ,
76
76
) ;
77
77
const nDstPrice = ScaledMath . normalize (
78
78
quote . dstPrice ,
79
79
SIGNED_QUOTE_DECIMALS ,
80
- r
80
+ r ,
81
81
) ;
82
82
const scaledConversion = ScaledMath . div ( nDstPrice , nSrcPrice , r ) ;
83
83
84
84
const nGasLimitCost = ScaledMath . normalize (
85
85
gasLimit * quote . dstGasPrice ,
86
86
dstGasPriceDecimals ,
87
- r
87
+ r ,
88
88
) ;
89
89
90
90
const srcChainValueForGasLimit = ScaledMath . normalize (
91
91
ScaledMath . mul ( nGasLimitCost , scaledConversion , r ) ,
92
92
r ,
93
- srcTokenDecimals
93
+ srcTokenDecimals ,
94
94
) ;
95
95
96
96
const nMsgValue = ScaledMath . normalize ( msgValue , dstNativeDecimals , r ) ;
97
97
const srcChainValueForMsgValue = ScaledMath . normalize (
98
98
ScaledMath . mul ( nMsgValue , scaledConversion , r ) ,
99
99
r ,
100
- srcTokenDecimals
100
+ srcTokenDecimals ,
101
101
) ;
102
102
return (
103
103
srcChainValueForBaseFee +
0 commit comments