Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/bitgo/src/v2/coinFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
CoinFeature,
Nep141TokenConfig,
CosmosTokenConfig,
VetTokenConfig,
} from '@bitgo/statics';
import {
Ada,
Expand Down Expand Up @@ -210,6 +211,7 @@ import {
Zeta,
Zketh,
ZkethToken,
VetToken,
} from './coins';

export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: CoinMap = coins): void {
Expand Down Expand Up @@ -500,6 +502,10 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
CosmosToken.createTokenConstructors([...tokens.bitcoin.cosmos.tokens, ...tokens.testnet.cosmos.tokens]).forEach(
({ name, coinConstructor }) => coinFactory.register(name, coinConstructor)
);

VetToken.createTokenConstructors().forEach(({ name, coinConstructor }) =>
coinFactory.register(name, coinConstructor)
);
}

export function getCoinConstructor(coinName: string): CoinConstructor | undefined {
Expand Down Expand Up @@ -905,6 +911,9 @@ export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor |
case 'near':
case 'tnear':
return Nep141Token.createTokenConstructor(tokenConfig as Nep141TokenConfig);
case 'vet':
case 'tvet':
return VetToken.createTokenConstructor(tokenConfig as VetTokenConfig);
case 'asi':
case 'tasi':
case 'atom':
Expand Down
4 changes: 2 additions & 2 deletions modules/bitgo/src/v2/coins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { Tia, Ttia } from '@bitgo/sdk-coin-tia';
import { Ton, Tton } from '@bitgo/sdk-coin-ton';
import { Trx, Ttrx } from '@bitgo/sdk-coin-trx';
import { StellarToken, Txlm, Xlm } from '@bitgo/sdk-coin-xlm';
import { Vet, Tvet } from '@bitgo/sdk-coin-vet';
import { Vet, Tvet, VetToken } from '@bitgo/sdk-coin-vet';
import { Wemix, Twemix } from '@bitgo/sdk-coin-wemix';
import { World, Tworld, WorldToken } from '@bitgo/sdk-coin-world';
import { Xdc, Txdc } from '@bitgo/sdk-coin-xdc';
Expand Down Expand Up @@ -137,7 +137,7 @@ export { Sei, Tsei };
export { Injective, Tinjective };
export { Islm, Tislm };
export { Trx, Ttrx };
export { Vet, Tvet };
export { Vet, Tvet, VetToken };
export { Xdc, Txdc };
export { StellarToken, Txlm, Xlm };
export { Txrp, Xrp, XrpToken };
Expand Down
1 change: 1 addition & 0 deletions modules/bitgo/test/browser/browser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('Coins', () => {
WorldToken: 1,
CosmosToken: 1,
CosmosSharedCoin: 1,
VetToken: 1,
};
Object.keys(BitGoJS.Coin)
.filter((coinName) => !excludedKeys[coinName])
Expand Down
5 changes: 4 additions & 1 deletion modules/statics/src/tokenConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ export type TokenConfig =
| AptNFTCollectionConfig
| Sip10TokenConfig
| Nep141TokenConfig
| CosmosTokenConfig;
| CosmosTokenConfig
| VetTokenConfig;

export interface Tokens {
bitcoin: {
Expand Down Expand Up @@ -1185,6 +1186,8 @@ export function getFormattedTokenConfigForCoin(coin: Readonly<BaseCoin>): TokenC
return getNep141TokenConfig(coin);
} else if (coin instanceof CosmosChainToken) {
return getCosmosTokenConfig(coin);
} else if (coin instanceof VetToken) {
return getVetTokenConfig(coin);
}
return undefined;
}