@bitgo-beta/abstract-eth 1.0.2-beta.210 → 1.0.2-beta.2100
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 +876 -0
- package/dist/src/abstractEthLikeNewCoins.d.ts.map +1 -0
- package/dist/src/abstractEthLikeNewCoins.js +2664 -0
- package/dist/src/ethLikeToken.d.ts +38 -6
- package/dist/src/ethLikeToken.d.ts.map +1 -1
- package/dist/src/ethLikeToken.js +289 -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 +143 -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 +313 -0
- package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilder.js +926 -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 +350 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +946 -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 +107 -0
- package/dist/src/lib/zamaUtils.d.ts.map +1 -0
- package/dist/src/lib/zamaUtils.js +220 -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/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 +7 -0
- package/dist/test/unit/transactionBuilder/index.d.ts.map +1 -0
- package/dist/test/unit/transactionBuilder/index.js +23 -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/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/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 +352 -0
- package/dist/tsconfig.tsbuildinfo +1 -8286
- package/package.json +34 -10
- package/.eslintignore +0 -5
- package/CHANGELOG.md +0 -166
|
@@ -0,0 +1,313 @@
|
|
|
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
|
+
protected _transfer: TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984;
|
|
33
|
+
private _contractAddress;
|
|
34
|
+
private _contractCounter;
|
|
35
|
+
private _forwarderVersion;
|
|
36
|
+
private _initCode;
|
|
37
|
+
private _baseAddress;
|
|
38
|
+
private _feeAddress;
|
|
39
|
+
private _data;
|
|
40
|
+
private _salt;
|
|
41
|
+
protected _walletSimpleByteCode: string;
|
|
42
|
+
/**
|
|
43
|
+
* Public constructor.
|
|
44
|
+
*
|
|
45
|
+
* @param _coinConfig
|
|
46
|
+
*/
|
|
47
|
+
constructor(_coinConfig: Readonly<CoinConfig>);
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
protected buildImplementation(): Promise<BaseTransaction>;
|
|
50
|
+
protected getTransactionData(): TxData;
|
|
51
|
+
/** @inheritdoc */
|
|
52
|
+
protected fromImplementation(rawTransaction: string, isFirstSigner?: boolean): Transaction;
|
|
53
|
+
/**
|
|
54
|
+
* Load the builder data using the deserialized transaction
|
|
55
|
+
*
|
|
56
|
+
* @param {TxData} transactionJson the deserialized transaction json
|
|
57
|
+
* @param {boolean} isFirstSigner if the transaction is being signed by the first signer
|
|
58
|
+
*/
|
|
59
|
+
protected loadBuilderInput(transactionJson: TxData, isFirstSigner?: boolean): void;
|
|
60
|
+
protected setTransactionTypeFields(decodedType: TransactionType, transactionJson: TxData, isFirstSigner?: boolean): void;
|
|
61
|
+
/** @inheritdoc */
|
|
62
|
+
protected signImplementation(key: BaseKey): BaseTransaction;
|
|
63
|
+
/** @inheritdoc */
|
|
64
|
+
validateAddress(address: BaseAddress): void;
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
validateKey(key: BaseKey): void;
|
|
67
|
+
/**
|
|
68
|
+
* Validate the raw transaction is either a JSON or
|
|
69
|
+
* a hex encoded transaction
|
|
70
|
+
*
|
|
71
|
+
* @param {any} rawTransaction The raw transaction to be validated
|
|
72
|
+
*/
|
|
73
|
+
validateRawTransaction(rawTransaction: any): void;
|
|
74
|
+
private isEip1559Txn;
|
|
75
|
+
private isRLPDecodable;
|
|
76
|
+
protected validateBaseTransactionFields(): void;
|
|
77
|
+
/** @inheritdoc */
|
|
78
|
+
validateTransaction(transaction: BaseTransaction): void;
|
|
79
|
+
/**
|
|
80
|
+
* Check wallet owner addresses for wallet initialization transactions are valid or throw.
|
|
81
|
+
*/
|
|
82
|
+
private validateWalletInitializationFields;
|
|
83
|
+
/**
|
|
84
|
+
* Check if a token address for the tx was defined or throw.
|
|
85
|
+
*/
|
|
86
|
+
private validateTokenAddress;
|
|
87
|
+
/**
|
|
88
|
+
* Check if a forwarder address for the tx was defined or throw.
|
|
89
|
+
*/
|
|
90
|
+
private validateForwarderAddress;
|
|
91
|
+
/**
|
|
92
|
+
* Check if a contract address for the wallet was defined or throw.
|
|
93
|
+
*/
|
|
94
|
+
private validateContractAddress;
|
|
95
|
+
/**
|
|
96
|
+
* Checks if a contract call data field was defined or throws otherwise
|
|
97
|
+
*/
|
|
98
|
+
private validateDataField;
|
|
99
|
+
/**
|
|
100
|
+
* Check if a token contract address for ERC-7984 flush was defined or throw.
|
|
101
|
+
*/
|
|
102
|
+
private validateTokenContractAddress;
|
|
103
|
+
/**
|
|
104
|
+
* Check if an encrypted handle for ERC-7984 flush was defined or throw.
|
|
105
|
+
*/
|
|
106
|
+
private validateEncryptedHandle;
|
|
107
|
+
/**
|
|
108
|
+
* Check if a parent address for ERC-7984 flush was defined or throw.
|
|
109
|
+
*/
|
|
110
|
+
private validateParentAddress;
|
|
111
|
+
private setContract;
|
|
112
|
+
validateValue(value: BigNumber): void;
|
|
113
|
+
/**
|
|
114
|
+
* The type of transaction being built.
|
|
115
|
+
*
|
|
116
|
+
* @param {TransactionType} type
|
|
117
|
+
*/
|
|
118
|
+
type(type: TransactionType): void;
|
|
119
|
+
/**
|
|
120
|
+
* Set the transaction fees. Low fees may get a transaction rejected or never picked up by bakers.
|
|
121
|
+
*
|
|
122
|
+
* @param {Fee} fee Baker fees. May also include the maximum gas to pay
|
|
123
|
+
*/
|
|
124
|
+
fee(fee: Fee): void;
|
|
125
|
+
/**
|
|
126
|
+
* Set the transaction counter to prevent submitting repeated transactions.
|
|
127
|
+
*
|
|
128
|
+
* @param {number} counter The counter to use
|
|
129
|
+
*/
|
|
130
|
+
counter(counter: number): void;
|
|
131
|
+
/**
|
|
132
|
+
* The value to send along with this transaction. 0 by default
|
|
133
|
+
*
|
|
134
|
+
* @param {string} value The value to send along with this transaction
|
|
135
|
+
*/
|
|
136
|
+
value(value: string): void;
|
|
137
|
+
protected buildBase(data: string): TxData;
|
|
138
|
+
/**
|
|
139
|
+
* Set one of the owners of the multisig wallet.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} address An Ethereum address
|
|
142
|
+
*/
|
|
143
|
+
owner(address: string): void;
|
|
144
|
+
/**
|
|
145
|
+
* Build a transaction for a generic multisig contract.
|
|
146
|
+
*
|
|
147
|
+
* @returns {TxData} The Ethereum transaction data
|
|
148
|
+
*/
|
|
149
|
+
protected buildWalletInitializationTransaction(walletVersion?: number): TxData;
|
|
150
|
+
/**
|
|
151
|
+
* Returns the smart contract encoded data
|
|
152
|
+
*
|
|
153
|
+
* @param {string[]} addresses - the contract signers
|
|
154
|
+
* @returns {string} - the smart contract encoded data
|
|
155
|
+
*/
|
|
156
|
+
protected getContractData(addresses: string[]): string;
|
|
157
|
+
contract(address: string): void;
|
|
158
|
+
/**
|
|
159
|
+
* Gets the transfer funds builder if exist, or creates a new one for this transaction and returns it
|
|
160
|
+
*
|
|
161
|
+
* @param {string} data transfer data to initialize the transfer builder with, empty if none given
|
|
162
|
+
* @param {boolean} isFirstSigner whether the transaction is being signed by the first signer
|
|
163
|
+
* @returns {TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984} the transfer builder
|
|
164
|
+
*/
|
|
165
|
+
abstract transfer(data?: string, isFirstSigner?: boolean): TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder | TransferBuilderERC7984;
|
|
166
|
+
/**
|
|
167
|
+
* Returns the serialized sendMultiSig contract method data
|
|
168
|
+
*
|
|
169
|
+
* @returns {string} serialized sendMultiSig data
|
|
170
|
+
*/
|
|
171
|
+
getSendData(): string;
|
|
172
|
+
/**
|
|
173
|
+
* Decide if the coin uses non-packed encoding for tx data
|
|
174
|
+
*
|
|
175
|
+
* @returns {boolean} true if the coin uses non-packed encoding for tx data
|
|
176
|
+
*/
|
|
177
|
+
coinUsesNonPackedEncodingForTxData(): boolean;
|
|
178
|
+
private buildSendTransaction;
|
|
179
|
+
/**
|
|
180
|
+
* Set the contract transaction nonce to calculate the forwarder address.
|
|
181
|
+
*
|
|
182
|
+
* @param {number} contractCounter The counter to use
|
|
183
|
+
*/
|
|
184
|
+
contractCounter(contractCounter: number): void;
|
|
185
|
+
/**
|
|
186
|
+
* Build a transaction to create a forwarder.
|
|
187
|
+
*
|
|
188
|
+
* @returns {TxData} The Ethereum transaction data
|
|
189
|
+
*/
|
|
190
|
+
private buildAddressInitializationTransaction;
|
|
191
|
+
/**
|
|
192
|
+
* Set the forwarder address to flush
|
|
193
|
+
*
|
|
194
|
+
* @param {string} address The address to flush
|
|
195
|
+
*/
|
|
196
|
+
forwarderAddress(address: string): void;
|
|
197
|
+
/**
|
|
198
|
+
* Set the address of the ERC20 token contract that we are flushing tokens for
|
|
199
|
+
*
|
|
200
|
+
* @param {string} address the contract address of the token to flush
|
|
201
|
+
*/
|
|
202
|
+
tokenAddress(address: string): void;
|
|
203
|
+
/**
|
|
204
|
+
* Set the token ID for ERC721/ERC1155 token flush
|
|
205
|
+
*
|
|
206
|
+
* @param {string} tokenId the token ID to flush
|
|
207
|
+
*/
|
|
208
|
+
tokenId(tokenId: string): void;
|
|
209
|
+
/**
|
|
210
|
+
* Build a transaction to flush tokens from a forwarder.
|
|
211
|
+
*
|
|
212
|
+
* @returns {TxData} The Ethereum transaction data
|
|
213
|
+
*/
|
|
214
|
+
private buildFlushTokensTransaction;
|
|
215
|
+
/**
|
|
216
|
+
* Build a transaction to flush tokens from a forwarder.
|
|
217
|
+
*
|
|
218
|
+
* @returns {TxData} The Ethereum transaction data
|
|
219
|
+
*/
|
|
220
|
+
private buildFlushCoinsTransaction;
|
|
221
|
+
/**
|
|
222
|
+
* Build a transaction to flush ERC721 NFTs from a forwarder.
|
|
223
|
+
*
|
|
224
|
+
* @returns {TxData} The Ethereum transaction data
|
|
225
|
+
*/
|
|
226
|
+
private buildFlushERC721Transaction;
|
|
227
|
+
/**
|
|
228
|
+
* Build a transaction to flush ERC1155 tokens from a forwarder.
|
|
229
|
+
*
|
|
230
|
+
* @returns {TxData} The Ethereum transaction data
|
|
231
|
+
*/
|
|
232
|
+
private buildFlushERC1155Transaction;
|
|
233
|
+
data(encodedCall: string): void;
|
|
234
|
+
private buildGenericContractCallTransaction;
|
|
235
|
+
/** @inheritdoc */
|
|
236
|
+
protected get transaction(): Transaction;
|
|
237
|
+
/** @inheritdoc */
|
|
238
|
+
protected set transaction(transaction: Transaction);
|
|
239
|
+
/**
|
|
240
|
+
* Get the final v value. Final v is described in EIP-155.
|
|
241
|
+
*
|
|
242
|
+
* @protected for internal use when the enableFinalVField flag is true.
|
|
243
|
+
*/
|
|
244
|
+
protected getFinalV(): string;
|
|
245
|
+
/**
|
|
246
|
+
* Set the forwarder version for address to be initialized
|
|
247
|
+
*
|
|
248
|
+
* @param {number} version forwarder version
|
|
249
|
+
*/
|
|
250
|
+
forwarderVersion(version: number): void;
|
|
251
|
+
/**
|
|
252
|
+
* Set the salt to create the address using create2
|
|
253
|
+
*
|
|
254
|
+
* @param {string} salt The salt to create the address using create2, hex string
|
|
255
|
+
*/
|
|
256
|
+
salt(salt: string): void;
|
|
257
|
+
/**
|
|
258
|
+
* Take the implementation address for the proxy contract, and get the binary initcode for the associated proxy
|
|
259
|
+
*
|
|
260
|
+
* @param {string} implementationAddress The address of the implementation contract
|
|
261
|
+
*/
|
|
262
|
+
initCode(implementationAddress: string): void;
|
|
263
|
+
/**
|
|
264
|
+
* Set the wallet version for wallet to be initialized
|
|
265
|
+
*
|
|
266
|
+
* @param {number} version wallet version
|
|
267
|
+
*/
|
|
268
|
+
walletVersion(version: number): void;
|
|
269
|
+
/**
|
|
270
|
+
* Set the base address of the wallet
|
|
271
|
+
*
|
|
272
|
+
* @param {string} address The wallet contract address
|
|
273
|
+
*/
|
|
274
|
+
baseAddress(address: string): void;
|
|
275
|
+
/**
|
|
276
|
+
* Set the fee address of the wallet
|
|
277
|
+
*
|
|
278
|
+
* @param {string} address The fee address of the wallet
|
|
279
|
+
*/
|
|
280
|
+
feeAddress(address: string): void;
|
|
281
|
+
/**
|
|
282
|
+
* Get the wallet version for wallet
|
|
283
|
+
*/
|
|
284
|
+
getWalletVersion(): number;
|
|
285
|
+
/**
|
|
286
|
+
* Set the ERC-7984 token contract address for forwarder flush transactions.
|
|
287
|
+
*
|
|
288
|
+
* @param {string} address The ERC-7984 token contract address
|
|
289
|
+
*/
|
|
290
|
+
tokenContractAddress(address: string): void;
|
|
291
|
+
/**
|
|
292
|
+
* Set the encrypted balance handle (bytes32 hex) for forwarder flush transactions.
|
|
293
|
+
* This is the opaque handle returned by confidentialBalanceOf() on the ERC-7984 token contract.
|
|
294
|
+
*
|
|
295
|
+
* @param {string} handle The bytes32 hex encrypted balance handle
|
|
296
|
+
*/
|
|
297
|
+
encryptedHandle(handle: string): void;
|
|
298
|
+
/**
|
|
299
|
+
* Set the parent address (root wallet) for ERC-7984 forwarder flush transactions.
|
|
300
|
+
* The flushed tokens will be transferred to this address.
|
|
301
|
+
*
|
|
302
|
+
* @param {string} address The parent wallet address
|
|
303
|
+
*/
|
|
304
|
+
parentAddress(address: string): void;
|
|
305
|
+
/**
|
|
306
|
+
* Build a transaction to flush ERC-7984 tokens from a V4 forwarder to the parent wallet.
|
|
307
|
+
* Encodes: callFromParent(tokenContractAddress, 0, confidentialTransfer(parentAddress, encryptedHandle))
|
|
308
|
+
*
|
|
309
|
+
* @returns {TxData} The Ethereum transaction data
|
|
310
|
+
*/
|
|
311
|
+
private buildFlushERC7984ForwarderTokenTransaction;
|
|
312
|
+
}
|
|
313
|
+
//# 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,EAAsB,GAAG,EAAkD,MAAM,EAAE,MAAM,SAAS,CAAC;AAyB1G,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;IACrE,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC;IAEjC,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC;IAClC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC;IACl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