@certen.io/sdk 0.8.2 → 0.10.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 +103 -0
- package/README.md +81 -0
- package/dist/agent.d.ts +8 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +12 -0
- package/dist/agent.js.map +1 -1
- package/dist/browser.d.ts +34 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +43 -0
- package/dist/browser.js.map +1 -0
- package/dist/bytes.d.ts +14 -0
- package/dist/bytes.d.ts.map +1 -0
- package/dist/bytes.js +47 -0
- package/dist/bytes.js.map +1 -0
- package/dist/chains.d.ts +198 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/chains.js +261 -0
- package/dist/chains.js.map +1 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -6
- package/dist/client.js.map +1 -1
- package/dist/defaults.d.ts +3 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +3 -0
- package/dist/defaults.js.map +1 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +36 -23
- package/dist/doctor.js.map +1 -1
- package/dist/error-codes.d.ts.map +1 -1
- package/dist/error-codes.js +17 -0
- package/dist/error-codes.js.map +1 -1
- package/dist/errors.d.ts +76 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +108 -0
- package/dist/errors.js.map +1 -1
- package/dist/execution-proof.d.ts +111 -0
- package/dist/execution-proof.d.ts.map +1 -0
- package/dist/execution-proof.js +311 -0
- package/dist/execution-proof.js.map +1 -0
- package/dist/funding.d.ts +43 -6
- package/dist/funding.d.ts.map +1 -1
- package/dist/funding.js +69 -29
- package/dist/funding.js.map +1 -1
- package/dist/header-fields.d.ts +68 -0
- package/dist/header-fields.d.ts.map +1 -0
- package/dist/header-fields.js +147 -0
- package/dist/header-fields.js.map +1 -0
- package/dist/index.d.ts +9 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -23
- package/dist/index.js.map +1 -1
- package/dist/intent-states.d.ts +75 -0
- package/dist/intent-states.d.ts.map +1 -0
- package/dist/intent-states.js +66 -0
- package/dist/intent-states.js.map +1 -0
- package/dist/internal.d.ts +18 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +44 -0
- package/dist/internal.js.map +1 -1
- package/dist/origin.d.ts +19 -0
- package/dist/origin.d.ts.map +1 -0
- package/dist/origin.js +80 -0
- package/dist/origin.js.map +1 -0
- package/dist/random.d.ts +27 -0
- package/dist/random.d.ts.map +1 -0
- package/dist/random.js +30 -0
- package/dist/random.js.map +1 -0
- package/dist/reason-codes.d.ts +15 -0
- package/dist/reason-codes.d.ts.map +1 -0
- package/dist/reason-codes.js +30 -0
- package/dist/reason-codes.js.map +1 -0
- package/dist/resources/admin.d.ts +5 -2
- package/dist/resources/admin.d.ts.map +1 -1
- package/dist/resources/admin.js +8 -3
- package/dist/resources/admin.js.map +1 -1
- package/dist/resources/billing.d.ts.map +1 -1
- package/dist/resources/billing.js +5 -4
- package/dist/resources/billing.js.map +1 -1
- package/dist/resources/chains.d.ts +10 -0
- package/dist/resources/chains.d.ts.map +1 -1
- package/dist/resources/chains.js +15 -1
- package/dist/resources/chains.js.map +1 -1
- package/dist/resources/device.d.ts.map +1 -1
- package/dist/resources/device.js +2 -1
- package/dist/resources/device.js.map +1 -1
- package/dist/resources/execute.d.ts +49 -4
- package/dist/resources/execute.d.ts.map +1 -1
- package/dist/resources/execute.js +108 -29
- package/dist/resources/execute.js.map +1 -1
- package/dist/resources/governance.js +3 -3
- package/dist/resources/governance.js.map +1 -1
- package/dist/resources/identity.js +5 -5
- package/dist/resources/identity.js.map +1 -1
- package/dist/resources/oauth-clients.d.ts.map +1 -1
- package/dist/resources/oauth-clients.js +3 -2
- package/dist/resources/oauth-clients.js.map +1 -1
- package/dist/resources/proof.d.ts +10 -2
- package/dist/resources/proof.d.ts.map +1 -1
- package/dist/resources/proof.js +33 -11
- package/dist/resources/proof.js.map +1 -1
- package/dist/resources/registration-tokens.d.ts.map +1 -1
- package/dist/resources/registration-tokens.js +2 -1
- package/dist/resources/registration-tokens.js.map +1 -1
- package/dist/resources/sign.js +2 -2
- package/dist/resources/sign.js.map +1 -1
- package/dist/resources/transaction.d.ts.map +1 -1
- package/dist/resources/transaction.js +7 -3
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transparency.d.ts.map +1 -1
- package/dist/resources/transparency.js +3 -2
- package/dist/resources/transparency.js.map +1 -1
- package/dist/resources/webhooks.d.ts +5 -3
- package/dist/resources/webhooks.d.ts.map +1 -1
- package/dist/resources/webhooks.js +12 -8
- package/dist/resources/webhooks.js.map +1 -1
- package/dist/sha256.d.ts +10 -0
- package/dist/sha256.d.ts.map +1 -0
- package/dist/sha256.js +71 -0
- package/dist/sha256.js.map +1 -0
- package/dist/share-target.d.ts +10 -0
- package/dist/share-target.d.ts.map +1 -0
- package/dist/share-target.js +25 -0
- package/dist/share-target.js.map +1 -0
- package/dist/shared-proof.d.ts +7 -5
- package/dist/shared-proof.d.ts.map +1 -1
- package/dist/shared-proof.js +36 -17
- package/dist/shared-proof.js.map +1 -1
- package/dist/signing-check.d.ts +66 -0
- package/dist/signing-check.d.ts.map +1 -0
- package/dist/signing-check.js +171 -0
- package/dist/signing-check.js.map +1 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/verify-receipt.d.ts.map +1 -1
- package/dist/verify-receipt.js +68 -28
- package/dist/verify-receipt.js.map +1 -1
- package/dist/verify.d.ts +82 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +180 -0
- package/dist/verify.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/package.json +25 -7
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where an intent can be, and what each place means.
|
|
3
|
+
*
|
|
4
|
+
* ONE table, used by `execute.wait()`, the CLI and the MCP server, so they cannot disagree about which statuses end a wait. Before
|
|
5
|
+
* this there were three copies of `['completed', 'delivered', 'proven']`, and none of them knew the two states the execution
|
|
6
|
+
* outcome model added:
|
|
7
|
+
*
|
|
8
|
+
* - `executed`: the action EXECUTED on its chain and its proof bundle is pending. Not a failure, and not terminal: CERTEN produces
|
|
9
|
+
* the bundle automatically and the intent then reads `completed`. The fee is held meanwhile.
|
|
10
|
+
* - `completed_unproven`: the action executed and its proof can NEVER be produced (declared by an operator with the evidence).
|
|
11
|
+
* Terminal. Billed gas only, fee waived. It is never "completed": nothing can be verified for it.
|
|
12
|
+
*
|
|
13
|
+
* `expired` is terminal too, and a failure: the intent will never execute. `wait()` used to poll through it to its timeout.
|
|
14
|
+
*
|
|
15
|
+
* The statuses are the gateway's own (`chk_intent_status`, api-gateway migration 053) and the spec's description of the field.
|
|
16
|
+
* `delivered` and `error` are older spellings this client has always treated as terminal; they stay in the table so a gateway that
|
|
17
|
+
* still sends them is not misread. A status that is not in the table is `unknown` and is never treated as terminal.
|
|
18
|
+
*/
|
|
19
|
+
export const INTENT_STATUS_CLASS = {
|
|
20
|
+
created: 'in_flight',
|
|
21
|
+
signing_required: 'in_flight',
|
|
22
|
+
submitted: 'in_flight',
|
|
23
|
+
processing: 'in_flight',
|
|
24
|
+
anchoring: 'in_flight',
|
|
25
|
+
executed: 'executed',
|
|
26
|
+
completed: 'terminal_success',
|
|
27
|
+
proven: 'terminal_success',
|
|
28
|
+
delivered: 'terminal_success',
|
|
29
|
+
completed_unproven: 'terminal_gas_only',
|
|
30
|
+
failed: 'terminal_failure',
|
|
31
|
+
expired: 'terminal_failure',
|
|
32
|
+
error: 'terminal_failure',
|
|
33
|
+
};
|
|
34
|
+
/** The reason the gateway gives a `completed_unproven` intent: the proof can never be produced. */
|
|
35
|
+
export const EXECUTION_PROOF_UNAVAILABLE = 'execution_proof_unavailable';
|
|
36
|
+
export function classifyIntentStatus(status) {
|
|
37
|
+
return typeof status === 'string' && Object.prototype.hasOwnProperty.call(INTENT_STATUS_CLASS, status)
|
|
38
|
+
? INTENT_STATUS_CLASS[status]
|
|
39
|
+
: 'unknown';
|
|
40
|
+
}
|
|
41
|
+
/** Does this status end a wait (success, gas-only, or failure)? `executed` and `unknown` do not. */
|
|
42
|
+
export function isTerminalIntentStatus(status) {
|
|
43
|
+
const c = classifyIntentStatus(status);
|
|
44
|
+
return c === 'terminal_success' || c === 'terminal_gas_only' || c === 'terminal_failure';
|
|
45
|
+
}
|
|
46
|
+
/** Read the named outcome off a transaction response. Never invents a state: an unrecognised status is `unknown`. */
|
|
47
|
+
export function intentOutcome(tx) {
|
|
48
|
+
const status = typeof tx?.status === 'string' ? tx.status : '';
|
|
49
|
+
const cls = classifyIntentStatus(status);
|
|
50
|
+
const reasonCode = typeof tx?.reason_code === 'string' && tx.reason_code ? tx.reason_code : null;
|
|
51
|
+
switch (cls) {
|
|
52
|
+
case 'terminal_success':
|
|
53
|
+
return { status, class: cls, terminal: true, outcome: 'completed', reason: null };
|
|
54
|
+
case 'terminal_gas_only':
|
|
55
|
+
return { status, class: cls, terminal: true, outcome: 'completed_unproven', reason: reasonCode ?? EXECUTION_PROOF_UNAVAILABLE };
|
|
56
|
+
case 'executed':
|
|
57
|
+
return { status, class: cls, terminal: false, outcome: 'executed', reason: null };
|
|
58
|
+
case 'terminal_failure':
|
|
59
|
+
return { status, class: cls, terminal: true, outcome: 'failed', reason: reasonCode };
|
|
60
|
+
case 'in_flight':
|
|
61
|
+
return { status, class: cls, terminal: false, outcome: 'pending', reason: null };
|
|
62
|
+
default:
|
|
63
|
+
return { status, class: cls, terminal: false, outcome: 'unknown', reason: null };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=intent-states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-states.js","sourceRoot":"","sources":["../src/intent-states.ts"],"names":[],"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AAE,EAAE,WAAW,KAAK,QAAQ,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IACjG,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,kBAAkB;YACrB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACpF,KAAK,mBAAmB;YACtB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,IAAI,2BAA2B,EAAE,CAAC;QAClI,KAAK,UAAU;YACb,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACpF,KAAK,kBAAkB;YACrB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACvF,KAAK,WAAW;YACd,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACnF;YACE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrF,CAAC;AACH,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -7,4 +7,22 @@
|
|
|
7
7
|
* Building bodies through this keeps the wire payload exactly the set of fields the caller actually set.
|
|
8
8
|
*/
|
|
9
9
|
export declare function omitUndefined<T extends Record<string, unknown>>(o: T): Partial<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Build a request path from a template, encoding every interpolated value as exactly ONE path segment.
|
|
12
|
+
*
|
|
13
|
+
* apiPath`/v1/proof/${proofId}/bundle`
|
|
14
|
+
*
|
|
15
|
+
* Every id, hash and token reaching a url goes through here. Interpolating one raw let it change which route a call reached:
|
|
16
|
+
* an id containing `/` or `?` added segments or a query, and an id of `..` or `.` is resolved away by any proxy or server that
|
|
17
|
+
* normalises paths (`/v1/proof/../admin` is not `/v1/proof/<id>`). So:
|
|
18
|
+
*
|
|
19
|
+
* - `/`, `?`, `#`, `%`, spaces and every other reserved character are percent-encoded (`encodeURIComponent`);
|
|
20
|
+
* - a value that is only dots (`.`, `..`) is REFUSED, not encoded: `encodeURIComponent` leaves it alone, and even as `%2E%2E` the url
|
|
21
|
+
* parser treats it as `..` (measured: a request for `/v1/transaction/%2E%2E` arrived as `/v1/`). No genuine id is made of dots;
|
|
22
|
+
* - an empty, null or undefined value is REFUSED (`INVALID_PATH_PARAMETER`) rather than dropped: `identity.get('')` would otherwise
|
|
23
|
+
* request `/v1/identity/`, a different route, and answer with a list where a record was asked for.
|
|
24
|
+
*
|
|
25
|
+
* Only the interpolated values are encoded; the literal parts of the template are the route.
|
|
26
|
+
*/
|
|
27
|
+
export declare function apiPath(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
10
28
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAIjF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAMnF"}
|
package/dist/internal.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CertenError } from './errors.js';
|
|
1
2
|
/**
|
|
2
3
|
* Strip keys whose value is `undefined` before sending a body.
|
|
3
4
|
*
|
|
@@ -13,4 +14,47 @@ export function omitUndefined(o) {
|
|
|
13
14
|
out[k] = v;
|
|
14
15
|
return out;
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Build a request path from a template, encoding every interpolated value as exactly ONE path segment.
|
|
19
|
+
*
|
|
20
|
+
* apiPath`/v1/proof/${proofId}/bundle`
|
|
21
|
+
*
|
|
22
|
+
* Every id, hash and token reaching a url goes through here. Interpolating one raw let it change which route a call reached:
|
|
23
|
+
* an id containing `/` or `?` added segments or a query, and an id of `..` or `.` is resolved away by any proxy or server that
|
|
24
|
+
* normalises paths (`/v1/proof/../admin` is not `/v1/proof/<id>`). So:
|
|
25
|
+
*
|
|
26
|
+
* - `/`, `?`, `#`, `%`, spaces and every other reserved character are percent-encoded (`encodeURIComponent`);
|
|
27
|
+
* - a value that is only dots (`.`, `..`) is REFUSED, not encoded: `encodeURIComponent` leaves it alone, and even as `%2E%2E` the url
|
|
28
|
+
* parser treats it as `..` (measured: a request for `/v1/transaction/%2E%2E` arrived as `/v1/`). No genuine id is made of dots;
|
|
29
|
+
* - an empty, null or undefined value is REFUSED (`INVALID_PATH_PARAMETER`) rather than dropped: `identity.get('')` would otherwise
|
|
30
|
+
* request `/v1/identity/`, a different route, and answer with a list where a record was asked for.
|
|
31
|
+
*
|
|
32
|
+
* Only the interpolated values are encoded; the literal parts of the template are the route.
|
|
33
|
+
*/
|
|
34
|
+
export function apiPath(strings, ...values) {
|
|
35
|
+
let out = strings[0];
|
|
36
|
+
values.forEach((v, i) => {
|
|
37
|
+
out += segment(v, i + 1, strings) + strings[i + 1];
|
|
38
|
+
});
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
function segment(v, position, strings) {
|
|
42
|
+
const where = `${strings[position - 1].split('/').filter(Boolean).pop() ?? 'path'} parameter`;
|
|
43
|
+
if (typeof v !== 'string' && typeof v !== 'number' && typeof v !== 'bigint') {
|
|
44
|
+
throw new CertenError(`certen: ${where} must be a string or number, got ${v === null ? 'null' : typeof v}`, 0, 'INVALID_PATH_PARAMETER');
|
|
45
|
+
}
|
|
46
|
+
const s = String(v);
|
|
47
|
+
if (s === '')
|
|
48
|
+
throw new CertenError(`certen: ${where} is empty`, 0, 'INVALID_PATH_PARAMETER');
|
|
49
|
+
let enc;
|
|
50
|
+
try {
|
|
51
|
+
enc = encodeURIComponent(s);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
throw new CertenError(`certen: ${where} is not valid text (a lone surrogate cannot be encoded)`, 0, 'INVALID_PATH_PARAMETER');
|
|
55
|
+
}
|
|
56
|
+
if (/^\.+$/.test(s))
|
|
57
|
+
throw new CertenError(`certen: ${where} cannot be "${s}": a path segment of dots would be resolved away by the url parser`, 0, 'INVALID_PATH_PARAMETER');
|
|
58
|
+
return enc;
|
|
59
|
+
}
|
|
16
60
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAoC,CAAI;IACnE,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,IAAI,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxE,OAAO,GAAiB,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K,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAC3I,CAAC;IACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,KAAK,EAAE;QAAE,MAAM,IAAI,WAAW,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAC9F,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,WAAW,CAAC,WAAW,KAAK,yDAAyD,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAChI,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,WAAW,CAAC,WAAW,KAAK,eAAe,CAAC,oEAAoE,EAAE,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAC9K,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/origin.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface OriginCheck {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
resolved?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Would a request for `url` stay on `baseURL`'s origin, with no credentials smuggled in the url? */
|
|
7
|
+
export declare function checkOwnOrigin(url: string | undefined, baseURL: string | undefined): OriginCheck;
|
|
8
|
+
/**
|
|
9
|
+
* Throw `CertenForeignOriginError` unless `url` stays on the client's own origin.
|
|
10
|
+
* `what` names where the url came from (`submit_url`, `request`, `redirect`), so the message says what to distrust.
|
|
11
|
+
*/
|
|
12
|
+
export declare function assertOwnOrigin(url: string | undefined, baseURL: string | undefined, what: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Is a redirect from `from` to `to` safe for a request carrying credentials?
|
|
15
|
+
* Same origin, or an http -> https upgrade of the same host on the default ports (a gateway configured as `http://` that
|
|
16
|
+
* redirects to its own TLS port); never another host, and never https -> http.
|
|
17
|
+
*/
|
|
18
|
+
export declare function redirectStaysOnOrigin(from: string, to: string): boolean;
|
|
19
|
+
//# sourceMappingURL=origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,WAAW;IAAG,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AAEhF,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAkBhG;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CASxG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAQvE"}
|
package/dist/origin.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { CertenForeignOriginError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* The client only ever talks to its own gateway.
|
|
4
|
+
*
|
|
5
|
+
* The API key travels on every request the client sends, and axios sends an instance's default headers to an ABSOLUTE url on any
|
|
6
|
+
* host (axios 1.19.0 and 1.20.0 alike; reproduced against a local listener in RUNLOG_RB7b F16). Some responses name a url the client
|
|
7
|
+
* is expected to follow (`submit_url` on an intent and on a sign request). A compromised or buggy gateway, or anything able to
|
|
8
|
+
* alter a response, could therefore name `https://evil.example/x` and receive the key with the signature.
|
|
9
|
+
*
|
|
10
|
+
* So every url the client is about to request must resolve to the client's own base origin, and is refused by name before any
|
|
11
|
+
* request is sent otherwise (`FOREIGN_ORIGIN_URL`, with the url in `details`). Refusing is the only safe answer: a url that
|
|
12
|
+
* "looks right" but points elsewhere is the attack.
|
|
13
|
+
*/
|
|
14
|
+
/** How axios decides a url is absolute: a scheme, or a protocol-relative `//host`. */
|
|
15
|
+
const AXIOS_ABSOLUTE = /^([a-z][a-z\d+\-.]*:)?\/\//i;
|
|
16
|
+
/** Resolve `url` the way axios would build the request, so the check is on the url that is actually sent. */
|
|
17
|
+
function effectiveUrl(url, baseURL) {
|
|
18
|
+
const base = new URL(baseURL);
|
|
19
|
+
if (AXIOS_ABSOLUTE.test(url))
|
|
20
|
+
return new URL(url, base); // `//host/x` takes the base's scheme
|
|
21
|
+
// axios `combineURLs`: base without trailing slashes + '/' + url without leading slashes.
|
|
22
|
+
return new URL(`${baseURL.replace(/\/+$/, '')}/${url.replace(/^\/+/, '')}`);
|
|
23
|
+
}
|
|
24
|
+
/** Would a request for `url` stay on `baseURL`'s origin, with no credentials smuggled in the url? */
|
|
25
|
+
export function checkOwnOrigin(url, baseURL) {
|
|
26
|
+
if (!baseURL)
|
|
27
|
+
return { ok: true }; // a client with no base url sends absolute urls by construction; nothing to compare against
|
|
28
|
+
if (url === undefined || url === '')
|
|
29
|
+
return { ok: true };
|
|
30
|
+
let target;
|
|
31
|
+
let base;
|
|
32
|
+
try {
|
|
33
|
+
base = new URL(baseURL);
|
|
34
|
+
target = effectiveUrl(url, baseURL);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { ok: false, reason: 'is not a url this client can resolve' };
|
|
38
|
+
}
|
|
39
|
+
if (target.origin !== base.origin) {
|
|
40
|
+
return { ok: false, reason: `leaves ${base.origin} for ${target.origin}`, resolved: target.href };
|
|
41
|
+
}
|
|
42
|
+
if (target.username || target.password) {
|
|
43
|
+
return { ok: false, reason: 'carries credentials in the url', resolved: target.href };
|
|
44
|
+
}
|
|
45
|
+
return { ok: true, resolved: target.href };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Throw `CertenForeignOriginError` unless `url` stays on the client's own origin.
|
|
49
|
+
* `what` names where the url came from (`submit_url`, `request`, `redirect`), so the message says what to distrust.
|
|
50
|
+
*/
|
|
51
|
+
export function assertOwnOrigin(url, baseURL, what) {
|
|
52
|
+
const r = checkOwnOrigin(url, baseURL);
|
|
53
|
+
if (!r.ok) {
|
|
54
|
+
throw new CertenForeignOriginError(`certen: refusing to send a request to ${JSON.stringify(url)} (${what}): it ${r.reason}. `
|
|
55
|
+
+ 'The client only talks to its own gateway, so nothing was sent and no credential left this process.', String(url), baseURL ?? '', what);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Is a redirect from `from` to `to` safe for a request carrying credentials?
|
|
60
|
+
* Same origin, or an http -> https upgrade of the same host on the default ports (a gateway configured as `http://` that
|
|
61
|
+
* redirects to its own TLS port); never another host, and never https -> http.
|
|
62
|
+
*/
|
|
63
|
+
export function redirectStaysOnOrigin(from, to) {
|
|
64
|
+
let a;
|
|
65
|
+
let b;
|
|
66
|
+
try {
|
|
67
|
+
a = new URL(from);
|
|
68
|
+
b = new URL(to);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (b.username || b.password)
|
|
74
|
+
return false;
|
|
75
|
+
if (a.origin === b.origin)
|
|
76
|
+
return true;
|
|
77
|
+
return a.protocol === 'http:' && b.protocol === 'https:' && a.hostname === b.hostname
|
|
78
|
+
&& (a.port === '' || a.port === '80') && (b.port === '' || b.port === '443');
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin.js","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEv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,OAAO,CAAC,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;WAChF,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/random.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cryptographically random values from Web Crypto, which Node (>= 19) and every current browser expose as `globalThis.crypto`.
|
|
3
|
+
*
|
|
4
|
+
* The client used `randomBytes` from `node:crypto` and `randomUUID` from `crypto`, which a browser bundle cannot resolve. There is
|
|
5
|
+
* no weaker fallback here: where `crypto.getRandomValues` is absent the call throws, because an idempotency key drawn from
|
|
6
|
+
* `Math.random` would let two clients collide on the key that stops a payment being made twice.
|
|
7
|
+
*/
|
|
8
|
+
/** The few Web Crypto members this SDK uses, declared structurally because the SDK's type environment has no DOM lib. */
|
|
9
|
+
export interface WebCryptoLike {
|
|
10
|
+
getRandomValues(array: Uint8Array): Uint8Array;
|
|
11
|
+
randomUUID?: () => string;
|
|
12
|
+
subtle?: {
|
|
13
|
+
importKey(format: 'raw', key: Uint8Array, algorithm: {
|
|
14
|
+
name: string;
|
|
15
|
+
}, extractable: boolean, usages: string[]): Promise<unknown>;
|
|
16
|
+
verify(algorithm: {
|
|
17
|
+
name: string;
|
|
18
|
+
}, key: unknown, signature: Uint8Array, data: Uint8Array): Promise<boolean>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** `globalThis.crypto` when the runtime has it, otherwise undefined. */
|
|
22
|
+
export declare function maybeWebCrypto(): WebCryptoLike | undefined;
|
|
23
|
+
export declare function randomBytes(n: number): Uint8Array;
|
|
24
|
+
export declare function randomHex(n: number): string;
|
|
25
|
+
/** An RFC 4122 version 4 UUID. `crypto.randomUUID` needs a secure context in browsers; building it from random bytes does not. */
|
|
26
|
+
export declare function uuid(): string;
|
|
27
|
+
//# sourceMappingURL=random.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,yHAAyH;AACzH,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACjI,MAAM,CAAC,SAAS,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KAC9G,CAAC;CACH;AAED,wEAAwE;AACxE,wBAAgB,cAAc,IAAI,aAAa,GAAG,SAAS,CAE1D;AAUD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAEjD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,kIAAkI;AAClI,wBAAgB,IAAI,IAAI,MAAM,CAQ7B"}
|
package/dist/random.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { bytesToHex } from './bytes.js';
|
|
2
|
+
/** `globalThis.crypto` when the runtime has it, otherwise undefined. */
|
|
3
|
+
export function maybeWebCrypto() {
|
|
4
|
+
return globalThis.crypto;
|
|
5
|
+
}
|
|
6
|
+
function webCrypto() {
|
|
7
|
+
const c = maybeWebCrypto();
|
|
8
|
+
if (!c || typeof c.getRandomValues !== 'function') {
|
|
9
|
+
throw new Error('certen: this runtime has no Web Crypto (globalThis.crypto.getRandomValues), so no secure random value can be made');
|
|
10
|
+
}
|
|
11
|
+
return c;
|
|
12
|
+
}
|
|
13
|
+
export function randomBytes(n) {
|
|
14
|
+
return webCrypto().getRandomValues(new Uint8Array(n));
|
|
15
|
+
}
|
|
16
|
+
export function randomHex(n) {
|
|
17
|
+
return bytesToHex(randomBytes(n));
|
|
18
|
+
}
|
|
19
|
+
/** An RFC 4122 version 4 UUID. `crypto.randomUUID` needs a secure context in browsers; building it from random bytes does not. */
|
|
20
|
+
export function uuid() {
|
|
21
|
+
const c = webCrypto();
|
|
22
|
+
if (typeof c.randomUUID === 'function')
|
|
23
|
+
return c.randomUUID();
|
|
24
|
+
const b = randomBytes(16);
|
|
25
|
+
b[6] = (b[6] & 0x0f) | 0x40;
|
|
26
|
+
b[8] = (b[8] & 0x3f) | 0x80;
|
|
27
|
+
const h = bytesToHex(b);
|
|
28
|
+
return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../src/random.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAmBxC,wEAAwE;AACxE,MAAM,UAAU,cAAc;IAC5B,OAAQ,UAAyC,CAAC,MAAM,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS;IAChB,MAAM,CAAC,GAAG,cAAc,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAClD,MAAM,IAAI,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
|
5
|
+
* A `Record` over the union rather than a switch with a default, so adding a value to
|
|
6
|
+
* `TransactionReasonCode` without describing it is a compile error.
|
|
7
|
+
*
|
|
8
|
+
* Held, denied and expired are three different outcomes and are worded so they cannot be confused:
|
|
9
|
+
* a denial is a party saying no, an expiry is a deadline passing with signatures still missing.
|
|
10
|
+
*/
|
|
11
|
+
export declare const REASON_CODE_DESCRIPTIONS: Readonly<Record<TransactionReasonCode, string>>;
|
|
12
|
+
export declare function isTransactionReasonCode(code: unknown): code is TransactionReasonCode;
|
|
13
|
+
/** A readable line for any `reason_code`, including one this SDK release does not know. */
|
|
14
|
+
export declare function describeReasonCode(code: string | null | undefined): string | undefined;
|
|
15
|
+
//# sourceMappingURL=reason-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../src/reason-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAepF,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,qBAAqB,CAEpF;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKtF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One sentence per `reason_code`, fit to show a person.
|
|
3
|
+
*
|
|
4
|
+
* A `Record` over the union rather than a switch with a default, so adding a value to
|
|
5
|
+
* `TransactionReasonCode` without describing it is a compile error.
|
|
6
|
+
*
|
|
7
|
+
* Held, denied and expired are three different outcomes and are worded so they cannot be confused:
|
|
8
|
+
* a denial is a party saying no, an expiry is a deadline passing with signatures still missing.
|
|
9
|
+
*/
|
|
10
|
+
export const REASON_CODE_DESCRIPTIONS = {
|
|
11
|
+
target_reverted: 'The destination contract rejected the call. CERTEN completed its part; retrying the identical call reverts again.',
|
|
12
|
+
policy_denied: 'A policy refused the intent. Nothing executed.',
|
|
13
|
+
network_failed: 'The network failed the transaction. Nothing is known to have executed.',
|
|
14
|
+
post_submission_timeout: 'The transaction was submitted but no outcome was observed in time. Check the destination chain before retrying.',
|
|
15
|
+
pre_submission_error: 'The intent failed before it was submitted. Nothing executed.',
|
|
16
|
+
expired: 'The deadline (expires_at) passed before every required signature arrived. Nothing executed and no fee or gas was charged.',
|
|
17
|
+
expectation_unmet: 'The call executed but the events it committed to (expectedEvents) are missing from the destination receipt. This is not a success.',
|
|
18
|
+
};
|
|
19
|
+
export function isTransactionReasonCode(code) {
|
|
20
|
+
return typeof code === 'string' && Object.prototype.hasOwnProperty.call(REASON_CODE_DESCRIPTIONS, code);
|
|
21
|
+
}
|
|
22
|
+
/** A readable line for any `reason_code`, including one this SDK release does not know. */
|
|
23
|
+
export function describeReasonCode(code) {
|
|
24
|
+
if (!code)
|
|
25
|
+
return undefined;
|
|
26
|
+
return isTransactionReasonCode(code)
|
|
27
|
+
? REASON_CODE_DESCRIPTIONS[code]
|
|
28
|
+
: `The gateway reported reason "${code}", which this SDK version does not recognise.`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=reason-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reason-codes.js","sourceRoot":"","sources":["../src/reason-codes.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAoD;IACvF,eAAe,EACb,mHAAmH;IACrH,aAAa,EACX,gDAAgD;IAClD,cAAc,EACZ,wEAAwE;IAC1E,uBAAuB,EACrB,iHAAiH;IACnH,oBAAoB,EAClB,8DAA8D;IAChE,OAAO,EACL,2HAA2H;IAC7H,iBAAiB,EACf,oIAAoI;CACvI,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,IAAa;IACnD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;AAC1G,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,IAA+B;IAChE,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,uBAAuB,CAAC,IAAI,CAAC;QAClC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAChC,CAAC,CAAC,gCAAgC,IAAI,+CAA+C,CAAC;AAC1F,CAAC"}
|
|
@@ -38,9 +38,12 @@ export declare class AdminResource {
|
|
|
38
38
|
listApiKeys(): Promise<{
|
|
39
39
|
apiKeys: ApiKeyListItem[];
|
|
40
40
|
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Revoke an API key. The gateway answers 204 with NO body, so there is nothing to return from it; this resolves `{ success: true }`
|
|
43
|
+
* (a failure throws). It used to be typed `{ success, message }` and returned the empty body, which was an empty string.
|
|
44
|
+
*/
|
|
41
45
|
revokeApiKey(id: string): Promise<{
|
|
42
|
-
success:
|
|
43
|
-
message: string;
|
|
46
|
+
success: true;
|
|
44
47
|
}>;
|
|
45
48
|
/**
|
|
46
49
|
* Rotate an api key: the gateway provisions a fresh key with the same
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/resources/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,aAAa,EACd,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src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OAeG;IACH,WAAW,CACT,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,EAC9E,QAAQ,SAAM,GACb,qBAAqB,CAAC;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAUrF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;CASvF"}
|
package/dist/resources/admin.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { paginateWithTotal } from '../client.js';
|
|
2
|
+
import { apiPath } from '../internal.js';
|
|
2
3
|
export class AdminResource {
|
|
3
4
|
http;
|
|
4
5
|
constructor(http) {
|
|
@@ -58,9 +59,13 @@ export class AdminResource {
|
|
|
58
59
|
const { data } = await this.http.get('/v1/admin/api-keys');
|
|
59
60
|
return data;
|
|
60
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Revoke an API key. The gateway answers 204 with NO body, so there is nothing to return from it; this resolves `{ success: true }`
|
|
64
|
+
* (a failure throws). It used to be typed `{ success, message }` and returned the empty body, which was an empty string.
|
|
65
|
+
*/
|
|
61
66
|
async revokeApiKey(id) {
|
|
62
|
-
|
|
63
|
-
return
|
|
67
|
+
await this.http.delete(apiPath `/v1/admin/api-keys/${id}`);
|
|
68
|
+
return { success: true };
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
66
71
|
* Rotate an api key: the gateway provisions a fresh key with the same
|
|
@@ -68,7 +73,7 @@ export class AdminResource {
|
|
|
68
73
|
* ONCE — clients must persist it now.
|
|
69
74
|
*/
|
|
70
75
|
async rotateApiKey(id) {
|
|
71
|
-
const { data } = await this.http.post(`/v1/admin/api-keys/${id}/rotate`);
|
|
76
|
+
const { data } = await this.http.post(apiPath `/v1/admin/api-keys/${id}/rotate`);
|
|
72
77
|
return data;
|
|
73
78
|
}
|
|
74
79
|
async getAuditLog(params) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/resources/admin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/resources/admin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAajD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAE3C;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,KAAK,CAAC,SAAS,CAAC,MAAuB;QACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACrD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,UAAU;SAC/B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,YAAY,CAA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K9D;;;;;;;OAOG;IACG,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAQxF;;;;;;OAMG;IACH;;;;;OAKG;IACG,QAAQ,CAAC,MAAM,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC;IAO1G,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAU9D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;KAC3C,GACL,OAAO,CAAC,mBAAmB,CAAC;IAgC/B;;;;;OAKG;YACW,aAAa;CAc5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { paginate } from '../client.js';
|
|
2
2
|
import { verifyReceipt } from '../verify-receipt.js';
|
|
3
|
+
import { apiPath } from '../internal.js';
|
|
3
4
|
/**
|
|
4
5
|
* Balance, commitments, and adding funds.
|
|
5
6
|
*
|
|
@@ -101,7 +102,7 @@ export class BillingResource {
|
|
|
101
102
|
* `quote()` CREATES; this one READS. Requires `billing:read`.
|
|
102
103
|
*/
|
|
103
104
|
async quoteById(id) {
|
|
104
|
-
const { data } = await this.http.get(`/v1/quote/${
|
|
105
|
+
const { data } = await this.http.get(apiPath `/v1/quote/${id}`);
|
|
105
106
|
// `seconds_remaining` is computed HERE rather than left to the caller.
|
|
106
107
|
//
|
|
107
108
|
// The question anyone reads a quote back to answer is "can I still use this?", and answering it
|
|
@@ -179,7 +180,7 @@ export class BillingResource {
|
|
|
179
180
|
* receipt is in a log that was anchored on Accumulate.
|
|
180
181
|
*/
|
|
181
182
|
async receipt(id) {
|
|
182
|
-
const { data } = await this.http.get(`/v1/billing/receipts/${
|
|
183
|
+
const { data } = await this.http.get(apiPath `/v1/billing/receipts/${id}`);
|
|
183
184
|
return data;
|
|
184
185
|
}
|
|
185
186
|
/**
|
|
@@ -193,7 +194,7 @@ export class BillingResource {
|
|
|
193
194
|
* word. Only receipts with `logged: true` have one — expect a 404 otherwise.
|
|
194
195
|
*/
|
|
195
196
|
async receiptProof(id, params = {}) {
|
|
196
|
-
const { data } = await this.http.get(`/v1/billing/receipts/${
|
|
197
|
+
const { data } = await this.http.get(apiPath `/v1/billing/receipts/${id}/proof`, params.treeSize ? { params: { tree_size: params.treeSize } } : undefined);
|
|
197
198
|
return data;
|
|
198
199
|
}
|
|
199
200
|
/**
|
|
@@ -287,7 +288,7 @@ export class BillingResource {
|
|
|
287
288
|
return data;
|
|
288
289
|
}
|
|
289
290
|
async payment(reference) {
|
|
290
|
-
const { data } = await this.http.get(`/v1/billing/deposits/${
|
|
291
|
+
const { data } = await this.http.get(apiPath `/v1/billing/deposits/${reference}`);
|
|
291
292
|
// The response IS the intent. It used to arrive under an `intent` key with nothing beside it,
|
|
292
293
|
// so the wrapper carried no information — the clearest case of the inconsistency the gateway's
|
|
293
294
|
// 2026-08 break removed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/resources/billing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAqB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/resources/billing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAqB,MAAM,cAAc,CAAC;AAC3D,OA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I,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YACxD,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;gBACjC,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU;oBAAE,OAAO,KAAK,CAAC;gBAC1C,IAAI,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC;oBAAE,OAAO,KAAK,CAAC;gBAC7D,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;gBAClD,kFAAkF;gBAClF,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,MAAM,CAAC;YACrD,CAAC,CAAC,IAAI,IAAI,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import type { ChainsListResponse, ChainDetailResponse } from '../types.js';
|
|
3
|
+
import { type ChainCatalogueEntry } from '../chains.js';
|
|
3
4
|
/**
|
|
4
5
|
* The contract registry: which chains CERTEN is deployed on, and at what addresses.
|
|
5
6
|
*
|
|
@@ -34,5 +35,14 @@ export declare class ChainsResource {
|
|
|
34
35
|
* handed them, and making them translate is a step that buys nothing.
|
|
35
36
|
*/
|
|
36
37
|
get(idOrChainId: string | number): Promise<ChainDetailResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* The chains to offer: the configured set (default: the catalogue's live chains) narrowed to
|
|
40
|
+
* those the gateway serves right now.
|
|
41
|
+
*
|
|
42
|
+
* This is the runtime authority. The catalogue alone answers offline questions (what a numeric
|
|
43
|
+
* id means, which token is gas), but whether a chain may be USED is decided against the
|
|
44
|
+
* gateway: a chain it does not list, or lists with `enabled: false`, is never returned.
|
|
45
|
+
*/
|
|
46
|
+
enabled(configured?: readonly string[]): Promise<ChainCatalogueEntry[]>;
|
|
37
47
|
}
|
|
38
48
|
//# sourceMappingURL=chains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/resources/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/resources/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAA8C,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGpG;;;;;;;;;;;GAWG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEvC;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAUjG;;;;;OAKG;IACG,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKrE;;;;;;;OAOG;IACG,OAAO,CAAC,UAAU,GAAE,SAAS,MAAM,EAA2B,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAItG"}
|