@bitgo-beta/sdk-coin-polygon 1.3.3-alpha.45 → 1.3.3-alpha.450
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/index.js +6 -2
- package/dist/src/lib/index.d.ts +2 -1
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +30 -12
- package/dist/src/lib/resources.d.ts.map +1 -1
- package/dist/src/lib/resources.js +8 -4
- package/dist/src/lib/transactionBuilder.d.ts +11 -8
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilder.js +21 -21
- package/dist/src/lib/transferBuilder.d.ts +1 -1
- package/dist/src/lib/transferBuilder.js +3 -3
- package/dist/src/lib/utils.d.ts +1 -1
- package/dist/src/lib/utils.js +6 -6
- package/dist/src/polygon.d.ts +23 -63
- package/dist/src/polygon.d.ts.map +1 -1
- package/dist/src/polygon.js +26 -392
- package/dist/src/polygonToken.d.ts +15 -24
- package/dist/src/polygonToken.d.ts.map +1 -1
- package/dist/src/polygonToken.js +31 -59
- package/dist/src/tpolygon.d.ts +0 -1
- package/dist/src/tpolygon.d.ts.map +1 -1
- package/dist/src/tpolygon.js +1 -4
- package/dist/test/fixtures/polygon.d.ts +151 -0
- package/dist/test/fixtures/polygon.d.ts.map +1 -0
- package/dist/test/fixtures/polygon.js +233 -0
- package/dist/test/getBuilder.d.ts +3 -0
- package/dist/test/getBuilder.d.ts.map +1 -0
- package/dist/test/getBuilder.js +9 -0
- package/dist/test/resources.d.ts +27 -0
- package/dist/test/resources.d.ts.map +1 -0
- package/dist/test/resources.js +41 -0
- package/dist/test/unit/polygon.d.ts +2 -0
- package/dist/test/unit/polygon.d.ts.map +1 -0
- package/dist/test/unit/polygon.js +1202 -0
- package/dist/test/unit/polygonToken.d.ts +2 -0
- package/dist/test/unit/polygonToken.d.ts.map +1 -0
- package/dist/test/unit/polygonToken.js +62 -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 +92 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.d.ts +2 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.js +104 -0
- package/dist/test/unit/transactionBuilder/flushTokens.d.ts +2 -0
- package/dist/test/unit/transactionBuilder/flushTokens.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/flushTokens.js +9 -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 +114 -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 +169 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +20 -19
- package/.eslintignore +0 -5
- package/.mocharc.yml +0 -8
- package/CHANGELOG.md +0 -102
package/dist/src/polygon.d.ts
CHANGED
|
@@ -1,81 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
/**
|
|
2
|
+
* @prettier
|
|
3
|
+
*/
|
|
4
|
+
import { AbstractEthLikeNewCoins } from '@bitgo-beta/abstract-eth';
|
|
5
|
+
import { BaseCoin, BitGoBase, MPCAlgorithm, MultisigType } from '@bitgo-beta/sdk-core';
|
|
5
6
|
import { BaseCoin as StaticsBaseCoin } from '@bitgo-beta/statics';
|
|
6
7
|
import { TransactionBuilder } from './lib';
|
|
7
|
-
import
|
|
8
|
-
export declare class Polygon extends
|
|
9
|
-
protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
|
|
10
|
-
protected readonly sendMethodName: 'sendMultiSig' | 'sendMultiSigToken';
|
|
8
|
+
import { UnsignedSweepTxMPCv2, RecoverOptions, OfflineVaultTxInfo } from '../../abstract-eth/src/abstractEthLikeNewCoins';
|
|
9
|
+
export declare class Polygon extends AbstractEthLikeNewCoins {
|
|
11
10
|
protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
|
|
12
|
-
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
|
|
13
|
-
static getCustomChainName(chainId?: number): string;
|
|
14
|
-
static buildTransaction(params: BuildTransactionParams): EthTxLib.FeeMarketEIP1559Transaction | EthTxLib.Transaction;
|
|
15
|
-
getChain(): string;
|
|
16
|
-
getFamily(): string;
|
|
17
|
-
getFullName(): string;
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Builds an unsigned sweep transaction for TSS
|
|
13
|
+
* @param params - Recovery options
|
|
14
|
+
* @returns {Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2>}
|
|
20
15
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** @inheritDoc */
|
|
24
|
-
explainTransaction(options: ExplainTransactionOptions): Promise<TransactionExplanation>;
|
|
16
|
+
protected buildUnsignedSweepTxnTSS(params: RecoverOptions): Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2>;
|
|
17
|
+
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin;
|
|
25
18
|
/**
|
|
26
19
|
* Create a new transaction builder for the current chain
|
|
27
20
|
* @return a new transaction builder
|
|
28
21
|
*/
|
|
29
|
-
getTransactionBuilder(): TransactionBuilder;
|
|
30
|
-
/**
|
|
31
|
-
* Get transfer operation for coin
|
|
32
|
-
* @param recipient recipient info
|
|
33
|
-
* @param expireTime expiry time
|
|
34
|
-
* @param contractSequenceId sequence id
|
|
35
|
-
* @returns {Array} operation array
|
|
36
|
-
*/
|
|
37
|
-
getOperation(recipient: Recipient, expireTime: number, contractSequenceId: number): (string | Buffer)[][];
|
|
38
|
-
/**
|
|
39
|
-
* Build arguments to call the send method on the wallet contract
|
|
40
|
-
* @param txInfo
|
|
41
|
-
*/
|
|
42
|
-
getSendMethodArgs(txInfo: GetSendMethodArgsOptions): SendMethodArgs[];
|
|
43
|
-
/**
|
|
44
|
-
* Helper function for signTransaction for the rare case that SDK is doing the second signature
|
|
45
|
-
* Note: we are expecting this to be called from the offline vault
|
|
46
|
-
* @param params.txPrebuild
|
|
47
|
-
* @param params.prv
|
|
48
|
-
* @returns {{txHex: string}}
|
|
49
|
-
*/
|
|
50
|
-
signFinalPolygon(params: SignFinalOptions): Promise<FullySignedTransaction>;
|
|
22
|
+
protected getTransactionBuilder(): TransactionBuilder;
|
|
51
23
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @param params
|
|
54
|
-
*/
|
|
55
|
-
signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
|
|
56
|
-
/**
|
|
57
|
-
* Make a query to Polygonscan for information such as balance, token balance, solidity calls
|
|
24
|
+
* Make a query to Polygon explorer for information such as balance, token balance, solidity calls
|
|
58
25
|
* @param {Object} query key-value pairs of parameters to append after /api
|
|
59
|
-
* @
|
|
26
|
+
* @param {string} apiKey optional API key to use instead of the one from the environment
|
|
27
|
+
* @returns {Promise<Object>} response from Polygon
|
|
60
28
|
*/
|
|
61
|
-
recoveryBlockchainExplorerQuery(query: Record<string, string
|
|
62
|
-
/**
|
|
63
|
-
* Builds a funds recovery transaction without BitGo for non-TSS transaction
|
|
64
|
-
* @param params
|
|
65
|
-
* @param {String} params.userKey [encrypted] xprv or xpub
|
|
66
|
-
* @param {String} params.backupKey [encrypted] xprv or xpub if the xprv is held by a KRS provider
|
|
67
|
-
* @param {String} params.walletPassphrase used to decrypt userKey and backupKey
|
|
68
|
-
* @param {String} params.walletContractAddress the Polygon address of the wallet contract
|
|
69
|
-
* @param {String} params.krsProvider necessary if backup key is held by KRS
|
|
70
|
-
* @param {String} params.recoveryDestination target address to send recovered funds to
|
|
71
|
-
* @returns {Promise<RecoveryInfo | OfflineVaultTxInfo>}
|
|
72
|
-
*/
|
|
73
|
-
recoverEthLike(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
|
|
74
|
-
/** @inheritDoc */
|
|
75
|
-
supportsTss(): boolean;
|
|
29
|
+
recoveryBlockchainExplorerQuery(query: Record<string, string>, apiKey?: string): Promise<Record<string, unknown>>;
|
|
76
30
|
/** @inheritDoc */
|
|
77
31
|
supportsMessageSigning(): boolean;
|
|
78
32
|
/** @inheritDoc */
|
|
33
|
+
supportsSigningTypedData(): boolean;
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
supportsTss(): boolean;
|
|
36
|
+
/** inherited doc */
|
|
37
|
+
getDefaultMultisigType(): MultisigType;
|
|
38
|
+
/** @inheritDoc */
|
|
79
39
|
getMPCAlgorithm(): MPCAlgorithm;
|
|
80
40
|
}
|
|
81
41
|
//# sourceMappingURL=polygon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/polygon.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/polygon.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAmC,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAU,YAAY,EAAE,YAAY,EAAiB,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAS,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EACnB,MAAM,gDAAgD,CAAC;AAExD,qBAAa,OAAQ,SAAQ,uBAAuB;IAClD,SAAS,aAAa,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC;IAI/E;;;;OAIG;cACa,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,GAAG,oBAAoB,CAAC;IAIpH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,QAAQ;IAI1F;;;OAGG;IACH,SAAS,CAAC,qBAAqB,IAAI,kBAAkB;IAIrD;;;;;OAKG;IACG,+BAA+B,CACnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAMnC,kBAAkB;IAClB,sBAAsB,IAAI,OAAO;IAIjC,kBAAkB;IAClB,wBAAwB,IAAI,OAAO;IAInC,kBAAkB;IAClB,WAAW,IAAI,OAAO;IAItB,oBAAoB;IACpB,sBAAsB,IAAI,YAAY;IAItC,kBAAkB;IAClB,eAAe,IAAI,YAAY;CAGhC"}
|