@bitgo-beta/sdk-coin-atom 3.1.2-beta.99 → 3.1.2-beta.991

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +809 -0
  2. package/dist/src/atom.d.ts +7 -114
  3. package/dist/src/atom.d.ts.map +1 -1
  4. package/dist/src/atom.js +12 -498
  5. package/dist/src/index.js +6 -2
  6. package/dist/src/lib/constants.d.ts +0 -6
  7. package/dist/src/lib/constants.d.ts.map +1 -1
  8. package/dist/src/lib/constants.js +5 -11
  9. package/dist/src/lib/index.d.ts +3 -8
  10. package/dist/src/lib/index.d.ts.map +1 -1
  11. package/dist/src/lib/index.js +33 -24
  12. package/dist/src/lib/keyPair.d.ts +3 -12
  13. package/dist/src/lib/keyPair.d.ts.map +1 -1
  14. package/dist/src/lib/keyPair.js +5 -43
  15. package/dist/src/lib/transactionBuilderFactory.d.ts +8 -11
  16. package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
  17. package/dist/src/lib/transactionBuilderFactory.js +21 -11
  18. package/dist/src/lib/utils.d.ts +5 -159
  19. package/dist/src/lib/utils.d.ts.map +1 -1
  20. package/dist/src/lib/utils.js +32 -498
  21. package/dist/src/tatom.d.ts +0 -8
  22. package/dist/src/tatom.d.ts.map +1 -1
  23. package/dist/src/tatom.js +1 -13
  24. package/package.json +10 -15
  25. package/dist/src/lib/StakingActivateBuilder.d.ts +0 -11
  26. package/dist/src/lib/StakingActivateBuilder.d.ts.map +0 -1
  27. package/dist/src/lib/StakingActivateBuilder.js +0 -31
  28. package/dist/src/lib/StakingDeactivateBuilder.d.ts +0 -11
  29. package/dist/src/lib/StakingDeactivateBuilder.d.ts.map +0 -1
  30. package/dist/src/lib/StakingDeactivateBuilder.js +0 -31
  31. package/dist/src/lib/StakingWithdrawRewardsBuilder.d.ts +0 -11
  32. package/dist/src/lib/StakingWithdrawRewardsBuilder.d.ts.map +0 -1
  33. package/dist/src/lib/StakingWithdrawRewardsBuilder.js +0 -31
  34. package/dist/src/lib/iface.d.ts +0 -46
  35. package/dist/src/lib/iface.d.ts.map +0 -1
  36. package/dist/src/lib/iface.js +0 -3
  37. package/dist/src/lib/transaction.d.ts +0 -58
  38. package/dist/src/lib/transaction.d.ts.map +0 -1
  39. package/dist/src/lib/transaction.js +0 -271
  40. package/dist/src/lib/transactionBuilder.d.ts +0 -78
  41. package/dist/src/lib/transactionBuilder.d.ts.map +0 -1
  42. package/dist/src/lib/transactionBuilder.js +0 -179
  43. package/dist/src/lib/transferBuilder.d.ts +0 -11
  44. package/dist/src/lib/transferBuilder.d.ts.map +0 -1
  45. package/dist/src/lib/transferBuilder.js +0 -31
