UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

2 lines (1 loc) 913 B
import{BigNumber as e}from"@ethersproject/bignumber";const i=i=>e.from(i);function t(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)}function r(e){let t={};return void 0!==e.to&&(t.to=e.to),void 0!==e.data&&(t.data=e.data),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.type&&(t.type=e.type),void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.nonce&&(t.nonce=i(e.nonce).toNumber()),void 0!==e.gasLimit&&(t.gasLimit=i(e.gasLimit)),void 0!==e.gasPrice&&(t.gasPrice=i(e.gasPrice)),void 0!==e.value&&(t.value=i(e.value)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=i(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=i(e.maxPriorityFeePerGas)),t}export{i as QuantityToBigNumber,t as convertBigNumberish,r as toEthersUnsignedTransaction};