@moneybutton/paymail-client
Advanced tools
Comparing version 0.33.0 to 0.34.0
@@ -361,7 +361,6 @@ 'use strict'; | ||
buildBodySendTx(transactions, metadata, reference) { | ||
buildBodySendTx(hexTransaction, metadata) { | ||
return { | ||
transactions, | ||
metadata, | ||
reference | ||
hex: hexTransaction, | ||
metadata | ||
}; | ||
@@ -579,13 +578,9 @@ } | ||
async sendRawTx(targetPaymail, transactions = [], metadata = {}, reference = null) { | ||
if (!transactions.every(tx => tx.hex)) { | ||
throw new Error('Transactions should include "hex" field'); | ||
async sendRawTx(targetPaymail, hexTransaction, metadata = {}) { | ||
if (!hexTransaction) { | ||
throw new Error('transaction hex cannot be empty'); | ||
} | ||
if (transactions.length === 0) { | ||
throw new Error('Transaction array should not be empty.'); | ||
} | ||
let receiveTxUrl = await this.resolver.getSendTxUrlFor(targetPaymail); | ||
const response = await this.http.postJson(receiveTxUrl, this.requestBodyFactory.buildBodySendTx(transactions, metadata, reference)); | ||
const response = await this.http.postJson(receiveTxUrl, this.requestBodyFactory.buildBodySendTx(hexTransaction, metadata)); | ||
@@ -592,0 +587,0 @@ if (!response.ok) { |
@@ -355,7 +355,6 @@ import AbortController from 'abort-controller'; | ||
buildBodySendTx(transactions, metadata, reference) { | ||
buildBodySendTx(hexTransaction, metadata) { | ||
return { | ||
transactions, | ||
metadata, | ||
reference | ||
hex: hexTransaction, | ||
metadata | ||
}; | ||
@@ -573,13 +572,9 @@ } | ||
async sendRawTx(targetPaymail, transactions = [], metadata = {}, reference = null) { | ||
if (!transactions.every(tx => tx.hex)) { | ||
throw new Error('Transactions should include "hex" field'); | ||
async sendRawTx(targetPaymail, hexTransaction, metadata = {}) { | ||
if (!hexTransaction) { | ||
throw new Error('transaction hex cannot be empty'); | ||
} | ||
if (transactions.length === 0) { | ||
throw new Error('Transaction array should not be empty.'); | ||
} | ||
let receiveTxUrl = await this.resolver.getSendTxUrlFor(targetPaymail); | ||
const response = await this.http.postJson(receiveTxUrl, this.requestBodyFactory.buildBodySendTx(transactions, metadata, reference)); | ||
const response = await this.http.postJson(receiveTxUrl, this.requestBodyFactory.buildBodySendTx(hexTransaction, metadata)); | ||
@@ -586,0 +581,0 @@ if (!response.ok) { |
{ | ||
"name": "@moneybutton/paymail-client", | ||
"version": "0.33.0", | ||
"version": "0.34.0", | ||
"description": "Money Button isomorphic Paymail utilities.", | ||
@@ -68,3 +68,3 @@ "main": "dist/paymail-client.cjs.js", | ||
}, | ||
"gitHead": "72284f2574b939451f0b1cf59b17502125165758" | ||
"gitHead": "924f8c35fb44d25117aea894876ace691b7c8fd8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112607
1003