@twin.org/wallet-connector-entity-storage 0.0.3-next.2 → 0.0.3-next.4
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/README.md +1 -1
- package/docs/changelog.md +66 -38
- package/docs/examples.md +123 -1
- package/docs/reference/classes/EntityStorageFaucetConnector.md +6 -6
- package/docs/reference/classes/EntityStorageWalletConnector.md +8 -8
- package/docs/reference/classes/WalletAddress.md +3 -3
- package/docs/reference/interfaces/IEntityStorageFaucetConnectorConstructorOptions.md +2 -2
- package/docs/reference/interfaces/IEntityStorageWalletConnectorConfig.md +6 -6
- package/docs/reference/interfaces/IEntityStorageWalletConnectorConstructorOptions.md +8 -8
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN Wallet Connector Entity Storage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package implements wallet and faucet connectors backed by entity storage for local and test workflows. It enables predictable address and balance handling through storage abstractions, which makes it useful for integration testing and scenarios where lightweight persistence is required.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/docs/changelog.md
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.3-next.3...wallet-connector-entity-storage-v0.0.3-next.4) (2026-05-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* typescript 6 update ([7db75ad](https://github.com/iotaledger/twin-wallet/commit/7db75ade7482bc52f1da01014f0b66fa80d74d51))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/wallet-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.3-next.2...wallet-connector-entity-storage-v0.0.3-next.3) (2026-03-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **wallet-connector-entity-storage:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/wallet-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.3-next.1...wallet-connector-entity-storage-v0.0.3-next.2) (2026-02-25)
|
|
4
32
|
|
|
5
33
|
|
|
6
34
|
### Bug Fixes
|
|
7
35
|
|
|
8
|
-
* missing dependency ([6f02070](https://github.com/
|
|
36
|
+
* missing dependency ([6f02070](https://github.com/iotaledger/twin-wallet/commit/6f02070f3ad7d6dcdbbddd952c7d18a47386f15d))
|
|
9
37
|
|
|
10
38
|
|
|
11
39
|
### Dependencies
|
|
@@ -14,19 +42,19 @@
|
|
|
14
42
|
* dependencies
|
|
15
43
|
* @twin.org/wallet-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
16
44
|
|
|
17
|
-
## [0.0.3-next.1](https://github.com/
|
|
45
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.3-next.0...wallet-connector-entity-storage-v0.0.3-next.1) (2025-11-11)
|
|
18
46
|
|
|
19
47
|
|
|
20
48
|
### Features
|
|
21
49
|
|
|
22
|
-
* add context id features ([#46](https://github.com/
|
|
23
|
-
* add validate-locales ([e5200c2](https://github.com/
|
|
24
|
-
* eslint migration to flat config ([7068485](https://github.com/
|
|
25
|
-
* iota rebased release ([d0c617d](https://github.com/
|
|
26
|
-
* remove bech32 encoding for addresses ([869ef88](https://github.com/
|
|
27
|
-
* update dependencies ([4b47a7d](https://github.com/
|
|
28
|
-
* update framework core ([1c8a381](https://github.com/
|
|
29
|
-
* use shared store mechanism ([#27](https://github.com/
|
|
50
|
+
* add context id features ([#46](https://github.com/iotaledger/twin-wallet/issues/46)) ([9389c28](https://github.com/iotaledger/twin-wallet/commit/9389c28084656666d04ed82575cbc8d3fa9f0d88))
|
|
51
|
+
* add validate-locales ([e5200c2](https://github.com/iotaledger/twin-wallet/commit/e5200c279de60592b64eeb64279fa8ed289a677f))
|
|
52
|
+
* eslint migration to flat config ([7068485](https://github.com/iotaledger/twin-wallet/commit/7068485f7c10121b76b6219798fdea4d3e91648a))
|
|
53
|
+
* iota rebased release ([d0c617d](https://github.com/iotaledger/twin-wallet/commit/d0c617d894f3663f7c80f7d53d2da858a0bd64f0))
|
|
54
|
+
* remove bech32 encoding for addresses ([869ef88](https://github.com/iotaledger/twin-wallet/commit/869ef8830eab0bcea6bc748f3bc637fc311e0709))
|
|
55
|
+
* update dependencies ([4b47a7d](https://github.com/iotaledger/twin-wallet/commit/4b47a7d900d72d1502d6db54cb391a954818478b))
|
|
56
|
+
* update framework core ([1c8a381](https://github.com/iotaledger/twin-wallet/commit/1c8a381e3c0544803a98db5560d87087fd095c23))
|
|
57
|
+
* use shared store mechanism ([#27](https://github.com/iotaledger/twin-wallet/issues/27)) ([2ba7861](https://github.com/iotaledger/twin-wallet/commit/2ba7861a2a610cf83396a3285c7bbaebe5a31551))
|
|
30
58
|
|
|
31
59
|
|
|
32
60
|
### Dependencies
|
|
@@ -35,12 +63,12 @@
|
|
|
35
63
|
* dependencies
|
|
36
64
|
* @twin.org/wallet-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
37
65
|
|
|
38
|
-
## [0.0.2-next.5](https://github.com/
|
|
66
|
+
## [0.0.2-next.5](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.2-next.4...wallet-connector-entity-storage-v0.0.2-next.5) (2025-10-09)
|
|
39
67
|
|
|
40
68
|
|
|
41
69
|
### Features
|
|
42
70
|
|
|
43
|
-
* add validate-locales ([e5200c2](https://github.com/
|
|
71
|
+
* add validate-locales ([e5200c2](https://github.com/iotaledger/twin-wallet/commit/e5200c279de60592b64eeb64279fa8ed289a677f))
|
|
44
72
|
|
|
45
73
|
|
|
46
74
|
### Dependencies
|
|
@@ -49,12 +77,12 @@
|
|
|
49
77
|
* dependencies
|
|
50
78
|
* @twin.org/wallet-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
51
79
|
|
|
52
|
-
## [0.0.2-next.4](https://github.com/
|
|
80
|
+
## [0.0.2-next.4](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.2-next.3...wallet-connector-entity-storage-v0.0.2-next.4) (2025-08-29)
|
|
53
81
|
|
|
54
82
|
|
|
55
83
|
### Features
|
|
56
84
|
|
|
57
|
-
* eslint migration to flat config ([7068485](https://github.com/
|
|
85
|
+
* eslint migration to flat config ([7068485](https://github.com/iotaledger/twin-wallet/commit/7068485f7c10121b76b6219798fdea4d3e91648a))
|
|
58
86
|
|
|
59
87
|
|
|
60
88
|
### Dependencies
|
|
@@ -63,7 +91,7 @@
|
|
|
63
91
|
* dependencies
|
|
64
92
|
* @twin.org/wallet-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
65
93
|
|
|
66
|
-
## [0.0.2-next.3](https://github.com/
|
|
94
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.2-next.2...wallet-connector-entity-storage-v0.0.2-next.3) (2025-08-20)
|
|
67
95
|
|
|
68
96
|
|
|
69
97
|
### Miscellaneous Chores
|
|
@@ -77,12 +105,12 @@
|
|
|
77
105
|
* dependencies
|
|
78
106
|
* @twin.org/wallet-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
79
107
|
|
|
80
|
-
## [0.0.2-next.2](https://github.com/
|
|
108
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.2-next.1...wallet-connector-entity-storage-v0.0.2-next.2) (2025-08-20)
|
|
81
109
|
|
|
82
110
|
|
|
83
111
|
### Features
|
|
84
112
|
|
|
85
|
-
* update framework core ([1c8a381](https://github.com/
|
|
113
|
+
* update framework core ([1c8a381](https://github.com/iotaledger/twin-wallet/commit/1c8a381e3c0544803a98db5560d87087fd095c23))
|
|
86
114
|
|
|
87
115
|
|
|
88
116
|
### Dependencies
|
|
@@ -91,15 +119,15 @@
|
|
|
91
119
|
* dependencies
|
|
92
120
|
* @twin.org/wallet-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
93
121
|
|
|
94
|
-
## [0.0.2-next.1](https://github.com/
|
|
122
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.2-next.0...wallet-connector-entity-storage-v0.0.2-next.1) (2025-07-16)
|
|
95
123
|
|
|
96
124
|
|
|
97
125
|
### Features
|
|
98
126
|
|
|
99
|
-
* iota rebased release ([d0c617d](https://github.com/
|
|
100
|
-
* remove bech32 encoding for addresses ([869ef88](https://github.com/
|
|
101
|
-
* update dependencies ([4b47a7d](https://github.com/
|
|
102
|
-
* use shared store mechanism ([#27](https://github.com/
|
|
127
|
+
* iota rebased release ([d0c617d](https://github.com/iotaledger/twin-wallet/commit/d0c617d894f3663f7c80f7d53d2da858a0bd64f0))
|
|
128
|
+
* remove bech32 encoding for addresses ([869ef88](https://github.com/iotaledger/twin-wallet/commit/869ef8830eab0bcea6bc748f3bc637fc311e0709))
|
|
129
|
+
* update dependencies ([4b47a7d](https://github.com/iotaledger/twin-wallet/commit/4b47a7d900d72d1502d6db54cb391a954818478b))
|
|
130
|
+
* use shared store mechanism ([#27](https://github.com/iotaledger/twin-wallet/issues/27)) ([2ba7861](https://github.com/iotaledger/twin-wallet/commit/2ba7861a2a610cf83396a3285c7bbaebe5a31551))
|
|
103
131
|
|
|
104
132
|
|
|
105
133
|
### Dependencies
|
|
@@ -113,7 +141,7 @@
|
|
|
113
141
|
|
|
114
142
|
### Features
|
|
115
143
|
|
|
116
|
-
* release to production ([4631961](https://github.com/
|
|
144
|
+
* release to production ([4631961](https://github.com/iotaledger/twin-wallet/commit/4631961bf9c8cf82ffd0c8dd2a7d750456bbab39))
|
|
117
145
|
|
|
118
146
|
|
|
119
147
|
### Dependencies
|
|
@@ -122,14 +150,14 @@
|
|
|
122
150
|
* dependencies
|
|
123
151
|
* @twin.org/wallet-models bumped from ^0.0.0 to ^0.0.1
|
|
124
152
|
|
|
125
|
-
## [0.0.1-next.24](https://github.com/
|
|
153
|
+
## [0.0.1-next.24](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.23...wallet-connector-entity-storage-v0.0.1-next.24) (2025-07-03)
|
|
126
154
|
|
|
127
155
|
|
|
128
156
|
### Features
|
|
129
157
|
|
|
130
|
-
* iota rebased release ([d0c617d](https://github.com/
|
|
131
|
-
* update dependencies ([4b47a7d](https://github.com/
|
|
132
|
-
* use shared store mechanism ([#27](https://github.com/
|
|
158
|
+
* iota rebased release ([d0c617d](https://github.com/iotaledger/twin-wallet/commit/d0c617d894f3663f7c80f7d53d2da858a0bd64f0))
|
|
159
|
+
* update dependencies ([4b47a7d](https://github.com/iotaledger/twin-wallet/commit/4b47a7d900d72d1502d6db54cb391a954818478b))
|
|
160
|
+
* use shared store mechanism ([#27](https://github.com/iotaledger/twin-wallet/issues/27)) ([2ba7861](https://github.com/iotaledger/twin-wallet/commit/2ba7861a2a610cf83396a3285c7bbaebe5a31551))
|
|
133
161
|
|
|
134
162
|
|
|
135
163
|
### Dependencies
|
|
@@ -138,7 +166,7 @@
|
|
|
138
166
|
* dependencies
|
|
139
167
|
* @twin.org/wallet-models bumped from 0.0.1-next.23 to 0.0.1-next.24
|
|
140
168
|
|
|
141
|
-
## [0.0.1-next.23](https://github.com/
|
|
169
|
+
## [0.0.1-next.23](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.22...wallet-connector-entity-storage-v0.0.1-next.23) (2025-07-03)
|
|
142
170
|
|
|
143
171
|
|
|
144
172
|
### Miscellaneous Chores
|
|
@@ -152,12 +180,12 @@
|
|
|
152
180
|
* dependencies
|
|
153
181
|
* @twin.org/wallet-models bumped from 0.0.1-next.22 to 0.0.1-next.23
|
|
154
182
|
|
|
155
|
-
## [0.0.1-next.22](https://github.com/
|
|
183
|
+
## [0.0.1-next.22](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.21...wallet-connector-entity-storage-v0.0.1-next.22) (2025-06-12)
|
|
156
184
|
|
|
157
185
|
|
|
158
186
|
### Features
|
|
159
187
|
|
|
160
|
-
* update dependencies ([4b47a7d](https://github.com/
|
|
188
|
+
* update dependencies ([4b47a7d](https://github.com/iotaledger/twin-wallet/commit/4b47a7d900d72d1502d6db54cb391a954818478b))
|
|
161
189
|
|
|
162
190
|
|
|
163
191
|
### Dependencies
|
|
@@ -166,7 +194,7 @@
|
|
|
166
194
|
* dependencies
|
|
167
195
|
* @twin.org/wallet-models bumped from 0.0.1-next.21 to 0.0.1-next.22
|
|
168
196
|
|
|
169
|
-
## [0.0.1-next.21](https://github.com/
|
|
197
|
+
## [0.0.1-next.21](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.20...wallet-connector-entity-storage-v0.0.1-next.21) (2025-05-21)
|
|
170
198
|
|
|
171
199
|
|
|
172
200
|
### Miscellaneous Chores
|
|
@@ -180,12 +208,12 @@
|
|
|
180
208
|
* dependencies
|
|
181
209
|
* @twin.org/wallet-models bumped from 0.0.1-next.20 to 0.0.1-next.21
|
|
182
210
|
|
|
183
|
-
## [0.0.1-next.20](https://github.com/
|
|
211
|
+
## [0.0.1-next.20](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.19...wallet-connector-entity-storage-v0.0.1-next.20) (2025-05-06)
|
|
184
212
|
|
|
185
213
|
|
|
186
214
|
### Features
|
|
187
215
|
|
|
188
|
-
* iota rebased release ([d0c617d](https://github.com/
|
|
216
|
+
* iota rebased release ([d0c617d](https://github.com/iotaledger/twin-wallet/commit/d0c617d894f3663f7c80f7d53d2da858a0bd64f0))
|
|
189
217
|
|
|
190
218
|
|
|
191
219
|
### Dependencies
|
|
@@ -194,12 +222,12 @@
|
|
|
194
222
|
* dependencies
|
|
195
223
|
* @twin.org/wallet-models bumped from 0.0.1-next.19 to 0.0.1-next.20
|
|
196
224
|
|
|
197
|
-
## [0.0.1-next.19](https://github.com/
|
|
225
|
+
## [0.0.1-next.19](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.18...wallet-connector-entity-storage-v0.0.1-next.19) (2025-04-17)
|
|
198
226
|
|
|
199
227
|
|
|
200
228
|
### Features
|
|
201
229
|
|
|
202
|
-
* use shared store mechanism ([#27](https://github.com/
|
|
230
|
+
* use shared store mechanism ([#27](https://github.com/iotaledger/twin-wallet/issues/27)) ([2ba7861](https://github.com/iotaledger/twin-wallet/commit/2ba7861a2a610cf83396a3285c7bbaebe5a31551))
|
|
203
231
|
|
|
204
232
|
|
|
205
233
|
### Dependencies
|
|
@@ -208,7 +236,7 @@
|
|
|
208
236
|
* dependencies
|
|
209
237
|
* @twin.org/wallet-models bumped from 0.0.1-next.18 to 0.0.1-next.19
|
|
210
238
|
|
|
211
|
-
## [0.0.1-next.18](https://github.com/
|
|
239
|
+
## [0.0.1-next.18](https://github.com/iotaledger/twin-wallet/compare/wallet-connector-entity-storage-v0.0.1-next.17...wallet-connector-entity-storage-v0.0.1-next.18) (2025-03-28)
|
|
212
240
|
|
|
213
241
|
|
|
214
242
|
### Miscellaneous Chores
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Wallet Connector Entity Storage Examples
|
|
2
|
+
|
|
3
|
+
These examples show local wallet workflows with entity storage, including schema setup and faucet-assisted funding.
|
|
4
|
+
|
|
5
|
+
## EntityStorageWalletConnector
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { EntityStorageWalletConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
9
|
+
|
|
10
|
+
const walletConnector = new EntityStorageWalletConnector({
|
|
11
|
+
vaultConnectorType: 'vault',
|
|
12
|
+
faucetConnectorType: 'faucet',
|
|
13
|
+
walletAddressEntityStorageType: 'wallet-address',
|
|
14
|
+
config: {
|
|
15
|
+
vaultMnemonicId: 'mnemonic',
|
|
16
|
+
coinType: 4218,
|
|
17
|
+
networkName: 'ent'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
console.log(walletConnector.className()); // EntityStorageWalletConnector
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { EntityStorageWalletConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
26
|
+
|
|
27
|
+
const walletConnector = new EntityStorageWalletConnector({
|
|
28
|
+
walletAddressEntityStorageType: 'wallet-address'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const identity = 'alice';
|
|
32
|
+
await walletConnector.create(identity);
|
|
33
|
+
|
|
34
|
+
const addresses = await walletConnector.getAddresses(identity, 0, 0, 3);
|
|
35
|
+
console.log(addresses[0]); // ent1q...
|
|
36
|
+
console.log(addresses[1]); // ent1q...
|
|
37
|
+
console.log(addresses[2]); // ent1q...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { EntityStorageWalletConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
42
|
+
|
|
43
|
+
const walletConnector = new EntityStorageWalletConnector({
|
|
44
|
+
faucetConnectorType: 'faucet',
|
|
45
|
+
walletAddressEntityStorageType: 'wallet-address'
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const identity = 'alice';
|
|
49
|
+
const address = 'ent1qzk3h4f8s8pl2nq8h8m5x4aclnvmf6m7l9h8v2j5f7dp5z8yqpd3r2';
|
|
50
|
+
|
|
51
|
+
const balance = await walletConnector.getBalance(identity, address);
|
|
52
|
+
console.log(balance.toString()); // 1000000000
|
|
53
|
+
|
|
54
|
+
const funded = await walletConnector.ensureBalance(identity, address, 2000000000n, 10);
|
|
55
|
+
console.log(funded); // true
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { EntityStorageWalletConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
60
|
+
|
|
61
|
+
const walletConnector = new EntityStorageWalletConnector({
|
|
62
|
+
walletAddressEntityStorageType: 'wallet-address'
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const transferId = await walletConnector.transfer(
|
|
66
|
+
'alice',
|
|
67
|
+
'ent1qzk3h4f8s8pl2nq8h8m5x4aclnvmf6m7l9h8v2j5f7dp5z8yqpd3r2',
|
|
68
|
+
'ent1qz2y6wfj8n6r3xj2v4d6j7l8p0s4r3v8w5n0j2q9d7m4h1xj73v8t0',
|
|
69
|
+
500000000n
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
console.log(transferId); // undefined
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## EntityStorageFaucetConnector
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { EntityStorageFaucetConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
79
|
+
|
|
80
|
+
const faucetConnector = new EntityStorageFaucetConnector({
|
|
81
|
+
walletAddressEntityStorageType: 'wallet-address'
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
console.log(faucetConnector.className()); // EntityStorageFaucetConnector
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { EntityStorageFaucetConnector } from '@twin.org/wallet-connector-entity-storage';
|
|
89
|
+
|
|
90
|
+
const faucetConnector = new EntityStorageFaucetConnector({
|
|
91
|
+
walletAddressEntityStorageType: 'wallet-address'
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const funded = await faucetConnector.fundAddress(
|
|
95
|
+
'alice',
|
|
96
|
+
'ent1qzk3h4f8s8pl2nq8h8m5x4aclnvmf6m7l9h8v2j5f7dp5z8yqpd3r2',
|
|
97
|
+
60
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
console.log(funded.toString()); // 1000000000
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## WalletAddress
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { WalletAddress } from '@twin.org/wallet-connector-entity-storage';
|
|
107
|
+
|
|
108
|
+
const walletAddress = new WalletAddress();
|
|
109
|
+
walletAddress.address = 'ent1qzk3h4f8s8pl2nq8h8m5x4aclnvmf6m7l9h8v2j5f7dp5z8yqpd3r2';
|
|
110
|
+
walletAddress.identity = 'alice';
|
|
111
|
+
walletAddress.balance = '1500000000';
|
|
112
|
+
|
|
113
|
+
console.log(walletAddress.address); // ent1qzk3h4f8s8pl2nq8h8m5x4aclnvmf6m7l9h8v2j5f7dp5z8yqpd3r2
|
|
114
|
+
console.log(walletAddress.balance); // 1500000000
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## initSchema
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { initSchema } from '@twin.org/wallet-connector-entity-storage';
|
|
121
|
+
|
|
122
|
+
initSchema();
|
|
123
|
+
```
|
|
@@ -28,7 +28,7 @@ The options for the wallet connector.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### NAMESPACE
|
|
31
|
+
### NAMESPACE {#namespace}
|
|
32
32
|
|
|
33
33
|
> `readonly` `static` **NAMESPACE**: `string` = `"entity-storage"`
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ The namespace supported by the wallet connector.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### CLASS\_NAME
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Runtime name for the class.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,9 +62,9 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### fundAddress()
|
|
65
|
+
### fundAddress() {#fundaddress}
|
|
66
66
|
|
|
67
|
-
> **fundAddress**(`identity`, `address`, `timeoutInSeconds
|
|
67
|
+
> **fundAddress**(`identity`, `address`, `timeoutInSeconds?`): `Promise`\<`bigint`\>
|
|
68
68
|
|
|
69
69
|
Fund the wallet from the faucet.
|
|
70
70
|
|
|
@@ -82,7 +82,7 @@ The identity of the user to access the vault keys.
|
|
|
82
82
|
|
|
83
83
|
The hex encoded address of the address to fund.
|
|
84
84
|
|
|
85
|
-
##### timeoutInSeconds
|
|
85
|
+
##### timeoutInSeconds?
|
|
86
86
|
|
|
87
87
|
`number` = `60`
|
|
88
88
|
|
|
@@ -28,7 +28,7 @@ The options for the wallet connector.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### CLASS\_NAME
|
|
31
|
+
### CLASS\_NAME {#class_name}
|
|
32
32
|
|
|
33
33
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ Runtime name for the class.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### NAMESPACE
|
|
39
|
+
### NAMESPACE {#namespace}
|
|
40
40
|
|
|
41
41
|
> `readonly` `static` **NAMESPACE**: `string` = `"entity-storage"`
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ The namespace supported by the wallet connector.
|
|
|
44
44
|
|
|
45
45
|
## Methods
|
|
46
46
|
|
|
47
|
-
### className()
|
|
47
|
+
### className() {#classname}
|
|
48
48
|
|
|
49
49
|
> **className**(): `string`
|
|
50
50
|
|
|
@@ -62,7 +62,7 @@ The class name of the component.
|
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
65
|
-
### create()
|
|
65
|
+
### create() {#create}
|
|
66
66
|
|
|
67
67
|
> **create**(`identity`): `Promise`\<`void`\>
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ Nothing.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### getAddresses()
|
|
91
|
+
### getAddresses() {#getaddresses}
|
|
92
92
|
|
|
93
93
|
> **getAddresses**(`identity`, `accountIndex`, `startAddressIndex`, `count`): `Promise`\<`string`[]\>
|
|
94
94
|
|
|
@@ -132,7 +132,7 @@ The list of addresses.
|
|
|
132
132
|
|
|
133
133
|
***
|
|
134
134
|
|
|
135
|
-
### getBalance()
|
|
135
|
+
### getBalance() {#getbalance}
|
|
136
136
|
|
|
137
137
|
> **getBalance**(`identity`, `address`): `Promise`\<`bigint`\>
|
|
138
138
|
|
|
@@ -164,7 +164,7 @@ The balance of the wallet address.
|
|
|
164
164
|
|
|
165
165
|
***
|
|
166
166
|
|
|
167
|
-
### ensureBalance()
|
|
167
|
+
### ensureBalance() {#ensurebalance}
|
|
168
168
|
|
|
169
169
|
> **ensureBalance**(`identity`, `address`, `ensureBalance`, `timeoutInSeconds?`): `Promise`\<`boolean`\>
|
|
170
170
|
|
|
@@ -208,7 +208,7 @@ True if the balance has been ensured.
|
|
|
208
208
|
|
|
209
209
|
***
|
|
210
210
|
|
|
211
|
-
### transfer()
|
|
211
|
+
### transfer() {#transfer}
|
|
212
212
|
|
|
213
213
|
> **transfer**(`identity`, `addressSource`, `addressDest`, `amount`): `Promise`\<`string` \| `undefined`\>
|
|
214
214
|
|
|
@@ -14,7 +14,7 @@ Class describing a wallet address.
|
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
17
|
-
### address
|
|
17
|
+
### address {#address}
|
|
18
18
|
|
|
19
19
|
> **address**: `string`
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ The address in the wallet.
|
|
|
22
22
|
|
|
23
23
|
***
|
|
24
24
|
|
|
25
|
-
### identity
|
|
25
|
+
### identity {#identity}
|
|
26
26
|
|
|
27
27
|
> **identity**: `string`
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ The identity of the owner.
|
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
33
|
-
### balance
|
|
33
|
+
### balance {#balance}
|
|
34
34
|
|
|
35
35
|
> **balance**: `string`
|
|
36
36
|
|
|
@@ -4,9 +4,9 @@ Options for the entity storage faucet connector.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### walletAddressEntityStorageType?
|
|
7
|
+
### walletAddressEntityStorageType? {#walletaddressentitystoragetype}
|
|
8
8
|
|
|
9
|
-
> `optional` **walletAddressEntityStorageType
|
|
9
|
+
> `optional` **walletAddressEntityStorageType?**: `string`
|
|
10
10
|
|
|
11
11
|
The entity storage type for wallet addresses.
|
|
12
12
|
|
|
@@ -4,9 +4,9 @@ Configuration for the Entity Storage Wallet Connector.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### vaultMnemonicId?
|
|
7
|
+
### vaultMnemonicId? {#vaultmnemonicid}
|
|
8
8
|
|
|
9
|
-
> `optional` **vaultMnemonicId
|
|
9
|
+
> `optional` **vaultMnemonicId?**: `string`
|
|
10
10
|
|
|
11
11
|
The id of the entry in the vault containing the mnemonic.
|
|
12
12
|
|
|
@@ -18,9 +18,9 @@ mnemonic
|
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
### coinType?
|
|
21
|
+
### coinType? {#cointype}
|
|
22
22
|
|
|
23
|
-
> `optional` **coinType
|
|
23
|
+
> `optional` **coinType?**: `number`
|
|
24
24
|
|
|
25
25
|
The coin type.
|
|
26
26
|
|
|
@@ -32,9 +32,9 @@ The coin type.
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
-
### networkName?
|
|
35
|
+
### networkName? {#networkname}
|
|
36
36
|
|
|
37
|
-
> `optional` **networkName
|
|
37
|
+
> `optional` **networkName?**: `string`
|
|
38
38
|
|
|
39
39
|
The network name part for the addresses.
|
|
40
40
|
|
|
@@ -4,9 +4,9 @@ Options for the entity storage wallet connector.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### vaultConnectorType?
|
|
7
|
+
### vaultConnectorType? {#vaultconnectortype}
|
|
8
8
|
|
|
9
|
-
> `optional` **vaultConnectorType
|
|
9
|
+
> `optional` **vaultConnectorType?**: `string`
|
|
10
10
|
|
|
11
11
|
Vault connector to use for wallet secrets.
|
|
12
12
|
|
|
@@ -18,9 +18,9 @@ vault
|
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
### faucetConnectorType?
|
|
21
|
+
### faucetConnectorType? {#faucetconnectortype}
|
|
22
22
|
|
|
23
|
-
> `optional` **faucetConnectorType
|
|
23
|
+
> `optional` **faucetConnectorType?**: `string`
|
|
24
24
|
|
|
25
25
|
Optional faucet for requesting funds.
|
|
26
26
|
|
|
@@ -32,9 +32,9 @@ faucet
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
-
### walletAddressEntityStorageType?
|
|
35
|
+
### walletAddressEntityStorageType? {#walletaddressentitystoragetype}
|
|
36
36
|
|
|
37
|
-
> `optional` **walletAddressEntityStorageType
|
|
37
|
+
> `optional` **walletAddressEntityStorageType?**: `string`
|
|
38
38
|
|
|
39
39
|
The entity storage for wallets.
|
|
40
40
|
|
|
@@ -46,8 +46,8 @@ wallet-address
|
|
|
46
46
|
|
|
47
47
|
***
|
|
48
48
|
|
|
49
|
-
### config?
|
|
49
|
+
### config? {#config}
|
|
50
50
|
|
|
51
|
-
> `optional` **config
|
|
51
|
+
> `optional` **config?**: [`IEntityStorageWalletConnectorConfig`](IEntityStorageWalletConnectorConfig.md)
|
|
52
52
|
|
|
53
53
|
The configuration for the wallet connector.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/wallet-connector-entity-storage",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.4",
|
|
4
|
+
"description": "Implements wallet and faucet connectors backed by entity storage for local and test workflows",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/wallet.git",
|
|
8
8
|
"directory": "packages/wallet-connector-entity-storage"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@twin.org/entity-storage-models": "next",
|
|
21
21
|
"@twin.org/nameof": "next",
|
|
22
22
|
"@twin.org/vault-models": "next",
|
|
23
|
-
"@twin.org/wallet-models": "0.0.3-next.
|
|
23
|
+
"@twin.org/wallet-models": "0.0.3-next.4"
|
|
24
24
|
},
|
|
25
25
|
"main": "./dist/es/index.js",
|
|
26
26
|
"types": "./dist/types/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"integration"
|
|
58
58
|
],
|
|
59
59
|
"bugs": {
|
|
60
|
-
"url": "git+https://github.com/
|
|
60
|
+
"url": "git+https://github.com/iotaledger/wallet/issues"
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://twindev.org"
|
|
63
63
|
}
|