Skip to content
Open
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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-stt /var/modules/sdk-coin-stt/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-stx /var/modules/sdk-coin-stx/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-sui /var/modules/sdk-coin-sui/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-tao /var/modules/sdk-coin-tao/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-tempo /var/modules/sdk-coin-tempo/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-tia /var/modules/sdk-coin-tia/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-ton /var/modules/sdk-coin-ton/
COPY --from=builder /tmp/bitgo/modules/sdk-coin-trx /var/modules/sdk-coin-trx/
Expand Down Expand Up @@ -207,6 +208,7 @@ cd /var/modules/sdk-coin-stt && yarn link && \
cd /var/modules/sdk-coin-stx && yarn link && \
cd /var/modules/sdk-coin-sui && yarn link && \
cd /var/modules/sdk-coin-tao && yarn link && \
cd /var/modules/sdk-coin-tempo && yarn link && \
cd /var/modules/sdk-coin-tia && yarn link && \
cd /var/modules/sdk-coin-ton && yarn link && \
cd /var/modules/sdk-coin-trx && yarn link && \
Expand Down Expand Up @@ -308,6 +310,7 @@ RUN cd /var/bitgo-express && \
yarn link @bitgo/sdk-coin-stx && \
yarn link @bitgo/sdk-coin-sui && \
yarn link @bitgo/sdk-coin-tao && \
yarn link @bitgo/sdk-coin-tempo && \
yarn link @bitgo/sdk-coin-tia && \
yarn link @bitgo/sdk-coin-ton && \
yarn link @bitgo/sdk-coin-trx && \
Expand Down
1 change: 1 addition & 0 deletions modules/account-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"@bitgo/sdk-coin-stx": "^3.10.24",
"@bitgo/sdk-coin-sui": "^5.19.24",
"@bitgo/sdk-coin-tao": "^1.13.4",
"@bitgo/sdk-coin-tempo": "^1.3.2",
"@bitgo/sdk-coin-tia": "^3.5.24",
"@bitgo/sdk-coin-ton": "^3.13.3",
"@bitgo/sdk-coin-trx": "^3.8.4",
Expand Down
5 changes: 5 additions & 0 deletions modules/account-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export { Apechain };
import * as Tao from '@bitgo/sdk-coin-tao';
export { Tao };

import * as Tempo from '@bitgo/sdk-coin-tempo';
export { Tempo };

import * as Icp from '@bitgo/sdk-coin-icp';
export { Icp };

