1- import { BaseCoin , BitGoBase } from '@bitgo/sdk-core' ;
2- import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics' ;
1+ import { BaseCoin , BitGoBase , Environments } from '@bitgo/sdk-core' ;
2+ import { BaseUnit , BaseCoin as StaticsBaseCoin , coins } from '@bitgo/statics' ;
33import { CosmosCoin , CosmosKeyPair , GasAmountDetails } from '@bitgo/abstract-cosmos' ;
4- import { TransactionBuilderFactory } from './lib' ;
4+ import { KeyPair , TransactionBuilderFactory } from './lib' ;
5+ import { GAS_AMOUNT , GAS_LIMIT } from './lib/constants' ;
6+ import utils from './lib/utils' ;
57
8+ /**
9+ *
10+ * Full Name: Fetch
11+ * Website: https://innovationlab.fetch.ai/
12+ * Docs: https://website.prod.fetch-ai.com/docs/
13+ * GitHub : https://github.com/fetchai
14+ */
615export class Fetch extends CosmosCoin {
716 protected readonly _staticsCoin : Readonly < StaticsBaseCoin > ;
817
@@ -27,36 +36,39 @@ export class Fetch extends CosmosCoin {
2736
2837 /** @inheritDoc **/
2938 getBuilder ( ) : TransactionBuilderFactory {
30- throw new Error ( 'Method not implemented.' ) ;
39+ return new TransactionBuilderFactory ( coins . get ( this . getChain ( ) ) ) ;
3140 }
3241
3342 /** @inheritDoc **/
3443 isValidAddress ( address : string ) : boolean {
35- throw new Error ( 'Method not implemented.' ) ;
44+ return utils . isValidAddress ( address ) || utils . isValidValidatorAddress ( address ) ;
3645 }
3746
3847 /** @inheritDoc **/
3948 getDenomination ( ) : string {
40- throw new Error ( 'Method not implemented' ) ;
49+ return BaseUnit . FETCH ;
4150 }
4251
4352 /** @inheritDoc **/
4453 getGasAmountDetails ( ) : GasAmountDetails {
45- throw new Error ( 'Method not implemented' ) ;
54+ return {
55+ gasAmount : GAS_AMOUNT ,
56+ gasLimit : GAS_LIMIT ,
57+ } ;
4658 }
4759
4860 /** @inheritDoc **/
4961 getKeyPair ( publicKey : string ) : CosmosKeyPair {
50- throw new Error ( 'Method not implemented' ) ;
62+ return new KeyPair ( { pub : publicKey } ) ;
5163 }
5264
5365 /** @inheritDoc **/
5466 protected getPublicNodeUrl ( ) : string {
55- throw new Error ( 'Method not implemented' ) ;
67+ return Environments [ this . bitgo . getEnv ( ) ] . fetchNodeUrl ;
5668 }
5769
5870 /** @inheritDoc **/
5971 getAddressFromPublicKey ( pubKey : string ) : string {
60- throw new Error ( 'Method not implemented' ) ;
72+ return new KeyPair ( { pub : pubKey } ) . getAddress ( ) ;
6173 }
6274}
0 commit comments