@waves/waves-transactions
Advanced tools
Comparing version 3.12.1 to 3.12.2
@@ -473,3 +473,6 @@ /** | ||
}; | ||
payment?: IInvokeScriptPayment[]; | ||
payment?: { | ||
assetId?: string | null; | ||
amount: number; | ||
}[]; | ||
} |
@@ -21,5 +21,5 @@ "use strict"; | ||
call: paramsOrTx.call && Object.assign({ args: [] }, paramsOrTx.call), | ||
payment: paramsOrTx.payment || [], | ||
payment: mapPayment(paramsOrTx.payment), | ||
fee: generic_1.fee(paramsOrTx, 500000), | ||
feeAssetId: paramsOrTx.feeAssetId, | ||
feeAssetId: paramsOrTx.feeAssetId === 'WAVES' ? null : paramsOrTx.feeAssetId, | ||
timestamp: paramsOrTx.timestamp || Date.now(), | ||
@@ -36,2 +36,5 @@ chainId: generic_1.networkByte(paramsOrTx.chainId, 87), | ||
exports.invokeScript = invokeScript; | ||
const mapPayment = (payments) => payments == null | ||
? [] | ||
: payments.map(pmt => (Object.assign({}, pmt, { assetId: pmt.assetId === 'WAVES' ? null : pmt.assetId }))); | ||
//# sourceMappingURL=invoke-script.js.map |
{ | ||
"name": "@waves/waves-transactions", | ||
"version": "3.12.1", | ||
"version": "3.12.2", | ||
"description": "Build and sign(multi-sign) transactions for Waves blockchain.", | ||
@@ -40,5 +40,2 @@ "keywords": [ | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"typescript": "^3.2.2" | ||
}, | ||
"devDependencies": { | ||
@@ -63,3 +60,3 @@ "@types/axios": "^0.14.0", | ||
"typedoc-plugin-external-module-name": "^2.1.0", | ||
"typescript": "^3.2.2", | ||
"typescript": "^3.5.2", | ||
"typescript-json-schema": "^0.33.0", | ||
@@ -66,0 +63,0 @@ "webpack": "^4.30.0", |
@@ -553,4 +553,7 @@ /** | ||
}, | ||
payment?: IInvokeScriptPayment[] | ||
payment?: { | ||
assetId?: string | null | ||
amount: number | ||
}[] | ||
} | ||
@@ -9,3 +9,3 @@ /** | ||
IInvokeScriptParams, | ||
IInvokeScriptTransaction | ||
IInvokeScriptTransaction, IInvokeScriptPayment | ||
} from '../transactions' | ||
@@ -33,5 +33,5 @@ import { signBytes, blake2b, base58Encode, } from '@waves/waves-crypto' | ||
call: paramsOrTx.call && {args: [], ...paramsOrTx.call}, | ||
payment: paramsOrTx.payment || [], | ||
payment: mapPayment(paramsOrTx.payment), | ||
fee: fee(paramsOrTx, 500000), | ||
feeAssetId: paramsOrTx.feeAssetId, | ||
feeAssetId: paramsOrTx.feeAssetId === 'WAVES' ? null : paramsOrTx.feeAssetId, | ||
timestamp: paramsOrTx.timestamp || Date.now(), | ||
@@ -49,2 +49,6 @@ chainId: networkByte(paramsOrTx.chainId, 87), | ||
return tx | ||
} | ||
} | ||
const mapPayment = (payments?: IInvokeScriptPayment[]): IInvokeScriptPayment[] => payments == null | ||
? [] | ||
: payments.map(pmt => ({...pmt, assetId: pmt.assetId === 'WAVES' ? null : pmt.assetId})) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
763401
3
5953