Skip to content

Commit 988f57b

Browse files
Merge pull request #7257 from BitGo/rel/latest-resolve-conflict-WP-6380
WP-6380: resolve back-merge conflicts
2 parents e0674d4 + f5eac79 commit 988f57b

File tree

146 files changed

+3468
-1697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3468
-1697
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-baby /var/modules/sdk-coin-baby/
7272
COPY --from=builder /tmp/bitgo/modules/sdk-coin-bera /var/modules/sdk-coin-bera/
7373
COPY --from=builder /tmp/bitgo/modules/sdk-coin-bld /var/modules/sdk-coin-bld/
7474
COPY --from=builder /tmp/bitgo/modules/sdk-coin-bsc /var/modules/sdk-coin-bsc/
75+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-canton /var/modules/sdk-coin-canton/
7576
COPY --from=builder /tmp/bitgo/modules/sdk-coin-celo /var/modules/sdk-coin-celo/
7677
COPY --from=builder /tmp/bitgo/modules/sdk-coin-coredao /var/modules/sdk-coin-coredao/
7778
COPY --from=builder /tmp/bitgo/modules/sdk-coin-coreum /var/modules/sdk-coin-coreum/
@@ -123,7 +124,6 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-bsv /var/modules/sdk-coin-bsv/
123124
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btc /var/modules/sdk-coin-btc/
124125
COPY --from=builder /tmp/bitgo/modules/utxo-ord /var/modules/utxo-ord/
125126
COPY --from=builder /tmp/bitgo/modules/sdk-coin-btg /var/modules/sdk-coin-btg/
126-
COPY --from=builder /tmp/bitgo/modules/sdk-coin-canton /var/modules/sdk-coin-canton/
127127
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dash /var/modules/sdk-coin-dash/
128128
COPY --from=builder /tmp/bitgo/modules/sdk-coin-doge /var/modules/sdk-coin-doge/
129129
COPY --from=builder /tmp/bitgo/modules/sdk-coin-eos /var/modules/sdk-coin-eos/
@@ -169,6 +169,7 @@ cd /var/modules/sdk-coin-baby && yarn link && \
169169
cd /var/modules/sdk-coin-bera && yarn link && \
170170
cd /var/modules/sdk-coin-bld && yarn link && \
171171
cd /var/modules/sdk-coin-bsc && yarn link && \
172+
cd /var/modules/sdk-coin-canton && yarn link && \
172173
cd /var/modules/sdk-coin-celo && yarn link && \
173174
cd /var/modules/sdk-coin-coredao && yarn link && \
174175
cd /var/modules/sdk-coin-coreum && yarn link && \
@@ -220,7 +221,6 @@ cd /var/modules/sdk-coin-bsv && yarn link && \
220221
cd /var/modules/sdk-coin-btc && yarn link && \
221222
cd /var/modules/utxo-ord && yarn link && \
222223
cd /var/modules/sdk-coin-btg && yarn link && \
223-
cd /var/modules/sdk-coin-canton && yarn link && \
224224
cd /var/modules/sdk-coin-dash && yarn link && \
225225
cd /var/modules/sdk-coin-doge && yarn link && \
226226
cd /var/modules/sdk-coin-eos && yarn link && \
@@ -269,6 +269,7 @@ RUN cd /var/bitgo-express && \
269269
yarn link @bitgo/sdk-coin-bera && \
270270
yarn link @bitgo/sdk-coin-bld && \
271271
yarn link @bitgo/sdk-coin-bsc && \
272+
yarn link @bitgo/sdk-coin-canton && \
272273
yarn link @bitgo/sdk-coin-celo && \
273274
yarn link @bitgo/sdk-coin-coredao && \
274275
yarn link @bitgo/sdk-coin-coreum && \
@@ -320,7 +321,6 @@ RUN cd /var/bitgo-express && \
320321
yarn link @bitgo/sdk-coin-btc && \
321322
yarn link @bitgo/utxo-ord && \
322323
yarn link @bitgo/sdk-coin-btg && \
323-
yarn link @bitgo/sdk-coin-canton && \
324324
yarn link @bitgo/sdk-coin-dash && \
325325
yarn link @bitgo/sdk-coin-doge && \
326326
yarn link @bitgo/sdk-coin-eos && \

