File tree Expand file tree Collapse file tree 4 files changed +1400
-1373
lines changed Expand file tree Collapse file tree 4 files changed +1400
-1373
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pythnetwork/price-pusher" ,
3
- "version" : " 6.6.3 " ,
3
+ "version" : " 6.7.0 " ,
4
4
"description" : " Pyth Price Pusher" ,
5
5
"homepage" : " https://pyth.network" ,
6
6
"main" : " lib/index.js" ,
Original file line number Diff line number Diff line change @@ -52,6 +52,20 @@ export default {
52
52
required : false ,
53
53
default : 5 ,
54
54
} as Options ,
55
+ "gas-limit" : {
56
+ description : "Gas limit for the transaction" ,
57
+ type : "number" ,
58
+ required : false ,
59
+ } as Options ,
60
+ "update-fee-multiplier" : {
61
+ description :
62
+ "Multiplier for the fee to update the price. It is useful in networks " +
63
+ "such as Hedera where setting on-chain getUpdateFee as the transaction value " +
64
+ "won't work. Default to 1" ,
65
+ type : "number" ,
66
+ required : false ,
67
+ default : 1 ,
68
+ } as Options ,
55
69
...options . priceConfigFile ,
56
70
...options . priceServiceEndpoint ,
57
71
...options . mnemonicFile ,
@@ -73,6 +87,8 @@ export default {
73
87
txSpeed,
74
88
overrideGasPriceMultiplier,
75
89
overrideGasPriceMultiplierCap,
90
+ gasLimit,
91
+ updateFeeMultiplier,
76
92
} = argv ;
77
93
78
94
const priceConfigs = readPriceConfigFile ( priceConfigFile ) ;
@@ -119,6 +135,8 @@ export default {
119
135
pythContractFactory ,
120
136
overrideGasPriceMultiplier ,
121
137
overrideGasPriceMultiplierCap ,
138
+ updateFeeMultiplier ,
139
+ gasLimit ,
122
140
gasStation
123
141
) ;
124
142
Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ export class EvmPricePusher implements IPricePusher {
130
130
pythContractFactory : PythContractFactory ,
131
131
private overrideGasPriceMultiplier : number ,
132
132
private overrideGasPriceMultiplierCap : number ,
133
+ private updateFeeMultiplier : number ,
134
+ private gasLimit ?: number ,
133
135
customGasStation ?: CustomGasStation
134
136
) {
135
137
this . customGasStation = customGasStation ;
@@ -168,6 +170,7 @@ export class EvmPricePusher implements IPricePusher {
168
170
updateFee = await this . pythContract . methods
169
171
. getUpdateFee ( priceFeedUpdateData )
170
172
. call ( ) ;
173
+ updateFee = Number ( updateFee ) * ( this . updateFeeMultiplier || 1 ) ;
171
174
console . log ( `Update fee: ${ updateFee } ` ) ;
172
175
} catch ( e : any ) {
173
176
console . error (
@@ -217,7 +220,12 @@ export class EvmPricePusher implements IPricePusher {
217
220
priceIdsWith0x ,
218
221
pubTimesToPush
219
222
)
220
- . send ( { value : updateFee , gasPrice, nonce : txNonce } )
223
+ . send ( {
224
+ value : updateFee ,
225
+ gasPrice,
226
+ nonce : txNonce ,
227
+ gasLimit : this . gasLimit ,
228
+ } )
221
229
. on ( "transactionHash" , ( hash : string ) => {
222
230
console . log ( `Successful. Tx hash: ${ hash } ` ) ;
223
231
} )
You can’t perform that action at this time.
0 commit comments