Expand Down Expand Up @@ -292,6 +295,8 @@ const coinBuilderMap = {
tapt: Apt.TransactionBuilder,
tao: Tao.TransactionBuilderFactory,
ttao: Tao.TransactionBuilderFactory,
tempo: Tempo.Tip20TransactionBuilder,
ttempo: Tempo.Tip20TransactionBuilder,
icp: Icp.TransactionBuilder,
ticp: Icp.TransactionBuilder,
baby: Baby.TransactionBuilder,
Expand Down
3 changes: 3 additions & 0 deletions modules/account-lib/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
{
"path": "../sdk-coin-tia"
},
{
"path": "../sdk-coin-tempo"
},
{
"path": "../sdk-coin-trx"
},
Expand Down
1 change: 1 addition & 0 deletions modules/bitgo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"@bitgo/sdk-coin-stx": "^3.10.24",
"@bitgo/sdk-coin-sui": "^5.19.24",
"@bitgo/sdk-coin-tao": "^1.13.4",
"@bitgo/sdk-coin-tempo": "^1.3.2",
"@bitgo/sdk-coin-tia": "^3.5.24",
"@bitgo/sdk-coin-ton": "^3.13.3",
"@bitgo/sdk-coin-trx": "^3.8.4",
Expand Down
17 changes: 17 additions & 0 deletions modules/bitgo/src/v2/coinFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
CosmosTokenConfig,
VetTokenConfig,
TaoTokenConfig,
Tip20TokenConfig,
PolyxTokenConfig,
JettonTokenConfig,
} from '@bitgo/statics';
Expand Down Expand Up @@ -133,6 +134,8 @@ import {
Susd,
Tao,
TaoToken,
Tempo,
Tip20Token,
Ton,
Tada,
Talgo,
Expand Down Expand Up @@ -200,6 +203,7 @@ import {
Twemix,
Tworld,
Ttao,
Ttempo,
Ttia,
Tton,
Ttrx,
Expand Down Expand Up @@ -304,6 +308,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
coinFactory.register('sui', Sui.createInstance);
coinFactory.register('susd', Susd.createInstance);
coinFactory.register('tao', Tao.createInstance);
coinFactory.register('tempo', Tempo.createInstance);
coinFactory.register('tia', Tia.createInstance);
coinFactory.register('ton', Ton.createInstance);
coinFactory.register('talgo', Talgo.createInstance);
Expand Down Expand Up @@ -373,6 +378,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
coinFactory.register('tsui', Tsui.createInstance);
coinFactory.register('tsusd', Tsusd.createInstance);
coinFactory.register('ttao', Ttao.createInstance);
coinFactory.register('ttempo', Ttempo.createInstance);
coinFactory.register('ttia', Ttia.createInstance);
coinFactory.register('tton', Tton.createInstance);
coinFactory.register('ttrx', Ttrx.createInstance);
Expand Down Expand Up @@ -522,6 +528,10 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
({ name, coinConstructor }) => coinFactory.register(name, coinConstructor)
);

Tip20Token.createTokenConstructors([...tokens.bitcoin.tempo.tokens, ...tokens.testnet.tempo.tokens]).forEach(
({ name, coinConstructor }) => coinFactory.register(name, coinConstructor)
);

PolyxToken.createTokenConstructors([...tokens.bitcoin.polyx.tokens, ...tokens.testnet.polyx.tokens]).forEach(
({ name, coinConstructor }) => coinFactory.register(name, coinConstructor)
);
Expand Down Expand Up @@ -751,6 +761,8 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
return Susd.createInstance;
case 'tao':
return Tao.createInstance;
case 'tempo':
return Tempo.createInstance;
case 'tia':
return Tia.createInstance;
case 'ton':
Expand Down Expand Up @@ -889,6 +901,8 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
return Tsusd.createInstance;
case 'ttao':
return Ttao.createInstance;
case 'ttempo':
return Ttempo.createInstance;
case 'ttia':
return Ttia.createInstance;
case 'tton':
Expand Down Expand Up @@ -1043,6 +1057,9 @@ export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor |
case 'tao':
case 'ttao':
return TaoToken.createTokenConstructor(tokenConfig as TaoTokenConfig);
case 'tempo':
case 'ttempo':
return Tip20Token.createTokenConstructor(tokenConfig as Tip20TokenConfig);
case 'polyx':
case 'tpolyx':
return PolyxToken.createTokenConstructor(tokenConfig as PolyxTokenConfig);
Expand Down
2 changes: 2 additions & 0 deletions modules/bitgo/src/v2/coins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { Sol, Tsol } from '@bitgo/sdk-coin-sol';
import { Stx, Tstx, Sip10Token } from '@bitgo/sdk-coin-stx';
import { Sui, Tsui, SuiToken } from '@bitgo/sdk-coin-sui';
import { Tao, Ttao, TaoToken } from '@bitgo/sdk-coin-tao';
import { Tempo, Ttempo, Tip20Token } from '@bitgo/sdk-coin-tempo';
import { Tia, Ttia } from '@bitgo/sdk-coin-tia';
import { Ton, Tton, JettonToken } from '@bitgo/sdk-coin-ton';
import { Trx, Ttrx } from '@bitgo/sdk-coin-trx';
Expand Down Expand Up @@ -134,6 +135,7 @@ export { Tstt };
export { Stx, Tstx, Sip10Token };
export { Sui, Tsui, SuiToken };
export { Tao, Ttao, TaoToken };
export { Tempo, Ttempo, Tip20Token };
export { Tia, Ttia };
export { Ton, Tton, JettonToken };
export { Bld, Tbld };
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 @@ -61,6 +61,7 @@ describe('Coins', () => {
MonToken: 1,
XdcToken: 1,
JettonToken: 1,
Tip20Token: 1,
};
Object.keys(BitGoJS.Coin)
.filter((coinName) => !excludedKeys[coinName])
Expand Down
3 changes: 3 additions & 0 deletions modules/bitgo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@
{
"path": "../sdk-coin-tao"
},
{
"path": "../sdk-coin-tempo"
},
{
"path": "../sdk-coin-tia"
},
Expand Down
33 changes: 2 additions & 31 deletions modules/sdk-coin-tempo/src/lib/keyPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,7 @@
* Tempo KeyPair - Reuses Ethereum KeyPair Implementation
*
* Since Tempo is EVM-compatible and uses the same cryptography (ECDSA/secp256k1)
* as Ethereum, we can directly reuse the Ethereum KeyPair implementation.
* as Ethereum, we directly reuse the Ethereum KeyPair implementation from abstract-eth.
*/

import { bip32 } from '@bitgo/secp256k1';
import { DefaultKeys, KeyPairOptions } from '@bitgo/sdk-core';

/**
* Tempo KeyPair class
* Uses same key derivation as Ethereum (BIP32 + secp256k1)
*/
export class KeyPair {
private keyPair: DefaultKeys;

constructor(source?: KeyPairOptions) {
// TODO: Implement proper key generation when needed
const seed = Buffer.alloc(64);
const hdNode = bip32.fromSeed(seed);

this.keyPair = {
prv: hdNode.toBase58(),
pub: hdNode.neutered().toBase58(),
};
}

getKeys(): DefaultKeys {
return this.keyPair;
}

getAddress(): string {
// TODO: Implement Ethereum-style address derivation
return '0x0000000000000000000000000000000000000000';
}
}
export { KeyPair } from '@bitgo/abstract-eth';
24 changes: 9 additions & 15 deletions modules/sdk-coin-tempo/src/tip20Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
* @prettier
*/
import { BitGoBase, CoinConstructor, MPCAlgorithm, NamedCoinConstructor } from '@bitgo/sdk-core';
import { coins } from '@bitgo/statics';
import { coins, Tip20TokenConfig } from '@bitgo/statics';
import { GetSendMethodArgsOptions, SendMethodArgs } from '@bitgo/abstract-eth';
import { Address } from './lib/types';
import { Tempo } from './tempo';
import { encodeTip20TransferWithMemo, amountToTip20Units, isValidAddress, isValidTip20Amount } from './lib/utils';

/**
* TIP20 Token Configuration Interface
*/
export interface Tip20TokenConfig {
type: string; // Token identifier (e.g., 'tempo:usdc')
coin: string; // Base coin (e.g., 'tempo' or 'ttempo')
network: 'Mainnet' | 'Testnet';
name: string; // Token full name
tokenContractAddress: string; // Smart contract address (0x...)
decimalPlaces: number; // Token decimal places
}
export { Tip20TokenConfig };

/**
* TIP20 Token Implementation (Skeleton)
Expand All @@ -31,8 +21,7 @@ export class Tip20Token extends Tempo {
public readonly tokenConfig: Tip20TokenConfig;

constructor(bitgo: BitGoBase, tokenConfig: Tip20TokenConfig) {
const coinName = tokenConfig.network === 'Mainnet' ? 'tempo' : 'ttempo';
const staticsCoin = coins.get(coinName);
const staticsCoin = tokenConfig.network === 'Mainnet' ? coins.get('tempo') : coins.get('ttempo');
super(bitgo, staticsCoin);
this.tokenConfig = tokenConfig;
}
Expand Down Expand Up @@ -79,7 +68,7 @@ export class Tip20Token extends Tempo {
}

/** Get the network */
get network(): 'Mainnet' | 'Testnet' {
get network(): string {
return this.tokenConfig.network;
}

Expand All @@ -98,6 +87,11 @@ export class Tip20Token extends Tempo {
return this.tokenConfig.type;
}

/** @inheritDoc */
getBaseChain(): string {
return this.coin;
}

/** @inheritDoc */
getFullName(): string {
return 'TIP20 Token';
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@
{
"path": "./modules/sdk-coin-tao"
},
{
"path": "./modules/sdk-coin-tempo"
},
{
"path": "./modules/sdk-coin-tia"
},
Expand Down