Handle changes to address RPC api in bitcoin core 22

fixes #778
This commit is contained in:
softsimon 2021-09-14 19:28:47 +04:00
parent 2236c6d9a6
commit 3e788ecbf9
No known key found for this signature in database
GPG key ID: 488D7DCFB5A430D7
4 changed files with 7 additions and 5 deletions

View file

@ -71,7 +71,7 @@ interface BisqScriptPubKey {
addresses: string[]; addresses: string[];
asm: string; asm: string;
hex: string; hex: string;
reqSigs: number; reqSigs?: number;
type: string; type: string;
} }

View file

@ -90,9 +90,10 @@ export namespace IBitcoinApi {
scriptPubKey: { // (json object) scriptPubKey: { // (json object)
asm: string; // (string) the asm asm: string; // (string) the asm
hex: string; // (string) the hex hex: string; // (string) the hex
reqSigs: number; // (numeric) The required sigs reqSigs?: number; // (numeric) The required sigs
type: string; // (string) The type, eg 'pubkeyhash' type: string; // (string) The type, eg 'pubkeyhash'
addresses: string[] // (string) bitcoin address addresses?: string[] // (string) bitcoin addresses
address?: string // (string) bitcoin address
}; };
} }

View file

@ -123,7 +123,8 @@ class BitcoinApi implements AbstractBitcoinApi {
return { return {
value: vout.value * 100000000, value: vout.value * 100000000,
scriptpubkey: vout.scriptPubKey.hex, scriptpubkey: vout.scriptPubKey.hex,
scriptpubkey_address: vout.scriptPubKey && vout.scriptPubKey.addresses ? vout.scriptPubKey.addresses[0] : '', scriptpubkey_address: vout.scriptPubKey && vout.scriptPubKey.address ? vout.scriptPubKey.address
: vout.scriptPubKey.addresses ? vout.scriptPubKey.addresses[0] : '',
scriptpubkey_asm: vout.scriptPubKey.asm ? this.convertScriptSigAsm(vout.scriptPubKey.asm) : '', scriptpubkey_asm: vout.scriptPubKey.asm ? this.convertScriptSigAsm(vout.scriptPubKey.asm) : '',
scriptpubkey_type: this.translateScriptPubKeyType(vout.scriptPubKey.type), scriptpubkey_type: this.translateScriptPubKeyType(vout.scriptPubKey.type),
}; };

View file

@ -71,7 +71,7 @@ interface BisqScriptPubKey {
addresses: string[]; addresses: string[];
asm: string; asm: string;
hex: string; hex: string;
reqSigs: number; reqSigs?: number;
type: string; type: string;
} }