@@ -1,133 +1,26 @@
1
- /// <reference types="node" />
2
- import { BaseCoin, BitGoBase, ExplanationResult, KeyPair, MPCAlgorithm, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo-beta/sdk-core';
3
- import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo-beta/statics';
4
- import { Hash } from 'crypto';
1
+ import { CosmosCoin, CosmosKeyPair, GasAmountDetails } from '@bitgo-beta/abstract-cosmos';
2
+ import { BaseCoin, BitGoBase } from '@bitgo-beta/sdk-core';
3
+ import { BaseCoin as StaticsBaseCoin } from '@bitgo-beta/statics';
5
4
  import { TransactionBuilderFactory } from './lib';
6
- import * as request from 'superagent';
7
- /**
8
- * Atom accounts support memo Id based addresses
9
- */
10
- interface AddressDetails {
11
- address: string;
12
- memoId?: string | undefined;
13
- }
14
- interface RecoveryOptions {
15
- userKey?: string;
16
- backupKey?: string;
17
- bitgoKey: string;
18
- recoveryDestination: string;
19
- krsProvider?: string;
20
- walletPassphrase?: string;
21
- startingScanIndex?: number;
22
- scan?: number;
23
- }
24
- interface AtomTx {
25
- serializedTx: string;
26
- scanIndex: number;
27
- }
28
- export declare class Atom extends BaseCoin {
5
+ export declare class Atom extends CosmosCoin {
29
6
  protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
30
7
  protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
31
8
  static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
32
9
  /** @inheritDoc **/
33
10
  getBaseFactor(): string | number;
34
- /** @inheritDoc **/
35
- getChain(): string;
36
- /** @inheritDoc **/
37
- getFamily(): CoinFamily;
38
- /** @inheritDoc **/
39
- getFullName(): string;
40
- /** @inheritDoc */
41
- supportsTss(): boolean;
42
- /** @inheritDoc **/
43
- getMPCAlgorithm(): MPCAlgorithm;
44
- /** @inheritDoc **/
45
- isValidPub(pub: string): boolean;
46
- /** @inheritDoc **/
47
- isValidPrv(prv: string): boolean;
48
11
  getBuilder(): TransactionBuilderFactory;
49
12
  /** @inheritDoc **/
50
13
  isValidAddress(address: string): boolean;
51
14
  /** @inheritDoc **/
52
- verifyTransaction(params: VerifyTransactionOptions): Promise<boolean>;
53
- /** @inheritDoc **/
54
- parseTransaction(params: ParseTransactionOptions & {
55
- txHex: string;
56
- }): Promise<ParsedTransaction>;
15
+ getDenomination(): string;
57
16
  /** @inheritDoc **/
58
- explainTransaction(options: {
59
- txHex: string;
60
- }): Promise<ExplanationResult>;
17
+ getGasAmountDetails(): GasAmountDetails;
61
18
  /** @inheritDoc **/
62
- generateKeyPair(seed?: Buffer): KeyPair;
63
- /**
64
- * Sign a transaction with a single private key
65
- * @param params parameters in the form of { txPrebuild: {txHex}, prv }
66
- * @returns signed transaction in the form of { txHex }
67
- */
68
- signTransaction(params: SignTransactionOptions & {
69
- txPrebuild: {
70
- txHex: string;
71
- };
72
- prv: string;
73
- }): Promise<SignedTransaction>;
74
- /**
75
- * Builds a funds recovery transaction without BitGo
76
- * @param {RecoveryOptions} params parameters needed to construct and
77
- * (maybe) sign the transaction
78
- *
79
- * @returns {AtomTx} the serialized transaction hex string and index
80
- * of the address being swept
81
- */
82
- recover(params: RecoveryOptions): Promise<AtomTx>;
83
- /**
84
- * Get balance from public node
85
- */
86
- protected getBalanceFromNode(senderAddress: string): Promise<request.Response>;
87
- /**
88
- * Helper to fetch chainId
89
- */
90
- protected getChainId(): Promise<string>;
91
- /**
92
- * Get chain id from public node
93
- */
94
- protected getChainIdFromNode(): Promise<request.Response>;
95
- /**
96
- * Helper to fetch account number
97
- */
98
- protected getAccountDetails(senderAddress: string): Promise<string[]>;
99
- /**
100
- * Get account number from public node
101
- */
102
- protected getAccountFromNode(senderAddress: string): Promise<request.Response>;
103
- /**
104
- * Helper to fetch account balance
105
- */
106
- protected getAccountBalance(senderAddress: string): Promise<string>;
19
+ getKeyPair(publicKey: string): CosmosKeyPair;
107
20
  /**
108
21
  * Get the public node url from the Environments constant we have defined
109
22
  */
110
23
  protected getPublicNodeUrl(): string;
111
24
  getAddressFromPublicKey(pubKey: string): string;
112
- /** @inheritDoc **/
113
- isWalletAddress(params: VerifyAddressOptions): Promise<boolean>;
114
- getHashFunction(): Hash;
115
- /**
116
- * Process address into address and memo id
117
- *
118
- * @param address the address
119
- * @returns object containing address and memo id
120
- */
121
- getAddressDetails(address: string): AddressDetails;
122
- /**
123
- * Return boolean indicating whether a memo id is valid
124
- *
125
- * @param memoId memo id
126
- * @returns true if memo id is valid
127
- */
128
- isValidMemoId(memoId: string): boolean;
129
- private getKeyCombinedFromTssKeyShares;
130
- private signRecoveryTSS;
131
25
  }
132
- export {};
133
26
  //# sourceMappingURL=atom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"atom.d.ts","sourceRoot":"","sources":["../../src/atom.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EAER,SAAS,EAKT,iBAAiB,EAIjB,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EAEjB,sBAAsB,EAGtB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,IAAI,eAAe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