@bitgo-beta/sdk-coin-etc 1.2.3-alpha.3 → 1.2.3-alpha.300

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.
package/dist/src/etc.d.ts CHANGED
@@ -1,14 +1,114 @@
1
1
  /**
2
2
  * @prettier
3
3
  */
4
- import { AbstractEthLikeCoin } from '@bitgo-beta/abstract-eth';
5
- import { BaseCoin, BitGoBase } from '@bitgo-beta/sdk-core';
6
- import { BaseCoin as StaticsBaseCoin } from '@bitgo-beta/statics';
4
+ import { AbstractEthLikeCoin, OfflineVaultTxInfo, RecoverOptions, RecoveryInfo, SignedTransaction, SignTransactionOptions } from '@bitgo-beta/abstract-eth';
5
+ import { BaseCoin, BitGoBase, Recipient, MultisigType } from '@bitgo-beta/sdk-core';
6
+ import { BaseCoin as StaticsBaseCoin, EthereumNetwork as EthLikeNetwork } from '@bitgo-beta/statics';
7
7
  import { TransactionBuilder } from './lib';
8
+ import { Buffer } from 'buffer';
9
+ import { BN } from 'ethereumjs-util';
8
10
  export declare class Etc extends AbstractEthLikeCoin {
11
+ readonly staticsCoin?: Readonly<StaticsBaseCoin>;
12
+ protected readonly sendMethodName: 'sendMultiSig' | 'sendMultiSigToken';
9
13
  protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
10
14
  static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
11
15
  isValidPub(pub: string): boolean;
12
- protected getTransactionBuilder(): TransactionBuilder;
16
+ /** {@inheritDoc } **/
17
+ supportsMultisig(): boolean;
18
+ /** inherited doc */
19
+ getDefaultMultisigType(): MultisigType;
20
+ /**
21
+ * Builds a funds recovery transaction without BitGo
22
+ * @param params
23
+ * @param {string} params.userKey - [encrypted] xprv
24
+ * @param {string} params.backupKey - [encrypted] xprv or xpub if the xprv is held by a KRS provider
25
+ * @param {string} params.walletPassphrase - used to decrypt userKey and backupKey
26
+ * @param {string} params.walletContractAddress - the ETH address of the wallet contract
27
+ * @param {string} params.krsProvider - necessary if backup key is held by KRS
28
+ * @param {string} params.recoveryDestination - target address to send recovered funds to
29
+ * @param {string} params.bitgoFeeAddress - wrong chain wallet fee address for evm based cross chain recovery txn
30
+ * @param {string} params.bitgoDestinationAddress - target bitgo address where fee will be sent for evm based cross chain recovery txn
31
+ */
32
+ recover(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
33
+ getTransactionBuilder(): TransactionBuilder;
34
+ /**
35
+ * Make a query to etc.network for information such as balance, token balance, solidity calls
36
+ * @param {Object} query — key-value pairs of parameters to append after /api
37
+ * @returns {Promise<Object>} response from etc.network
38
+ */
39
+ recoveryBlockchainExplorerQuery(query: Record<string, any>): Promise<any>;
40
+ /**
41
+ * Method to validate recovery params
42
+ * @param {RecoverOptions} params
43
+ * @returns {void}
44
+ */
45
+ validateRecoveryParams(params: RecoverOptions): void;
46
+ /**
47
+ * Queries public block explorer to get the next ETHLike coin's nonce that should be used for the given ETH address
48
+ * @param {string} address
49
+ * @returns {Promise<number>}
50
+ */
51
+ getAddressNonce(address: string): Promise<number>;
52
+ /**
53
+ * Queries etc.network for the balance of an address
54
+ * @param {string} address - the ETC address
55
+ * @returns {Promise<BigNumber>} address balance
56
+ */
57
+ queryAddressBalance(address: string): Promise<BN>;
58
+ /**
59
+ * Queries the contract (via explorer API) for the next sequence ID
60
+ * @param {String} address - address of the contract
61
+ * @returns {Promise<Number>} sequence ID
62
+ */
63
+ querySequenceId(address: string): Promise<number>;
64
+ /**
65
+ * Check whether the gas price passed in by user are within our max and min bounds
66
+ * If they are not set, set them to the defaults
67
+ * @param {number} userGasPrice - user defined gas price
68
+ * @returns {number} the gas price to use for this transaction
69
+ */
70
+ setGasPrice(userGasPrice?: number): number;
71
+ /**
72
+ * Check whether gas limit passed in by user are within our max and min bounds
73
+ * If they are not set, set them to the defaults
74
+ * @param {number} userGasLimit user defined gas limit
75
+ * @returns {number} the gas limit to use for this transaction
76
+ */
77
+ setGasLimit(userGasLimit?: number): number;
78
+ /**
79
+ * @param {Recipient[]} recipients - the recipients of the transaction
80
+ * @param {number} expireTime - the expire time of the transaction
81
+ * @param {number} contractSequenceId - the contract sequence id of the transaction
82
+ * @returns {string}
83
+ */
84
+ getOperationSha3ForExecuteAndConfirm(recipients: Recipient[], expireTime: number, contractSequenceId: number): string;
85
+ /**
86
+ * Get transfer operation for coin
87
+ * @param {Recipient} recipient - recipient info
88
+ * @param {number} expireTime - expiry time
89
+ * @param {number} contractSequenceId - sequence id
90
+ * @returns {Array} operation array
91
+ */
92
+ getOperation(recipient: Recipient, expireTime: number, contractSequenceId: number): (string | Buffer)[][];
93
+ /**
94
+ * Method to return the coin's network object
95
+ * @returns {EthLikeNetwork | undefined}
96
+ */
97
+ getNetwork(): EthLikeNetwork | undefined;
98
+ /**
99
+ * Assemble half-sign prebuilt transaction
100
+ * @param {SignTransactionOptions} params
101
+ */
102
+ signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
103
+ /**
104
+ * Helper function for signTransaction for the rare case that SDK is doing the second signature
105
+ * Note: we are expecting this to be called from the offline vault
106
+ * @param params.txPrebuild
107
+ * @param params.prv
108
+ * @returns {{txHex: string}}
109
+ */
110
+ signFinal(params: any): Promise<{
111
+ txHex: any;
112
+ }>;
13
113
  }
14
114
  //# sourceMappingURL=etc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"etc.d.ts","sourceRoot":"","sources":["../../src/etc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAS,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAW,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEpD,qBAAa,GAAI,SAAQ,mBAAmB;IAC1C,SAAS,aA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