Merge pull request #779 from mempool/simon/core-22-compatibility

This commit is contained in:
wiz 2021-09-18 17:51:41 +09:00 committed by GitHub
commit d602b20f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

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

View File

@ -90,9 +90,10 @@ export namespace IBitcoinApi {
scriptPubKey: { // (json object)
asm: string; // (string) the asm
hex: string; // (string) the hex
reqSigs: number; // (numeric) The required sigs
reqSigs?: number; // (numeric) The required sigs
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 {
value: vout.value * 100000000,
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_type: this.translateScriptPubKeyType(vout.scriptPubKey.type),
};

View File

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