tenzro-sdk 0.3.0 → 0.4.1

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.
Files changed (72) hide show
  1. package/README.md +10 -0
  2. package/dist/a2a-extension.d.ts +42 -0
  3. package/dist/a2a-extension.d.ts.map +1 -0
  4. package/dist/a2a-extension.js +55 -0
  5. package/dist/a2a-extension.js.map +1 -0
  6. package/dist/api-key.d.ts +128 -0
  7. package/dist/api-key.d.ts.map +1 -0
  8. package/dist/api-key.js +94 -0
  9. package/dist/api-key.js.map +1 -0
  10. package/dist/axelar.d.ts +54 -0
  11. package/dist/axelar.d.ts.map +1 -0
  12. package/dist/axelar.js +30 -0
  13. package/dist/axelar.js.map +1 -0
  14. package/dist/babylon.d.ts +46 -0
  15. package/dist/babylon.d.ts.map +1 -0
  16. package/dist/babylon.js +37 -0
  17. package/dist/babylon.js.map +1 -0
  18. package/dist/caip-helpers.d.ts +64 -0
  19. package/dist/caip-helpers.d.ts.map +1 -0
  20. package/dist/caip-helpers.js +100 -0
  21. package/dist/caip-helpers.js.map +1 -0
  22. package/dist/caip.d.ts +43 -0
  23. package/dist/caip.d.ts.map +1 -0
  24. package/dist/caip.js +29 -0
  25. package/dist/caip.js.map +1 -0
  26. package/dist/canton.d.ts +16 -18
  27. package/dist/canton.d.ts.map +1 -1
  28. package/dist/canton.js +16 -18
  29. package/dist/canton.js.map +1 -1
  30. package/dist/capital.d.ts +167 -0
  31. package/dist/capital.d.ts.map +1 -0
  32. package/dist/capital.js +117 -0
  33. package/dist/capital.js.map +1 -0
  34. package/dist/client.d.ts +27 -1
  35. package/dist/client.d.ts.map +1 -1
  36. package/dist/client.js +37 -0
  37. package/dist/client.js.map +1 -1
  38. package/dist/did-tenzro-helpers.d.ts +36 -0
  39. package/dist/did-tenzro-helpers.d.ts.map +1 -0
  40. package/dist/did-tenzro-helpers.js +77 -0
  41. package/dist/did-tenzro-helpers.js.map +1 -0
  42. package/dist/hyperlane.d.ts +47 -0
  43. package/dist/hyperlane.d.ts.map +1 -0
  44. package/dist/hyperlane.js +27 -0
  45. package/dist/hyperlane.js.map +1 -0
  46. package/dist/index.d.ts +27 -2
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +49 -2
  49. package/dist/index.js.map +1 -1
  50. package/dist/permit2.d.ts +49 -0
  51. package/dist/permit2.d.ts.map +1 -0
  52. package/dist/permit2.js +30 -0
  53. package/dist/permit2.js.map +1 -0
  54. package/dist/rpc.d.ts.map +1 -1
  55. package/dist/rpc.js +16 -0
  56. package/dist/rpc.js.map +1 -1
  57. package/dist/secure-mint.d.ts +39 -0
  58. package/dist/secure-mint.d.ts.map +1 -0
  59. package/dist/secure-mint.js +44 -0
  60. package/dist/secure-mint.js.map +1 -0
  61. package/dist/training.d.ts +61 -0
  62. package/dist/training.d.ts.map +1 -1
  63. package/dist/training.js +76 -1
  64. package/dist/training.js.map +1 -1
  65. package/dist/types.d.ts +93 -27
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/types.js.map +1 -1
  68. package/dist/workflow.d.ts +98 -0
  69. package/dist/workflow.d.ts.map +1 -0
  70. package/dist/workflow.js +131 -0
  71. package/dist/workflow.js.map +1 -0
  72. package/package.json +1 -1
package/README.md CHANGED
@@ -220,6 +220,16 @@ const result = await app.sponsorInference(user.address, 'gemma3-270m', 'Hello');
220
220
  | `skill` | `listSkills()`, `registerSkill()` |
221
221
  | `tool` | `listTools()`, `registerTool()` |
222
222
  | `svm-cross-vm` | Tenzro Cross-VM SVM-native program: `TENZRO_CROSS_VM_PROGRAM_ID_BASE58`, `encodeBridgeToEvm()`, `encodeBridgeFromEvm()`, `encodeRegisterTokenPointer()`, `encodeTransferCrossVm()`, `decodeCrossVmInstruction()` |
