Skip to content

Commit bb78db6

Browse files
Merge branch 'master' into rel/latest
2 parents 75749da + 4efe9a0 commit bb78db6

File tree

112 files changed

+8586
-1596
lines changed

Some content is hidden

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

112 files changed

+8586
-1596
lines changed

CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
/modules/sdk-coin-cspr/ @BitGo/ethalt-team
6262
/modules/sdk-coin-dot/ @BitGo/ethalt-team
6363
/modules/sdk-coin-eos/ @BitGo/ethalt-team
64-
/modules/sdk-coin-fetch/ @BitGo/ethalt-team
64+
/modules/sdk-coin-fetchai/ @BitGo/ethalt-team
6565
/modules/sdk-coin-flr/ @BitGo/ethalt-team
6666
/modules/sdk-coin-ethlike/ @BitGo/ethalt-team
6767
/modules/sdk-coin-hbar/ @BitGo/ethalt-team
@@ -84,6 +84,7 @@
8484
/modules/sdk-coin-tao/ @BitGo/ethalt-team
8585
/modules/sdk-coin-ton/ @BitGo/ethalt-team
8686
/modules/sdk-coin-trx/ @BitGo/ethalt-team
87+
/modules/sdk-coin-vet/ @Bitgo/ethalt-team
8788
/modules/sdk-coin-wemix/ @BitGo/ethalt-team
8889
/modules/sdk-coin-world/ @BitGo/ethalt-team
8990
/modules/sdk-coin-xdc/ @BitGo/ethalt-team

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-cronos /var/modules/sdk-coin-cro
7676
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cspr /var/modules/sdk-coin-cspr/
7777
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dot /var/modules/sdk-coin-dot/
7878
COPY --from=builder /tmp/bitgo/modules/sdk-coin-etc /var/modules/sdk-coin-etc/
79-
COPY --from=builder /tmp/bitgo/modules/sdk-coin-fetch /var/modules/sdk-coin-fetch/
79+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-fetchai /var/modules/sdk-coin-fetchai/
8080
COPY --from=builder /tmp/bitgo/modules/sdk-coin-flr /var/modules/sdk-coin-flr/
8181
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hash /var/modules/sdk-coin-hash/
8282
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hbar /var/modules/sdk-coin-hbar/
@@ -129,6 +129,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-lnbtc /var/modules/sdk-coin-lnbt
129129
COPY --from=builder /tmp/bitgo/modules/sdk-coin-ltc /var/modules/sdk-coin-ltc/
130130
COPY --from=builder /tmp/bitgo/modules/sdk-coin-xlm /var/modules/sdk-coin-xlm/
131131
COPY --from=builder /tmp/bitgo/modules/sdk-coin-zec /var/modules/sdk-coin-zec/
132+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-vet /var/modules/sdk-coin-vet/
132133

133134
RUN cd /var/modules/abstract-lightning && yarn link && \
134135
cd /var/modules/sdk-core && yarn link && \
@@ -168,7 +169,7 @@ cd /var/modules/sdk-coin-cronos && yarn link && \
168169
cd /var/modules/sdk-coin-cspr && yarn link && \
169170
cd /var/modules/sdk-coin-dot && yarn link && \
170171
cd /var/modules/sdk-coin-etc && yarn link && \
171-
cd /var/modules/sdk-coin-fetch && yarn link && \
172+
cd /var/modules/sdk-coin-fetchai && yarn link && \
172173
cd /var/modules/sdk-coin-flr && yarn link && \
173174
cd /var/modules/sdk-coin-hash && yarn link && \
174175
cd /var/modules/sdk-coin-hbar && yarn link && \
@@ -220,7 +221,8 @@ cd /var/modules/sdk-coin-ethw && yarn link && \
220221
cd /var/modules/sdk-coin-lnbtc && yarn link && \
221222
cd /var/modules/sdk-coin-ltc && yarn link && \
222223
cd /var/modules/sdk-coin-xlm && yarn link && \
223-
cd /var/modules/sdk-coin-zec && yarn link
224+
cd /var/modules/sdk-coin-zec && yarn link && \
225+
cd /var/modules/sdk-coin-vet && yarn link
224226
#COPY_END
225227

