@bitgo-beta/sdk-coin-etc 1.2.3-alpha.43 → 1.2.3-alpha.430
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 +102 -4
- package/dist/src/etc.d.ts.map +1 -1
- package/dist/src/etc.js +475 -1
- package/dist/src/index.js +6 -2
- package/dist/src/lib/builder.js +2 -3
- package/dist/src/lib/index.js +23 -9
- package/dist/src/lib/transactionBuilder.js +2 -2
- package/dist/src/lib/utils.js +4 -4
- package/dist/test/resources.d.ts +16 -0
- package/dist/test/resources.d.ts.map +1 -0
- package/dist/test/resources.js +29 -0
- package/dist/test/unit/etc.d.ts +2 -0
- package/dist/test/unit/etc.d.ts.map +1 -0
- package/dist/test/unit/etc.js +194 -0
- package/dist/test/unit/getBuilder.d.ts +3 -0
- package/dist/test/unit/getBuilder.d.ts.map +1 -0
- package/dist/test/unit/getBuilder.js +10 -0
- package/dist/test/unit/transaction.d.ts +2 -0
- package/dist/test/unit/transaction.d.ts.map +1 -0
- package/dist/test/unit/transaction.js +93 -0
- package/dist/test/unit/transactionBuilder/send.d.ts +2 -0
- package/dist/test/unit/transactionBuilder/send.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/send.js +117 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.d.ts +2 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.js +131 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +20 -12
- package/.eslintignore +0 -5
- package/.mocharc.yml +0 -8
- package/CHANGELOG.md +0 -100
package/dist/src/etc.d.ts
CHANGED
|
@@ -1,14 +1,112 @@
|
|
|
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
|
-
|
|
16
|
+
/** inherited doc */
|
|
17
|
+
getDefaultMultisigType(): MultisigType;
|
|
18
|
+
/**
|
|
19
|
+
* Builds a funds recovery transaction without BitGo
|
|
20
|
+
* @param params
|
|
21
|
+
* @param {string} params.userKey - [encrypted] xprv
|
|
22
|
+
* @param {string} params.backupKey - [encrypted] xprv or xpub if the xprv is held by a KRS provider
|
|
23
|
+
* @param {string} params.walletPassphrase - used to decrypt userKey and backupKey
|
|
24
|
+
* @param {string} params.walletContractAddress - the ETH address of the wallet contract
|
|
25
|
+
* @param {string} params.krsProvider - necessary if backup key is held by KRS
|
|
26
|
+
* @param {string} params.recoveryDestination - target address to send recovered funds to
|
|
27
|
+
* @param {string} params.bitgoFeeAddress - wrong chain wallet fee address for evm based cross chain recovery txn
|
|
28
|
+
* @param {string} params.bitgoDestinationAddress - target bitgo address where fee will be sent for evm based cross chain recovery txn
|
|
29
|
+
*/
|
|
30
|
+
recover(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
|
|
31
|
+
getTransactionBuilder(): TransactionBuilder;
|
|
32
|
+
/**
|
|
33
|
+
* Make a query to etc.network for information such as balance, token balance, solidity calls
|
|
34
|
+
* @param {Object} query — key-value pairs of parameters to append after /api
|
|
35
|
+
* @returns {Promise<Object>} response from etc.network
|
|
36
|
+
*/
|
|
37
|
+
recoveryBlockchainExplorerQuery(query: Record<string, any>): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Method to validate recovery params
|
|
40
|
+
* @param {RecoverOptions} params
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
validateRecoveryParams(params: RecoverOptions): void;
|
|
44
|
+
/**
|
|
45
|
+
* Queries public block explorer to get the next ETHLike coin's nonce that should be used for the given ETH address
|
|
46
|
+
* @param {string} address
|
|
47
|
+
* @returns {Promise<number>}
|
|
48
|
+
*/
|
|
49
|
+
getAddressNonce(address: string): Promise<number>;
|
|
50
|
+
/**
|
|
51
|
+
* Queries etc.network for the balance of an address
|
|
52
|
+
* @param {string} address - the ETC address
|
|
53
|
+
* @returns {Promise<BigNumber>} address balance
|
|
54
|
+
*/
|
|
55
|
+
queryAddressBalance(address: string): Promise<BN>;
|
|
56
|
+
/**
|
|
57
|
+
* Queries the contract (via explorer API) for the next sequence ID
|
|
58
|
+
* @param {String} address - address of the contract
|
|
59
|
+
* @returns {Promise<Number>} sequence ID
|
|
60
|
+
*/
|
|
61
|
+
querySequenceId(address: string): Promise<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Check whether the gas price passed in by user are within our max and min bounds
|
|
64
|
+
* If they are not set, set them to the defaults
|
|
65
|
+
* @param {number} userGasPrice - user defined gas price
|
|
66
|
+
* @returns {number} the gas price to use for this transaction
|
|
67
|
+
*/
|
|
68
|
+
setGasPrice(userGasPrice?: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* Check whether gas limit passed in by user are within our max and min bounds
|
|
71
|
+
* If they are not set, set them to the defaults
|
|
72
|
+
* @param {number} userGasLimit user defined gas limit
|
|
73
|
+
* @returns {number} the gas limit to use for this transaction
|
|
74
|
+
*/
|
|
75
|
+
setGasLimit(userGasLimit?: number): number;
|
|
76
|
+
/**
|
|
77
|
+
* @param {Recipient[]} recipients - the recipients of the transaction
|
|
78
|
+
* @param {number} expireTime - the expire time of the transaction
|
|
79
|
+
* @param {number} contractSequenceId - the contract sequence id of the transaction
|
|
80
|
+
* @returns {string}
|
|
81
|
+
*/
|
|
82
|
+
getOperationSha3ForExecuteAndConfirm(recipients: Recipient[], expireTime: number, contractSequenceId: number): string;
|
|
83
|
+
/**
|
|
84
|
+
* Get transfer operation for coin
|
|
85
|
+
* @param {Recipient} recipient - recipient info
|
|
86
|
+
* @param {number} expireTime - expiry time
|
|
87
|
+
* @param {number} contractSequenceId - sequence id
|
|
88
|
+
* @returns {Array} operation array
|
|
89
|
+
*/
|
|
90
|
+
getOperation(recipient: Recipient, expireTime: number, contractSequenceId: number): (string | Buffer)[][];
|
|
91
|
+
/**
|
|
92
|
+
* Method to return the coin's network object
|
|
93
|
+
* @returns {EthLikeNetwork | undefined}
|
|
94
|
+
*/
|
|
95
|
+
getNetwork(): EthLikeNetwork | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Assemble half-sign prebuilt transaction
|
|
98
|
+
* @param {SignTransactionOptions} params
|
|
99
|
+
*/
|
|
100
|
+
signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
|
|
101
|
+
/**
|
|
102
|
+
* Helper function for signTransaction for the rare case that SDK is doing the second signature
|
|
103
|
+
* Note: we are expecting this to be called from the offline vault
|
|
104
|
+
* @param params.txPrebuild
|
|
105
|
+
* @param params.prv
|
|
106
|
+
* @returns {{txHex: string}}
|
|
107
|
+
*/
|
|
108
|
+
signFinal(params: any): Promise<{
|
|
109
|
+
txHex: any;
|
|
110
|
+
}>;
|
|
13
111
|
}
|
|
14
112
|
//# sourceMappingURL=etc.d.ts.map
|
package/dist/src/etc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"etc.d.ts","sourceRoot":"","sources":["../../src/etc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"etc.d.ts","sourceRoot":"","sources":["../../src/etc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,mBAAmB,EAEnB,kBAAkB,EAElB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,QAAQ,EACR,SAAS,EAIT,SAAS,EACT,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAS,eAAe,IAAI,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAA0C,MAAM,OAAO,CAAC;AAInF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,qBAAa,GAAI,SAAQ,mBAAmB;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,mBAAmB,CAAC;IAExE,SAAS,aAAa,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAU/E,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,QAAQ;IAI1F,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAUhC,oBAAoB;IACpB,sBAAsB,IAAI,YAAY;IAItC;;;;;;;;;;;OA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