@v3finance/core-sdk 0.21.0 → 0.22.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/CHANGELOG.md +40 -0
- package/README.md +1 -1
- package/dist/cjs/generated/operations.d.ts +16 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +18 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +102 -3
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/query-keys.d.ts +5 -0
- package/dist/cjs/query-keys.d.ts.map +1 -1
- package/dist/cjs/query-keys.js +5 -0
- package/dist/cjs/query-keys.js.map +1 -1
- package/dist/cjs/resources/addresses.d.ts +47 -4
- package/dist/cjs/resources/addresses.d.ts.map +1 -1
- package/dist/cjs/resources/addresses.js +38 -3
- package/dist/cjs/resources/addresses.js.map +1 -1
- package/dist/cjs/resources/registries.d.ts +26 -1
- package/dist/cjs/resources/registries.d.ts.map +1 -1
- package/dist/cjs/resources/registries.js +26 -1
- package/dist/cjs/resources/registries.js.map +1 -1
- package/dist/cjs/resources/transfers.d.ts +20 -0
- package/dist/cjs/resources/transfers.d.ts.map +1 -1
- package/dist/cjs/resources/transfers.js +20 -0
- package/dist/cjs/resources/transfers.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/generated/operations.d.ts +16 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +18 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +102 -3
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/query-keys.d.ts +5 -0
- package/dist/esm/query-keys.d.ts.map +1 -1
- package/dist/esm/query-keys.js +5 -0
- package/dist/esm/query-keys.js.map +1 -1
- package/dist/esm/resources/addresses.d.ts +47 -4
- package/dist/esm/resources/addresses.d.ts.map +1 -1
- package/dist/esm/resources/addresses.js +38 -3
- package/dist/esm/resources/addresses.js.map +1 -1
- package/dist/esm/resources/registries.d.ts +26 -1
- package/dist/esm/resources/registries.d.ts.map +1 -1
- package/dist/esm/resources/registries.js +26 -1
- package/dist/esm/resources/registries.js.map +1 -1
- package/dist/esm/resources/transfers.d.ts +20 -0
- package/dist/esm/resources/transfers.d.ts.map +1 -1
- package/dist/esm/resources/transfers.js +20 -0
- package/dist/esm/resources/transfers.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/concepts.md +9 -0
- package/docs/errors.md +40 -3
- package/package.json +1 -1
- package/src/generated/operations.ts +18 -2
- package/src/generated/types.ts +105 -3
- package/src/index.ts +1 -0
- package/src/query-keys.ts +6 -0
- package/src/resources/addresses.ts +53 -3
- package/src/resources/registries.ts +26 -1
- package/src/resources/transfers.ts +20 -0
- package/src/version.ts +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type { Address, AddressDetail, Transaction, TransactionStatus, HistoryIte
|
|
|
35
35
|
* you need a shape the resources do not expose yet.
|
|
36
36
|
*/
|
|
37
37
|
export type * from './generated/types.js';
|
|
38
|
-
export { AddressesResource, type AddressFilters, type AddressFacet, type AddressesSummaryParams, type ListAddressesParams, type PendingApproval, } from './resources/addresses.js';
|
|
38
|
+
export { AddressesResource, type AddressFilters, type AddressFacet, type AddressGasParams, type AddressesSummaryParams, type ListAddressesParams, type PendingApproval, } from './resources/addresses.js';
|
|
39
39
|
export { TransfersResource, type VoteInput } from './resources/transfers.js';
|
|
40
40
|
export { TransferDraftsResource, type ListTransferDraftsParams, type TransferDraftStatus, } from './resources/transferDrafts.js';
|
|
41
41
|
export { PaymentsResource, DealsResource, type ListDealsParams, type ListPaymentsParams, type PaymentFilters, type PaymentState, } from './resources/payments.js';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEzD;;;;;;;;;;GAUG;AACH,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,EACL,UAAU,EACV,cAAc,EACd,GAAG,EACH,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,cAAc,EACd,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,EACX,MAAM,EACN,YAAY,EACZ,eAAe,EACf,MAAM,EACN,GAAG,EACH,GAAG,EACH,OAAO,EACP,MAAM,EACN,UAAU,EACV,KAAK,MAAM,GACZ,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE5D,YAAY,EACV,OAAO,EACP,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,UAAU,GACX,MAAM,sBAAsB,CAAA;AAE7B;;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ot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAA;AAezD,OAAO,EACL,UAAU,EACV,cAAc,EACd,GAAG,GAOJ,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,cAAc,EACd,cAAc,GAGf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,EACX,MAAM,EACN,YAAY,EACZ,eAAe,EACf,MAAM,EACN,GAAG,EACH,GAAG,EACH,OAAO,EACP,MAAM,EACN,UAAU,GAEX,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAiC,MAAM,iBAAiB,CAAA;AAE9F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA8B,MAAM,sBAAsB,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAiB5D,OAAO,EACL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAA;AAezD,OAAO,EACL,UAAU,EACV,cAAc,EACd,GAAG,GAOJ,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,cAAc,EACd,cAAc,GAGf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,EACX,MAAM,EACN,YAAY,EACZ,eAAe,EACf,MAAM,EACN,GAAG,EACH,GAAG,EACH,OAAO,EACP,MAAM,EACN,UAAU,GAEX,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAiC,MAAM,iBAAiB,CAAA;AAE9F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA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AAU,EACV,gBAAgB,GAIjB,MAAM,2BAA2B,CAAA"}
|
package/dist/esm/query-keys.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export declare const queryKeys: {
|
|
|
10
10
|
readonly vault: (code: string) => readonly ['v3', 'vault', string];
|
|
11
11
|
readonly addresses: (code: string, filters?: Record<string, unknown>) => readonly ['v3', 'vault', string, 'addresses', Record<string, unknown> | null];
|
|
12
12
|
readonly address: (code: string, id: string) => readonly ['v3', 'vault', string, 'address', string];
|
|
13
|
+
/**
|
|
14
|
+
* Under the address's own key on purpose: invalidating `address(code, id)`
|
|
15
|
+
* drops its gas too, and after a transfer from the address both are stale.
|
|
16
|
+
*/
|
|
17
|
+
readonly addressGas: (code: string, id: string, transfer?: Record<string, unknown>) => readonly ['v3', 'vault', string, 'address', string, 'gas', Record<string, unknown> | null];
|
|
13
18
|
readonly transfer: (code: string, id: string) => readonly ['v3', 'vault', string, 'transfer', string];
|
|
14
19
|
readonly history: (code: string, filters?: Record<string, unknown>) => readonly ['v3', 'vault', string, 'history', Record<string, unknown> | null];
|
|
15
20
|
readonly profile: () => readonly ['v3', 'me', 'profile'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;aACpB,KAAK,SAAS,MAAM,eAAM,IAAI,EAAE,OAAO;aACvC,SAAS,SAAS,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACxD,IAAI,EAAE,OAAO,UAAQ,WAAW;aACnC,OAAO,SAAS,MAAM,MAAM,MAAM,eAAM,IAAI,EAAE,OAAO,UAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS;aACpB,KAAK,SAAS,MAAM,eAAM,IAAI,EAAE,OAAO;aACvC,SAAS,SAAS,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACxD,IAAI,EAAE,OAAO,UAAQ,WAAW;aACnC,OAAO,SAAS,MAAM,MAAM,MAAM,eAAM,IAAI,EAAE,OAAO,UAAQ,SAAS;IACtE;;;OAGG;aACH,UAAU,SAAS,MAAM,MAAM,MAAM,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACtE,IAAI,EAAE,OAAO,UAAQ,SAAS,UAAM,KAAK;aAC5C,QAAQ,SAAS,MAAM,MAAM,MAAM,eAAM,IAAI,EAAE,OAAO,UAAQ,UAAU;aACxE,OAAO,SAAS,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACtD,IAAI,EAAE,OAAO,UAAQ,SAAS;aACjC,OAAO,kBAAS,IAAI,EAAE,IAAI,EAAE,SAAS;CAC7B,CAAA"}
|
package/dist/esm/query-keys.js
CHANGED
|
@@ -10,6 +10,11 @@ export const queryKeys = {
|
|
|
10
10
|
vault: (code) => ['v3', 'vault', code],
|
|
11
11
|
addresses: (code, filters) => ['v3', 'vault', code, 'addresses', filters ?? null],
|
|
12
12
|
address: (code, id) => ['v3', 'vault', code, 'address', id],
|
|
13
|
+
/**
|
|
14
|
+
* Under the address's own key on purpose: invalidating `address(code, id)`
|
|
15
|
+
* drops its gas too, and after a transfer from the address both are stale.
|
|
16
|
+
*/
|
|
17
|
+
addressGas: (code, id, transfer) => ['v3', 'vault', code, 'address', id, 'gas', transfer ?? null],
|
|
13
18
|
transfer: (code, id) => ['v3', 'vault', code, 'transfer', id],
|
|
14
19
|
history: (code, filters) => ['v3', 'vault', code, 'history', filters ?? null],
|
|
15
20
|
profile: () => ['v3', 'me', 'profile'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.js","sourceRoot":"","sources":["../../src/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC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pF;;;OAGG;IACH,UAAU,EAAE,CAAC,IAAY,EAAE,EAAU,EAAE,QAAkC,EAAE,EAAE,CAC3E,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAU;IACxE,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAU;IACtF,OAAO,EAAE,CAAC,IAAY,EAAE,OAAiC,EAAE,EAAE,CAC3D,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,IAAI,IAAI,CAAU;IAC5D,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAU;CACvC,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { type HttpClient } from '../core/http.js';
|
|
|
2
2
|
import type { Page, PageParams } from '../core/pagination.js';
|
|
3
3
|
import { type Gated } from '../core/gated.js';
|
|
4
4
|
import type { Address, AddressDetail } from './types.js';
|
|
5
|
-
import type { AddressesSummary, CreateAddressBody, CreateAddressResult, PatchAddressBody, PendingApproval as GeneratedPendingApproval } from '../generated/types.js';
|
|
5
|
+
import type { AddressGas, AddressesSummary, CreateAddressBody, CreateAddressResult, PatchAddressBody, PendingApproval as GeneratedPendingApproval } from '../generated/types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Returned when creating an address required approval instead of running.
|
|
8
8
|
*
|
|
@@ -65,6 +65,18 @@ export interface ListAddressesParams extends AddressFilters, PageParams {
|
|
|
65
65
|
*/
|
|
66
66
|
sort?: 'createdAt' | 'lastActivity' | undefined;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The transfer `gas()` should estimate the fee of. All three together or none:
|
|
70
|
+
* a partial set is 400 `GAS_QUERY_INCOMPLETE`.
|
|
71
|
+
*/
|
|
72
|
+
export interface AddressGasParams {
|
|
73
|
+
/** The recipient. */
|
|
74
|
+
to?: string | undefined;
|
|
75
|
+
/** Token code: `usdt_eth`. */
|
|
76
|
+
asset?: string | undefined;
|
|
77
|
+
/** The amount in whole units of the token, as a decimal string — what `transfers.send` takes. */
|
|
78
|
+
amount?: string | undefined;
|
|
79
|
+
}
|
|
68
80
|
/** What `summary()` can count by. */
|
|
69
81
|
export type AddressFacet = keyof AddressesSummary['facets'];
|
|
70
82
|
export interface AddressesSummaryParams extends AddressFilters {
|
|
@@ -110,6 +122,34 @@ export declare class AddressesResource {
|
|
|
110
122
|
*/
|
|
111
123
|
summary(params?: AddressesSummaryParams): Promise<AddressesSummary>;
|
|
112
124
|
get(addressId: string): Promise<AddressDetail>;
|
|
125
|
+
/**
|
|
126
|
+
* Who pays the network fee for transfers from this address, and whether
|
|
127
|
+
* there is enough to pay it.
|
|
128
|
+
*
|
|
129
|
+
* `payer: 'platform'` (TRON) — the platform buys the resources, nothing has
|
|
130
|
+
* to be kept on the address, and every other field is `null`.
|
|
131
|
+
* `payer: 'address'` (Ethereum) — the address pays itself, in the network's
|
|
132
|
+
* coin (`symbol`, ETH): without it a token transfer does not leave, however
|
|
133
|
+
* much of the token is there, and `transfers.send` answers 400
|
|
134
|
+
* `INSUFFICIENT_GAS`. Show `balance` next to the token balances and check
|
|
135
|
+
* `estimate.enough` before offering to send.
|
|
136
|
+
*
|
|
137
|
+
* THE COIN IS NOT AN ASSET OF THE VAULT. `balance` is read from the network
|
|
138
|
+
* at the moment of the call (`checkedAt`); it is not in the address's
|
|
139
|
+
* `balances[]`, a top-up of it does not arrive as a deposit, and it cannot
|
|
140
|
+
* be sent with `transfers.send`.
|
|
141
|
+
*
|
|
142
|
+
* With `to`, `asset` and `amount` the answer carries `estimate` — the
|
|
143
|
+
* CEILING of the fee for that transfer, computed the way sending checks it;
|
|
144
|
+
* what is charged is usually less. `estimate: null` with all three passed is
|
|
145
|
+
* not a refusal: the fee could not be computed — the node did not answer, or
|
|
146
|
+
* the address does not hold the token amount itself.
|
|
147
|
+
*
|
|
148
|
+
* Needs the `view` right on the address (404 otherwise). 409
|
|
149
|
+
* `NETWORK_NOT_READY` — the network is not set up for reading the chain;
|
|
150
|
+
* 502 `ONCHAIN_STATE_UNAVAILABLE` — the node did not answer, ask again.
|
|
151
|
+
*/
|
|
152
|
+
gas(addressId: string, params?: AddressGasParams): Promise<AddressGas>;
|
|
113
153
|
/**
|
|
114
154
|
* 201 — the address is ready (`applied`); 202 — it went for approval and a
|
|
115
155
|
* request came back (`pending`); 200 — a replay of `idempotencyKey`
|
|
@@ -128,9 +168,12 @@ export declare class AddressesResource {
|
|
|
128
168
|
* rolled back) does not consume the key. The key is per member of the
|
|
129
169
|
* vault.
|
|
130
170
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
171
|
+
* An address is created only on a network whose deposits are monitored:
|
|
172
|
+
* TRON, and an EVM network (Ethereum) once the API is connected to its
|
|
173
|
+
* monitoring. On any other network of the vault it is refused with 400
|
|
174
|
+
* `NETWORK_NOT_MONITORED` before anything is asked of the signing service;
|
|
175
|
+
* 409 `NETWORK_NOT_READY` — an EVM network in a vault whose signing service
|
|
176
|
+
* cannot derive EVM addresses.
|
|
134
177
|
*/
|
|
135
178
|
create(input: CreateAddressBody): Promise<Gated<CreateAddressResult, PendingApproval>>;
|
|
136
179
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/resources/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAA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;IAED,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAE7C;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAIzE;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC,CAK3F;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnE;CACF"}
|
|
@@ -51,6 +51,38 @@ export class AddressesResource {
|
|
|
51
51
|
get(addressId) {
|
|
52
52
|
return this.#http.request('GET', `${this.#base}/${seg(addressId)}`);
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Who pays the network fee for transfers from this address, and whether
|
|
56
|
+
* there is enough to pay it.
|
|
57
|
+
*
|
|
58
|
+
* `payer: 'platform'` (TRON) — the platform buys the resources, nothing has
|
|
59
|
+
* to be kept on the address, and every other field is `null`.
|
|
60
|
+
* `payer: 'address'` (Ethereum) — the address pays itself, in the network's
|
|
61
|
+
* coin (`symbol`, ETH): without it a token transfer does not leave, however
|
|
62
|
+
* much of the token is there, and `transfers.send` answers 400
|
|
63
|
+
* `INSUFFICIENT_GAS`. Show `balance` next to the token balances and check
|
|
64
|
+
* `estimate.enough` before offering to send.
|
|
65
|
+
*
|
|
66
|
+
* THE COIN IS NOT AN ASSET OF THE VAULT. `balance` is read from the network
|
|
67
|
+
* at the moment of the call (`checkedAt`); it is not in the address's
|
|
68
|
+
* `balances[]`, a top-up of it does not arrive as a deposit, and it cannot
|
|
69
|
+
* be sent with `transfers.send`.
|
|
70
|
+
*
|
|
71
|
+
* With `to`, `asset` and `amount` the answer carries `estimate` — the
|
|
72
|
+
* CEILING of the fee for that transfer, computed the way sending checks it;
|
|
73
|
+
* what is charged is usually less. `estimate: null` with all three passed is
|
|
74
|
+
* not a refusal: the fee could not be computed — the node did not answer, or
|
|
75
|
+
* the address does not hold the token amount itself.
|
|
76
|
+
*
|
|
77
|
+
* Needs the `view` right on the address (404 otherwise). 409
|
|
78
|
+
* `NETWORK_NOT_READY` — the network is not set up for reading the chain;
|
|
79
|
+
* 502 `ONCHAIN_STATE_UNAVAILABLE` — the node did not answer, ask again.
|
|
80
|
+
*/
|
|
81
|
+
gas(addressId, params = {}) {
|
|
82
|
+
return this.#http.request('GET', `${this.#base}/${seg(addressId)}/gas`, {
|
|
83
|
+
query: { ...params },
|
|
84
|
+
});
|
|
85
|
+
}
|
|
54
86
|
/**
|
|
55
87
|
* 201 — the address is ready (`applied`); 202 — it went for approval and a
|
|
56
88
|
* request came back (`pending`); 200 — a replay of `idempotencyKey`
|
|
@@ -69,9 +101,12 @@ export class AddressesResource {
|
|
|
69
101
|
* rolled back) does not consume the key. The key is per member of the
|
|
70
102
|
* vault.
|
|
71
103
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
104
|
+
* An address is created only on a network whose deposits are monitored:
|
|
105
|
+
* TRON, and an EVM network (Ethereum) once the API is connected to its
|
|
106
|
+
* monitoring. On any other network of the vault it is refused with 400
|
|
107
|
+
* `NETWORK_NOT_MONITORED` before anything is asked of the signing service;
|
|
108
|
+
* 409 `NETWORK_NOT_READY` — an EVM network in a vault whose signing service
|
|
109
|
+
* cannot derive EVM addresses.
|
|
75
110
|
*/
|
|
76
111
|
async create(input) {
|
|
77
112
|
const res = await this.#http.requestRaw('POST', this.#base, { body: input });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/resources/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AA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O,CAAa,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE;YAClF,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE;SACrB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,MAAM,CAAC,KAAwB;QACnC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAU,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;QACrF,OAAO,OAAO,CAAuC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE;YACzE,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAiB,EAAE,KAAuB;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACjG,CAAC;CACF"}
|
|
@@ -150,9 +150,19 @@ export declare class RegistriesResource {
|
|
|
150
150
|
* A derivation path is written WITHOUT apostrophes — `m/44/195/…`, not
|
|
151
151
|
* `m/44'/…`. The hardened marker is implied; writing it out produces a
|
|
152
152
|
* different path and therefore different addresses.
|
|
153
|
+
*
|
|
154
|
+
* An EVM network (`type: 'EVM'`, `coinType: 60`) needs `chainId` — Ethereum
|
|
155
|
+
* is 1 — and takes `nativeSymbol`, the coin its addresses pay the fee in
|
|
156
|
+
* (`ETH`); both are refused on any other network. `slug` must be the
|
|
157
|
+
* network's name at the deposit monitoring, in lower case (`ethereum`):
|
|
158
|
+
* incoming payments are matched to the network by it.
|
|
153
159
|
*/
|
|
154
160
|
createNetwork(input: CreateNetworkBody): Promise<Network>;
|
|
155
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* Administrators only. `chainId` can be set or changed only while the
|
|
163
|
+
* network has no addresses (409 otherwise): the same key on another chain is
|
|
164
|
+
* another account.
|
|
165
|
+
*/
|
|
156
166
|
updateNetwork(networkId: string, input: PatchNetworkBody): Promise<Network>;
|
|
157
167
|
/**
|
|
158
168
|
* Registering a token. Administrators only.
|
|
@@ -160,6 +170,21 @@ export declare class RegistriesResource {
|
|
|
160
170
|
* The contract address is the key: an incoming payment is matched to a
|
|
161
171
|
* token by it, so a wrong one means deposits land on the wrong asset or
|
|
162
172
|
* nowhere at all.
|
|
173
|
+
*
|
|
174
|
+
* On an EVM network `decimals` is checked against the contract itself:
|
|
175
|
+
* the signing service converts an amount by the contract's `decimals()`,
|
|
176
|
+
* the ledger by the registry's, and one digit of difference sends ten times
|
|
177
|
+
* what was booked. 400 `TOKEN_DECIMALS_MISMATCH` (the contract's number is
|
|
178
|
+
* in `message`); 400 `INVALID_CONTRACT_ADDRESS` — not an address, or no
|
|
179
|
+
* token contract there; 400 `TOKEN_DECIMALS_UNSUPPORTED` — more than 9;
|
|
180
|
+
* 400 `EVM_NATIVE_NOT_SUPPORTED` — the network's coin (ETH) is not an asset
|
|
181
|
+
* and is not registered; 409 `NETWORK_NOT_READY` — the network has no
|
|
182
|
+
* `chainId` or no node to read from; 409 `ONCHAIN_STATE_UNAVAILABLE` — the
|
|
183
|
+
* node did not answer, the token was not created, try again.
|
|
184
|
+
*
|
|
185
|
+
* A token code is unique across networks, so USDT on Ethereum is a token of
|
|
186
|
+
* its own (`usdt_eth`): policies and limits written for `usdt` do not apply
|
|
187
|
+
* to it.
|
|
163
188
|
*/
|
|
164
189
|
createToken(input: CreateTokenBody): Promise<TokenWithNetwork>;
|
|
165
190
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries.d.ts","sourceRoot":"","sources":["../../../src/resources/registries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,E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;;;;OAYG;IACH,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAExD;IAED;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAI1E;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE7D;IAED;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAI7E;CACF"}
|
|
@@ -123,11 +123,21 @@ export class RegistriesResource {
|
|
|
123
123
|
* A derivation path is written WITHOUT apostrophes — `m/44/195/…`, not
|
|
124
124
|
* `m/44'/…`. The hardened marker is implied; writing it out produces a
|
|
125
125
|
* different path and therefore different addresses.
|
|
126
|
+
*
|
|
127
|
+
* An EVM network (`type: 'EVM'`, `coinType: 60`) needs `chainId` — Ethereum
|
|
128
|
+
* is 1 — and takes `nativeSymbol`, the coin its addresses pay the fee in
|
|
129
|
+
* (`ETH`); both are refused on any other network. `slug` must be the
|
|
130
|
+
* network's name at the deposit monitoring, in lower case (`ethereum`):
|
|
131
|
+
* incoming payments are matched to the network by it.
|
|
126
132
|
*/
|
|
127
133
|
createNetwork(input) {
|
|
128
134
|
return this.#http.request('POST', '/api/v1/networks', { body: input });
|
|
129
135
|
}
|
|
130
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Administrators only. `chainId` can be set or changed only while the
|
|
138
|
+
* network has no addresses (409 otherwise): the same key on another chain is
|
|
139
|
+
* another account.
|
|
140
|
+
*/
|
|
131
141
|
updateNetwork(networkId, input) {
|
|
132
142
|
return this.#http.request('PATCH', `/api/v1/networks/${encodeURIComponent(networkId)}`, {
|
|
133
143
|
body: input,
|
|
@@ -139,6 +149,21 @@ export class RegistriesResource {
|
|
|
139
149
|
* The contract address is the key: an incoming payment is matched to a
|
|
140
150
|
* token by it, so a wrong one means deposits land on the wrong asset or
|
|
141
151
|
* nowhere at all.
|
|
152
|
+
*
|
|
153
|
+
* On an EVM network `decimals` is checked against the contract itself:
|
|
154
|
+
* the signing service converts an amount by the contract's `decimals()`,
|
|
155
|
+
* the ledger by the registry's, and one digit of difference sends ten times
|
|
156
|
+
* what was booked. 400 `TOKEN_DECIMALS_MISMATCH` (the contract's number is
|
|
157
|
+
* in `message`); 400 `INVALID_CONTRACT_ADDRESS` — not an address, or no
|
|
158
|
+
* token contract there; 400 `TOKEN_DECIMALS_UNSUPPORTED` — more than 9;
|
|
159
|
+
* 400 `EVM_NATIVE_NOT_SUPPORTED` — the network's coin (ETH) is not an asset
|
|
160
|
+
* and is not registered; 409 `NETWORK_NOT_READY` — the network has no
|
|
161
|
+
* `chainId` or no node to read from; 409 `ONCHAIN_STATE_UNAVAILABLE` — the
|
|
162
|
+
* node did not answer, the token was not created, try again.
|
|
163
|
+
*
|
|
164
|
+
* A token code is unique across networks, so USDT on Ethereum is a token of
|
|
165
|
+
* its own (`usdt_eth`): policies and limits written for `usdt` do not apply
|
|
166
|
+
* to it.
|
|
142
167
|
*/
|
|
143
168
|
createToken(input) {
|
|
144
169
|
return this.#http.request('POST', '/api/v1/tokens', { body: input });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries.js","sourceRoot":"","sources":["../../../src/resources/registries.ts"],"names":[],"mappings":"AAiDA;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAkB;IACpB,KAAK,CAAY;IAE1B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,KAAK,EAAE,kBAAkB,CAAC,CAAA;IACzE,CAAC;IAED,mFAAmF;IACnF,MAAM,CAAC,MAAM,GAA4C,EAAE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AO,CAAU,MAAM,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACjF,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,SAAiB,EAAE,KAAuB;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,OAAO,EAAE,oBAAoB,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAAE;YAC/F,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CAAC,KAAsB;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,MAAM,EAAE,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACxF,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,OAAe,EAAE,KAAqB;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,OAAO,EAAE,kBAAkB,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE;YACpG,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -60,6 +60,14 @@ export declare class TransfersResource {
|
|
|
60
60
|
*
|
|
61
61
|
* A key beginning with `draft:` is refused with 400 `BAD_REQUEST`: the
|
|
62
62
|
* prefix is reserved for the transfers `transferDrafts.send()` creates.
|
|
63
|
+
*
|
|
64
|
+
* From an Ethereum address the fee is paid by the address itself, in ETH,
|
|
65
|
+
* and its transactions go out one at a time: 400 `INSUFFICIENT_GAS` (top up
|
|
66
|
+
* the address — `addresses.gas()` shows what is there), 409 `ADDRESS_BUSY`
|
|
67
|
+
* (an earlier transfer from it is not settled yet), 409
|
|
68
|
+
* `ONCHAIN_STATE_UNAVAILABLE` (the network did not answer). All three are
|
|
69
|
+
* definite refusals — the transfer is `failed` and the reserve is back — so
|
|
70
|
+
* a retry takes a NEW key.
|
|
63
71
|
*/
|
|
64
72
|
send(input: CreateTransferBody, options?: {
|
|
65
73
|
signal?: AbortSignal;
|
|
@@ -152,6 +160,18 @@ export declare class TransfersResource {
|
|
|
152
160
|
* the saved hash in `details.txHash`. The other two cases never executed
|
|
153
161
|
* and take no hash.
|
|
154
162
|
*
|
|
163
|
+
* On Ethereum the server DOES check the chain. Without a hash the reserve
|
|
164
|
+
* is returned only if no transaction left the address since the transfer
|
|
165
|
+
* went to the signing service — 409 `BROADCAST_DETECTED` otherwise
|
|
166
|
+
* (`details.address`: find the hash in an explorer and send it). With a
|
|
167
|
+
* hash the transaction must be from the transfer's address, not older than
|
|
168
|
+
* the transfer and already in a block: 400 `INVALID_TXHASH`, 409
|
|
169
|
+
* `TX_NOT_INCLUDED`, 409 `TXHASH_MISMATCH`. A transaction the contract
|
|
170
|
+
* reverted settles the transfer as `failed` WITH that `txHash` and the
|
|
171
|
+
* reserve returned, so read `status` of the answer rather than assuming
|
|
172
|
+
* `confirmed`. 409 `ONCHAIN_STATE_UNAVAILABLE` — the chain could not be
|
|
173
|
+
* read, nothing moved, reconcile again later.
|
|
174
|
+
*
|
|
155
175
|
* A FRESH transfer is refused on purpose — while execution may still be in
|
|
156
176
|
* flight, intervening risks a SECOND broadcast, which costs more than
|
|
157
177
|
* waiting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM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CAM9D;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,qBAA0B,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAMlC;CACF"}
|
|
@@ -59,6 +59,14 @@ export class TransfersResource {
|
|
|
59
59
|
*
|
|
60
60
|
* A key beginning with `draft:` is refused with 400 `BAD_REQUEST`: the
|
|
61
61
|
* prefix is reserved for the transfers `transferDrafts.send()` creates.
|
|
62
|
+
*
|
|
63
|
+
* From an Ethereum address the fee is paid by the address itself, in ETH,
|
|
64
|
+
* and its transactions go out one at a time: 400 `INSUFFICIENT_GAS` (top up
|
|
65
|
+
* the address — `addresses.gas()` shows what is there), 409 `ADDRESS_BUSY`
|
|
66
|
+
* (an earlier transfer from it is not settled yet), 409
|
|
67
|
+
* `ONCHAIN_STATE_UNAVAILABLE` (the network did not answer). All three are
|
|
68
|
+
* definite refusals — the transfer is `failed` and the reserve is back — so
|
|
69
|
+
* a retry takes a NEW key.
|
|
62
70
|
*/
|
|
63
71
|
async send(input, options = {}) {
|
|
64
72
|
const res = await this.#http.requestRaw('POST', this.#base, {
|
|
@@ -164,6 +172,18 @@ export class TransfersResource {
|
|
|
164
172
|
* the saved hash in `details.txHash`. The other two cases never executed
|
|
165
173
|
* and take no hash.
|
|
166
174
|
*
|
|
175
|
+
* On Ethereum the server DOES check the chain. Without a hash the reserve
|
|
176
|
+
* is returned only if no transaction left the address since the transfer
|
|
177
|
+
* went to the signing service — 409 `BROADCAST_DETECTED` otherwise
|
|
178
|
+
* (`details.address`: find the hash in an explorer and send it). With a
|
|
179
|
+
* hash the transaction must be from the transfer's address, not older than
|
|
180
|
+
* the transfer and already in a block: 400 `INVALID_TXHASH`, 409
|
|
181
|
+
* `TX_NOT_INCLUDED`, 409 `TXHASH_MISMATCH`. A transaction the contract
|
|
182
|
+
* reverted settles the transfer as `failed` WITH that `txHash` and the
|
|
183
|
+
* reserve returned, so read `status` of the answer rather than assuming
|
|
184
|
+
* `confirmed`. 409 `ONCHAIN_STATE_UNAVAILABLE` — the chain could not be
|
|
185
|
+
* read, nothing moved, reconcile again later.
|
|
186
|
+
*
|
|
167
187
|
* A FRESH transfer is refused on purpose — while execution may still be in
|
|
168
188
|
* flight, intervening risks a SECOND broadcast, which costs more than
|
|
169
189
|
* waiting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAgBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,OAAO,iBAAiB;IACnB,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,KAAK,GAAG,kBAAkB,GAAG,CAAC,SAAS,CAAC,YAAY,CAAA;IAC3D,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../../src/resources/transfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAgBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,OAAO,iBAAiB;IACnB,KAAK,CAAY;IACjB,KAAK,CAAQ;IAEtB,YAAY,IAAgB,EAAE,SAAiB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAA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,CAAC,UAAU,CAAC,YAAY,EAC5C,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,UAAkB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAe,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,SAAS,CACP,UAAkB,EAClB,KAAK,GAA0B,EAAE;QAEjC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,MAAM,EACN,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,EAC5C,EAAE,IAAI,EAAE,KAAK,EAAE,CAChB,CAAA;IACH,CAAC;CACF"}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version, sent in the `user-agent` header. */
|
|
2
|
-
export declare const SDK_VERSION = "0.
|
|
2
|
+
export declare const SDK_VERSION = "0.22.0";
|
|
3
3
|
/** Default API base URL. */
|
|
4
4
|
export declare const DEFAULT_BASE_URL = "https://policy-engine-rest.ezig.workers.dev";
|
|
5
5
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/esm/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** SDK version, sent in the `user-agent` header. */
|
|
2
|
-
export const SDK_VERSION = '0.
|
|
2
|
+
export const SDK_VERSION = '0.22.0';
|
|
3
3
|
/** Default API base URL. */
|
|
4
4
|
export const DEFAULT_BASE_URL = 'https://policy-engine-rest.ezig.workers.dev';
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/docs/concepts.md
CHANGED
|
@@ -161,6 +161,15 @@ no balance is stored on an address. A token with no ledger account simply does n
|
|
|
161
161
|
|
|
162
162
|
The ledger is append-only. A correction is a reversing entry, never an edit.
|
|
163
163
|
|
|
164
|
+
**The coin an address pays the fee in is not in the ledger.** On TRON the platform pays for a
|
|
165
|
+
transfer and an address needs nothing but the token. On Ethereum the address pays itself, in ETH —
|
|
166
|
+
and ETH is not an asset of the vault: it is not in `balances[]`, a top-up of it does not arrive as
|
|
167
|
+
a deposit, and it cannot be sent. `addresses.gas()` reads it from the network when asked
|
|
168
|
+
(`payer: 'address'`, `balance`, and with a recipient, token and amount — `estimate.enough`). An
|
|
169
|
+
address full of USDT and empty of ETH cannot send: 400 `INSUFFICIENT_GAS`. A token is also one
|
|
170
|
+
network's: USDT on Ethereum is `usdt_eth`, a token of its own, and a policy or limit written for
|
|
171
|
+
`usdt` does not cover it.
|
|
172
|
+
|
|
164
173
|
## 5. Shared access: roles out, flags in
|
|
165
174
|
|
|
166
175
|
An address or a folder can be shared. Outwards the right is a **role**, inwards it is flags:
|
package/docs/errors.md
CHANGED
|
@@ -119,6 +119,10 @@ the authentication middleware with `UNAUTHENTICATED`.
|
|
|
119
119
|
| `VAULT_HAS_NO_WALLET_SERVICE` | 500 | The vault has no `walletServiceUrl` configured. | Configuration fault, not a user error. Transfers from this vault cannot work at all. Contact an administrator. |
|
|
120
120
|
| `ONCHAIN_BALANCE_UNAVAILABLE` | 409 | For a token whose balance is checked on the network before sending (A7A5): the network did not answer, so the transfer was not sent. A definite refusal — the transfer is `failed`, the reserve is returned. 409 and not 5xx on purpose: nothing is uncertain. | Retry with a **new** idempotency key a little later. |
|
|
121
121
|
| `SIGNER_PATH_UNSUPPORTED` | 409 | The sending address has a derivation path the signing service cannot use — deeper than 10 levels, or outside `m/44/195/…` and `m/44/60/…`. Checked before energy is bought; the transfer is `failed`, the reserve is returned. For an approved transfer it comes as `applyError` on the vote. | Do not retry: the address cannot send until an administrator changes the signing service. Receiving on it still works. |
|
|
122
|
+
| `INSUFFICIENT_GAS` | 400 | Ethereum, where the sending address pays the network fee itself, in the network's coin (ETH): the address does not hold enough of it, however much of the token is there. `message` says how much is missing and the fee ceiling. A definite refusal — nothing was sent, the transfer is `failed`, the reserve is returned. For an approved transfer the vote answers `failed` with this text in `executionError.message`. | Ask to top up the address with the coin, then send again with a **new** idempotency key. `addresses.gas()` shows the coin balance, and whether it covers a given transfer, before anything is sent. |
|
|
123
|
+
| `ADDRESS_BUSY` | 409 | Ethereum: transactions of one address go out strictly one at a time, and an earlier transfer from this address is at the signing service, has an unknown outcome, or its transaction is not in a block yet. A definite refusal — nothing was sent, the transfer is `failed`, the reserve is returned. An approved transfer does not wait either: the vote answers `failed`, the reason in `executionError.message`. | Retry with a **new** idempotency key once the earlier transfer is settled — usually within a minute; one with an unknown outcome waits for an administrator's reconciliation. An approved transfer has to be created anew. |
|
|
124
|
+
| `ONCHAIN_STATE_UNAVAILABLE` | 409 | Ethereum: the network node did not answer when the state of the sending address was read, so the transfer was not sent — `failed`, the reserve is returned. 409 and not 5xx on purpose: nothing is uncertain. The same code answers a reconciliation that could not read the chain and `registries.createToken()` that could not read the contract — nothing changed in either; `addresses.gas()` answers it with 502. | Retry a little later; a transfer — with a **new** idempotency key. |
|
|
125
|
+
| `NETWORK_NOT_READY` | 409 | The network of the sending address is not set up for sending: no `chainId` in the registry, no node to read the chain from, or the token is recorded without a contract. The transfer is `failed`, the reserve is returned. Also from `addresses.create()`, `addresses.gas()` and `registries.createToken()` — see [Addresses](#addresses) and [Network and token registries](#network-and-token-registries). | Not a retry: a configuration gap an administrator has to close. |
|
|
122
126
|
| `GAS_STATION_FAILED` | 502 | Energy/bandwidth provisioning failed. The transfer is marked `failed` and the reserve is already returned. | Retry with a **new** idempotency key (the old one is bound to the failed row). If it persists, an upstream service is down. |
|
|
123
127
|
| `WALLET_SERVICE_ERROR` | 400 | The signing service refused the request. A definite refusal: nothing reached the network, the transfer is `failed` and the reserve is returned. It answered 4xx — or, with the unified signing service, said itself that the transaction never reached the network: the node rejected it before its pool, or a step before sending failed (reading the balance, building, signing). Every other failure of the signing service is `TRANSFER_OUTCOME_UNKNOWN`, not this. | A retry of the same request will usually fail identically. `message` starts with the service's status (`Wallet Service returned 400`). With the unified signing service it continues with the service's own reason — `: Insufficient TRC20 balance`, `: Failed to broadcast transaction — CONTRACT_VALIDATE_ERROR: …` — at most 300 characters; show it as the reason. With the older service the status is all there is: its body is not echoed, it goes to the worker log. A new attempt needs a new key. |
|
|
124
128
|
| `TRANSFER_OUTCOME_UNKNOWN` | 502 | The signing service gave no definite answer — none within 60 s, a broken connection, a 5xx or 524 that does not say the transaction never reached the network, a 409 (the transfer's key is already in use at the service), or a 2xx without a transaction id — so the transaction may or may not have reached the network. The transfer stays `pending` with the funds reserved; `details` is `{transactionId, status: "pending"}`. An administrator's reconciliation settles it. | **Neither a refusal nor a success.** Show that the outcome is being established. **Never retry with a new key** — that can send the money twice. A retry with the same key answers 200 (`replayed`) with the transfer as it stands and does not execute it again. Follow the transfer by `details.transactionId`. |
|
|
@@ -144,17 +148,22 @@ the authentication middleware with `UNAUTHENTICATED`.
|
|
|
144
148
|
|
|
145
149
|
A `pending` transfer is decided by the hash: with `txHash` it is driven to `confirmed`; without one the reserve is returned (`failed`) — that is the reconciler's statement that nothing was broadcast, not something the server checks. So for a `pending` transfer with no hash, look on the chain from the sending address first: returning the reserve of a transaction that did go out creates money. A `pending` transfer that already has a hash saved from the signing service is settled only by that hash, sent explicitly. The other two cases never executed: they take no hash, and the reserve is returned.
|
|
146
150
|
|
|
151
|
+
On Ethereum the server does check the chain, for a `pending` transfer that reached the signing service. Without `txHash` the reserve is returned only if the network shows that no transaction has left the address since then — none in a block, none in the node's queue; otherwise 409 `BROADCAST_DETECTED`. With `txHash` the transaction has to be from the transfer's address, not older than the transfer, and already in a block. A transaction the contract reverted settles the transfer as `failed` **with** that `txHash`, the reserve returned: the answer's `status` is `failed`, not `confirmed`, so read it. One gap is left without a hash: a transaction that is in no block and not in the node's queue can still be delivered by someone else, until the address's next transaction takes its number. So prefer waiting for the hash to reconciling without one.
|
|
152
|
+
|
|
147
153
|
| Code | Status | When | What to do |
|
|
148
154
|
|---|---|---|---|
|
|
149
155
|
| `TRANSFER_STILL_EXECUTING` | 409 | The transfer changed less than 10 minutes ago (`updatedAt`). An unknown outcome counts as a change: the clock starts when execution stopped waiting for the signing service. | **This is "wait", not "no".** Execution may still be in flight; intervening now risks a second broadcast. Back off and offer the action again after the window. See [Easily confused](#easily-confused). |
|
|
150
156
|
| `TRANSFER_NOT_STUCK` | 409 | Nothing to reconcile: the transfer is in none of the states above (an `awaiting_approval` one still has a live request, a closed one holds no reserve), or another path changed it while you were reconciling. | Re-read it. It resolved itself, or it is closed by a vote or a cancel; nothing to do here. |
|
|
151
157
|
| `RESERVE_ALREADY_CONSUMED` | 409 | Without `txHash`: a `confirm` posting has already spent the reserve — the transaction went to the network. With `txHash`: the reserve was returned in parallel, for instance by a reconciliation without a hash. | Without a hash: **never retry as a release.** The money left. Finish the transfer by supplying its `txHash` instead. With a hash: re-read the transfer. |
|
|
152
158
|
| `TRANSFER_BROADCAST` | 409 | No `txHash` sent, but the `pending` transfer has a hash saved from the signing service — it went to the network. `details.txHash` is that hash. Nothing moved. | Reconcile again with that `txHash`. Never as a release. |
|
|
153
|
-
| `TXHASH_MISMATCH` | 409 | The `txHash` differs from the hash saved on the transfer, which is in `details.txHash`. Nothing moved. | Check the hash. The saved one came from the signing service. |
|
|
159
|
+
| `TXHASH_MISMATCH` | 409 | The `txHash` differs from the hash saved on the transfer, which is in `details.txHash`. On Ethereum also: the transaction was sent from another address, or from this one before the transfer — it belongs to another transfer; no `details`. Nothing moved. | Check the hash. The saved one came from the signing service. |
|
|
154
160
|
| `TXHASH_IN_USE` | 409 | The `txHash` is already recorded on another transfer. Nothing moved. | Almost certainly the wrong hash. Check it. |
|
|
155
161
|
| `TRANSFER_NOT_EXECUTED` | 409 | `txHash` sent for a transfer that never executed — `awaiting_approval`, or closed with its reserve still held. | Reconcile without `txHash`; the reserve is returned. |
|
|
156
162
|
| `RESERVE_MISSING` | 409 | `txHash` sent for a transfer whose funds were never reserved, so it cannot have executed. | Reconcile without `txHash`; it closes as `failed` with no money moved. |
|
|
157
163
|
| `RESERVE_RELEASED` | 409 | `txHash` sent, but the reserve had already been returned: on a `pending` transfer the returned funds are already spent and the send cannot be charged to them; a closed transfer is not confirmed by reconciliation at all. Nothing moved. | An administrator has to post a correcting entry. Escalate. |
|
|
164
|
+
| `INVALID_TXHASH` | 400 | Ethereum: `txHash` is not a transaction hash — `0x` and 64 hex digits (the `0x` may be omitted, the case does not matter). Nothing moved. | Fix the hash. |
|
|
165
|
+
| `TX_NOT_INCLUDED` | 409 | Ethereum: the network does not know the transaction, or it is not in a block yet. Nothing moved. | Check the hash; if it is right, wait for the block and reconcile again. |
|
|
166
|
+
| `BROADCAST_DETECTED` | 409 | Ethereum, no `txHash` sent: since the transfer went to the signing service a transaction from its address got into a block, or one is in the node's queue — the transfer's own. The reserve is not returned; `details.address` is the sending address. Nothing moved. | Find the transaction of that address in a block explorer and reconcile with its `txHash`; one still in the queue — after it gets into a block. Never as a release. |
|
|
158
167
|
|
|
159
168
|
### Transfer drafts
|
|
160
169
|
|
|
@@ -227,7 +236,8 @@ Two sets of uppercase strings travel inside **successful** bodies and will misle
|
|
|
227
236
|
|---|---|---|---|
|
|
228
237
|
| `CONCURRENCY_CONFLICT` | 409 | A unique derivation index could not be allocated after 3 attempts — too many simultaneous creations. | **Retry.** This is the one conflict here where a plain retry is the correct answer. |
|
|
229
238
|
| `NETWORK_NOT_IN_VAULT` | 400 | The network is not connected to this vault. | Offer only the vault's own networks. Terminal otherwise. |
|
|
230
|
-
| `NETWORK_NOT_MONITORED` | 400 | The network has no deposit monitoring
|
|
239
|
+
| `NETWORK_NOT_MONITORED` | 400 | The network has no deposit monitoring, so no address is created on it: TRON has it; an EVM network (Ethereum) has it once the API is connected to that network's monitoring. Checked before the signing service and before any approval request; `details.network` names it. (Until 2026-11-22 such an address was created and registered with TRON's monitoring, which never watched it.) | Offer only monitored networks for new addresses. Terminal otherwise. |
|
|
240
|
+
| `NETWORK_NOT_READY` | 409 | An EVM network in a vault whose signing service cannot derive EVM addresses. Checked before the policy and before any approval request; nothing was created. `details.network` names it. | Not a retry: an administrator has to move the vault to a signing service that supports the network. |
|
|
231
241
|
| `IDEMPOTENCY_KEY_REUSED` | 409 | The `idempotencyKey` was already used for an attempt with another body. | Not a replay. A new address needs a new key; a retry of the same one needs the old key with the same body. |
|
|
232
242
|
| `IDEMPOTENCY_KEY_IN_PROGRESS` | 409 | The attempt with this key went for approval, the request was approved, and the address is being created right now. | Wait and retry with the same key and body: it then answers 200 (`replayed`) with the address. |
|
|
233
243
|
| `IDEMPOTENCY_KEY_CLOSED` | 409 | The attempt with this key went for approval and the request closed without an address — rejected, cancelled, or it failed to apply. `details` has `{approvalRequestId, requestStatus}`. | The outcome is settled. A new attempt needs a new key. |
|
|
@@ -260,6 +270,33 @@ Creating an address **into a folder** (`groupId`) can succeed without the folder
|
|
|
260
270
|
|
|
261
271
|
The same three arrive in `applyWarnings` of a **200** vote that applied an approved `create_address`: there the folder is checked when the request is applied, not when it was filed, and the request's history gets a `folder_skipped` event. Nothing is thrown in either case, so read the field. The address is fine; do not show it inside the folder.
|
|
262
272
|
|
|
273
|
+
### Gas of an address
|
|
274
|
+
|
|
275
|
+
`addresses.gas()` — `GET /addresses/{id}/gas`. Reads the network at the moment of the call; nothing is changed. `estimate: null` in a 200 is not an error: the fee could not be computed (the node did not answer, or the address does not hold the token amount itself).
|
|
276
|
+
|
|
277
|
+
| Code | Status | When | What to do |
|
|
278
|
+
|---|---|---|---|
|
|
279
|
+
| `GAS_QUERY_INCOMPLETE` | 400 | `to`, `asset` and `amount` were not passed all together. | A client bug: pass the three, or none for the balance alone. |
|
|
280
|
+
| `NETWORK_NOT_READY` | 409 | The address's network is not set up for reading the chain — no `chainId`, or no node. | Configuration gap; hide the gas line until an administrator closes it. |
|
|
281
|
+
| `ONCHAIN_STATE_UNAVAILABLE` | 502 | The network node did not answer. | Retry. Do not show a zero balance in the meantime. |
|
|
282
|
+
|
|
283
|
+
With the three parameters the transfer is checked as a send would check it, with the same codes: `TOKEN_NOT_FOUND`, `TOKEN_NETWORK_MISMATCH`, `INVALID_DESTINATION_ADDRESS`, `INVALID_AMOUNT` (all 400). An address you cannot view is 404.
|
|
284
|
+
|
|
285
|
+
## Network and token registries
|
|
286
|
+
|
|
287
|
+
`registries.createNetwork()`, `registries.updateNetwork()`, `registries.createToken()` — administrators only. The network checks have no code of their own (400 `BAD_REQUEST` with the reason in `message`): an EVM network without `chainId`, `chainId` or `nativeSymbol` on a network that is not EVM, a `chainId` already taken; changing `chainId` of a network that has addresses is a 409.
|
|
288
|
+
|
|
289
|
+
A token of an EVM network:
|
|
290
|
+
|
|
291
|
+
| Code | Status | When | What to do |
|
|
292
|
+
|---|---|---|---|
|
|
293
|
+
| `EVM_NATIVE_NOT_SUPPORTED` | 400 | `isNative: true` on an EVM network. The network's coin (ETH) is what addresses pay the fee in; it is not an asset of the vault, has no balance in the ledger and is not sent or credited. | Do not register it. Its balance on an address is `addresses.gas()`. |
|
|
294
|
+
| `TOKEN_DECIMALS_UNSUPPORTED` | 400 | `decimals` above 9: the ledger keeps amounts in 64-bit integers, and such a token would overflow it. | The token cannot be supported. Terminal. |
|
|
295
|
+
| `INVALID_CONTRACT_ADDRESS` | 400 | `contractAddress` is not an EVM address (`0x` + 40 hex, the EIP-55 checksum when mixed-case), or there is no token contract at it on this network — it does not answer `decimals()`. | Fix the address; check the network. |
|
|
296
|
+
| `TOKEN_DECIMALS_MISMATCH` | 400 | `decimals` differs from what the contract itself reports; `message` has both numbers. Refused because the signing service converts amounts by the contract and the ledger by the registry — a difference would send 10^k times what was booked, and `decimals` cannot be edited afterwards. | Send the contract's number. |
|
|
297
|
+
| `NETWORK_NOT_READY` | 409 | The network has no `chainId` or no node to read from, so `decimals` cannot be checked against the contract. The token was not created. | Finish the network's configuration first. |
|
|
298
|
+
| `ONCHAIN_STATE_UNAVAILABLE` | 409 | The node did not answer; `decimals` was not checked and the token was not created. | Retry. |
|
|
299
|
+
|
|
263
300
|
## Grants and sharing
|
|
264
301
|
|
|
265
302
|
Address shares, folder shares, member-visibility grants. All grant `POST`s are idempotent: repeating a pair changes the rights, and a revoked grant is reactivated. There is no `GRANT_EXISTS` anywhere.
|
|
@@ -594,7 +631,7 @@ One more is named because the API documents it: `VALIDATION_ERROR`, the library'
|
|
|
594
631
|
|
|
595
632
|
A changing request (`POST`, `PUT`, `PATCH`, `DELETE`) to `/api/v1/*` from a page of a site the API does not trust is refused before anything else with 403 `CROSS_SITE_REQUEST_REFUSED` — an `Origin` outside the trusted list (`Origin: null` included), or no `Origin` with `Sec-Fetch-Site: cross-site`. The session cookie is `SameSite=None`, so without this a foreign page could act with it. Native clients and servers send no `Origin` and are not affected; a web client gets it only when served from an origin the API was not told about — a configuration fix, not a retry.
|
|
596
633
|
|
|
597
|
-
`/webhooks/wallet` is the signing service's inbound channel, not a client endpoint; its 401 `WEBHOOK_UNAUTHORIZED` (a signature missing or wrong while the secret is configured) is for that service.
|
|
634
|
+
`/webhooks/wallet` is the signing service's inbound channel, not a client endpoint; its 401 `WEBHOOK_UNAUTHORIZED` (a signature missing or wrong while the secret is configured) is for that service. `/webhooks/monitoring` is the same for the deposit monitoring of EVM networks: 401 `WEBHOOK_UNAUTHORIZED` on a missing or wrong signature, and 503 `WEBHOOK_NOT_CONFIGURED` while the API has no secret for it — no event is accepted unsigned.
|
|
598
635
|
|
|
599
636
|
Three refusals the API puts **in front of** the library are its own: they arrive in the API's envelope, and their codes can be branched on.
|
|
600
637
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v3finance/core-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "The official TypeScript SDK for the V3 Finance Core API — custodial addresses, transfers under policy control, approvals, shared access, labelling and reports",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|