@bitgo-beta/abstract-eth 1.0.2-beta.235 → 1.0.2-beta.2350
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/abstractEthLikeCoin.d.ts +20 -9
- package/dist/src/abstractEthLikeCoin.d.ts.map +1 -1
- package/dist/src/abstractEthLikeCoin.js +46 -15
- package/dist/src/abstractEthLikeNewCoins.d.ts +978 -0
- package/dist/src/abstractEthLikeNewCoins.d.ts.map +1 -0
- package/dist/src/abstractEthLikeNewCoins.js +3072 -0
- package/dist/src/ethLikeToken.d.ts +38 -6
- package/dist/src/ethLikeToken.d.ts.map +1 -1
- package/dist/src/ethLikeToken.js +293 -10
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -2
- package/dist/src/lib/constants.d.ts +4 -0
- package/dist/src/lib/constants.d.ts.map +1 -0
- package/dist/src/lib/constants.js +11 -0
- package/dist/src/lib/contractCall.d.ts +8 -0
- package/dist/src/lib/contractCall.d.ts.map +1 -0
- package/dist/src/lib/contractCall.js +17 -0
- package/dist/src/lib/decryptionDelegationBuilder.d.ts +90 -0
- package/dist/src/lib/decryptionDelegationBuilder.d.ts.map +1 -0
- package/dist/src/lib/decryptionDelegationBuilder.js +59 -0
- package/dist/src/lib/iface.d.ts +173 -0
- package/dist/src/lib/iface.d.ts.map +1 -0
- package/dist/src/lib/iface.js +8 -0
- package/dist/src/lib/index.d.ts +19 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +60 -0
- package/dist/src/lib/keyPair.d.ts +26 -0
- package/dist/src/lib/keyPair.d.ts.map +1 -0
- package/dist/src/lib/keyPair.js +65 -0
- package/dist/src/lib/messages/eip191/eip191Message.d.ts +12 -0
- package/dist/src/lib/messages/eip191/eip191Message.d.ts.map +1 -0
- package/dist/src/lib/messages/eip191/eip191Message.js +25 -0
- package/dist/src/lib/messages/eip191/eip191MessageBuilder.d.ts +19 -0
- package/dist/src/lib/messages/eip191/eip191MessageBuilder.d.ts.map +1 -0
- package/dist/src/lib/messages/eip191/eip191MessageBuilder.js +27 -0
- package/dist/src/lib/messages/eip191/index.d.ts +3 -0
- package/dist/src/lib/messages/eip191/index.d.ts.map +1 -0
- package/dist/src/lib/messages/eip191/index.js +19 -0
- package/dist/src/lib/messages/eip712/eip712Message.d.ts +6 -0
- package/dist/src/lib/messages/eip712/eip712Message.d.ts.map +1 -0
- package/dist/src/lib/messages/eip712/eip712Message.js +27 -0
- package/dist/src/lib/messages/eip712/eip712MessageBuilder.d.ts +7 -0
- package/dist/src/lib/messages/eip712/eip712MessageBuilder.d.ts.map +1 -0
- package/dist/src/lib/messages/eip712/eip712MessageBuilder.js +15 -0
- package/dist/src/lib/messages/eip712/index.d.ts +3 -0
- package/dist/src/lib/messages/eip712/index.d.ts.map +1 -0
- package/dist/src/lib/messages/eip712/index.js +19 -0
- package/dist/src/lib/messages/index.d.ts +4 -0
- package/dist/src/lib/messages/index.d.ts.map +1 -0
- package/dist/src/lib/messages/index.js +20 -0
- package/dist/src/lib/messages/messageBuilderFactory.d.ts +7 -0
- package/dist/src/lib/messages/messageBuilderFactory.d.ts.map +1 -0
- package/dist/src/lib/messages/messageBuilderFactory.js +23 -0
- package/dist/src/lib/transaction.d.ts +69 -0
- package/dist/src/lib/transaction.d.ts.map +1 -0
- package/dist/src/lib/transaction.js +149 -0
- package/dist/src/lib/transactionBuilder.d.ts +388 -0
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilder.js +1120 -0
- package/dist/src/lib/transferBuilder.d.ts +76 -0
- package/dist/src/lib/transferBuilder.d.ts.map +1 -0
- package/dist/src/lib/transferBuilder.js +307 -0
- package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.d.ts +54 -0
- package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.d.ts.map +1 -0
- package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.js +120 -0
- package/dist/src/lib/transferBuilders/index.d.ts +5 -0
- package/dist/src/lib/transferBuilders/index.d.ts.map +1 -0
- package/dist/src/lib/transferBuilders/index.js +21 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC1155.d.ts +17 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC1155.d.ts.map +1 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC1155.js +96 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC721.d.ts +21 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC721.d.ts.map +1 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC721.js +91 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC7984.d.ts +35 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC7984.d.ts.map +1 -0
- package/dist/src/lib/transferBuilders/transferBuilderERC7984.js +113 -0
- package/dist/src/lib/types.d.ts +40 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +140 -0
- package/dist/src/lib/utils.d.ts +386 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +1026 -0
- package/dist/src/lib/walletUtil.d.ts +46 -0
- package/dist/src/lib/walletUtil.d.ts.map +1 -0
- package/dist/src/lib/walletUtil.js +53 -0
- package/dist/src/lib/zamaUtils.d.ts +257 -0
- package/dist/src/lib/zamaUtils.d.ts.map +1 -0
- package/dist/src/lib/zamaUtils.js +527 -0
- package/dist/src/types.d.ts +9 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +3 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +18 -0
- package/dist/test/unit/coin.d.ts +8 -0
- package/dist/test/unit/coin.d.ts.map +1 -0
- package/dist/test/unit/coin.js +577 -0
- package/dist/test/unit/decryptionDelegationBuilder.d.ts +2 -0
- package/dist/test/unit/decryptionDelegationBuilder.d.ts.map +1 -0
- package/dist/test/unit/decryptionDelegationBuilder.js +265 -0
- package/dist/test/unit/index.d.ts +8 -0
- package/dist/test/unit/index.d.ts.map +1 -0
- package/dist/test/unit/index.js +24 -0
- package/dist/test/unit/messages/abstractEthMessageBuilderTests.d.ts +3 -0
- package/dist/test/unit/messages/abstractEthMessageBuilderTests.d.ts.map +1 -0
- package/dist/test/unit/messages/abstractEthMessageBuilderTests.js +110 -0
- package/dist/test/unit/messages/abstractEthMessageTestTypes.d.ts +43 -0
- package/dist/test/unit/messages/abstractEthMessageTestTypes.d.ts.map +1 -0
- package/dist/test/unit/messages/abstractEthMessageTestTypes.js +3 -0
- package/dist/test/unit/messages/abstractEthMessagesTests.d.ts +3 -0
- package/dist/test/unit/messages/abstractEthMessagesTests.d.ts.map +1 -0
- package/dist/test/unit/messages/abstractEthMessagesTests.js +129 -0
- package/dist/test/unit/messages/eip191/eip191Message.d.ts +2 -0
- package/dist/test/unit/messages/eip191/eip191Message.d.ts.map +1 -0
- package/dist/test/unit/messages/eip191/eip191Message.js +15 -0
- package/dist/test/unit/messages/eip191/eip191MessageBuilder.d.ts +2 -0
- package/dist/test/unit/messages/eip191/eip191MessageBuilder.d.ts.map +1 -0
- package/dist/test/unit/messages/eip191/eip191MessageBuilder.js +16 -0
- package/dist/test/unit/messages/eip191/fixtures.d.ts +109 -0
- package/dist/test/unit/messages/eip191/fixtures.d.ts.map +1 -0
- package/dist/test/unit/messages/eip191/fixtures.js +63 -0
- package/dist/test/unit/messages/eip712/eip712Message.d.ts +2 -0
- package/dist/test/unit/messages/eip712/eip712Message.d.ts.map +1 -0
- package/dist/test/unit/messages/eip712/eip712Message.js +15 -0
- package/dist/test/unit/messages/eip712/eip712MessageBuilder.d.ts +2 -0
- package/dist/test/unit/messages/eip712/eip712MessageBuilder.d.ts.map +1 -0
- package/dist/test/unit/messages/eip712/eip712MessageBuilder.js +16 -0
- package/dist/test/unit/messages/eip712/fixtures.d.ts +76 -0
- package/dist/test/unit/messages/eip712/fixtures.d.ts.map +1 -0
- package/dist/test/unit/messages/eip712/fixtures.js +120 -0
- package/dist/test/unit/messages/index.d.ts +4 -0
- package/dist/test/unit/messages/index.d.ts.map +1 -0
- package/dist/test/unit/messages/index.js +20 -0
- package/dist/test/unit/messages/messageBuilderFactory.d.ts +2 -0
- package/dist/test/unit/messages/messageBuilderFactory.d.ts.map +1 -0
- package/dist/test/unit/messages/messageBuilderFactory.js +52 -0
- package/dist/test/unit/token.d.ts +2 -0
- package/dist/test/unit/token.d.ts.map +1 -0
- package/dist/test/unit/token.js +37 -0
- package/dist/test/unit/transaction.d.ts +3 -0
- package/dist/test/unit/transaction.d.ts.map +1 -0
- package/dist/test/unit/transaction.js +73 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.d.ts +8 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/addressInitialization.js +95 -0
- package/dist/test/unit/transactionBuilder/decryptionDelegation.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/decryptionDelegation.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/decryptionDelegation.js +161 -0
- package/dist/test/unit/transactionBuilder/finalizeUnwrapERC7984.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/finalizeUnwrapERC7984.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/finalizeUnwrapERC7984.js +127 -0
- package/dist/test/unit/transactionBuilder/flushERC7984.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/flushERC7984.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/flushERC7984.js +292 -0
- package/dist/test/unit/transactionBuilder/flushNft.d.ts +2 -0
- package/dist/test/unit/transactionBuilder/flushNft.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/flushNft.js +381 -0
- package/dist/test/unit/transactionBuilder/index.d.ts +10 -0
- package/dist/test/unit/transactionBuilder/index.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/index.js +26 -0
- package/dist/test/unit/transactionBuilder/send.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/send.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/send.js +197 -0
- package/dist/test/unit/transactionBuilder/unwrapERC7984.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/unwrapERC7984.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/unwrapERC7984.js +134 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.d.ts +11 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/walletInitialization.js +137 -0
- package/dist/test/unit/transactionBuilder/wrapERC7984.d.ts +3 -0
- package/dist/test/unit/transactionBuilder/wrapERC7984.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/wrapERC7984.js +140 -0
- package/dist/test/unit/transferBuilder.d.ts +2 -0
- package/dist/test/unit/transferBuilder.d.ts.map +1 -0
- package/dist/test/unit/transferBuilder.js +76 -0
- package/dist/test/unit/utils.d.ts +2 -0
- package/dist/test/unit/utils.d.ts.map +1 -0
- package/dist/test/unit/utils.js +214 -0
- package/dist/test/unit/zamaUtils.d.ts +2 -0
- package/dist/test/unit/zamaUtils.d.ts.map +1 -0
- package/dist/test/unit/zamaUtils.js +616 -0
- package/dist/tsconfig.tsbuildinfo +1 -8442
- package/package.json +34 -10
- package/.eslintignore +0 -5
- package/CHANGELOG.md +0 -178
- package/LICENSE +0 -191
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
|
|
2
|
+
import EthereumCommon from '@ethereumjs/common';
|
|
3
|
+
import BigNumber from 'bignumber.js';
|
|
4
|
+
import { BaseAddress, BaseKey, BaseTransaction, BaseTransactionBuilder, TransactionType } from '@bitgo-beta/sdk-core';
|
|
5
|
+
import { KeyPair } from './keyPair';
|
|
6
|
+
import { Fee, TxData } from './iface';
|
|
7
|
+
import { ERC1155TransferBuilder } from './transferBuilders/transferBuilderERC1155';
|
|
8
|
+
import { ERC721TransferBuilder } from './transferBuilders/transferBuilderERC721';
|
|
9
|
+
import { TransferBuilderERC7984 } from './transferBuilders/transferBuilderERC7984';
|
|
10
|
+
import { Transaction } from './transaction';
|
|
11
|
+
import { TransferBuilder } from './transferBuilder';
|
|
12
|
+
/**
|
|
13
|
+
* EthereumLike transaction builder.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class TransactionBuilder extends BaseTransactionBuilder {
|
|
16
|
+
protected _type: TransactionType;
|
|
17
|
+
protected _common: EthereumCommon;
|
|
18
|
+
protected _sourceKeyPair: KeyPair;
|
|
19
|
+
private _transaction;
|
|
20
|
+
private _counter;
|
|
21
|
+
private _fee;
|
|
22
|
+
protected _value: string;
|
|
23
|
+
private _txSignature;
|
|
24
|
+
private _walletOwnerAddresses;
|
|
25
|
+
protected _walletVersion: number;
|
|
26
|
+
private _forwarderAddress;
|
|
27
|
+
private _tokenAddress;
|
|
28
|
+
private _tokenId;
|
|
29
|
+
private _tokenContractAddress;
|
|
30
|
+
private _encryptedHandle;
|
|
31
|
+
private _parentAddress;
|
|
32
|
+
private _wrapRecipient;
|
|
33
|
+
private _wrapAmount;
|
|
34
|
+
private _wrapRate;
|
|
35
|
+
private _unwrapFrom;
|
|
36
|
+
private _unwrapTo;
|
|
37
|
+
private _unwrapEncryptedAmount;
|
|
38
|
+
private _unwrapInputProof;
|
|
39
|
+
private _finalizeUnwrapRequestId;
|
|
40
|
+
private _finalizeUnwrapCleartextAmount;
|
|
41
|
+
private _finalizeUnwrapDecryptionProof;
|
|
42
|
+
protected _transfer: TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984;
|
|
43
|
+
private _contractAddress;
|
|
44
|
+
private _contractCounter;
|
|
45
|
+
private _forwarderVersion;
|
|
46
|
+
private _initCode;
|
|
47
|
+
private _baseAddress;
|
|
48
|
+
private _feeAddress;
|
|
49
|
+
private _data;
|
|
50
|
+
private _salt;
|
|
51
|
+
protected _walletSimpleByteCode: string;
|
|
52
|
+
/**
|
|
53
|
+
* Public constructor.
|
|
54
|
+
*
|
|
55
|
+
* @param _coinConfig
|
|
56
|
+
*/
|
|
57
|
+
constructor(_coinConfig: Readonly<CoinConfig>);
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
protected buildImplementation(): Promise<BaseTransaction>;
|
|
60
|
+
protected getTransactionData(): TxData;
|
|
61
|
+
/** @inheritdoc */
|
|
62
|
+
protected fromImplementation(rawTransaction: string, isFirstSigner?: boolean): Transaction;
|
|
63
|
+
/**
|
|
64
|
+
* Load the builder data using the deserialized transaction
|
|
65
|
+
*
|
|
66
|
+
* @param {TxData} transactionJson the deserialized transaction json
|
|
67
|
+
* @param {boolean} isFirstSigner if the transaction is being signed by the first signer
|
|
68
|
+
*/
|
|
69
|
+
protected loadBuilderInput(transactionJson: TxData, isFirstSigner?: boolean): void;
|
|
70
|
+
protected setTransactionTypeFields(decodedType: TransactionType, transactionJson: TxData, isFirstSigner?: boolean): void;
|
|
71
|
+
/** @inheritdoc */
|
|
72
|
+
protected signImplementation(key: BaseKey): BaseTransaction;
|
|
73
|
+
/** @inheritdoc */
|
|
74
|
+
validateAddress(address: BaseAddress): void;
|
|
75
|
+
/** @inheritdoc */
|
|
76
|
+
validateKey(key: BaseKey): void;
|
|
77
|
+
/**
|
|
78
|
+
* Validate the raw transaction is either a JSON or
|
|
79
|
+
* a hex encoded transaction
|
|
80
|
+
*
|
|
81
|
+
* @param {any} rawTransaction The raw transaction to be validated
|
|
82
|
+
*/
|
|
83
|
+
validateRawTransaction(rawTransaction: any): void;
|
|
84
|
+
private isEip1559Txn;
|
|
85
|
+
private isRLPDecodable;
|
|
86
|
+
protected validateBaseTransactionFields(): void;
|
|
87
|
+
/** @inheritdoc */
|
|
88
|
+
validateTransaction(transaction: BaseTransaction): void;
|
|
89
|
+
/**
|
|
90
|
+
* Check wallet owner addresses for wallet initialization transactions are valid or throw.
|
|
91
|
+
*/
|
|
92
|
+
private validateWalletInitializationFields;
|
|
93
|
+
/**
|
|
94
|
+
* Check if a token address for the tx was defined or throw.
|
|
95
|
+
*/
|
|
96
|
+
private validateTokenAddress;
|
|
97
|
+
/**
|
|
98
|
+
* Check if a forwarder address for the tx was defined or throw.
|
|
99
|
+
*/
|
|
100
|
+
private validateForwarderAddress;
|
|
101
|
+
/**
|
|
102
|
+
* Check if a contract address for the wallet was defined or throw.
|
|
103
|
+
*/
|
|
104
|
+
private validateContractAddress;
|
|
105
|
+
/**
|
|
106
|
+
* Checks if a contract call data field was defined or throws otherwise
|
|
107
|
+
*/
|
|
108
|
+
private validateDataField;
|
|
109
|
+
/**
|
|
110
|
+
* Check if a token contract address for ERC-7984 flush was defined or throw.
|
|
111
|
+
*/
|
|
112
|
+
private validateTokenContractAddress;
|
|
113
|
+
/**
|
|
114
|
+
* Check if an encrypted handle for ERC-7984 flush was defined or throw.
|
|
115
|
+
*/
|
|
116
|
+
private validateEncryptedHandle;
|
|
117
|
+
/**
|
|
118
|
+
* Check if a parent address for ERC-7984 flush was defined or throw.
|
|
119
|
+
*/
|
|
120
|
+
private validateParentAddress;
|
|
121
|
+
private validateWrapRecipient;
|
|
122
|
+
private validateWrapAmount;
|
|
123
|
+
private validateUnwrapFrom;
|
|
124
|
+
private validateUnwrapTo;
|
|
125
|
+
private validateUnwrapEncryptedAmount;
|
|
126
|
+
private validateUnwrapInputProof;
|
|
127
|
+
private validateFinalizeUnwrapRequestId;
|
|
128
|
+
private validateFinalizeUnwrapCleartextAmount;
|
|
129
|
+
private validateFinalizeUnwrapDecryptionProof;
|
|
130
|
+
private setContract;
|
|
131
|
+
validateValue(value: BigNumber): void;
|
|
132
|
+
/**
|
|
133
|
+
* The type of transaction being built.
|
|
134
|
+
*
|
|
135
|
+
* @param {TransactionType} type
|
|
136
|
+
*/
|
|
137
|
+
type(type: TransactionType): void;
|
|
138
|
+
/**
|
|
139
|
+
* Set the transaction fees. Low fees may get a transaction rejected or never picked up by bakers.
|
|
140
|
+
*
|
|
141
|
+
* @param {Fee} fee Baker fees. May also include the maximum gas to pay
|
|
142
|
+
*/
|
|
143
|
+
fee(fee: Fee): void;
|
|
144
|
+
/**
|
|
145
|
+
* Set the transaction counter to prevent submitting repeated transactions.
|
|
146
|
+
*
|
|
147
|
+
* @param {number} counter The counter to use
|
|
148
|
+
*/
|
|
149
|
+
counter(counter: number): void;
|
|
150
|
+
/**
|
|
151
|
+
* The value to send along with this transaction. 0 by default
|
|
152
|
+
*
|
|
153
|
+
* @param {string} value The value to send along with this transaction
|
|
154
|
+
*/
|
|
155
|
+
value(value: string): void;
|
|
156
|
+
protected buildBase(data: string): TxData;
|
|
157
|
+
/**
|
|
158
|
+
* Set one of the owners of the multisig wallet.
|
|
159
|
+
*
|
|
160
|
+
* @param {string} address An Ethereum address
|
|
161
|
+
*/
|
|
162
|
+
owner(address: string): void;
|
|
163
|
+
/**
|
|
164
|
+
* Build a transaction for a generic multisig contract.
|
|
165
|
+
*
|
|
166
|
+
* @returns {TxData} The Ethereum transaction data
|
|
167
|
+
*/
|
|
168
|
+
protected buildWalletInitializationTransaction(walletVersion?: number): TxData;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the smart contract encoded data
|
|
171
|
+
*
|
|
172
|
+
* @param {string[]} addresses - the contract signers
|
|
173
|
+
* @returns {string} - the smart contract encoded data
|
|
174
|
+
*/
|
|
175
|
+
protected getContractData(addresses: string[]): string;
|
|
176
|
+
contract(address: string): void;
|
|
177
|
+
/**
|
|
178
|
+
* Gets the transfer funds builder if exist, or creates a new one for this transaction and returns it
|
|
179
|
+
*
|
|
180
|
+
* @param {string} data transfer data to initialize the transfer builder with, empty if none given
|
|
181
|
+
* @param {boolean} isFirstSigner whether the transaction is being signed by the first signer
|
|
182
|
+
* @returns {TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984} the transfer builder
|
|
183
|
+
*/
|
|
184
|
+
abstract transfer(data?: string, isFirstSigner?: boolean): TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984;
|
|
185
|
+
/**
|
|
186
|
+
* Returns the serialized sendMultiSig contract method data
|
|
187
|
+
*
|
|
188
|
+
* @returns {string} serialized sendMultiSig data
|
|
189
|
+
*/
|
|
190
|
+
getSendData(): string;
|
|
191
|
+
/**
|
|
192
|
+
* Decide if the coin uses non-packed encoding for tx data
|
|
193
|
+
*
|
|
194
|
+
* @returns {boolean} true if the coin uses non-packed encoding for tx data
|
|
195
|
+
*/
|
|
196
|
+
coinUsesNonPackedEncodingForTxData(): boolean;
|
|
197
|
+
private buildSendTransaction;
|
|
198
|
+
/**
|
|
199
|
+
* Set the contract transaction nonce to calculate the forwarder address.
|
|
200
|
+
*
|
|
201
|
+
* @param {number} contractCounter The counter to use
|
|
202
|
+
*/
|
|
203
|
+
contractCounter(contractCounter: number): void;
|
|
204
|
+
/**
|
|
205
|
+
* Build a transaction to create a forwarder.
|
|
206
|
+
*
|
|
207
|
+
* @returns {TxData} The Ethereum transaction data
|
|
208
|
+
*/
|
|
209
|
+
private buildAddressInitializationTransaction;
|
|
210
|
+
/**
|
|
211
|
+
* Set the forwarder address to flush
|
|
212
|
+
*
|
|
213
|
+
* @param {string} address The address to flush
|
|
214
|
+
*/
|
|
215
|
+
forwarderAddress(address: string): void;
|
|
216
|
+
/**
|
|
217
|
+
* Set the address of the ERC20 token contract that we are flushing tokens for
|
|
218
|
+
*
|
|
219
|
+
* @param {string} address the contract address of the token to flush
|
|
220
|
+
*/
|
|
221
|
+
tokenAddress(address: string): void;
|
|
222
|
+
/**
|
|
223
|
+
* Set the token ID for ERC721/ERC1155 token flush
|
|
224
|
+
*
|
|
225
|
+
* @param {string} tokenId the token ID to flush
|
|
226
|
+
*/
|
|
227
|
+
tokenId(tokenId: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* Build a transaction to flush tokens from a forwarder.
|
|
230
|
+
*
|
|
231
|
+
* @returns {TxData} The Ethereum transaction data
|
|
232
|
+
*/
|
|
233
|
+
private buildFlushTokensTransaction;
|
|
234
|
+
/**
|
|
235
|
+
* Build a transaction to flush tokens from a forwarder.
|
|
236
|
+
*
|
|
237
|
+
* @returns {TxData} The Ethereum transaction data
|
|
238
|
+
*/
|
|
239
|
+
private buildFlushCoinsTransaction;
|
|
240
|
+
/**
|
|
241
|
+
* Build a transaction to flush ERC721 NFTs from a forwarder.
|
|
242
|
+
*
|
|
243
|
+
* @returns {TxData} The Ethereum transaction data
|
|
244
|
+
*/
|
|
245
|
+
private buildFlushERC721Transaction;
|
|
246
|
+
/**
|
|
247
|
+
* Build a transaction to flush ERC1155 tokens from a forwarder.
|
|
248
|
+
*
|
|
249
|
+
* @returns {TxData} The Ethereum transaction data
|
|
250
|
+
*/
|
|
251
|
+
private buildFlushERC1155Transaction;
|
|
252
|
+
data(encodedCall: string): void;
|
|
253
|
+
private buildGenericContractCallTransaction;
|
|
254
|
+
/** @inheritdoc */
|
|
255
|
+
protected get transaction(): Transaction;
|
|
256
|
+
/** @inheritdoc */
|
|
257
|
+
protected set transaction(transaction: Transaction);
|
|
258
|
+
/**
|
|
259
|
+
* Get the final v value. Final v is described in EIP-155.
|
|
260
|
+
*
|
|
261
|
+
* @protected for internal use when the enableFinalVField flag is true.
|
|
262
|
+
*/
|
|
263
|
+
protected getFinalV(): string;
|
|
264
|
+
/**
|
|
265
|
+
* Set the forwarder version for address to be initialized
|
|
266
|
+
*
|
|
267
|
+
* @param {number} version forwarder version
|
|
268
|
+
*/
|
|
269
|
+
forwarderVersion(version: number): void;
|
|
270
|
+
/**
|
|
271
|
+
* Set the salt to create the address using create2
|
|
272
|
+
*
|
|
273
|
+
* @param {string} salt The salt to create the address using create2, hex string
|
|
274
|
+
*/
|
|
275
|
+
salt(salt: string): void;
|
|
276
|
+
/**
|
|
277
|
+
* Take the implementation address for the proxy contract, and get the binary initcode for the associated proxy
|
|
278
|
+
*
|
|
279
|
+
* @param {string} implementationAddress The address of the implementation contract
|
|
280
|
+
*/
|
|
281
|
+
initCode(implementationAddress: string): void;
|
|
282
|
+
/**
|
|
283
|
+
* Set the wallet version for wallet to be initialized
|
|
284
|
+
*
|
|
285
|
+
* @param {number} version wallet version
|
|
286
|
+
*/
|
|
287
|
+
walletVersion(version: number): void;
|
|
288
|
+
/**
|
|
289
|
+
* Set the base address of the wallet
|
|
290
|
+
*
|
|
291
|
+
* @param {string} address The wallet contract address
|
|
292
|
+
*/
|
|
293
|
+
baseAddress(address: string): void;
|
|
294
|
+
/**
|
|
295
|
+
* Set the fee address of the wallet
|
|
296
|
+
*
|
|
297
|
+
* @param {string} address The fee address of the wallet
|
|
298
|
+
*/
|
|
299
|
+
feeAddress(address: string): void;
|
|
300
|
+
/**
|
|
301
|
+
* Get the wallet version for wallet
|
|
302
|
+
*/
|
|
303
|
+
getWalletVersion(): number;
|
|
304
|
+
/**
|
|
305
|
+
* Set the ERC-7984 token contract address for forwarder flush transactions.
|
|
306
|
+
*
|
|
307
|
+
* @param {string} address The ERC-7984 token contract address
|
|
308
|
+
*/
|
|
309
|
+
tokenContractAddress(address: string): void;
|
|
310
|
+
/**
|
|
311
|
+
* Set the encrypted balance handle (bytes32 hex) for forwarder flush transactions.
|
|
312
|
+
* This is the opaque handle returned by confidentialBalanceOf() on the ERC-7984 token contract.
|
|
313
|
+
*
|
|
314
|
+
* @param {string} handle The bytes32 hex encrypted balance handle
|
|
315
|
+
*/
|
|
316
|
+
encryptedHandle(handle: string): void;
|
|
317
|
+
/**
|
|
318
|
+
* Set the parent address (root wallet) for ERC-7984 forwarder flush transactions.
|
|
319
|
+
* The flushed tokens will be transferred to this address.
|
|
320
|
+
*
|
|
321
|
+
* @param {string} address The parent wallet address
|
|
322
|
+
*/
|
|
323
|
+
parentAddress(address: string): void;
|
|
324
|
+
/**
|
|
325
|
+
* Build a transaction to flush ERC-7984 tokens from a V4 forwarder to the parent wallet.
|
|
326
|
+
* Encodes: callFromParent(tokenContractAddress, 0, confidentialTransfer(parentAddress, encryptedHandle))
|
|
327
|
+
*
|
|
328
|
+
* @returns {TxData} The Ethereum transaction data
|
|
329
|
+
*/
|
|
330
|
+
private buildFlushERC7984ForwarderTokenTransaction;
|
|
331
|
+
/**
|
|
332
|
+
* Set the wrap recipient (`to` argument of wrap(address,uint256)).
|
|
333
|
+
* Self-directed shields use the wallet base address.
|
|
334
|
+
*/
|
|
335
|
+
wrapRecipient(address: string): void;
|
|
336
|
+
/**
|
|
337
|
+
* Set the underlying amount to wrap (base units, decimal string).
|
|
338
|
+
*/
|
|
339
|
+
wrapAmount(amount: string): void;
|
|
340
|
+
/**
|
|
341
|
+
* Set the wrapper on-chain `rate()` used for floor(amount / rate) uint64 validation.
|
|
342
|
+
*/
|
|
343
|
+
wrapRate(rate: string): void;
|
|
344
|
+
/**
|
|
345
|
+
* Build a WrapERC7984 (shield) transaction: wrap(to, amount) against the wrapper contract.
|
|
346
|
+
* Does not set gasLimit — WP owns gas.
|
|
347
|
+
*/
|
|
348
|
+
private buildWrapERC7984Transaction;
|
|
349
|
+
/**
|
|
350
|
+
* Set the unwrap `from` address (source of confidential balance).
|
|
351
|
+
*/
|
|
352
|
+
unwrapFrom(address: string): void;
|
|
353
|
+
/**
|
|
354
|
+
* Set the unwrap `to` address (recipient of released ERC-20).
|
|
355
|
+
*/
|
|
356
|
+
unwrapTo(address: string): void;
|
|
357
|
+
/**
|
|
358
|
+
* Set the bytes32 encrypted amount handle for unwrap.
|
|
359
|
+
*/
|
|
360
|
+
unwrapEncryptedAmount(encryptedAmount: string): void;
|
|
361
|
+
/**
|
|
362
|
+
* Set the encryption input proof for unwrap.
|
|
363
|
+
*/
|
|
364
|
+
unwrapInputProof(inputProof: string): void;
|
|
365
|
+
/**
|
|
366
|
+
* Build an UnwrapERC7984 (unshield phase-1) transaction.
|
|
367
|
+
* Does not set gasLimit — WP owns gas.
|
|
368
|
+
*/
|
|
369
|
+
private buildUnwrapERC7984Transaction;
|
|
370
|
+
/**
|
|
371
|
+
* Set the bytes32 unwrap request id for finalizeUnwrap.
|
|
372
|
+
*/
|
|
373
|
+
finalizeUnwrapRequestId(requestId: string): void;
|
|
374
|
+
/**
|
|
375
|
+
* Set the cleartext (decrypted) amount for finalizeUnwrap.
|
|
376
|
+
*/
|
|
377
|
+
finalizeUnwrapCleartextAmount(cleartextAmount: string): void;
|
|
378
|
+
/**
|
|
379
|
+
* Set the oracle decryption proof for finalizeUnwrap.
|
|
380
|
+
*/
|
|
381
|
+
finalizeUnwrapDecryptionProof(decryptionProof: string): void;
|
|
382
|
+
/**
|
|
383
|
+
* Build a FinalizeUnwrapERC7984 (unshield phase-2) transaction.
|
|
384
|
+
* Does not set gasLimit — WP owns gas.
|
|
385
|
+
*/
|
|
386
|
+
private buildFinalizeUnwrapERC7984Transaction;
|
|
387
|
+
}
|
|
388
|
+
//# sourceMappingURL=transactionBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactionBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/transactionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAgC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAEhD,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,OAAO,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,sBAAsB,EAOtB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAEL,GAAG,EAGH,MAAM,EAIP,MAAM,SAAS,CAAC;AAiCjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD;;GAEG;AACH,8BAAsB,kBAAmB,SAAQ,sBAAsB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