@omisego/omg-js-childchain
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@omisego/omg-js-childchain", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Module to interact with OMG ChildChain", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@omisego/omg-js-util": "^1.0.0", | ||
"@omisego/omg-js-util": "^1.1.0", | ||
"debug": "^4.0.1", | ||
@@ -35,3 +35,3 @@ "json-bigint": "^0.3.0", | ||
}, | ||
"gitHead": "05a32e8de40322603167499e80453596038370d2" | ||
"gitHead": "09e36e667d11af23eb8b449a0a54f71b428340dc" | ||
} |
@@ -126,3 +126,3 @@ /* | ||
/** | ||
* Submit a signed transaction to the childchain | ||
* Submit a signed transaction to the watcher | ||
* | ||
@@ -135,3 +135,3 @@ * @method submitTransaction | ||
// validateTxBody(transactionBody) | ||
return rpcApi.post(`${this.childChainUrl}/transaction.submit`, { | ||
return rpcApi.post(`${this.watcherUrl}/transaction.submit`, { | ||
transaction: transaction.startsWith('0x') ? transaction : `0x${transaction}` | ||
@@ -152,3 +152,3 @@ }) | ||
*/ | ||
async sendTransaction (fromAddress, fromUtxos, fromPrivateKeys, toAddress, toAmount) { | ||
async sendTransaction (fromAddress, fromUtxos, fromPrivateKeys, toAddress, toAmount, currency) { | ||
validateAddress(fromAddress) | ||
@@ -159,3 +159,3 @@ validateAddress(toAddress) | ||
// create the transaction body | ||
const txBody = transaction.createTransactionBody(fromAddress, fromUtxos, toAddress, toAmount) | ||
const txBody = transaction.createTransactionBody(fromAddress, fromUtxos, toAddress, toAmount, currency) | ||
// create transaction | ||
@@ -162,0 +162,0 @@ const unsignedTx = this.createTransaction(txBody) |
@@ -148,25 +148,2 @@ const ChildChain = require('../src') | ||
}) | ||
it('should fail to create a transaction with mixed currencies', () => { | ||
const txBody = { | ||
'inputs': [ | ||
{ | ||
'txindex': 0, | ||
'oindex': 0, | ||
'currency': '0000000000000000000000000000000000000000', | ||
'blknum': 19774001, | ||
'amount': 1000000000000000000 | ||
}, | ||
{ | ||
'txindex': 0, | ||
'oindex': 0, | ||
'currency': '0000000000000000000000999999999999999999', | ||
'blknum': 19774001, | ||
'amount': 1000000000000000000 | ||
} | ||
], | ||
'outputs': [] | ||
} | ||
return assert.throws(() => childChain.createTransaction(txBody), InvalidArgumentError, /Cannot mix currencies/) | ||
}) | ||
}) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
28445
477
Updated@omisego/omg-js-util@^1.1.0