modules/abstract-lightning/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
]
4040
},
4141
"dependencies": {
42-
"@bitgo/public-types": "5.29.0",
42+
"@bitgo/public-types": "5.31.0",
4343
"@bitgo/sdk-core": "^36.13.0",
4444
"@bitgo/statics": "^58.5.0",
4545
"@bitgo/utxo-lib": "^11.11.1",

modules/abstract-lightning/src/wallet/lightning.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ export interface ILightningWallet {
165165
* On chain withdrawal
166166
* @param {LightningOnchainWithdrawParams} params - Withdraw parameters
167167
* @param {LightningOnchainRecipient[]} params.recipients - The recipients to pay
168-
* @param {bigint} params.satsPerVbyte - Value for sats per virtual byte
168+
* @param {bigint} [params.satsPerVbyte] - Optional value for sats per virtual byte. If not present, it will be estimated.
169+
* @param {number} [params.numBlocks] - Target blocks for the transaction to be confirmed
169170
* @param {string} params.passphrase - The wallet passphrase
170171
* @param {string} [params.sequenceId] - Optional sequence ID for the respective withdraw transfer
171172
* @param {string} [params.comment] - Optional comment for the respective withdraw transfer
@@ -337,6 +338,7 @@ export class LightningWallet implements ILightningWallet {
337338
onchainRequest: {
338339
recipients: params.recipients,
339340
satsPerVbyte: params.satsPerVbyte,
341+
numBlocks: params.numBlocks,
340342
},
341343
intentType: 'payment',
342344
},

modules/abstract-utxo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
]
4343
},
4444
"dependencies": {
45+
"@bitgo/secp256k1": "^1.5.0",
4546
"@bitgo/blockapis": "^1.12.1",
4647
"@bitgo/sdk-api": "^1.70.2",
4748
"@bitgo/sdk-core": "^36.13.0",

modules/abstract-utxo/src/abstractUtxoCoin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { randomBytes } from 'crypto';
33

44
import _ from 'lodash';
55
import * as utxolib from '@bitgo/utxo-lib';
6-
import { bip32, bitgo, getMainnet, isMainnet, isTestnet } from '@bitgo/utxo-lib';
6+
import { bip32 } from '@bitgo/secp256k1';
7+
import { bitgo, getMainnet, isMainnet, isTestnet } from '@bitgo/utxo-lib';
78
import {
89
AddressCoinSpecific,
910
AddressTypeChainMismatchError,
@@ -46,7 +47,6 @@ import {
4647
Wallet,
4748
isValidPrv,
4849
isValidXprv,
49-
bitcoin,
5050
} from '@bitgo/sdk-core';
5151

5252
import {
@@ -1160,7 +1160,7 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
11601160
throw new Error('invalid private key');
11611161
}
11621162
if (publicKey) {
1163-
const genPubKey = bitcoin.HDNode.fromBase58(prv).neutered().toBase58();
1163+
const genPubKey = bip32.fromBase58(prv).neutered().toBase58();
11641164
if (genPubKey !== publicKey) {
11651165
throw new Error('public key does not match private key');
11661166
}

modules/abstract-utxo/src/descriptor/builder/parse.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { BIP32Interface } from '@bitgo/utxo-lib';
2-
import * as utxolib from '@bitgo/utxo-lib';
1+
import { BIP32Interface, bip32 } from '@bitgo/secp256k1';
32
import { Descriptor } from '@bitgo/wasm-miniscript';
43

54
import { DescriptorBuilder, getDescriptorFromBuilder } from './builder';
@@ -55,7 +54,7 @@ function parseMulti(node: unknown): {
5554
});
5655
return {
5756
threshold,
58-
keys: keyWithPath.map((k) => utxolib.bip32.fromBase58(k.xpub)),
57+
keys: keyWithPath.map((k) => bip32.fromBase58(k.xpub)),
5958
path: paths[0],
6059
};
6160
}

modules/abstract-utxo/src/descriptor/createWallet/createDescriptorWallet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BitGoAPI } from '@bitgo/sdk-api';
2-
import * as utxolib from '@bitgo/utxo-lib';
2+
import { bip32 } from '@bitgo/secp256k1';
33
import { Wallet } from '@bitgo/sdk-core';
44

