@tetherto/wdk-wallet-evm-erc-4337 1.0.0-beta.2 → 1.0.0-beta.21

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.
@@ -0,0 +1,20 @@
1
+ /** @type {import('hardhat/config').HardhatUserConfig} */
2
+ export default {
3
+ networks: {
4
+ hardhat: {
5
+ type: 'edr-simulated',
6
+ chainId: 1,
7
+ accounts: {
8
+ mnemonic: 'test test test test test test test test test test test junk',
9
+ path: "m/44'/60'/0'/0",
10
+ initialIndex: 0,
11
+ count: 20,
12
+ accountsBalance: '10000000000000000000000'
13
+ },
14
+ mining: {
15
+ auto: true,
16
+ interval: 1000
17
+ }
18
+ }
19
+ }
20
+ }
package/index.js CHANGED
@@ -14,20 +14,50 @@
14
14
 
15
15
  'use strict'
16
16
 
17
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').UserOperationReceipt} UserOperationReceipt */
18
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').BuiltUserOperation} BuiltUserOperation */
19
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337TransactionDetails} EvmErc4337TransactionDetails */
20
+
21
+ /** @typedef {import('@tetherto/wdk-wallet').Finality} Finality */
22
+ /** @typedef {import('@tetherto/wdk-wallet').TransactionReceipt} TransactionReceipt */
23
+ /** @typedef {import('@tetherto/wdk-wallet').WaitForTransactionTarget} WaitForTransactionTarget */
24
+ /** @typedef {import('@tetherto/wdk-wallet').WaitForTransactionOptions} WaitForTransactionOptions */
25
+
17
26
  /** @typedef {import('@tetherto/wdk-wallet-evm').FeeRates} FeeRates */
18
27
 
19
28
  /** @typedef {import('@tetherto/wdk-wallet-evm').KeyPair} KeyPair */
20
- /** @typedef {import('@tetherto/wdk-wallet-evm').EvmTransaction} EvmTransaction */
29
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337Transaction} EvmErc4337Transaction */
30
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337GasOverrides} EvmErc4337GasOverrides */
31
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337TransferOptions} EvmErc4337TransferOptions */
32
+ /** @typedef {import('./src/wallet-account-evm-erc-4337.js').EvmErc4337ApproveOptions} EvmErc4337ApproveOptions */
33
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').Nonce} Nonce */
21
34
  /** @typedef {import('@tetherto/wdk-wallet-evm').TransactionResult} TransactionResult */
22
35
  /** @typedef {import('@tetherto/wdk-wallet-evm').TransferOptions} TransferOptions */
23
36
  /** @typedef {import('@tetherto/wdk-wallet-evm').TransferResult} TransferResult */
24
37
  /** @typedef {import('@tetherto/wdk-wallet-evm').EvmTransactionReceipt} EvmTransactionReceipt */
25
38
  /** @typedef {import('@tetherto/wdk-wallet-evm').ApproveOptions} ApproveOptions */
26
39
 
40
+ /** @typedef {import('@tetherto/wdk-wallet-evm').TypedData} TypedData */
41
+ /** @typedef {import('@tetherto/wdk-wallet-evm').TypedDataDomain} TypedDataDomain */
42
+ /** @typedef {import('@tetherto/wdk-wallet-evm').TypedDataField} TypedDataField */
43
+
27
44
  /** @typedef {import('./src/wallet-manager-evm-erc-4337.js').EvmErc4337WalletConfig} EvmErc4337WalletConfig */
28
45
 
46
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337WalletCommonConfig} EvmErc4337WalletCommonConfig */
47
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337WalletPaymasterTokenConfig} EvmErc4337WalletPaymasterTokenConfig */
48
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337WalletSponsorshipPolicyConfig} EvmErc4337WalletSponsorshipPolicyConfig */
49
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').EvmErc4337WalletNativeCoinsConfig} EvmErc4337WalletNativeCoinsConfig */
50
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').OnChainIdentifier} OnChainIdentifier */
51
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').SafeAccountV0_3_0} SafeAccountV0_3_0 */
52
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').UserOperationV7} UserOperationV7 */
53
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').TokenQuote} TokenQuote */
54
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').MetaTransaction} MetaTransaction */
55
+ /** @typedef {import('./src/wallet-account-read-only-evm-erc-4337.js').InitCodeOverrides} InitCodeOverrides */
56
+
29
57
  export { default } from './src/wallet-manager-evm-erc-4337.js'
30
58
 
31
59
  export { default as WalletAccountReadOnlyEvmErc4337 } from './src/wallet-account-read-only-evm-erc-4337.js'
32
60
 