223
+ | `capital` | Regulated capital-allocation intents: `openCapitalIntent()`, `quoteCapitalIntent()`, `assignCapitalIntent()`, `executeCapitalLeg()`, `verifyCapitalLeg()`, `compensateCapitalLeg()`, `settleCapitalIntent()`, `getCapitalIntent()`, `submitReserveAttestation()`, `getReserve()`, `attestedMint()` |
224
+ | `workflow` | Multi-party saga workflows with AP2 / x402 / MPP / Stripe SPT / Visa TAP / Mastercard Agent Pay mandate binding: `openWorkflow()`, `executeStep()`, `verifyStep()`, `compensateStep()`, `finalizeWorkflow()`, `mirrorToCanton()`, `verifyDidEnvelope()`, `getWorkflow()`, `getWorkflowSaga()`, `getWorkflowLifecycle()`, `getWorkflowReceipt()`, `getWorkflowOperationalMetrics()`, `listWorkflowsByCreator()`, `listWorkflowsByParticipant()`, `listWorkflowsByStatus()`, `listWorkflowReceipts()` |
225
+ | `eip7702` | Pectra Type-4 delegation registry: `install7702Delegation()`, `get7702Delegation()`, `revoke7702Delegation()` |
226
+ | `erc7683` | Cross-chain intents origin opener + destination fill registry: `open7683Order()`, `get7683Order()`, `list7683Orders()`, `recordFill7683()`, `getFill7683()`, `listFills7683()` |
227
+ | `permit2` | Permit2 `SignatureTransfer`: `domainSeparator()`, `digest()`, `verifyAndConsume()`, `nonceUsed()` (optional witness binding for ERC-7683 origin opens) |
228
+ | `secureMint` | Per-token 1:1 reserve-attestation invariant for tokenized RWAs: `setPolicy()`, `getPolicy()`, `clearPolicy()`, `check()`, `apply()`, `recordBurn()` |
229
+ | `hyperlane` | Hyperlane V3 messaging with sovereign Tenzro-validator-set ISM: `listChains()`, `quoteDispatch()`, `dispatch()`, `getMessage()` |
230
+ | `axelar` | Axelar GMP — Cosmos / Move / Stellar / XRPL reach: `listChains()`, `callContract()`, `payGas()`, `getMessage()` |
231
+ | `babylon` | Babylon Bitcoin staking finality-providers + EOTS delegations: `registerFinalityProvider()`, `submitFinalitySignature()`, `totalStakeForProvider()`, `listDelegations()` |
232
+ | `caip` | Tenzro CAIP namespace identifiers per `ChainAgnostic/namespaces#184`: `caip2()`, `caip10()`, `caip19()` |
223
233
 
224
234
  ## Auth (OAuth 2.1 + DPoP Onboarding)