55
import { AbstractUtxoCoin } from '../../abstractUtxoCoin';
@@ -56,12 +56,12 @@ export async function createDescriptorWalletWithWalletPassphrase(
5656
if (!userKeychain.prv) {
5757
throw new Error('Missing private key');
5858
}
59-
const userKey = utxolib.bip32.fromBase58(userKeychain.prv);
59+
const userKey = bip32.fromBase58(userKeychain.prv);
6060
const cosigners = [backupKeychain, bitgoKeychain].map((keychain) => {
6161
if (!keychain.pub) {
6262
throw new Error('Missing public key');
6363
}
64-
return utxolib.bip32.fromBase58(keychain.pub);
64+
return bip32.fromBase58(keychain.pub);
6565
});
6666
return createDescriptorWallet(bitgo, coin, {
6767
...params,

modules/abstract-utxo/src/keychains.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'assert';
22

33
import * as t from 'io-ts';
4-
import * as utxolib from '@bitgo/utxo-lib';
4+
import { BIP32Interface, bip32 } from '@bitgo/secp256k1';
55
import { IRequestTracer, IWallet, KeyIndices, promiseProps, Triple } from '@bitgo/sdk-core';
66

77
import { AbstractUtxoCoin } from './abstractUtxoCoin';
@@ -48,12 +48,12 @@ export function toKeychainTriple(keychains: UtxoNamedKeychains): Triple<UtxoKeyc
4848

4949
export function toBip32Triple(
5050
keychains: UtxoNamedKeychains | Triple<{ pub: string }> | Triple<string>
51-
): Triple<utxolib.BIP32Interface> {
51+
): Triple<BIP32Interface> {
5252
if (Array.isArray(keychains)) {
5353
return keychains.map((keychain: { pub: string } | string) => {
5454
const v = typeof keychain === 'string' ? keychain : keychain.pub;
55-
return utxolib.bip32.fromBase58(v);
56-
}) as Triple<utxolib.BIP32Interface>;
55+
return bip32.fromBase58(v);
56+
}) as Triple<BIP32Interface>;
5757
}
5858

5959
return toBip32Triple(toKeychainTriple(keychains));

modules/abstract-utxo/src/offlineVault/OfflineVaultHalfSigned.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { BIP32Interface, bip32 } from '@bitgo/secp256k1';
12
import * as utxolib from '@bitgo/utxo-lib';
2-
import { BIP32Interface } from '@bitgo/utxo-lib';
33
import { BaseCoin } from '@bitgo/sdk-core';
44

55
import { getNetworkFromChain } from '../names';
@@ -23,7 +23,7 @@ export function createHalfSigned(
2323
): OfflineVaultHalfSigned {
2424
const network = getNetworkFromChain(coin);
2525
if (typeof prv === 'string') {
26-
prv = utxolib.bip32.fromBase58(prv);
26+
prv = bip32.fromBase58(prv);
2727
}
2828
prv = BaseCoin.deriveKeyWithSeedBip32(prv, derivationId).key;
2929
if (!OfflineVaultSignable.is(tx)) {

modules/abstract-utxo/src/offlineVault/OfflineVaultSignable.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as utxolib from '@bitgo/utxo-lib';
1+
import { BIP32Interface, bip32 } from '@bitgo/secp256k1';
22
import { Triple } from '@bitgo/sdk-core';
33
import * as t from 'io-ts';
44

@@ -28,8 +28,8 @@ export type OfflineVaultUnsigned = t.TypeOf<typeof OfflineVaultSignable>;
2828

2929
type WithXpub = { xpub: string };
3030
type NamedKeys = { user: WithXpub; backup: WithXpub; bitgo: WithXpub };
31-
export function toKeyTriple(xpubs: NamedKeys): Triple<utxolib.BIP32Interface> {
31+
export function toKeyTriple(xpubs: NamedKeys): Triple<BIP32Interface> {
3232
return [xpubs.user.xpub, xpubs.backup.xpub, xpubs.bitgo.xpub].map((xpub) =>
33-
utxolib.bip32.fromBase58(xpub)
34-
) as Triple<utxolib.BIP32Interface>;
33+
bip32.fromBase58(xpub)
34+
) as Triple<BIP32Interface>;
3535
}

0 commit comments

Comments
 (0)