@bitgo/public-types 5.32.0 → 5.33.0
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/schema/coin/coin.d.ts +3 -0
- package/dist/src/schema/coin/coin.js +29 -0
- package/dist/src/schema/coin/coin.js.map +1 -0
- package/dist/src/schema/wallet/address.d.ts +253 -0
- package/dist/src/schema/wallet/address.js +124 -0
- package/dist/src/schema/wallet/address.js.map +1 -0
- package/dist/src/schema/wallet/index.d.ts +1 -0
- package/dist/src/schema/wallet/index.js +1 -0
- package/dist/src/schema/wallet/index.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/coin/coin.ts +7 -0
- package/src/schema/wallet/address.ts +190 -0
- package/src/schema/wallet/index.ts +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CoinString = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
exports.CoinString = t.string;
|
|
29
|
+
//# sourceMappingURL=coin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coin.js","sourceRoot":"","sources":["../../../../src/schema/coin/coin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAKd,QAAA,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const AddressLabelString: t.StringC;
|
|
3
|
+
export type AddressLabelString = t.TypeOf<typeof AddressLabelString>;
|
|
4
|
+
export declare const AddressString: t.StringC;
|
|
5
|
+
export type AddressString = t.TypeOf<typeof AddressString>;
|
|
6
|
+
export declare const AddressChain: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<10>, t.LiteralC<11>, t.LiteralC<20>, t.LiteralC<21>, t.LiteralC<30>, t.LiteralC<31>, t.LiteralC<40>, t.LiteralC<41>]>;
|
|
7
|
+
export type AddressChain = t.TypeOf<typeof AddressChain>;
|
|
8
|
+
export declare const AddressChainString: t.UnionC<[t.LiteralC<"0">, t.LiteralC<"1">, t.LiteralC<"10">, t.LiteralC<"11">, t.LiteralC<"20">, t.LiteralC<"21">, t.LiteralC<"30">, t.LiteralC<"31">, t.LiteralC<"40">, t.LiteralC<"41">]>;
|
|
9
|
+
export type AddressChainString = t.TypeOf<typeof AddressChainString>;
|
|
10
|
+
export declare const TrimmedBalance: t.IntersectionC<[t.TypeC<{
|
|
11
|
+
balanceString: t.StringC;
|
|
12
|
+
confirmedBalanceString: t.StringC;
|
|
13
|
+
spendableBalanceString: t.StringC;
|
|
14
|
+
}>, t.PartialC<{
|
|
15
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
16
|
+
balance: t.NumberC;
|
|
17
|
+
lockedBalanceString: t.StringC;
|
|
18
|
+
reservedBalanceString: t.StringC;
|
|
19
|
+
totalReceived: t.NumberC;
|
|
20
|
+
totalSent: t.NumberC;
|
|
21
|
+
transferCount: t.NumberC;
|
|
22
|
+
tokens: t.UnknownRecordC;
|
|
23
|
+
nfts: t.UnknownRecordC;
|
|
24
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
25
|
+
type: t.UnknownC;
|
|
26
|
+
metadata: t.UnknownC;
|
|
27
|
+
}>]>;
|
|
28
|
+
export type TrimmedBalance = t.TypeOf<typeof TrimmedBalance>;
|
|
29
|
+
export declare const BaseWalletAddress: t.PartialC<{
|
|
30
|
+
id: t.StringC;
|
|
31
|
+
address: t.StringC;
|
|
32
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
33
|
+
balanceString: t.StringC;
|
|
34
|
+
confirmedBalanceString: t.StringC;
|
|
35
|
+
spendableBalanceString: t.StringC;
|
|
36
|
+
}>, t.PartialC<{
|
|
37
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
38
|
+
balance: t.NumberC;
|
|
39
|
+
lockedBalanceString: t.StringC;
|
|
40
|
+
reservedBalanceString: t.StringC;
|
|
41
|
+
totalReceived: t.NumberC;
|
|
42
|
+
totalSent: t.NumberC;
|
|
43
|
+
transferCount: t.NumberC;
|
|
44
|
+
tokens: t.UnknownRecordC;
|
|
45
|
+
nfts: t.UnknownRecordC;
|
|
46
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
47
|
+
type: t.UnknownC;
|
|
48
|
+
metadata: t.UnknownC;
|
|
49
|
+
}>]>, t.UnknownC]>;
|
|
50
|
+
coinSpecific: t.UnknownC;
|
|
51
|
+
label: t.StringC;
|
|
52
|
+
lastNonce: t.NumberC;
|
|
53
|
+
token: t.StringC;
|
|
54
|
+
proof: t.StringC;
|
|
55
|
+
signature: t.StringC;
|
|
56
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
57
|
+
needsConsolidation: t.BooleanC;
|
|
58
|
+
tokenConsolidationState: t.UnknownC;
|
|
59
|
+
tokenAddress: t.UnknownC;
|
|
60
|
+
}>;
|
|
61
|
+
export type BaseWalletAddress = t.TypeOf<typeof BaseWalletAddress>;
|
|
62
|
+
export declare const LightningWalletAddress: t.IntersectionC<[t.PartialC<{
|
|
63
|
+
id: t.StringC;
|
|
64
|
+
address: t.StringC;
|
|
65
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
66
|
+
balanceString: t.StringC;
|
|
67
|
+
confirmedBalanceString: t.StringC;
|
|
68
|
+
spendableBalanceString: t.StringC;
|
|
69
|
+
}>, t.PartialC<{
|
|
70
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
71
|
+
balance: t.NumberC;
|
|
72
|
+
lockedBalanceString: t.StringC;
|
|
73
|
+
reservedBalanceString: t.StringC;
|
|
74
|
+
totalReceived: t.NumberC;
|
|
75
|
+
totalSent: t.NumberC;
|
|
76
|
+
transferCount: t.NumberC;
|
|
77
|
+
tokens: t.UnknownRecordC;
|
|
78
|
+
nfts: t.UnknownRecordC;
|
|
79
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
80
|
+
type: t.UnknownC;
|
|
81
|
+
metadata: t.UnknownC;
|
|
82
|
+
}>]>, t.UnknownC]>;
|
|
83
|
+
coinSpecific: t.UnknownC;
|
|
84
|
+
label: t.StringC;
|
|
85
|
+
lastNonce: t.NumberC;
|
|
86
|
+
token: t.StringC;
|
|
87
|
+
proof: t.StringC;
|
|
88
|
+
signature: t.StringC;
|
|
89
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
90
|
+
needsConsolidation: t.BooleanC;
|
|
91
|
+
tokenConsolidationState: t.UnknownC;
|
|
92
|
+
tokenAddress: t.UnknownC;
|
|
93
|
+
}>, t.TypeC<{
|
|
94
|
+
coin: t.StringC;
|
|
95
|
+
wallet: t.StringC;
|
|
96
|
+
}>]>;
|
|
97
|
+
export type LightningWalletAddress = t.TypeOf<typeof LightningWalletAddress>;
|
|
98
|
+
export declare const WalletAddress: t.IntersectionC<[t.PartialC<{
|
|
99
|
+
id: t.StringC;
|
|
100
|
+
address: t.StringC;
|
|
101
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
102
|
+
balanceString: t.StringC;
|
|
103
|
+
confirmedBalanceString: t.StringC;
|
|
104
|
+
spendableBalanceString: t.StringC;
|
|
105
|
+
}>, t.PartialC<{
|
|
106
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
107
|
+
balance: t.NumberC;
|
|
108
|
+
lockedBalanceString: t.StringC;
|
|
109
|
+
reservedBalanceString: t.StringC;
|
|
110
|
+
totalReceived: t.NumberC;
|
|
111
|
+
totalSent: t.NumberC;
|
|
112
|
+
transferCount: t.NumberC;
|
|
113
|
+
tokens: t.UnknownRecordC;
|
|
114
|
+
nfts: t.UnknownRecordC;
|
|
115
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
116
|
+
type: t.UnknownC;
|
|
117
|
+
metadata: t.UnknownC;
|
|
118
|
+
}>]>, t.UnknownC]>;
|
|
119
|
+
coinSpecific: t.UnknownC;
|
|
120
|
+
label: t.StringC;
|
|
121
|
+
lastNonce: t.NumberC;
|
|
122
|
+
token: t.StringC;
|
|
123
|
+
proof: t.StringC;
|
|
124
|
+
signature: t.StringC;
|
|
125
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
126
|
+
needsConsolidation: t.BooleanC;
|
|
127
|
+
tokenConsolidationState: t.UnknownC;
|
|
128
|
+
tokenAddress: t.UnknownC;
|
|
129
|
+
}>, t.TypeC<{
|
|
130
|
+
coin: t.StringC;
|
|
131
|
+
wallet: t.StringC;
|
|
132
|
+
chain: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<10>, t.LiteralC<11>, t.LiteralC<20>, t.LiteralC<21>, t.LiteralC<30>, t.LiteralC<31>, t.LiteralC<40>, t.LiteralC<41>]>;
|
|
133
|
+
index: t.NumberC;
|
|
134
|
+
}>]>;
|
|
135
|
+
export type WalletAddress = t.TypeOf<typeof WalletAddress>;
|
|
136
|
+
export declare const WalletAddressUnion: t.UnionC<[t.IntersectionC<[t.PartialC<{
|
|
137
|
+
id: t.StringC;
|
|
138
|
+
address: t.StringC;
|
|
139
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
140
|
+
balanceString: t.StringC;
|
|
141
|
+
confirmedBalanceString: t.StringC;
|
|
142
|
+
spendableBalanceString: t.StringC;
|
|
143
|
+
}>, t.PartialC<{
|
|
144
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
145
|
+
balance: t.NumberC;
|
|
146
|
+
lockedBalanceString: t.StringC;
|
|
147
|
+
reservedBalanceString: t.StringC;
|
|
148
|
+
totalReceived: t.NumberC;
|
|
149
|
+
totalSent: t.NumberC;
|
|
150
|
+
transferCount: t.NumberC;
|
|
151
|
+
tokens: t.UnknownRecordC;
|
|
152
|
+
nfts: t.UnknownRecordC;
|
|
153
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
154
|
+
type: t.UnknownC;
|
|
155
|
+
metadata: t.UnknownC;
|
|
156
|
+
}>]>, t.UnknownC]>;
|
|
157
|
+
coinSpecific: t.UnknownC;
|
|
158
|
+
label: t.StringC;
|
|
159
|
+
lastNonce: t.NumberC;
|
|
160
|
+
token: t.StringC;
|
|
161
|
+
proof: t.StringC;
|
|
162
|
+
signature: t.StringC;
|
|
163
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
164
|
+
needsConsolidation: t.BooleanC;
|
|
165
|
+
tokenConsolidationState: t.UnknownC;
|
|
166
|
+
tokenAddress: t.UnknownC;
|
|
167
|
+
}>, t.TypeC<{
|
|
168
|
+
coin: t.StringC;
|
|
169
|
+
wallet: t.StringC;
|
|
170
|
+
chain: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<10>, t.LiteralC<11>, t.LiteralC<20>, t.LiteralC<21>, t.LiteralC<30>, t.LiteralC<31>, t.LiteralC<40>, t.LiteralC<41>]>;
|
|
171
|
+
index: t.NumberC;
|
|
172
|
+
}>]>, t.IntersectionC<[t.PartialC<{
|
|
173
|
+
id: t.StringC;
|
|
174
|
+
address: t.StringC;
|
|
175
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
176
|
+
balanceString: t.StringC;
|
|
177
|
+
confirmedBalanceString: t.StringC;
|
|
178
|
+
spendableBalanceString: t.StringC;
|
|
179
|
+
}>, t.PartialC<{
|
|
180
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
181
|
+
balance: t.NumberC;
|
|
182
|
+
lockedBalanceString: t.StringC;
|
|
183
|
+
reservedBalanceString: t.StringC;
|
|
184
|
+
totalReceived: t.NumberC;
|
|
185
|
+
totalSent: t.NumberC;
|
|
186
|
+
transferCount: t.NumberC;
|
|
187
|
+
tokens: t.UnknownRecordC;
|
|
188
|
+
nfts: t.UnknownRecordC;
|
|
189
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
190
|
+
type: t.UnknownC;
|
|
191
|
+
metadata: t.UnknownC;
|
|
192
|
+
}>]>, t.UnknownC]>;
|
|
193
|
+
coinSpecific: t.UnknownC;
|
|
194
|
+
label: t.StringC;
|
|
195
|
+
lastNonce: t.NumberC;
|
|
196
|
+
token: t.StringC;
|
|
197
|
+
proof: t.StringC;
|
|
198
|
+
signature: t.StringC;
|
|
199
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
200
|
+
needsConsolidation: t.BooleanC;
|
|
201
|
+
tokenConsolidationState: t.UnknownC;
|
|
202
|
+
tokenAddress: t.UnknownC;
|
|
203
|
+
}>, t.TypeC<{
|
|
204
|
+
coin: t.StringC;
|
|
205
|
+
wallet: t.StringC;
|
|
206
|
+
}>]>]>;
|
|
207
|
+
export type WalletAddressUnion = t.TypeOf<typeof WalletAddressUnion>;
|
|
208
|
+
export declare const AddressQueryResult: t.IntersectionC<[t.TypeC<{
|
|
209
|
+
coin: t.StringC;
|
|
210
|
+
}>, t.PartialC<{
|
|
211
|
+
pendingAddressCount: t.NumberC;
|
|
212
|
+
totalAddressCount: t.NumberC;
|
|
213
|
+
addresses: t.UnionC<[t.ArrayC<t.IntersectionC<[t.PartialC<{
|
|
214
|
+
id: t.StringC;
|
|
215
|
+
address: t.StringC;
|
|
216
|
+
balance: t.UnionC<[t.IntersectionC<[t.TypeC<{
|
|
217
|
+
balanceString: t.StringC;
|
|
218
|
+
confirmedBalanceString: t.StringC;
|
|
219
|
+
spendableBalanceString: t.StringC;
|
|
220
|
+
}>, t.PartialC<{
|
|
221
|
+
updated: t.UnionC<[import("io-ts-types").DateFromISOStringC, import("io-ts-types").DateC, t.UnknownC]>;
|
|
222
|
+
balance: t.NumberC;
|
|
223
|
+
lockedBalanceString: t.StringC;
|
|
224
|
+
reservedBalanceString: t.StringC;
|
|
225
|
+
totalReceived: t.NumberC;
|
|
226
|
+
totalSent: t.NumberC;
|
|
227
|
+
transferCount: t.NumberC;
|
|
228
|
+
tokens: t.UnknownRecordC;
|
|
229
|
+
nfts: t.UnknownRecordC;
|
|
230
|
+
unsupportedNfts: t.UnknownRecordC;
|
|
231
|
+
type: t.UnknownC;
|
|
232
|
+
metadata: t.UnknownC;
|
|
233
|
+
}>]>, t.UnknownC]>;
|
|
234
|
+
coinSpecific: t.UnknownC;
|
|
235
|
+
label: t.StringC;
|
|
236
|
+
lastNonce: t.NumberC;
|
|
237
|
+
token: t.StringC;
|
|
238
|
+
proof: t.StringC;
|
|
239
|
+
signature: t.StringC;
|
|
240
|
+
lastConsolidatedTime: import("io-ts-types").DateC;
|
|
241
|
+
needsConsolidation: t.BooleanC;
|
|
242
|
+
tokenConsolidationState: t.UnknownC;
|
|
243
|
+
tokenAddress: t.UnknownC;
|
|
244
|
+
}>, t.TypeC<{
|
|
245
|
+
coin: t.StringC;
|
|
246
|
+
wallet: t.StringC;
|
|
247
|
+
chain: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<10>, t.LiteralC<11>, t.LiteralC<20>, t.LiteralC<21>, t.LiteralC<30>, t.LiteralC<31>, t.LiteralC<40>, t.LiteralC<41>]>;
|
|
248
|
+
index: t.NumberC;
|
|
249
|
+
}>]>>, t.UnknownC]>;
|
|
250
|
+
nextBatchPrevId: t.StringC;
|
|
251
|
+
count: t.NumberC;
|
|
252
|
+
}>]>;
|
|
253
|
+
export type AddressQueryResult = t.TypeOf<typeof AddressQueryResult>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AddressQueryResult = exports.WalletAddressUnion = exports.WalletAddress = exports.LightningWalletAddress = exports.BaseWalletAddress = exports.TrimmedBalance = exports.AddressChainString = exports.AddressChain = exports.AddressString = exports.AddressLabelString = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
29
|
+
const coin_1 = require("../coin/coin");
|
|
30
|
+
exports.AddressLabelString = t.string;
|
|
31
|
+
exports.AddressString = t.string;
|
|
32
|
+
exports.AddressChain = t.union([
|
|
33
|
+
t.literal(0),
|
|
34
|
+
t.literal(1),
|
|
35
|
+
t.literal(10),
|
|
36
|
+
t.literal(11),
|
|
37
|
+
t.literal(20),
|
|
38
|
+
t.literal(21),
|
|
39
|
+
t.literal(30),
|
|
40
|
+
t.literal(31),
|
|
41
|
+
t.literal(40),
|
|
42
|
+
t.literal(41),
|
|
43
|
+
]);
|
|
44
|
+
exports.AddressChainString = t.union([
|
|
45
|
+
t.literal("0"),
|
|
46
|
+
t.literal("1"),
|
|
47
|
+
t.literal("10"),
|
|
48
|
+
t.literal("11"),
|
|
49
|
+
t.literal("20"),
|
|
50
|
+
t.literal("21"),
|
|
51
|
+
t.literal("30"),
|
|
52
|
+
t.literal("31"),
|
|
53
|
+
t.literal("40"),
|
|
54
|
+
t.literal("41"),
|
|
55
|
+
]);
|
|
56
|
+
exports.TrimmedBalance = t.intersection([
|
|
57
|
+
t.type({
|
|
58
|
+
balanceString: t.string,
|
|
59
|
+
confirmedBalanceString: t.string,
|
|
60
|
+
spendableBalanceString: t.string,
|
|
61
|
+
}),
|
|
62
|
+
t.partial({
|
|
63
|
+
updated: t.union([io_ts_types_1.DateFromISOString, io_ts_types_1.date, t.unknown]),
|
|
64
|
+
balance: t.number,
|
|
65
|
+
lockedBalanceString: t.string,
|
|
66
|
+
reservedBalanceString: t.string,
|
|
67
|
+
totalReceived: t.number,
|
|
68
|
+
totalSent: t.number,
|
|
69
|
+
transferCount: t.number,
|
|
70
|
+
tokens: t.UnknownRecord,
|
|
71
|
+
nfts: t.UnknownRecord,
|
|
72
|
+
unsupportedNfts: t.UnknownRecord,
|
|
73
|
+
type: t.unknown,
|
|
74
|
+
metadata: t.unknown,
|
|
75
|
+
}),
|
|
76
|
+
]);
|
|
77
|
+
exports.BaseWalletAddress = t.partial({
|
|
78
|
+
id: t.string,
|
|
79
|
+
address: exports.AddressString,
|
|
80
|
+
balance: t.union([exports.TrimmedBalance, t.unknown]),
|
|
81
|
+
coinSpecific: t.unknown,
|
|
82
|
+
label: exports.AddressLabelString,
|
|
83
|
+
lastNonce: t.number,
|
|
84
|
+
token: t.string,
|
|
85
|
+
proof: t.string,
|
|
86
|
+
signature: t.string,
|
|
87
|
+
lastConsolidatedTime: io_ts_types_1.date,
|
|
88
|
+
needsConsolidation: t.boolean,
|
|
89
|
+
tokenConsolidationState: t.unknown,
|
|
90
|
+
tokenAddress: t.unknown,
|
|
91
|
+
});
|
|
92
|
+
exports.LightningWalletAddress = t.intersection([
|
|
93
|
+
exports.BaseWalletAddress,
|
|
94
|
+
t.type({
|
|
95
|
+
coin: coin_1.CoinString,
|
|
96
|
+
wallet: t.string,
|
|
97
|
+
}),
|
|
98
|
+
]);
|
|
99
|
+
exports.WalletAddress = t.intersection([
|
|
100
|
+
exports.BaseWalletAddress,
|
|
101
|
+
t.type({
|
|
102
|
+
coin: coin_1.CoinString,
|
|
103
|
+
wallet: t.string,
|
|
104
|
+
chain: exports.AddressChain,
|
|
105
|
+
index: t.number,
|
|
106
|
+
}),
|
|
107
|
+
]);
|
|
108
|
+
exports.WalletAddressUnion = t.union([
|
|
109
|
+
exports.WalletAddress,
|
|
110
|
+
exports.LightningWalletAddress,
|
|
111
|
+
]);
|
|
112
|
+
exports.AddressQueryResult = t.intersection([
|
|
113
|
+
t.type({
|
|
114
|
+
coin: t.string,
|
|
115
|
+
}),
|
|
116
|
+
t.partial({
|
|
117
|
+
pendingAddressCount: t.number,
|
|
118
|
+
totalAddressCount: t.number,
|
|
119
|
+
addresses: t.union([t.array(exports.WalletAddress), t.unknown]),
|
|
120
|
+
nextBatchPrevId: t.string,
|
|
121
|
+
count: t.number,
|
|
122
|
+
}),
|
|
123
|
+
]);
|
|
124
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../src/schema/wallet/address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAsD;AACtD,uCAA0C;AAO7B,QAAA,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;AAO9B,QAAA,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;AAMzB,QAAA,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC;IAClC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACd,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,CAAC,CAA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,CAAC;QAER,mBAAmB,EAAE,CAAC,CAAC,MAAM;QAE7B,iBAAiB,EAAE,CAAC,CAAC,MAAM;QAC3B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,qBAAa,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QAKvD,eAAe,EAAE,CAAC,CAAC,MAAM;QAEzB,KAAK,EAAE,CAAC,CAAC,MAAM;KAChB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./wallet"), exports);
|
|
18
18
|
__exportStar(require("./multisigTypeVersion"), exports);
|
|
19
19
|
__exportStar(require("./walletTypes"), exports);
|
|
20
|
+
__exportStar(require("./address"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAsC;AACtC,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAsC;AACtC,gDAA8B;AAC9B,4CAA0B"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { date, DateFromISOString } from "io-ts-types";
|
|
3
|
+
import { CoinString } from "../coin/coin";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A human-readable label for the address
|
|
7
|
+
* @maxLength 250
|
|
8
|
+
* @example Bob's Hot Wallet Address
|
|
9
|
+
*/
|
|
10
|
+
export const AddressLabelString = t.string;
|
|
11
|
+
export type AddressLabelString = t.TypeOf<typeof AddressLabelString>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @maxLength 250
|
|
15
|
+
* @example 2MvrwRYBAuRtPTiZ5MyKg42Ke55W3fZJfZS
|
|
16
|
+
*/
|
|
17
|
+
export const AddressString = t.string;
|
|
18
|
+
export type AddressString = t.TypeOf<typeof AddressString>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Address chain identifier
|
|
22
|
+
*/
|
|
23
|
+
export const AddressChain = t.union([
|
|
24
|
+
t.literal(0),
|
|
25
|
+
t.literal(1),
|
|
26
|
+
t.literal(10),
|
|
27
|
+
t.literal(11),
|
|
28
|
+
t.literal(20),
|
|
29
|
+
t.literal(21),
|
|
30
|
+
t.literal(30),
|
|
31
|
+
t.literal(31),
|
|
32
|
+
t.literal(40),
|
|
33
|
+
t.literal(41),
|
|
34
|
+
]);
|
|
35
|
+
export type AddressChain = t.TypeOf<typeof AddressChain>;
|
|
36
|
+
|
|
37
|
+
export const AddressChainString = t.union([
|
|
38
|
+
t.literal("0"),
|
|
39
|
+
t.literal("1"),
|
|
40
|
+
t.literal("10"),
|
|
41
|
+
t.literal("11"),
|
|
42
|
+
t.literal("20"),
|
|
43
|
+
t.literal("21"),
|
|
44
|
+
t.literal("30"),
|
|
45
|
+
t.literal("31"),
|
|
46
|
+
t.literal("40"),
|
|
47
|
+
t.literal("41"),
|
|
48
|
+
]);
|
|
49
|
+
export type AddressChainString = t.TypeOf<typeof AddressChainString>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Balance information for an address
|
|
53
|
+
*/
|
|
54
|
+
export const TrimmedBalance = t.intersection([
|
|
55
|
+
t.type({
|
|
56
|
+
/**
|
|
57
|
+
* String representation of the balance. Guaranteed to not lose precision.
|
|
58
|
+
* @example 500000
|
|
59
|
+
*/
|
|
60
|
+
balanceString: t.string,
|
|
61
|
+
/**
|
|
62
|
+
* The total balance of confirmed transactions for the address (in the chain's base unit). Guaranteed to not lose precision.
|
|
63
|
+
* @example 400000
|
|
64
|
+
*/
|
|
65
|
+
confirmedBalanceString: t.string,
|
|
66
|
+
/**
|
|
67
|
+
* The total balance of the address (in the chain's base unit) which may be used as inputs for creating new transactions in string representation. Guaranteed to not lose precision.
|
|
68
|
+
* @example 40000
|
|
69
|
+
*/
|
|
70
|
+
spendableBalanceString: t.string,
|
|
71
|
+
}),
|
|
72
|
+
t.partial({
|
|
73
|
+
/**
|
|
74
|
+
* The last time a transaction affected the balance of this address
|
|
75
|
+
*/
|
|
76
|
+
updated: t.union([DateFromISOString, date, t.unknown]),
|
|
77
|
+
/**
|
|
78
|
+
* @example 50000
|
|
79
|
+
*/
|
|
80
|
+
balance: t.number,
|
|
81
|
+
lockedBalanceString: t.string,
|
|
82
|
+
reservedBalanceString: t.string,
|
|
83
|
+
/**
|
|
84
|
+
* The total amount received on this address (in the chain's base unit)
|
|
85
|
+
*/
|
|
86
|
+
totalReceived: t.number,
|
|
87
|
+
/**
|
|
88
|
+
* The total amount sent from this address (in the chain's base unit)
|
|
89
|
+
*/
|
|
90
|
+
totalSent: t.number,
|
|
91
|
+
transferCount: t.number,
|
|
92
|
+
tokens: t.UnknownRecord,
|
|
93
|
+
nfts: t.UnknownRecord,
|
|
94
|
+
unsupportedNfts: t.UnknownRecord,
|
|
95
|
+
type: t.unknown,
|
|
96
|
+
metadata: t.unknown,
|
|
97
|
+
}),
|
|
98
|
+
]);
|
|
99
|
+
export type TrimmedBalance = t.TypeOf<typeof TrimmedBalance>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Base wallet address with optional fields
|
|
103
|
+
*/
|
|
104
|
+
export const BaseWalletAddress = t.partial({
|
|
105
|
+
/**
|
|
106
|
+
* Platform public ID for an address
|
|
107
|
+
* @example 59cd72485007a239fb00282ed480da1f
|
|
108
|
+
* @pattern ^[0-9a-f]{32}$
|
|
109
|
+
*/
|
|
110
|
+
id: t.string,
|
|
111
|
+
address: AddressString,
|
|
112
|
+
balance: t.union([TrimmedBalance, t.unknown]),
|
|
113
|
+
/**
|
|
114
|
+
* Properties specific to certain coin types
|
|
115
|
+
*/
|
|
116
|
+
// TODO: Add the coin specific schema
|
|
117
|
+
coinSpecific: t.unknown,
|
|
118
|
+
label: AddressLabelString,
|
|
119
|
+
/**
|
|
120
|
+
* @default -1
|
|
121
|
+
*/
|
|
122
|
+
lastNonce: t.number,
|
|
123
|
+
token: t.string,
|
|
124
|
+
proof: t.string,
|
|
125
|
+
signature: t.string,
|
|
126
|
+
lastConsolidatedTime: date,
|
|
127
|
+
needsConsolidation: t.boolean,
|
|
128
|
+
tokenConsolidationState: t.unknown,
|
|
129
|
+
tokenAddress: t.unknown,
|
|
130
|
+
});
|
|
131
|
+
export type BaseWalletAddress = t.TypeOf<typeof BaseWalletAddress>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Lightning wallet address
|
|
135
|
+
*/
|
|
136
|
+
export const LightningWalletAddress = t.intersection([
|
|
137
|
+
BaseWalletAddress,
|
|
138
|
+
t.type({
|
|
139
|
+
coin: CoinString,
|
|
140
|
+
wallet: t.string,
|
|
141
|
+
}),
|
|
142
|
+
]);
|
|
143
|
+
export type LightningWalletAddress = t.TypeOf<typeof LightningWalletAddress>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Standard wallet address
|
|
147
|
+
*/
|
|
148
|
+
export const WalletAddress = t.intersection([
|
|
149
|
+
BaseWalletAddress,
|
|
150
|
+
t.type({
|
|
151
|
+
coin: CoinString,
|
|
152
|
+
wallet: t.string,
|
|
153
|
+
chain: AddressChain,
|
|
154
|
+
index: t.number,
|
|
155
|
+
}),
|
|
156
|
+
]);
|
|
157
|
+
export type WalletAddress = t.TypeOf<typeof WalletAddress>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Union of wallet address types
|
|
161
|
+
*/
|
|
162
|
+
export const WalletAddressUnion = t.union([
|
|
163
|
+
WalletAddress,
|
|
164
|
+
LightningWalletAddress,
|
|
165
|
+
]);
|
|
166
|
+
export type WalletAddressUnion = t.TypeOf<typeof WalletAddressUnion>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Response type for listing wallet addresses
|
|
170
|
+
*/
|
|
171
|
+
export const AddressQueryResult = t.intersection([
|
|
172
|
+
t.type({
|
|
173
|
+
coin: t.string,
|
|
174
|
+
}),
|
|
175
|
+
t.partial({
|
|
176
|
+
/** Total number of addresses pending on-chain initialization on this wallet **Note:** for wallets with many addresses (100,000 or more), this property may be omitted for performance reasons. If the pending address count is needed for a large wallet, the `includeTotalAddressCount` query parameter can be used to force an address count to be returned with the initial page of addresses. */
|
|
177
|
+
pendingAddressCount: t.number,
|
|
178
|
+
/** Total number of addresses which match the provided query parameters. **Note:** for wallets with many addresses (100,000 or more), this property may be omitted for performance reasons. If the total address count is needed for a large wallet, the `includeTotalAddressCount` query parameter can be used to force an address count to be returned with the initial page of addresses. */
|
|
179
|
+
totalAddressCount: t.number,
|
|
180
|
+
addresses: t.union([t.array(WalletAddress), t.unknown]),
|
|
181
|
+
/** When a result set is truncated, this field returns the id of the last object in the previous batch. To get the next batch of results, pass this value via the `prevId` query parameter.
|
|
182
|
+
* @format uuid
|
|
183
|
+
* @example 585951a5df8380e0e3063e9f
|
|
184
|
+
*/
|
|
185
|
+
nextBatchPrevId: t.string,
|
|
186
|
+
/** Total number of addresses returned in this response */
|
|
187
|
+
count: t.number,
|
|
188
|
+
}),
|
|
189
|
+
]);
|
|
190
|
+
export type AddressQueryResult = t.TypeOf<typeof AddressQueryResult>;
|