225
235
 
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Tenzro's A2A (Agent-to-Agent) protocol extension constants.
3
+ *
4
+ * Tenzro extends Google's A2A protocol with DID-bound message
5
+ * signing, allowing any A2A message to carry a `did:tenzro:`
6
+ * signature that downstream parties can verify. The extension is
7
+ * surfaced as JSON metadata keys (NOT URLs — per
8
+ * `feedback_a2a_extension_metadata_keys` the parent `/v1` should
9
+ * resolve but child keys like `/v1/did` are JSON keys, not URLs).
10
+ *
11
+ * These constants are exported so consumers don't hard-code the
12
+ * key strings — if the extension version bumps, callers re-import.
13
+ */
14
+ /** Top-level extension namespace as it appears in A2A message metadata. */
15
+ export declare const TENZRO_A2A_EXTENSION_NAMESPACE = "tenzro/v1";
16
+ /** Metadata key carrying the sender's `did:tenzro:` DID. */
17
+ export declare const TENZRO_A2A_DID_KEY = "tenzro/v1/did";
18
+ /** Metadata key carrying the Ed25519 + ML-DSA-65 hybrid signature. */
19
+ export declare const TENZRO_A2A_SIG_KEY = "tenzro/v1/sig";
20
+ /** Metadata key carrying the signing pubkey (or KID for caching). */
21
+ export declare const TENZRO_A2A_PUBKEY_KEY = "tenzro/v1/pubkey";
22
+ /** Metadata key for a TDIP delegation scope reference, if scoped. */
23
+ export declare const TENZRO_A2A_DELEGATION_KEY = "tenzro/v1/delegation";
24
+ /** Metadata key for the optional mandate-ref payload (AP2 / x402 / etc.). */
25
+ export declare const TENZRO_A2A_MANDATE_REF_KEY = "tenzro/v1/mandate-ref";
26
+ /** Metadata key for the message's audit-trail link to a prior receipt. */
27
+ export declare const TENZRO_A2A_RECEIPT_REF_KEY = "tenzro/v1/receipt-ref";
28
+ /** Convenience type for the parsed Tenzro extension envelope. */
29
+ export interface TenzroA2aExtension {
30
+ readonly did: string;
31
+ readonly sig: string;
32
+ readonly pubkey: string;
33
+ readonly delegation?: string;
34
+ readonly mandateRef?: string;
35
+ readonly receiptRef?: string;
36
+ }
37
+ /**
38
+ * Extract the Tenzro extension fields from an A2A message metadata
39
+ * object. Returns `null` when no Tenzro extension is present.
40
+ */
41
+ export declare function extractTenzroA2aExtension(metadata: Readonly<Record<string, unknown>>): TenzroA2aExtension | null;
42
+ //# sourceMappingURL=a2a-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a-extension.d.ts","sourceRoot":"","sources":["../src/a2a-extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAE1D,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAElE,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAElE,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC1C,kBAAkB,GAAG,IAAI,CAkB3B"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * Tenzro's A2A (Agent-to-Agent) protocol extension constants.
4
+ *
5
+ * Tenzro extends Google's A2A protocol with DID-bound message
6
+ * signing, allowing any A2A message to carry a `did:tenzro:`
7
+ * signature that downstream parties can verify. The extension is
8
+ * surfaced as JSON metadata keys (NOT URLs — per
9
+ * `feedback_a2a_extension_metadata_keys` the parent `/v1` should
10
+ * resolve but child keys like `/v1/did` are JSON keys, not URLs).
11
+ *
12
+ * These constants are exported so consumers don't hard-code the
13
+ * key strings — if the extension version bumps, callers re-import.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.TENZRO_A2A_RECEIPT_REF_KEY = exports.TENZRO_A2A_MANDATE_REF_KEY = exports.TENZRO_A2A_DELEGATION_KEY = exports.TENZRO_A2A_PUBKEY_KEY = exports.TENZRO_A2A_SIG_KEY = exports.TENZRO_A2A_DID_KEY = exports.TENZRO_A2A_EXTENSION_NAMESPACE = void 0;
17
+ exports.extractTenzroA2aExtension = extractTenzroA2aExtension;
18
+ /** Top-level extension namespace as it appears in A2A message metadata. */
19
+ exports.TENZRO_A2A_EXTENSION_NAMESPACE = 'tenzro/v1';
20
+ /** Metadata key carrying the sender's `did:tenzro:` DID. */
21
+ exports.TENZRO_A2A_DID_KEY = 'tenzro/v1/did';
22
+ /** Metadata key carrying the Ed25519 + ML-DSA-65 hybrid signature. */
23
+ exports.TENZRO_A2A_SIG_KEY = 'tenzro/v1/sig';
24
+ /** Metadata key carrying the signing pubkey (or KID for caching). */
25
+ exports.TENZRO_A2A_PUBKEY_KEY = 'tenzro/v1/pubkey';
26
+ /** Metadata key for a TDIP delegation scope reference, if scoped. */
27
+ exports.TENZRO_A2A_DELEGATION_KEY = 'tenzro/v1/delegation';
28
+ /** Metadata key for the optional mandate-ref payload (AP2 / x402 / etc.). */
29
+ exports.TENZRO_A2A_MANDATE_REF_KEY = 'tenzro/v1/mandate-ref';
30
+ /** Metadata key for the message's audit-trail link to a prior receipt. */
31
+ exports.TENZRO_A2A_RECEIPT_REF_KEY = 'tenzro/v1/receipt-ref';
32
+ /**
33
+ * Extract the Tenzro extension fields from an A2A message metadata
34
+ * object. Returns `null` when no Tenzro extension is present.
35
+ */
36
+ function extractTenzroA2aExtension(metadata) {
37
+ const did = metadata[exports.TENZRO_A2A_DID_KEY];
38
+ const sig = metadata[exports.TENZRO_A2A_SIG_KEY];
39
+ const pubkey = metadata[exports.TENZRO_A2A_PUBKEY_KEY];
40
+ if (typeof did !== 'string' || typeof sig !== 'string' || typeof pubkey !== 'string') {
41
+ return null;
42
+ }
43
+ const delegation = metadata[exports.TENZRO_A2A_DELEGATION_KEY];
44
+ const mandateRef = metadata[exports.TENZRO_A2A_MANDATE_REF_KEY];
45
+ const receiptRef = metadata[exports.TENZRO_A2A_RECEIPT_REF_KEY];
46
+ return {
47
+ did,
48
+ sig,
49
+ pubkey,
50
+ ...(typeof delegation === 'string' ? { delegation } : {}),
51
+ ...(typeof mandateRef === 'string' ? { mandateRef } : {}),
52
+ ...(typeof receiptRef === 'string' ? { receiptRef } : {}),
53
+ };
54
+ }
55
+ //# sourceMappingURL=a2a-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a-extension.js","sourceRoot":"","sources":["../src/a2a-extension.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAqCH,8DAoBC;AAvDD,2EAA2E;AAC9D,QAAA,8BAA8B,GAAG,WAAW,CAAC;AAE1D,4DAA4D;AAC/C,QAAA,kBAAkB,GAAG,eAAe,CAAC;AAElD,sEAAsE;AACzD,QAAA,kBAAkB,GAAG,eAAe,CAAC;AAElD,qEAAqE;AACxD,QAAA,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,qEAAqE;AACxD,QAAA,yBAAyB,GAAG,sBAAsB,CAAC;AAEhE,6EAA6E;AAChE,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AAElE,0EAA0E;AAC7D,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AAYlE;;;GAGG;AACH,SAAgB,yBAAyB,CACvC,QAA2C;IAE3C,MAAM,GAAG,GAAG,QAAQ,CAAC,0BAAkB,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,0BAAkB,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,6BAAqB,CAAC,CAAC;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACrF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,iCAAyB,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,QAAQ,CAAC,kCAA0B,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,kCAA0B,CAAC,CAAC;IACxD,OAAO;QACL,GAAG;QACH,GAAG;QACH,MAAM;QACN,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,128 @@
1
+ import type { RpcClient } from "./rpc";
2
+ /**
3
+ * Key class — controls who can revoke the key.
4
+ *
5
+ * - `subject`: default. Subject can self-revoke via `revokeMine`; admin
6
+ * can revoke via `revoke`.
7
+ * - `operator_internal`: operator-only ops key. Admin can revoke; subject
8
+ * path does not apply.
9
+ * - `operator_protected`: operator-only locked-down key. Not revokable
10
+ * via RPC by anyone (including admin). Rotate by updating the operator
11
+ * secret + restarting the node.
12
+ */
13
+ export type KeyClass = "subject" | "operator_internal" | "operator_protected";
14
+ /** Parameters for {@link ApiKeyClient.create}. */
15
+ export interface CreateApiKeyParams {
16
+ /** Free-form label shown in `list`. */
17
+ label: string;
18
+ /**
19
+ * Optional subject identifier — typically a Tenzro DID. Required if
20
+ * the operator wants the holder to self-revoke later.
21
+ */
22
+ subject?: string;
23
+ /** Scopes to grant. Defaults to `["canton"]` server-side when empty. */
24
+ scopes?: string[];
25
+ /** Revocability class. Defaults to `subject` when omitted. */
26
+ class?: KeyClass;
27
+ }
28
+ /**
29
+ * Response from {@link ApiKeyClient.create}. The `key` field is the
30
+ * plaintext `tnz_...` token and is shown exactly once — persist it
31
+ * immediately.
32
+ */
33
+ export interface CreatedApiKey {
34
+ key: string;
35
+ key_id: string;
36
+ label: string;
37
+ subject?: string | null;
38
+ scopes: string[];
39
+ class?: string | null;
40
+ created_at: number;
41
+ note?: string | null;
42
+ }
43
+ /** One row of the keyring as returned by `list` / `listMine`. */
44
+ export interface ApiKeyRecord {
45
+ key_id: string;
46
+ subject?: string | null;
47
+ label: string;
48
+ scopes: string[];
49
+ class?: string | null;
50
+ created_at: number;
51
+ revoked_at?: number | null;
52
+ active: boolean;
53
+ }
54
+ /** Response from {@link ApiKeyClient.list}. */
55
+ export interface ApiKeyList {
56
+ keys: ApiKeyRecord[];
57
+ }
58
+ /** Response from {@link ApiKeyClient.listMine}. */
59
+ export interface MyApiKeyList {
60
+ keys: ApiKeyRecord[];
61
+ subject: string;
62
+ }
63
+ /** Response from {@link ApiKeyClient.revoke} / {@link ApiKeyClient.revokeMine}. */
64
+ export interface RevokeApiKeyResult {
65
+ key_id: string;
66
+ revoked: boolean;
67
+ }
68
+ /**
69
+ * API-key management client.
70
+ *
71
+ * Two control planes:
72
+ *
73
+ * 1. **Operator** (`X-Tenzro-Admin-Token`): {@link create} / {@link list}
74
+ * / {@link revoke} any key on the operator's own node. Sourced from
75
+ * the `TENZRO_ADMIN_TOKEN` env var by the underlying `RpcClient`.
76
+ * 2. **Subject** (`X-Tenzro-Api-Key`): {@link listMine} / {@link revokeMine}
77
+ * keys belonging to the caller's own subject. Sourced from `TENZRO_API_KEY`.
78
+ *
79
+ * Every Tenzro node operator holds their own admin token for *their
80
+ * own* node. There is no global "Tenzro Labs token," and admin
81
+ * capabilities do not extend to network-wide state (validator set,
82
+ * treasury, fee schedule, system contracts — those flow through
83
+ * on-chain governance via `tenzro-token`). See `docs/api-keys.md`.
84
+ */
85
+ export declare class ApiKeyClient {
86
+ private readonly rpc;
87
+ constructor(rpc: RpcClient);
88
+ /**
89
+ * Mint a new API key on this node. Requires `TENZRO_ADMIN_TOKEN` in
90
+ * the environment.
91
+ *
92
+ * `class` controls revocability:
93
+ * - `subject` (default): subject can self-revoke, admin can revoke.
94
+ * - `operator_internal`: admin-only revoke.
95
+ * - `operator_protected`: not revokable via RPC — rotate by updating
96
+ * the operator secret and restarting the node. The SDK injects the
97
+ * `confirm_operator_protected` interlock automatically.
98
+ */
99
+ create(params: CreateApiKeyParams): Promise<CreatedApiKey>;
100
+ /**
101
+ * List every API key the node has issued — active and revoked.
102
+ * Admin-token-gated.
103
+ */
104
+ list(): Promise<ApiKeyList>;
105
+ /**
106
+ * Revoke an API key by its non-secret `key_id`. Admin-token-gated.
107
+ *
108
+ * Fails with `-32004` if the target is an `operator_protected` key
109
+ * (those cannot be revoked via RPC, by anyone, including an admin).
110
+ * Rotate that class by updating the operator secret + restart.
111
+ */
112
+ revoke(keyId: string): Promise<RevokeApiKeyResult>;
113
+ /**
114
+ * List every API key belonging to the caller's own subject.
115
+ * Requires `TENZRO_API_KEY` in the environment.
116
+ */
117
+ listMine(): Promise<MyApiKeyList>;
118
+ /**
119
+ * Revoke an API key belonging to the caller's own subject.
120
+ * Requires `TENZRO_API_KEY` in the environment.
121
+ *
122
+ * Only `subject`-class keys are eligible. The error for "no such key"
123
+ * and "not your key" is intentionally the same so ownership cannot be
124
+ * probed.
125
+ */
126
+ revokeMine(keyId: string): Promise<RevokeApiKeyResult>;
127
+ }
128
+ //# sourceMappingURL=api-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.d.ts","sourceRoot":"","sources":["../src/api-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAE9E,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,+CAA+C;AAC/C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAI3C;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAehE;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAIjC;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQxD;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAIvC;;;;;;;OAOG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAK7D"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiKeyClient = void 0;
4
+ /**
5
+ * API-key management client.
6
+ *
7
+ * Two control planes:
8
+ *
9
+ * 1. **Operator** (`X-Tenzro-Admin-Token`): {@link create} / {@link list}
10
+ * / {@link revoke} any key on the operator's own node. Sourced from
11
+ * the `TENZRO_ADMIN_TOKEN` env var by the underlying `RpcClient`.
12
+ * 2. **Subject** (`X-Tenzro-Api-Key`): {@link listMine} / {@link revokeMine}
13
+ * keys belonging to the caller's own subject. Sourced from `TENZRO_API_KEY`.
14
+ *
15
+ * Every Tenzro node operator holds their own admin token for *their
16
+ * own* node. There is no global "Tenzro Labs token," and admin
17
+ * capabilities do not extend to network-wide state (validator set,
18
+ * treasury, fee schedule, system contracts — those flow through
19
+ * on-chain governance via `tenzro-token`). See `docs/api-keys.md`.
20
+ */
21
+ class ApiKeyClient {
22
+ rpc;
23
+ constructor(rpc) {
24
+ this.rpc = rpc;
25
+ }
26
+ // ── Operator surface (admin-token-gated) ─────────────────────────
27
+ /**
28
+ * Mint a new API key on this node. Requires `TENZRO_ADMIN_TOKEN` in
29
+ * the environment.
30
+ *
31
+ * `class` controls revocability:
32
+ * - `subject` (default): subject can self-revoke, admin can revoke.
33
+ * - `operator_internal`: admin-only revoke.
34
+ * - `operator_protected`: not revokable via RPC — rotate by updating
35
+ * the operator secret and restarting the node. The SDK injects the
36
+ * `confirm_operator_protected` interlock automatically.
37
+ */
38
+ async create(params) {
39
+ const body = {
40
+ label: params.label,
41
+ scopes: params.scopes ?? [],
42
+ class: params.class ?? "subject",
43
+ };
44
+ if (params.subject !== undefined) {
45
+ body.subject = params.subject;
46
+ }
47
+ if ((params.class ?? "subject") === "operator_protected") {
48
+ body.confirm_operator_protected = true;
49
+ }
50
+ return this.rpc.call("tenzro_createApiKey", body);
51
+ }
52
+ /**
53
+ * List every API key the node has issued — active and revoked.
54
+ * Admin-token-gated.
55
+ */
56
+ async list() {
57
+ return this.rpc.call("tenzro_listApiKeys", {});
58
+ }
59
+ /**
60
+ * Revoke an API key by its non-secret `key_id`. Admin-token-gated.
61
+ *
62
+ * Fails with `-32004` if the target is an `operator_protected` key
63
+ * (those cannot be revoked via RPC, by anyone, including an admin).
64
+ * Rotate that class by updating the operator secret + restart.
65
+ */
66
+ async revoke(keyId) {
67
+ return this.rpc.call("tenzro_revokeApiKey", {
68
+ key_id: keyId,
69
+ });
70
+ }
71
+ // ── Subject surface (X-Tenzro-Api-Key authenticated) ─────────────
72
+ /**
73
+ * List every API key belonging to the caller's own subject.
74
+ * Requires `TENZRO_API_KEY` in the environment.
75
+ */
76
+ async listMine() {
77
+ return this.rpc.call("tenzro_listMyApiKeys", {});
78
+ }
79
+ /**
80
+ * Revoke an API key belonging to the caller's own subject.
81
+ * Requires `TENZRO_API_KEY` in the environment.
82
+ *
83
+ * Only `subject`-class keys are eligible. The error for "no such key"
84
+ * and "not your key" is intentionally the same so ownership cannot be
85
+ * probed.
86
+ */
87
+ async revokeMine(keyId) {
88
+ return this.rpc.call("tenzro_revokeMyApiKey", {
89
+ key_id: keyId,
90
+ });
91
+ }
92
+ }
93
+ exports.ApiKeyClient = ApiKeyClient;
94
+ //# sourceMappingURL=api-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.js","sourceRoot":"","sources":["../src/api-key.ts"],"names":[],"mappings":";;;AA2EA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,YAAY;IACM;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,oEAAoE;IAEpE;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,CAAC,MAA0B;QACrC,MAAM,IAAI,GAA4B;YACpC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;YAC3B,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS;SACjC,CAAC;QACF,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,oBAAoB,EAAE,CAAC;YACzD,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAgB,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAa,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,qBAAqB,EAAE;YAC9D,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAED,oEAAoE;IAEpE;;;OAGG;IACH,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAe,sBAAsB,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,uBAAuB,EAAE;YAChE,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;CACF;AA3ED,oCA2EC"}
@@ -0,0 +1,54 @@
1
+ import type { RpcClient } from './rpc';
2
+ export interface AxelarChain {
3
+ chain_id: string;
4
+ family: string;
5
+ gateway?: string;
6
+ gas_service?: string;
7
+ }
8
+ export interface AxelarCallContractRequest {
9
+ source_chain: string;
10
+ destination_chain: string;
11
+ destination_address: string;
12
+ payload_hex: string;
13
+ gas_token?: string;
14
+ gas_amount?: string;
15
+ }
16
+ export interface AxelarCallContractResult {
17
+ payload_hash: string;
18
+ source_chain: string;
19
+ destination_chain: string;
20
+ }
21
+ export interface AxelarPayGasRequest {
22
+ payload_hash: string;
23
+ source_chain: string;
24
+ destination_chain: string;
25
+ destination_address: string;
26
+ gas_token: string;
27
+ gas_amount: string;
28
+ }
29
+ export interface AxelarPayGasResult {
30
+ paid: boolean;
31
+ gas_token: string;
32
+ gas_amount: string;
33
+ }
34
+ export interface AxelarMessage {
35
+ payload_hash: string;
36
+ source_chain: string;
37
+ destination_chain: string;
38
+ destination_address: string;
39
+ status: string;
40
+ }
41
+ /**
42
+ * Axelar GMP client — Cosmos / Move / Stellar / XRPL / Hyperliquid /
43
+ * Filecoin EVM / Kava reach via canonical `call_contract` + Gas
44
+ * Service pre-pay; correlation id is `keccak256(payload)`.
45
+ */
46
+ export declare class AxelarClient {
47
+ private readonly rpc;
48
+ constructor(rpc: RpcClient);
49
+ listChains(): Promise<AxelarChain[]>;
50
+ callContract(req: AxelarCallContractRequest): Promise<AxelarCallContractResult>;
51
+ payGas(req: AxelarPayGasRequest): Promise<AxelarPayGasResult>;
52
+ getMessage(payloadHash: string): Promise<AxelarMessage | null>;
53
+ }
54
+ //# sourceMappingURL=axelar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axelar.d.ts","sourceRoot":"","sources":["../src/axelar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAErC,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAIpC,YAAY,CAChB,GAAG,EAAE,yBAAyB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;IAO9B,MAAM,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI7D,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;CAKrE"}
package/dist/axelar.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AxelarClient = void 0;
4
+ /**
5
+ * Axelar GMP client — Cosmos / Move / Stellar / XRPL / Hyperliquid /
6
+ * Filecoin EVM / Kava reach via canonical `call_contract` + Gas
7
+ * Service pre-pay; correlation id is `keccak256(payload)`.
8
+ */
9
+ class AxelarClient {
10
+ rpc;
11
+ constructor(rpc) {
12
+ this.rpc = rpc;
13
+ }
14
+ async listChains() {
15
+ return this.rpc.call('tenzro_axelarListChains', []);
16
+ }
17
+ async callContract(req) {
18
+ return this.rpc.call('tenzro_axelarCallContract', [req]);
19
+ }
20
+ async payGas(req) {
21
+ return this.rpc.call('tenzro_axelarPayGas', [req]);
22
+ }
23
+ async getMessage(payloadHash) {
24
+ return this.rpc.call('tenzro_axelarGetMessage', [
25
+ { payload_hash: payloadHash },
26
+ ]);
27
+ }
28
+ }
29
+ exports.AxelarClient = AxelarClient;
30
+ //# sourceMappingURL=axelar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axelar.js","sourceRoot":"","sources":["../src/axelar.ts"],"names":[],"mappings":";;;AA+CA;;;;GAIG;AACH,MAAa,YAAY;IACM;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAgB,yBAAyB,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,GAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,2BAA2B,EAC3B,CAAC,GAAG,CAAC,CACN,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAwB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB;QAClC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAuB,yBAAyB,EAAE;YACpE,EAAE,YAAY,EAAE,WAAW,EAAE;SAC9B,CAAC,CAAC;IACL,CAAC;CACF;AAzBD,oCAyBC"}
@@ -0,0 +1,46 @@
1
+ import type { RpcClient } from './rpc';
2
+ export interface RegisterFinalityProviderRequest {
3
+ validator: string;
4
+ btc_pk: string;
5
+ commission_bps: number;
6
+ }
7
+ export interface FinalityProvider {
8
+ validator: string;
9
+ btc_pk: string;
10
+ commission_bps: number;
11
+ active: boolean;
12
+ }
13
+ export interface BabylonTotalStake {
14
+ validator: string;
15
+ total_satoshis: number;
16
+ delegation_count: number;
17
+ }
18
+ export interface SubmitFinalitySignatureRequest {
19
+ validator: string;
20
+ block_hash: string;
21
+ eots_signature: string;
22
+ }
23
+ export interface BtcDelegation {
24
+ delegator_btc_pk: string;
25
+ validator: string;
26
+ satoshis: number;
27
+ start_height: number;
28
+ end_height?: number | null;
29
+ }
30
+ /**
31
+ * Babylon Bitcoin staking client. Register a Tenzro validator as a
32
+ * Babylon finality provider so it is economically secured by native
33
+ * BTC; submit EOTS (Extractable One-Time Signatures) over Tenzro block
34
+ * hashes to avoid slashing.
35
+ */
36
+ export declare class BabylonClient {
37
+ private readonly rpc;
38
+ constructor(rpc: RpcClient);
39
+ registerFinalityProvider(req: RegisterFinalityProviderRequest): Promise<FinalityProvider>;
40
+ getFinalityProvider(validator: string): Promise<FinalityProvider | null>;
41
+ listFinalityProviders(): Promise<FinalityProvider[]>;
42
+ totalStakeForProvider(validator: string): Promise<BabylonTotalStake>;
43
+ submitFinalitySignature(req: SubmitFinalitySignatureRequest): Promise<unknown>;
44
+ listDelegations(validator: string): Promise<BtcDelegation[]>;
45
+ }
46
+ //# sourceMappingURL=babylon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babylon.d.ts","sourceRoot":"","sources":["../src/babylon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAErC,wBAAwB,CAC5B,GAAG,EAAE,+BAA+B,GACnC,OAAO,CAAC,gBAAgB,CAAC;IAOtB,mBAAmB,CACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAO7B,qBAAqB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAOpD,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOpE,uBAAuB,CAC3B,GAAG,EAAE,8BAA8B,GAClC,OAAO,CAAC,OAAO,CAAC;IAIb,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAKnE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BabylonClient = void 0;
4
+ /**
5
+ * Babylon Bitcoin staking client. Register a Tenzro validator as a
6
+ * Babylon finality provider so it is economically secured by native
7
+ * BTC; submit EOTS (Extractable One-Time Signatures) over Tenzro block
8
+ * hashes to avoid slashing.
9
+ */
10
+ class BabylonClient {
11
+ rpc;
12
+ constructor(rpc) {
13
+ this.rpc = rpc;
14
+ }
15
+ async registerFinalityProvider(req) {
16
+ return this.rpc.call('tenzro_babylonRegisterFinalityProvider', [req]);
17
+ }
18
+ async getFinalityProvider(validator) {
19
+ return this.rpc.call('tenzro_babylonGetFinalityProvider', [{ validator }]);
20
+ }
21
+ async listFinalityProviders() {
22
+ return this.rpc.call('tenzro_babylonListFinalityProviders', []);
23
+ }
24
+ async totalStakeForProvider(validator) {
25
+ return this.rpc.call('tenzro_babylonTotalStakeForProvider', [{ validator }]);
26
+ }
27
+ async submitFinalitySignature(req) {
28
+ return this.rpc.call('tenzro_babylonSubmitFinalitySignature', [req]);
29
+ }
30
+ async listDelegations(validator) {
31
+ return this.rpc.call('tenzro_babylonListDelegations', [
32
+ { validator },
33
+ ]);
34
+ }
35
+ }
36
+ exports.BabylonClient = BabylonClient;
37
+ //# sourceMappingURL=babylon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babylon.js","sourceRoot":"","sources":["../src/babylon.ts"],"names":[],"mappings":";;;AAmCA;;;;;GAKG;AACH,MAAa,aAAa;IACK;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,KAAK,CAAC,wBAAwB,CAC5B,GAAoC;QAEpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,wCAAwC,EACxC,CAAC,GAAG,CAAC,CACN,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,SAAiB;QAEjB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,mCAAmC,EACnC,CAAC,EAAE,SAAS,EAAE,CAAC,CAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,qCAAqC,EACrC,EAAE,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,SAAiB;QAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,qCAAqC,EACrC,CAAC,EAAE,SAAS,EAAE,CAAC,CAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,GAAmC;QAEnC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uCAAuC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAiB;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAkB,+BAA+B,EAAE;YACrE,EAAE,SAAS,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF;AA9CD,sCA8CC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Pure helpers around the submitted `tenzro` CASA namespace
3
+ * (`ChainAgnostic/namespaces#184`). These functions reference the
4
+ * frozen spec values and are safe to use without an RPC round-trip:
5
+ * parsing, validation, and constants.
6
+ *
7
+ * For runtime-derived identifiers (the CAIP-2 reference, which depends
8
+ * on the genesis block hash for the network the wallet is connected
9
+ * to), use the `CaipClient` from `./caip.ts`.
10
+ */
11
+ /** CAIP-2 namespace string for Tenzro. */
12
+ export declare const TENZRO_CAIP2_NAMESPACE = "tenzro";
13
+ /**
14
+ * SLIP-44 coin index for native TNZO. Pre-registered until
15
+ * `satoshilabs/slips#2015` merges; the string form `"tenzro"` is also
16
+ * accepted on input by the node-side helpers.
17
+ */
18
+ export declare const TENZRO_SLIP44_COIN_INDEX = 1414421071;
19
+ /** Asset namespaces supported by the CAIP-19 Tenzro encoding. */
20
+ export type CaipAssetNamespace = 'slip44' | 'token' | 'nft';
21
+ /**
22
+ * Validate that a string looks like a Tenzro CAIP-2 chain id —
23
+ * `tenzro:<32-hex chars>`. Does NOT verify the reference is the live
24
+ * network's genesis hash; for that, compare against `CaipClient.caip2()`.
25
+ */
26
+ export declare function isTenzroCaip2(chainId: string): boolean;
27
+ /**
28
+ * Build a Tenzro CAIP-2 chain id from a 16-byte reference (the first
29
+ * 16 bytes of the genesis block hash). Pass either a `Uint8Array` of
30
+ * length 16, a 32-char lowercase hex string, or a `0x`-prefixed
31
+ * 34-char hex string. Throws if the reference is the wrong length.
32
+ */
33
+ export declare function buildTenzroCaip2(reference: Uint8Array | string): string;
34
+ /**
35
+ * Parse a Tenzro CAIP-2 chain id into `{ namespace, reference }`.
36
+ * Returns `null` if the input doesn't match the Tenzro shape.
37
+ */
38
+ export declare function parseTenzroCaip2(chainId: string): {
39
+ namespace: 'tenzro';
40
+ reference: string;
41
+ } | null;
42
+ /**
43
+ * Validate a Tenzro CAIP-10 account id: `tenzro:<32-hex>:<address>`.
44
+ * Tenzro addresses are 32 bytes (64-hex), but base58btc inputs are
45
+ * accepted on the node side and normalized, so this validator only
46
+ * checks the structural shape of the canonical hex form.
47
+ */
48
+ export declare function isTenzroCaip10(accountId: string): boolean;
49
+ /**
50
+ * Validate a Tenzro CAIP-19 asset id and return its parts. Returns
51
+ * `null` if the input doesn't match the Tenzro shape.
52
+ *
53
+ * Forms:
54
+ * - `tenzro:<chainRef>/slip44:1414421071` (native TNZO)
55
+ * - `tenzro:<chainRef>/token:<64-hex>`
56
+ * - `tenzro:<chainRef>/nft:<64-hex>/<tokenId>`
57
+ */
58
+ export declare function parseTenzroCaip19(assetId: string): {
59
+ chainRef: string;
60
+ namespace: CaipAssetNamespace;
61
+ reference: string;
62
+ tokenId?: string;
63
+ } | null;
64
+ //# sourceMappingURL=caip-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip-helpers.d.ts","sourceRoot":"","sources":["../src/caip-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAAgB,CAAC;AAEtD,iEAAiE;AACjE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAoBvE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GACd;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAGnD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAaP"}