In your example code at
|
const gasObject = { |
|
maxFee: {value: '100000'}, // use google.protobuf.StringValue |
|
maxPriorityFee: {value: '50000'}, |
|
gasLimit: {value: '21000'} |
|
}; |
|
const evmGas = EVMGas.create(gasObject); |
you create the object with variable names maxFee, maxPriorityFee and gasLimit.
I tried to apply this to my project and for some reason the evmGas was always ignored when I tried to submit this in an API call. Instead, MPCVault API always processed the request with evmGas = null, calculated the fees by itself from current market rates and for the gas limit applied some default of eight million gas units.
There are no warnings or errors coming up, it just seems like the evmGas was ignored in the request.
The solution: looking into the api.proto definitions at
|
message EVMGas { |
|
// max_fee is the maximum fee that the user is willing to pay, denominated in wei. |
|
google.protobuf.StringValue max_fee = 1; |
|
// max_priority_fee is the maximum priority fee that the user is willing to pay for EIP-1559 transactions, denominated in wei. |
|
// leave this field empty if you do not want to use EIP-1559. |
|
google.protobuf.StringValue max_priority_fee = 2; |
|
// gas_limit is the maximum amount of gas that the tx is allowed to consume. |
|
google.protobuf.StringValue gas_limit = 3; |
|
} |
the actual variable names are max_fee, max_priority_fee and gas_limit.
Replacing this in the example code, everything works fine. So I suggest you update your example to match the api.proto definitions. Since there are now warnings whatsoever, this costed me couple of hours trying with many different attempts to call the MPCVault API.
In your example code at
mpcvaultapis/examples/nodejs-create-signing-request/index.js
Lines 26 to 31 in 4580695
you create the object with variable names
maxFee,maxPriorityFeeandgasLimit.I tried to apply this to my project and for some reason the
evmGaswas always ignored when I tried to submit this in an API call. Instead, MPCVault API always processed the request withevmGas = null, calculated the fees by itself from current market rates and for the gas limit applied some default of eight million gas units.There are no warnings or errors coming up, it just seems like the
evmGaswas ignored in the request.The solution: looking into the
api.protodefinitions atmpcvaultapis/mpcvault/platform/v1/api.proto
Lines 213 to 221 in 4580695
the actual variable names are
max_fee,max_priority_feeandgas_limit.Replacing this in the example code, everything works fine. So I suggest you update your example to match the
api.protodefinitions. Since there are now warnings whatsoever, this costed me couple of hours trying with many different attempts to call the MPCVault API.