@celo/utils
Advanced tools
@@ -60,10 +60,5 @@ export declare const DAPPKIT_BASE_HOST = "celo://wallet/dappkit"; | ||
type: DappKitRequestTypes.SIGN_TX; | ||
txData: string; | ||
estimatedGas: number; | ||
from: string; | ||
to: string; | ||
nonce: number; | ||
gasCurrencyAddress: string; | ||
txs: TxToSignParam[]; | ||
} | ||
export declare const SignTxRequest: (txData: string, estimatedGas: number, from: string, to: string, nonce: number, gasCurrencyAddress: string, meta: DappKitRequestMeta) => SignTxRequest; | ||
export declare const SignTxRequest: (txs: TxToSignParam[], meta: DappKitRequestMeta) => SignTxRequest; | ||
export declare type DappKitRequest = AccountAuthRequest | SignTxRequest; | ||
@@ -70,0 +65,0 @@ export declare function serializeDappKitRequestDeeplink(request: DappKitRequest): string; |
@@ -58,8 +58,3 @@ "use strict"; | ||
exports.produceResponseDeeplink = produceResponseDeeplink; | ||
exports.SignTxRequest = function (txData, estimatedGas, from, to, nonce, gasCurrencyAddress, meta) { return (__assign({ type: DappKitRequestTypes.SIGN_TX, txData: txData, | ||
estimatedGas: estimatedGas, | ||
from: from, | ||
to: to, | ||
nonce: nonce, | ||
gasCurrencyAddress: gasCurrencyAddress }, meta)); }; | ||
exports.SignTxRequest = function (txs, meta) { return (__assign({ type: DappKitRequestTypes.SIGN_TX, txs: txs }, meta)); }; | ||
function serializeDappKitRequestDeeplink(request) { | ||
@@ -74,3 +69,3 @@ var params = { | ||
case DappKitRequestTypes.SIGN_TX: | ||
params = __assign({}, params, { txData: request.txData, estimatedGas: request.estimatedGas, from: request.from, to: request.to, nonce: request.nonce, gasCurrencyAddress: request.gasCurrencyAddress }); | ||
params = __assign({}, params, { txs: Buffer.from(JSON.stringify(request.txs), 'utf8').toString('base64') }); | ||
default: | ||
@@ -150,13 +145,3 @@ break; | ||
// @ts-ignore | ||
txData: rawParams.query.txData, | ||
// @ts-ignore | ||
estimatedGas: parseInt(rawParams.query.estimatedGas, 10), | ||
// @ts-ignore | ||
from: rawParams.query.from, | ||
// @ts-ignore | ||
to: rawParams.query.to, | ||
// @ts-ignore | ||
nonce: parseInt(rawParams.query.nonce, 10), | ||
// @ts-ignore | ||
gasCurrencyAddress: rawParams.query.gasCurrency }, requestMeta); | ||
txs: JSON.parse(Buffer.from(rawParams.query.txs, 'base64').toString('utf8')) }, requestMeta); | ||
default: | ||
@@ -163,0 +148,0 @@ throw new Error('Invalid Deeplink: does not match defined requests'); |
{ | ||
"name": "@celo/utils", | ||
"version": "0.0.5-dappkit4", | ||
"version": "0.0.5-dappkit5", | ||
"description": "Celo common utils", | ||
@@ -5,0 +5,0 @@ "author": "Celo", |
376570
-0.23%2048
-0.97%