226228
#LINK_START
@@ -263,7 +265,7 @@ RUN cd /var/bitgo-express && \
263265
yarn link @bitgo/sdk-coin-cspr && \
264266
yarn link @bitgo/sdk-coin-dot && \
265267
yarn link @bitgo/sdk-coin-etc && \
266-
yarn link @bitgo/sdk-coin-fetch && \
268+
yarn link @bitgo/sdk-coin-fetchai && \
267269
yarn link @bitgo/sdk-coin-flr && \
268270
yarn link @bitgo/sdk-coin-hash && \
269271
yarn link @bitgo/sdk-coin-hbar && \
@@ -315,7 +317,8 @@ RUN cd /var/bitgo-express && \
315317
yarn link @bitgo/sdk-coin-lnbtc && \
316318
yarn link @bitgo/sdk-coin-ltc && \
317319
yarn link @bitgo/sdk-coin-xlm && \
318-
yarn link @bitgo/sdk-coin-zec
320+
yarn link @bitgo/sdk-coin-zec && \
321+
yarn link @bitgo/sdk-coin-vet
319322
#LINK_END
320323

321324
#LABEL_START

modules/abstract-substrate/src/lib/transaction.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import { DEFAULT_SUBSTRATE_PREFIX } from './constants';
2121

2222
export class Transaction extends BaseTransaction {
2323
protected _substrateTransaction: UnsignedTransaction;
24-
private _signedTransaction?: string;
25-
private _registry: TypeRegistry;
26-
private _chainName: string;
27-
private _sender: string;
24+
protected _signedTransaction?: string;
25+
protected _registry: TypeRegistry;
26+
protected _chainName: string;
27+
protected _sender: string;
2828

2929
private static FAKE_SIGNATURE = `0x${Buffer.from(new Uint8Array(256).fill(1)).toString('hex')}`;
3030

@@ -128,6 +128,7 @@ export class Transaction extends BaseTransaction {
128128

129129
/** @inheritdoc */
130130
toJson(): TxData {
131+
console.log('Transaction toJson called in substrate Transaction class');
131132
if (!this._substrateTransaction) {
132133
throw new InvalidTransactionError('Empty transaction');
133134
}

modules/abstract-substrate/src/lib/transactionBuilder.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ import { Transaction } from './transaction';
2727
import { BaseTransactionSchema, SignedTransactionSchema, SigningPayloadTransactionSchema } from './txnSchema';
2828
import utils from './utils';
2929

30-
export abstract class TransactionBuilder extends BaseTransactionBuilder {
31-
protected _transaction: Transaction;
30+
export abstract class TransactionBuilder<
31+
TMethod = TxMethod,
32+
TTransaction extends Transaction = Transaction
33+
> extends BaseTransactionBuilder {
34+
protected _transaction: TTransaction;
3235
protected _keyPair: KeyPair;
3336
protected _signature?: string;
3437
protected _sender: string;
@@ -39,7 +42,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
3942
protected _tip?: number;
4043
protected _eraPeriod?: number;
4144
protected _registry: TypeRegistry;
42-
protected _method?: TxMethod;
45+
protected _method?: TMethod;
4346
protected _material: Material;
4447
// signatures that will be used to sign a transaction when building
4548
// not the same as the _signatures in transaction which is the signature in
@@ -48,7 +51,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
4851

4952
constructor(_coinConfig: Readonly<CoinConfig>) {
5053
super(_coinConfig);
51-
this._transaction = new Transaction(_coinConfig);
54+
this._transaction = new Transaction(_coinConfig) as TTransaction;
5255
}
5356

5457
/**
@@ -134,7 +137,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
134137
return this;
135138
}
136139

137-
private method(method: TxMethod): this {
140+
private method(method: TMethod): this {
138141
this._method = method;
139142
return this;
140143
}
@@ -154,17 +157,17 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
154157
}
155158

156159
/** @inheritdoc */
157-
protected get transaction(): Transaction {
160+
protected get transaction(): TTransaction {
158161
return this._transaction;
159162
}
160163

161164
/** @inheritdoc */
162-
protected set transaction(transaction: Transaction) {
165+
protected set transaction(transaction: TTransaction) {
163166
this._transaction = transaction;
164167
}
165168

166169
/** @inheritdoc */
167-
protected fromImplementation(rawTransaction: string): Transaction {
170+
protected fromImplementation(rawTransaction: string): TTransaction {
168171
const decodedTxn = decode(rawTransaction, {
169172
metadataRpc: this._material.metadata,
170173
registry: this._registry,
@@ -186,7 +189,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
186189
if (decodedTxn.tip) {
187190
this.fee({ amount: `${decodedTxn.tip}`, type: 'tip' });
188191
}
189-
this.method(decodedTxn.method as unknown as TxMethod);
192+
this.method(decodedTxn.method as unknown as TMethod);
190193
return this._transaction;
191194
}
192195

@@ -197,7 +200,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
197200
}
198201

199202
/** @inheritdoc */
200-
protected async buildImplementation(): Promise<Transaction> {
203+
protected async buildImplementation(): Promise<TTransaction> {
201204
this.transaction.setTransaction(this.buildTransaction());
202205
this.transaction.transactionType(this.transactionType);
203206
this.transaction.registry(this._registry);
@@ -320,7 +323,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
320323
}
321324

322325
/** @inheritdoc */
323-
validateTransaction(_: Transaction): void {
326+
validateTransaction(_: TTransaction): void {
324327
this.validateBaseFields(
325328
this._sender,
326329
this._blockNumber,
@@ -382,7 +385,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
382385
}
383386

384387
/** @inheritdoc */
385-
protected signImplementation({ key }: BaseKey): Transaction {
388+
protected signImplementation({ key }: BaseKey): TTransaction {
386389
this._keyPair = new KeyPair({ prv: key });
387390
return this._transaction;
388391
}

modules/account-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@bitgo/sdk-coin-dot": "^4.1.58",
4646
"@bitgo/sdk-coin-etc": "^2.2.47",
4747
"@bitgo/sdk-coin-eth": "^24.4.3",
48-
"@bitgo/sdk-coin-fetch": "^1.2.0",
48+
"@bitgo/sdk-coin-fetchai": "^1.2.0",
4949
"@bitgo/sdk-coin-flr": "^1.2.4",
5050
"@bitgo/sdk-coin-hash": "^3.0.49",
5151
"@bitgo/sdk-coin-hbar": "^2.0.80",

modules/account-lib/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export { Mantra };
113113
import * as Cronos from '@bitgo/sdk-coin-cronos';
114114
export { Cronos };
115115

116-
import * as Fetch from '@bitgo/sdk-coin-fetch';
117-
export { Fetch };
116+
import * as FetchAi from '@bitgo/sdk-coin-fetchai';
117+
export { FetchAi };
118118

119119
import * as Initia from '@bitgo/sdk-coin-initia';
120120
export { Initia };
@@ -272,8 +272,8 @@ const coinBuilderMap = {
272272
tbaby: Baby.TransactionBuilder,
273273
cronos: Cronos.TransactionBuilder,
274274
tcronos: Cronos.TransactionBuilder,
275-
fetch: Fetch.TransactionBuilder,
276-
tfetch: Fetch.TransactionBuilder,
275+
fetchai: FetchAi.TransactionBuilder,
276+
tfetchai: FetchAi.TransactionBuilder,
277277
initia: Initia.TransactionBuilder,
278278
tinitia: Initia.TransactionBuilder,
279279
flr: Flr.TransactionBuilder,

modules/bitgo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@bitgo/sdk-coin-eth": "^24.4.3",
7979
"@bitgo/sdk-coin-ethlike": "^1.2.15",
8080
"@bitgo/sdk-coin-ethw": "^20.0.80",
81-
"@bitgo/sdk-coin-fetch": "^1.2.0",
81+
"@bitgo/sdk-coin-fetchai": "^1.2.0",
8282
"@bitgo/sdk-coin-flr": "^1.2.4",
8383
"@bitgo/sdk-coin-hash": "^3.0.49",
8484
"@bitgo/sdk-coin-hbar": "^2.0.80",
@@ -128,7 +128,7 @@
128128
"bignumber.js": "^9.1.1",
129129
"fs-extra": "^9.1.0",
130130
"lodash": "^4.17.14",
131-
"openpgp": "5.10.1",
131+
"openpgp": "5.11.3",
132132
"stellar-sdk": "^10.0.1",
133133
"superagent": "^9.0.1"
134134
},

modules/bitgo/src/v2/coinFactory.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import {
4848
Eth,
4949
Ethw,
5050
EthLikeCoin,
51-
Fetch,
51+
FetchAi,
5252
Flr,
5353
TethLikeCoin,
5454
FiatAED,
@@ -121,7 +121,7 @@ import {
121121
Teos,
122122
Tetc,
123123
Teth,
124-
Tfetch,
124+
TfetchAi,
125125
Tflr,
126126
Tmon,
127127
TfiatAED,
@@ -161,13 +161,15 @@ import {
161161
Ttia,
162162
Tton,
163163
Ttrx,
164+
Tvet,
164165
Txlm,
165166
Txdc,
166167
Txrp,
167168
Txtz,
168169
Tzec,
169170
Tzeta,
170171
Tzketh,
172+
Vet,
171173
Wemix,
172174
World,
173175
Xdc,
@@ -217,7 +219,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
217219
coinFactory.register('fiatgbp', FiatGBP.createInstance);
218220
coinFactory.register('fiatsgd', FiatSGD.createInstance);
219221
coinFactory.register('fiatusd', FiatUsd.createInstance);
220-
coinFactory.register('fetch', Fetch.createInstance);
222+
coinFactory.register('fetchai', FetchAi.createInstance);
221223
coinFactory.register('flr', Flr.createInstance);
222224
coinFactory.register('gteth', Gteth.createInstance);
223225
coinFactory.register('hash', Hash.createInstance);
@@ -285,7 +287,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
285287
coinFactory.register('tfiatgbp', TfiatGBP.createInstance);
286288
coinFactory.register('tfiatsgd', TfiatSGD.createInstance);
287289
coinFactory.register('tfiatusd', TfiatUsd.createInstance);
288-
coinFactory.register('tfetch', Tfetch.createInstance);
290+
coinFactory.register('tfetchai', TfetchAi.createInstance);
289291
coinFactory.register('tflr', Tflr.createInstance);
290292
coinFactory.register('tmon', Tmon.createInstance);
291293
coinFactory.register('thash', Thash.createInstance);
@@ -318,6 +320,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
318320
coinFactory.register('ttia', Ttia.createInstance);
319321
coinFactory.register('tton', Tton.createInstance);
320322
coinFactory.register('ttrx', Ttrx.createInstance);
323+
coinFactory.register('tvet', Tvet.createInstance);
321324
coinFactory.register('txdc', Txdc.createInstance);
322325
coinFactory.register('txlm', Txlm.createInstance);
323326
coinFactory.register('txrp', Txrp.createInstance);
@@ -327,6 +330,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
327330
coinFactory.register('tzketh', Tzketh.createInstance);
328331
coinFactory.register('twemix', Twemix.createInstance);
329332
coinFactory.register('tworld', Tworld.createInstance);
333+
coinFactory.register('vet', Vet.createInstance);
330334
coinFactory.register('xdc', Xdc.createInstance);
331335
coinFactory.register('xlm', Xlm.createInstance);
332336
coinFactory.register('xrp', Xrp.createInstance);

modules/bitgo/src/v2/coins/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { Dot, Tdot } from '@bitgo/sdk-coin-dot';
2727
import { Eos, EosToken, Teos } from '@bitgo/sdk-coin-eos';
2828
import { Etc, Tetc } from '@bitgo/sdk-coin-etc';
2929
import { Erc20Token, Eth, Gteth, Hteth, Teth } from '@bitgo/sdk-coin-eth';
30-
import { Fetch, Tfetch } from '@bitgo/sdk-coin-fetch';
30+
import { FetchAi, TfetchAi } from '@bitgo/sdk-coin-fetchai';
3131
import { Flr, Tflr } from '@bitgo/sdk-coin-flr';
3232
import { Ethw } from '@bitgo/sdk-coin-ethw';
3333
import { EthLikeCoin, TethLikeCoin } from '@bitgo/sdk-coin-ethlike';
@@ -60,6 +60,7 @@ import { Tia, Ttia } from '@bitgo/sdk-coin-tia';
6060
import { Ton, Tton } from '@bitgo/sdk-coin-ton';
6161
import { Trx, Ttrx } from '@bitgo/sdk-coin-trx';
6262
import { StellarToken, Txlm, Xlm } from '@bitgo/sdk-coin-xlm';
63+
import { Vet, Tvet } from '@bitgo/sdk-coin-vet';
6364
import { Wemix, Twemix } from '@bitgo/sdk-coin-wemix';
6465
import { World, Tworld } from '@bitgo/sdk-coin-world';
6566
import { Xdc, Txdc } from '@bitgo/sdk-coin-xdc';
@@ -99,7 +100,7 @@ export { Erc20Token, Eth, Gteth, Hteth, Teth };
99100
export { Ethw };
100101
export { EthLikeCoin, TethLikeCoin };
101102
export { Etc, Tetc };
102-
export { Fetch, Tfetch };
103+
export { FetchAi, TfetchAi };
103104
export { Flr, Tflr };
104105
export { Hash, Thash };
105106
export { Hbar, Thbar };
@@ -130,6 +131,7 @@ export { Sei, Tsei };
130131
export { Injective, Tinjective };
131132
export { Islm, Tislm };
132133
export { Trx, Ttrx };
134+
export { Vet, Tvet };
133135
export { Xdc, Txdc };
134136
export { StellarToken, Txlm, Xlm };
135137
export { Txrp, Xrp, XrpToken };

modules/bitgo/test/v2/unit/keychains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('V2 Keychains', function () {
8282
n.asset !== UnderlyingAsset.SONEIUM &&
8383
n.asset !== UnderlyingAsset.VET &&
8484
n.asset !== UnderlyingAsset.CRONOS &&
85-
n.asset !== UnderlyingAsset.FETCH &&
85+
n.asset !== UnderlyingAsset.FETCHAI &&
8686
n.asset !== UnderlyingAsset.INITIA &&
8787
coinFamilyValues.includes(n.name)
8888
);

0 commit comments

Comments
 (0)