diff --git a/CODEOWNERS b/CODEOWNERS index 5f46ff10c3..22b934f710 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -69,6 +69,7 @@ /modules/sdk-coin-sol/ @BitGo/ethalt-team /modules/sdk-coin-stx/ @BitGo/ethalt-team /modules/sdk-coin-sui/ @BitGo/ethalt-team +/modules/sdk-coin-tao/ @BitGo/ethalt-team /modules/sdk-coin-ton/ @BitGo/ethalt-team /modules/sdk-coin-trx/ @BitGo/ethalt-team /modules/sdk-coin-xlm/ @BitGo/ethalt-team diff --git a/Dockerfile b/Dockerfile index e54a64b794..7697b6e44e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,6 +90,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-sei /var/modules/sdk-coin-sei/ COPY --from=builder /tmp/bitgo/modules/sdk-coin-sol /var/modules/sdk-coin-sol/ 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-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/ @@ -166,6 +167,7 @@ cd /var/modules/sdk-coin-sei && yarn link && \ cd /var/modules/sdk-coin-sol && 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-tia && yarn link && \ cd /var/modules/sdk-coin-ton && yarn link && \ cd /var/modules/sdk-coin-trx && yarn link && \ @@ -245,6 +247,7 @@ RUN cd /var/bitgo-express && \ yarn link @bitgo/sdk-coin-sol && \ yarn link @bitgo/sdk-coin-stx && \ yarn link @bitgo/sdk-coin-sui && \ + yarn link @bitgo/sdk-coin-tao && \ yarn link @bitgo/sdk-coin-tia && \ yarn link @bitgo/sdk-coin-ton && \ yarn link @bitgo/sdk-coin-trx && \ diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index 558bd16ddd..30cf9a5c89 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -94,6 +94,7 @@ "@bitgo/sdk-coin-sol": "^4.7.14", "@bitgo/sdk-coin-stx": "^3.3.14", "@bitgo/sdk-coin-sui": "^5.8.16", + "@bitgo/sdk-coin-tao": "^1.0.0", "@bitgo/sdk-coin-tia": "^3.0.26", "@bitgo/sdk-coin-ton": "^3.4.14", "@bitgo/sdk-coin-trx": "^2.0.57", diff --git a/modules/bitgo/src/v2/coinFactory.ts b/modules/bitgo/src/v2/coinFactory.ts index 971c30718c..26d364cd66 100644 --- a/modules/bitgo/src/v2/coinFactory.ts +++ b/modules/bitgo/src/v2/coinFactory.ts @@ -74,6 +74,7 @@ import { Sui, SuiToken, Susd, + Tao, Ton, Tada, Talgo, @@ -124,6 +125,7 @@ import { Tstx, Tsui, Tsusd, + Ttao, Ttia, Tton, Ttrx, @@ -197,6 +199,7 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void { globalCoinFactory.register('stx', Stx.createInstance); globalCoinFactory.register('sui', Sui.createInstance); globalCoinFactory.register('susd', Susd.createInstance); + globalCoinFactory.register('tao', Tao.createInstance); globalCoinFactory.register('tia', Tia.createInstance); globalCoinFactory.register('ton', Ton.createInstance); globalCoinFactory.register('talgo', Talgo.createInstance); @@ -249,6 +252,7 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void { globalCoinFactory.register('tstx', Tstx.createInstance); globalCoinFactory.register('tsui', Tsui.createInstance); globalCoinFactory.register('tsusd', Tsusd.createInstance); + globalCoinFactory.register('ttao', Ttao.createInstance); globalCoinFactory.register('ttia', Ttia.createInstance); globalCoinFactory.register('tton', Tton.createInstance); globalCoinFactory.register('ttrx', Ttrx.createInstance); diff --git a/modules/bitgo/src/v2/coins/index.ts b/modules/bitgo/src/v2/coins/index.ts index 58330345cc..a748856d83 100644 --- a/modules/bitgo/src/v2/coins/index.ts +++ b/modules/bitgo/src/v2/coins/index.ts @@ -44,6 +44,7 @@ import { Sei, Tsei } from '@bitgo/sdk-coin-sei'; import { Sol, Tsol } from '@bitgo/sdk-coin-sol'; import { Stx, Tstx } from '@bitgo/sdk-coin-stx'; import { Sui, Tsui, SuiToken } from '@bitgo/sdk-coin-sui'; +import { Tao, Ttao } from '@bitgo/sdk-coin-tao'; import { Tia, Ttia } from '@bitgo/sdk-coin-tia'; import { Ton, Tton } from '@bitgo/sdk-coin-ton'; import { Trx, Ttrx } from '@bitgo/sdk-coin-trx'; @@ -96,6 +97,7 @@ export { Rune, Trune }; export { Sol, Tsol }; export { Stx, Tstx }; export { Sui, Tsui, SuiToken }; +export { Tao, Ttao }; export { Tia, Ttia }; export { Ton, Tton }; export { Bld, Tbld }; diff --git a/modules/bitgo/tsconfig.json b/modules/bitgo/tsconfig.json index 6bfb378fec..d453639acf 100644 --- a/modules/bitgo/tsconfig.json +++ b/modules/bitgo/tsconfig.json @@ -198,6 +198,9 @@ { "path": "../sdk-coin-sui" }, + { + "path": "../sdk-coin-tao" + }, { "path": "../sdk-coin-tia" }, diff --git a/modules/sdk-coin-tao/.eslintignore b/modules/sdk-coin-tao/.eslintignore new file mode 100644 index 0000000000..1586a150fa --- /dev/null +++ b/modules/sdk-coin-tao/.eslintignore @@ -0,0 +1,4 @@ +node_modules +.idea +public +dist diff --git a/modules/sdk-coin-tao/.gitignore b/modules/sdk-coin-tao/.gitignore new file mode 100644 index 0000000000..67ccce4c64 --- /dev/null +++ b/modules/sdk-coin-tao/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +.idea/ +dist/ diff --git a/modules/sdk-coin-tao/.mocharc.yml b/modules/sdk-coin-tao/.mocharc.yml new file mode 100644 index 0000000000..95814796d1 --- /dev/null +++ b/modules/sdk-coin-tao/.mocharc.yml @@ -0,0 +1,8 @@ +require: 'ts-node/register' +timeout: '60000' +reporter: 'min' +reporter-option: + - 'cdn=true' + - 'json=false' +exit: true +spec: ['test/unit/**/*.ts'] diff --git a/modules/sdk-coin-tao/.npmignore b/modules/sdk-coin-tao/.npmignore new file mode 100644 index 0000000000..d5fb3a098c --- /dev/null +++ b/modules/sdk-coin-tao/.npmignore @@ -0,0 +1,14 @@ +!dist/ +dist/test/ +dist/tsconfig.tsbuildinfo +.idea/ +.prettierrc.yml +tsconfig.json +src/ +test/ +scripts/ +.nyc_output +CODEOWNERS +node_modules/ +.prettierignore +.mocharc.js diff --git a/modules/sdk-coin-tao/.prettierignore b/modules/sdk-coin-tao/.prettierignore new file mode 100644 index 0000000000..3a11d6af29 --- /dev/null +++ b/modules/sdk-coin-tao/.prettierignore @@ -0,0 +1,2 @@ +.nyc_output/ +dist/ diff --git a/modules/sdk-coin-tao/.prettierrc.yml b/modules/sdk-coin-tao/.prettierrc.yml new file mode 100644 index 0000000000..7c3d8dd32a --- /dev/null +++ b/modules/sdk-coin-tao/.prettierrc.yml @@ -0,0 +1,3 @@ +printWidth: 120 +singleQuote: true +trailingComma: 'es5' diff --git a/modules/sdk-coin-tao/CHANGELOG.md b/modules/sdk-coin-tao/CHANGELOG.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/modules/sdk-coin-tao/README.md b/modules/sdk-coin-tao/README.md new file mode 100644 index 0000000000..f65148cf66 --- /dev/null +++ b/modules/sdk-coin-tao/README.md @@ -0,0 +1,30 @@ +# BitGo sdk-coin-tao + +SDK coins provide a modular approach to a monolithic architecture. This and all BitGoJS SDK coins allow developers to use only the coins needed for a given project. + +## Installation + +All coins are loaded traditionally through the `bitgo` package. If you are using coins individually, you will be accessing the coin via the `@bitgo/sdk-api` package. + +In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-tao`. + +```shell +npm i @bitgo/sdk-api @bitgo/sdk-coin-tao +``` + +Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of `bitgo`. + +```javascript +import { BitGoAPI } from '@bitgo/sdk-api'; +import { Apt } from '@bitgo/sdk-coin-tao'; + +const sdk = new BitGoAPI(); + +sdk.register('apt', Apt.createInstance); +``` + +## Development + +Most of the coin implementations are derived from `@bitgo/sdk-core`, `@bitgo/statics`, and coin specific packages. These implementations are used to interact with the BitGo API and BitGo platform services. + +You will notice that the basic version of common class extensions have been provided to you and must be resolved before the package build will succeed. Upon initiation of a given SDK coin, you will need to verify that your coin has been included in the root `tsconfig.packages.json` and that the linting, formatting, and testing succeeds when run both within the coin and from the root of BitGoJS. diff --git a/modules/sdk-coin-tao/package.json b/modules/sdk-coin-tao/package.json new file mode 100644 index 0000000000..909be3ce12 --- /dev/null +++ b/modules/sdk-coin-tao/package.json @@ -0,0 +1,52 @@ +{ + "name": "@bitgo/sdk-coin-tao", + "version": "1.0.0", + "description": "BitGo SDK coin library for TAO (Bittensor) coin", + "main": "./dist/src/index.js", + "types": "./dist/src/index.d.ts", + "scripts": { + "build": "yarn tsc --build --incremental --verbose .", + "fmt": "prettier --write .", + "check-fmt": "prettier --check .", + "clean": "rm -r ./dist", + "lint": "eslint --quiet .", + "prepare": "npm run build", + "test": "npm run coverage", + "coverage": "nyc -- npm run unit-test", + "unit-test": "mocha" + }, + "author": "BitGo SDK Team ", + "license": "MIT", + "engines": { + "node": ">=16 <21" + }, + "repository": { + "type": "git", + "url": "https://github.com/BitGo/BitGoJS.git", + "directory": "modules/sdk-coin-tao" + }, + "lint-staged": { + "*.{js,ts}": [ + "yarn prettier --write", + "yarn eslint --fix" + ] + }, + "publishConfig": { + "access": "public" + }, + "nyc": { + "extension": [ + ".ts" + ] + }, + "dependencies": { + "@aptos-labs/ts-sdk": "^1.32.0", + "@bitgo/sdk-core": "^28.18.0", + "@bitgo/statics": "^50.17.0", + "bignumber.js": "^9.1.2" + }, + "devDependencies": { + "@bitgo/sdk-api": "^1.57.6", + "@bitgo/sdk-test": "^8.0.62" + } +} diff --git a/modules/sdk-coin-tao/src/index.ts b/modules/sdk-coin-tao/src/index.ts new file mode 100644 index 0000000000..dae2702397 --- /dev/null +++ b/modules/sdk-coin-tao/src/index.ts @@ -0,0 +1,4 @@ +export * from './lib'; +export * from './register'; +export * from './tao'; +export * from './ttao'; diff --git a/modules/sdk-coin-tao/src/lib/iface.ts b/modules/sdk-coin-tao/src/lib/iface.ts new file mode 100644 index 0000000000..546ef821e8 --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/iface.ts @@ -0,0 +1,6 @@ +/** + * The transaction data returned from the toJson() function of a transaction + */ +export interface TxData { + id: string; +} diff --git a/modules/sdk-coin-tao/src/lib/index.ts b/modules/sdk-coin-tao/src/lib/index.ts new file mode 100644 index 0000000000..aa5217eaac --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/index.ts @@ -0,0 +1,9 @@ +import * as Utils from './utils'; +import * as Interface from './iface'; + +export { KeyPair } from './keyPair'; +export { Transaction } from './transaction'; +export { TransactionBuilder } from './transactionBuilder'; +export { TransferBuilder } from './transferBuilder'; +export { TransactionBuilderFactory } from './transactionBuilderFactory'; +export { Interface, Utils }; diff --git a/modules/sdk-coin-tao/src/lib/keyPair.ts b/modules/sdk-coin-tao/src/lib/keyPair.ts new file mode 100644 index 0000000000..bb4449c74a --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/keyPair.ts @@ -0,0 +1,23 @@ +import { DefaultKeys, Ed25519KeyPair } from '@bitgo/sdk-core'; + +export class KeyPair extends Ed25519KeyPair { + /** @inheritdoc */ + getKeys(): DefaultKeys { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + recordKeysFromPrivateKeyInProtocolFormat(prv: string): DefaultKeys { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + recordKeysFromPublicKeyInProtocolFormat(pub: string): DefaultKeys { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + getAddress(): string { + throw new Error('Method not implemented.'); + } +} diff --git a/modules/sdk-coin-tao/src/lib/transaction.ts b/modules/sdk-coin-tao/src/lib/transaction.ts new file mode 100644 index 0000000000..431c397b49 --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/transaction.ts @@ -0,0 +1,16 @@ +import { BaseKey, BaseTransaction } from '@bitgo/sdk-core'; +import { TxData } from './iface'; + +export class Transaction extends BaseTransaction { + canSign(key: BaseKey): boolean { + return false; + } + + toBroadcastFormat(): string { + throw new Error('Method not implemented.'); + } + + toJson(): TxData { + throw new Error('Method not implemented.'); + } +} diff --git a/modules/sdk-coin-tao/src/lib/transactionBuilder.ts b/modules/sdk-coin-tao/src/lib/transactionBuilder.ts new file mode 100644 index 0000000000..04175935ff --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/transactionBuilder.ts @@ -0,0 +1,99 @@ +import { + BaseAddress, + BaseKey, + BaseTransactionBuilder, + BuildTransactionError, + FeeOptions, + PublicKey as BasePublicKey, + Signature, + TransactionType, +} from '@bitgo/sdk-core'; +import { Transaction } from './transaction'; +import utils from './utils'; +import BigNumber from 'bignumber.js'; + +export abstract class TransactionBuilder extends BaseTransactionBuilder { + protected _transaction: Transaction; + private _signatures: Signature[] = []; + + // get and set region + /** + * The transaction type. + */ + protected abstract get transactionType(): TransactionType; + + /** @inheritdoc */ + protected get transaction(): Transaction { + return this._transaction; + } + + /** @inheritdoc */ + protected set transaction(transaction: Transaction) { + this._transaction = transaction; + } + + /** @inheritdoc */ + protected signImplementation(key: BaseKey): Transaction { + throw new Error('Method not implemented.'); + } + + /** @inheritDoc */ + addSignature(publicKey: BasePublicKey, signature: Buffer): void { + this._signatures.push({ publicKey, signature }); + } + + /** + * Sets the sender of this transaction. + * This account will be responsible for paying transaction fees. + * + * @param {string} senderAddress the account that is sending this transaction + * @returns {TransactionBuilder} This transaction builder + */ + sender(senderAddress: string): this { + throw new Error('Method not implemented.'); + } + + fee(feeOptions: FeeOptions): this { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + protected fromImplementation(rawTransaction: string): Transaction { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + protected async buildImplementation(): Promise { + throw new Error('Method not implemented.'); + } + + // region Validators + /** @inheritdoc */ + validateAddress(address: BaseAddress, addressFormat?: string): void { + if (!utils.isValidAddress(address.address)) { + throw new BuildTransactionError('Invalid address ' + address.address); + } + } + + /** @inheritdoc */ + validateKey(key: BaseKey): void { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + validateRawTransaction(rawTransaction: string): void { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + validateTransaction(transaction?: Transaction): void { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + validateValue(value: BigNumber): void { + if (value.isLessThan(0)) { + throw new BuildTransactionError('Value cannot be less than zero'); + } + } +} diff --git a/modules/sdk-coin-tao/src/lib/transactionBuilderFactory.ts b/modules/sdk-coin-tao/src/lib/transactionBuilderFactory.ts new file mode 100644 index 0000000000..b963ec4b4d --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/transactionBuilderFactory.ts @@ -0,0 +1,20 @@ +import { BaseTransactionBuilderFactory } from '@bitgo/sdk-core'; +import { TransactionBuilder } from './transactionBuilder'; +import { TransferBuilder } from './transferBuilder'; + +export class TransactionBuilderFactory extends BaseTransactionBuilderFactory { + /** @inheritdoc */ + from(raw: string): TransactionBuilder { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + getTransferBuilder(): TransferBuilder { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + getWalletInitializationBuilder(): void { + throw new Error('Method not implemented.'); + } +} diff --git a/modules/sdk-coin-tao/src/lib/transferBuilder.ts b/modules/sdk-coin-tao/src/lib/transferBuilder.ts new file mode 100644 index 0000000000..b7ce748c92 --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/transferBuilder.ts @@ -0,0 +1,13 @@ +import { TransactionBuilder } from './transactionBuilder'; +import { BaseCoin as CoinConfig } from '@bitgo/statics'; +import { TransactionType } from '@bitgo/sdk-core'; + +export class TransferBuilder extends TransactionBuilder { + constructor(_coinConfig: Readonly) { + super(_coinConfig); + } + + protected get transactionType(): TransactionType { + return TransactionType.Send; + } +} diff --git a/modules/sdk-coin-tao/src/lib/utils.ts b/modules/sdk-coin-tao/src/lib/utils.ts new file mode 100644 index 0000000000..b0cdef2405 --- /dev/null +++ b/modules/sdk-coin-tao/src/lib/utils.ts @@ -0,0 +1,37 @@ +import { BaseUtils } from '@bitgo/sdk-core'; + +export class Utils implements BaseUtils { + /** @inheritdoc */ + isValidAddress(address: string): boolean { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + isValidBlockId(hash: string): boolean { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + isValidPrivateKey(key: string): boolean { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + isValidPublicKey(key: string): boolean { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + isValidSignature(signature: string): boolean { + throw new Error('Method not implemented.'); + } + + /** @inheritdoc */ + isValidTransactionId(txId: string): boolean { + throw new Error('Method not implemented.'); + } +} + +const utils = new Utils(); + +export default utils; diff --git a/modules/sdk-coin-tao/src/register.ts b/modules/sdk-coin-tao/src/register.ts new file mode 100644 index 0000000000..7af304e77a --- /dev/null +++ b/modules/sdk-coin-tao/src/register.ts @@ -0,0 +1,8 @@ +import { BitGoBase } from '@bitgo/sdk-core'; +import { Tao } from './tao'; +import { Ttao } from './ttao'; + +export const register = (sdk: BitGoBase): void => { + sdk.register('tao', Tao.createInstance); + sdk.register('ttao', Ttao.createInstance); +}; diff --git a/modules/sdk-coin-tao/src/tao.ts b/modules/sdk-coin-tao/src/tao.ts new file mode 100644 index 0000000000..f5df6e92da --- /dev/null +++ b/modules/sdk-coin-tao/src/tao.ts @@ -0,0 +1,73 @@ +import { + BaseCoin, + BitGoBase, + KeyPair, + ParsedTransaction, + ParseTransactionOptions, + SignedTransaction, + SignTransactionOptions, + VerifyAddressOptions, + VerifyTransactionOptions, +} from '@bitgo/sdk-core'; +import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics'; +import { SubstrateCoin } from '@bitgo/abstract-substrate'; + +export class Tao extends SubstrateCoin { + protected readonly _staticsCoin: Readonly; + protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly) { + super(bitgo); + + if (!staticsCoin) { + throw new Error('missing required constructor parameter staticsCoin'); + } + + this._staticsCoin = staticsCoin; + } + + static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin { + return new Tao(bitgo, staticsCoin); + } + + /** + * Factor between the coin's base unit and its smallest subdivison + */ + public getBaseFactor(): number { + return 1e9; + } + + public getChain(): string { + return 'tap'; + } + + public getFullName(): string { + return 'Bittensor'; + } + + verifyTransaction(params: VerifyTransactionOptions): Promise { + throw new Error('Method not implemented.'); + } + + isWalletAddress(params: VerifyAddressOptions): Promise { + throw new Error('Method not implemented.'); + } + + parseTransaction(params: ParseTransactionOptions): Promise { + throw new Error('Method not implemented.'); + } + + generateKeyPair(seed?: Buffer): KeyPair { + throw new Error('Method not implemented.'); + } + + isValidPub(pub: string): boolean { + throw new Error('Method not implemented.'); + } + + isValidAddress(address: string): boolean { + throw new Error('Method not implemented.'); + } + + signTransaction(params: SignTransactionOptions): Promise { + throw new Error('Method not implemented.'); + } +} diff --git a/modules/sdk-coin-tao/src/ttao.ts b/modules/sdk-coin-tao/src/ttao.ts new file mode 100644 index 0000000000..9f8f71ddca --- /dev/null +++ b/modules/sdk-coin-tao/src/ttao.ts @@ -0,0 +1,34 @@ +import { BaseCoin, BitGoBase } from '@bitgo/sdk-core'; +import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics'; +import { Tao } from './tao'; + +export class Ttao extends Tao { + protected readonly _staticsCoin: Readonly; + protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly) { + super(bitgo, staticsCoin); + + if (!staticsCoin) { + throw new Error('missing required constructor parameter staticsCoin'); + } + + this._staticsCoin = staticsCoin; + } + + static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin { + return new Ttao(bitgo, staticsCoin); + } + + /** + * Identifier for the blockchain which supports this coin + */ + public getChain(): string { + return 'ttao'; + } + + /** + * Complete human-readable name of this coin + */ + public getFullName(): string { + return 'Testnet Bittensor'; + } +} diff --git a/modules/sdk-coin-tao/test/integration/index.ts b/modules/sdk-coin-tao/test/integration/index.ts new file mode 100644 index 0000000000..39f6ca6243 --- /dev/null +++ b/modules/sdk-coin-tao/test/integration/index.ts @@ -0,0 +1,15 @@ +import 'should'; +import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test'; +import { BitGoAPI } from '@bitgo/sdk-api'; +import { Tao, Ttao } from '../../src'; + +describe('Tao:', function () { + let bitgo: TestBitGoAPI; + + before(function () { + bitgo = TestBitGo.decorate(BitGoAPI, { env: 'mock' }); + bitgo.safeRegister('tao', Tao.createInstance); + bitgo.safeRegister('ttao', Ttao.createInstance); + bitgo.initializeTestVars(); + }); +}); diff --git a/modules/sdk-coin-tao/tsconfig.json b/modules/sdk-coin-tao/tsconfig.json new file mode 100644 index 0000000000..aa8f5a7e66 --- /dev/null +++ b/modules/sdk-coin-tao/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./", + "strictPropertyInitialization": false, + "esModuleInterop": true, + "typeRoots": ["../../types", "./node_modules/@types", "../../node_modules/@types"] + }, + "include": ["src/**/*", "test/**/*"], + "exclude": ["node_modules"], + "references": [ + { + "path": "../sdk-api" + }, + { + "path": "../sdk-core" + }, + { + "path": "../sdk-test" + }, + { + "path": "../statics" + } + ] +} diff --git a/tsconfig.packages.json b/tsconfig.packages.json index a4b9249737..b202994e99 100644 --- a/tsconfig.packages.json +++ b/tsconfig.packages.json @@ -172,6 +172,9 @@ { "path": "./modules/sdk-coin-sui" }, + { + "path": "./modules/sdk-coin-tao" + }, { "path": "./modules/sdk-coin-tia" },