33
61
  export { default as WalletAccountEvmErc4337 } from './src/wallet-account-evm-erc-4337.js'
62
+
63
+ export { ConfigurationError } from './src/errors.js'
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@tetherto/wdk-wallet-evm-erc-4337",
3
- "version": "1.0.0-beta.2",
4
- "description": "A simple package to manage BIP-32 wallets for evm blockchains, which implement the erc-4337 standard and its account abstraction features",
3
+ "version": "1.0.0-beta.21",
4
+ "description": "ERC-4337 wallet module for EVM-compatible blockchains in WDK (Wallet Development Kit) by Tether.",
5
+ "homepage": "https://docs.wdk.tether.io/sdk/wallet-modules/wallet-evm-erc-4337/",
5
6
  "keywords": [
6
7
  "wdk",
7
8
  "wallet",
@@ -21,24 +22,45 @@
21
22
  "scripts": {
22
23
  "build:types": "tsc",
23
24
  "lint": "standard",
24
- "lint:fix": "standard --fix"
25
+ "lint:fix": "standard --fix",
26
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=/tests/integration/",
27
+ "test:coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage --testPathIgnorePatterns=/tests/integration/",
28
+ "test:integration-wait": "wait-on http://localhost:8545 && cross-env NODE_OPTIONS=--experimental-vm-modules jest tests/integration --forceExit",
29
+ "test:integration-wait:coverage": "wait-on http://localhost:8545 && cross-env NODE_OPTIONS=--experimental-vm-modules jest tests/integration --coverage --forceExit",
30
+ "test:integration": "concurrently -k -s first -n \"NODE,TEST\" -c \"black,green\" --hide NODE \"npx hardhat node --network hardhat\" \"npm run test:integration-wait\"",
31
+ "test:integration:coverage": "concurrently -k -s first -n \"NODE,TEST\" -c \"black,green\" --hide NODE \"npx hardhat node --network hardhat\" \"npm run test:integration-wait:coverage\""
25
32
  },
26
33
  "dependencies": {
27
- "@tetherto/wdk-wallet": "^1.0.0-beta.1",
28
- "@tetherto/wdk-wallet-evm": "^1.0.0-beta.3",
29
- "@wdk-safe-global/relay-kit": "4.1.3",
30
- "bare-node-runtime": "1.0.3",
31
- "ethers": "6.14.4"
34
+ "@tetherto/wdk-failover-provider": "1.0.0-beta.2",
35
+ "@tetherto/wdk-wallet": "1.0.0-beta.17",
36
+ "@tetherto/wdk-wallet-evm": "1.0.0-beta.19",
37
+ "abstractionkit": "0.4.0",
38
+ "bare-node-runtime": "^1.4.0",
39
+ "ethers": "6.17.0"
32
40
  },
33
41
  "devDependencies": {
42
+ "@pimlico/alto": "0.0.19",
43
+ "@pimlico/mock-paymaster": "0.0.4",
44
+ "concurrently": "9.2.0",
45
+ "cross-env": "7.0.3",
46
+ "hardhat": "3.12.0",
47
+ "jest": "29.7.0",
48
+ "prool": "0.0.23",
34
49
  "standard": "17.1.2",
35
- "typescript": "5.8.3"
50
+ "typescript": "5.8.3",
51
+ "wait-on": "8.0.4"
52
+ },
53
+ "devEngines": {
54
+ "runtime": {
55
+ "name": "node",
56
+ "version": ">=22.13.0",
57
+ "onFail": "error"
58
+ }
36
59
  },
37
60
  "overrides": {
38
- "axios": "1.12.2",
39
- "cookie": "1.0.2",
40
- "tmp": "0.2.5",
41
- "ws": "8.18.3"
61
+ "fast-uri": "3.1.2",
62
+ "tar": "7.5.16",
63
+ "uuid": "11.1.1"
42
64
  },
43
65
  "exports": {
44
66
  ".": {
package/src/errors.js ADDED
@@ -0,0 +1,35 @@
1
+ // Copyright 2024 Tether Operations Limited
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ 'use strict'
16
+
17
+ import { ValueError } from '@tetherto/wdk-wallet'
18
+
19
+ /**
20
+ * Thrown when the wallet configuration is invalid or has missing required fields.
21
+ *
22
+ * It extends {@link ValueError}, so it is also part of the `WdkError` taxonomy.
23
+ */
24
+ export class ConfigurationError extends ValueError {
25
+ /**
26
+ * Create a new configuration error.
27
+ *
28
+ * @param {string} message - The error message.
29
+ */
30
+ constructor (message) {
31
+ super(message)
32
+
33
+ this.name = 'ConfigurationError'
34
+ }
35
+ }