@multiplechain/bitcoin 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/provider.js +7 -0
- package/src/transaction.js +5 -6
package/package.json
CHANGED
package/src/provider.js
CHANGED
package/src/transaction.js
CHANGED
|
@@ -166,11 +166,10 @@ class Transaction {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* @param {
|
|
170
|
-
* @param {Number} amount
|
|
169
|
+
* @param {Object} config
|
|
171
170
|
* @returns {Boolean}
|
|
172
171
|
*/
|
|
173
|
-
async verifyTransferWithData(
|
|
172
|
+
async verifyTransferWithData(config) {
|
|
174
173
|
|
|
175
174
|
if (await this.validateTransaction()) {
|
|
176
175
|
|
|
@@ -178,7 +177,7 @@ class Transaction {
|
|
|
178
177
|
if (this.provider.testnet) {
|
|
179
178
|
|
|
180
179
|
let index = this.data.vout.findIndex(object => {
|
|
181
|
-
return object.scriptpubkey_address == receiver;
|
|
180
|
+
return object.scriptpubkey_address == config.receiver;
|
|
182
181
|
});
|
|
183
182
|
|
|
184
183
|
data = this.data.vout[index];
|
|
@@ -190,7 +189,7 @@ class Transaction {
|
|
|
190
189
|
} else {
|
|
191
190
|
|
|
192
191
|
let index = this.data.out.findIndex(object => {
|
|
193
|
-
return object.addr == receiver;
|
|
192
|
+
return object.addr == config.receiver;
|
|
194
193
|
});
|
|
195
194
|
|
|
196
195
|
data = this.data.out[index];
|
|
@@ -201,7 +200,7 @@ class Transaction {
|
|
|
201
200
|
};
|
|
202
201
|
}
|
|
203
202
|
|
|
204
|
-
if (data.receiver == receiver && data.amount == amount) {
|
|
203
|
+
if (data.receiver == config.receiver && data.amount == config.amount) {
|
|
205
204
|
return true;
|
|
206
205
|
} else {
|
|
207
206
|
return false;
|