tenzro-sdk 0.3.0 → 0.4.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/README.md +10 -0
- package/dist/api-key.d.ts +128 -0
- package/dist/api-key.d.ts.map +1 -0
- package/dist/api-key.js +94 -0
- package/dist/api-key.js.map +1 -0
- package/dist/axelar.d.ts +54 -0
- package/dist/axelar.d.ts.map +1 -0
- package/dist/axelar.js +30 -0
- package/dist/axelar.js.map +1 -0
- package/dist/babylon.d.ts +46 -0
- package/dist/babylon.d.ts.map +1 -0
- package/dist/babylon.js +37 -0
- package/dist/babylon.js.map +1 -0
- package/dist/caip.d.ts +43 -0
- package/dist/caip.d.ts.map +1 -0
- package/dist/caip.js +29 -0
- package/dist/caip.js.map +1 -0
- package/dist/canton.d.ts +16 -18
- package/dist/canton.d.ts.map +1 -1
- package/dist/canton.js +16 -18
- package/dist/canton.js.map +1 -1
- package/dist/capital.d.ts +167 -0
- package/dist/capital.d.ts.map +1 -0
- package/dist/capital.js +117 -0
- package/dist/capital.js.map +1 -0
- package/dist/client.d.ts +27 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +37 -0
- package/dist/client.js.map +1 -1
- package/dist/hyperlane.d.ts +47 -0
- package/dist/hyperlane.d.ts.map +1 -0
- package/dist/hyperlane.js +27 -0
- package/dist/hyperlane.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/permit2.d.ts +49 -0
- package/dist/permit2.d.ts.map +1 -0
- package/dist/permit2.js +30 -0
- package/dist/permit2.js.map +1 -0
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +16 -0
- package/dist/rpc.js.map +1 -1
- package/dist/secure-mint.d.ts +39 -0
- package/dist/secure-mint.d.ts.map +1 -0
- package/dist/secure-mint.js +44 -0
- package/dist/secure-mint.js.map +1 -0
- package/dist/types.d.ts +93 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/workflow.d.ts +98 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +131 -0
- package/dist/workflow.js.map +1 -0
- 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,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"}
|
package/dist/api-key.js
ADDED
|
@@ -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"}
|
package/dist/axelar.d.ts
ADDED
|
@@ -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"}
|
package/dist/babylon.js
ADDED
|
@@ -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"}
|
package/dist/caip.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RpcClient } from './rpc';
|
|
2
|
+
export interface Caip2Info {
|
|
3
|
+
chain_id: string;
|
|
4
|
+
namespace: string;
|
|
5
|
+
reference: string;
|
|
6
|
+
evm_chain_id: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Caip10Info {
|
|
9
|
+
account_id: string;
|
|
10
|
+
chain_id: string;
|
|
11
|
+
address: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Caip19Request {
|
|
14
|
+
/** One of `"slip44"`, `"token"`, `"nft"`. */
|
|
15
|
+
kind: 'slip44' | 'token' | 'nft' | string;
|
|
16
|
+
token_id?: string;
|
|
17
|
+
collection_id?: string;
|
|
18
|
+
nft_token_id?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Caip19Info {
|
|
21
|
+
asset_id: string;
|
|
22
|
+
chain_id: string;
|
|
23
|
+
asset_namespace: string;
|
|
24
|
+
asset_reference: string;
|
|
25
|
+
token_id?: string | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Chain-agnostic discovery client per the submitted `tenzro` CASA
|
|
29
|
+
* namespace (`ChainAgnostic/namespaces#184`).
|
|
30
|
+
*
|
|
31
|
+
* - CAIP-2 chain id: `tenzro:<lowercase hex of first 16 bytes of
|
|
32
|
+
* genesis block hash>`. EVM `evm_chain_id` sidecar is included.
|
|
33
|
+
* - CAIP-10: accepts hex or base58btc, normalises to canonical 64-hex.
|
|
34
|
+
* - CAIP-19: `slip44` (SLIP-44 coin index 1414421071), `token`, `nft`.
|
|
35
|
+
*/
|
|
36
|
+
export declare class CaipClient {
|
|
37
|
+
private readonly rpc;
|
|
38
|
+
constructor(rpc: RpcClient);
|
|
39
|
+
caip2(): Promise<Caip2Info>;
|
|
40
|
+
caip10(address: string): Promise<Caip10Info>;
|
|
41
|
+
caip19(params: Caip19Request): Promise<Caip19Info>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=caip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caip.d.ts","sourceRoot":"","sources":["../src/caip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAErC,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;IAI3B,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI5C,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;CAGzD"}
|
package/dist/caip.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaipClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Chain-agnostic discovery client per the submitted `tenzro` CASA
|
|
6
|
+
* namespace (`ChainAgnostic/namespaces#184`).
|
|
7
|
+
*
|
|
8
|
+
* - CAIP-2 chain id: `tenzro:<lowercase hex of first 16 bytes of
|
|
9
|
+
* genesis block hash>`. EVM `evm_chain_id` sidecar is included.
|
|
10
|
+
* - CAIP-10: accepts hex or base58btc, normalises to canonical 64-hex.
|
|
11
|
+
* - CAIP-19: `slip44` (SLIP-44 coin index 1414421071), `token`, `nft`.
|
|
12
|
+
*/
|
|
13
|
+
class CaipClient {
|
|
14
|
+
rpc;
|
|
15
|
+
constructor(rpc) {
|
|
16
|
+
this.rpc = rpc;
|
|
17
|
+
}
|
|
18
|
+
async caip2() {
|
|
19
|
+
return this.rpc.call('tenzro_caip2', []);
|
|
20
|
+
}
|
|
21
|
+
async caip10(address) {
|
|
22
|
+
return this.rpc.call('tenzro_caip10', [{ address }]);
|
|
23
|
+
}
|
|
24
|
+
async caip19(params) {
|
|
25
|
+
return this.rpc.call('tenzro_caip19', [params]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.CaipClient = CaipClient;
|
|
29
|
+
//# sourceMappingURL=caip.js.map
|
package/dist/caip.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caip.js","sourceRoot":"","sources":["../src/caip.ts"],"names":[],"mappings":";;;AA+BA;;;;;;;;GAQG;AACH,MAAa,UAAU;IACQ;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAY,cAAc,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAa,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAqB;QAChC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAa,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF;AAdD,gCAcC"}
|
package/dist/canton.d.ts
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import type { RpcClient } from './rpc';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CantonDomainList, DamlCommandParams, DamlCommandResult, DamlContractsResponse, ListDamlContractsParams } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for Canton / DAML enterprise ledger operations.
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Interacts with the shared Canton participant the Tenzro node is configured
|
|
7
|
+
* against. The node proxies all calls using its own bearer JWT — callers never
|
|
8
|
+
* see the Auth0 secret.
|
|
6
9
|
*
|
|
7
10
|
* Uses Canton 3.x JSON Ledger API v2 endpoints:
|
|
8
|
-
* - Commands:
|
|
9
|
-
* - Active contracts
|
|
10
|
-
* - Events:
|
|
11
|
+
* - Commands: `POST /v2/commands/submit-and-wait-for-transaction`
|
|
12
|
+
* - Active contracts:`POST /v2/state/active-contracts` (with `identifierFilter`)
|
|
13
|
+
* - Events: `POST /v2/events/events-by-contract-id`
|
|
11
14
|
*/
|
|
12
15
|
export declare class CantonClient {
|
|
13
16
|
private readonly rpc;
|
|
14
17
|
constructor(rpc: RpcClient);
|
|
15
18
|
/**
|
|
16
|
-
* List
|
|
17
|
-
*
|
|
19
|
+
* List the Canton synchronizer domains this node is configured against.
|
|
20
|
+
*
|
|
21
|
+
* The envelope is returned even when Canton is not enabled — check
|
|
22
|
+
* `enabled` on the response before treating `domains` as live.
|
|
18
23
|
*/
|
|
19
|
-
listDomains(): Promise<
|
|
24
|
+
listDomains(): Promise<CantonDomainList>;
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
22
|
-
* Queries the Canton 3.x active-contracts endpoint with `identifierFilter`
|
|
23
|
-
* for template-based filtering.
|
|
24
|
-
* @param params - Optional filter by domain, template, party, with pagination
|
|
25
|
-
* @returns Array of DAML contracts
|
|
26
|
+
* Query active DAML contracts. Requires at least one template id.
|
|
26
27
|
*/
|
|
27
|
-
listContracts(params
|
|
28
|
+
listContracts(params: ListDamlContractsParams): Promise<DamlContractsResponse>;
|
|
28
29
|
/**
|
|
29
|
-
* Submit a DAML
|
|
30
|
-
* Uses the Canton 3.x `submit-and-wait-for-transaction` endpoint.
|
|
31
|
-
* @param params - Command parameters including domain, template, payload, and optional choice
|
|
32
|
-
* @returns Command result with status and events
|
|
30
|
+
* Submit a DAML `create` or `exercise` command to the Canton participant.
|
|
33
31
|
*/
|
|
34
32
|
submitCommand(params: DamlCommandParams): Promise<DamlCommandResult>;
|
|
35
33
|
}
|
package/dist/canton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canton.d.ts","sourceRoot":"","sources":["../src/canton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"canton.d.ts","sourceRoot":"","sources":["../src/canton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAE3C;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAI9C;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAM3E"}
|
package/dist/canton.js
CHANGED
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CantonClient = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Client for Canton / DAML enterprise ledger operations.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Interacts with the shared Canton participant the Tenzro node is configured
|
|
8
|
+
* against. The node proxies all calls using its own bearer JWT — callers never
|
|
9
|
+
* see the Auth0 secret.
|
|
7
10
|
*
|
|
8
11
|
* Uses Canton 3.x JSON Ledger API v2 endpoints:
|
|
9
|
-
* - Commands:
|
|
10
|
-
* - Active contracts
|
|
11
|
-
* - Events:
|
|
12
|
+
* - Commands: `POST /v2/commands/submit-and-wait-for-transaction`
|
|
13
|
+
* - Active contracts:`POST /v2/state/active-contracts` (with `identifierFilter`)
|
|
14
|
+
* - Events: `POST /v2/events/events-by-contract-id`
|
|
12
15
|
*/
|
|
13
16
|
class CantonClient {
|
|
14
17
|
rpc;
|
|
@@ -16,30 +19,25 @@ class CantonClient {
|
|
|
16
19
|
this.rpc = rpc;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
* List
|
|
20
|
-
*
|
|
22
|
+
* List the Canton synchronizer domains this node is configured against.
|
|
23
|
+
*
|
|
24
|
+
* The envelope is returned even when Canton is not enabled — check
|
|
25
|
+
* `enabled` on the response before treating `domains` as live.
|
|
21
26
|
*/
|
|
22
27
|
async listDomains() {
|
|
23
|
-
return this.rpc.call('tenzro_listCantonDomains',
|
|
28
|
+
return this.rpc.call('tenzro_listCantonDomains', {});
|
|
24
29
|
}
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Queries the Canton 3.x active-contracts endpoint with `identifierFilter`
|
|
28
|
-
* for template-based filtering.
|
|
29
|
-
* @param params - Optional filter by domain, template, party, with pagination
|
|
30
|
-
* @returns Array of DAML contracts
|
|
31
|
+
* Query active DAML contracts. Requires at least one template id.
|
|
31
32
|
*/
|
|
32
33
|
async listContracts(params) {
|
|
33
|
-
return this.rpc.call('tenzro_listDamlContracts',
|
|
34
|
+
return this.rpc.call('tenzro_listDamlContracts', params);
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
* Submit a DAML
|
|
37
|
-
* Uses the Canton 3.x `submit-and-wait-for-transaction` endpoint.
|
|
38
|
-
* @param params - Command parameters including domain, template, payload, and optional choice
|
|
39
|
-
* @returns Command result with status and events
|
|
37
|
+
* Submit a DAML `create` or `exercise` command to the Canton participant.
|
|
40
38
|
*/
|
|
41
39
|
async submitCommand(params) {
|
|
42
|
-
return this.rpc.call('tenzro_submitDamlCommand',
|
|
40
|
+
return this.rpc.call('tenzro_submitDamlCommand', params);
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
exports.CantonClient = CantonClient;
|
package/dist/canton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canton.js","sourceRoot":"","sources":["../src/canton.ts"],"names":[],"mappings":";;;AASA
|
|
1
|
+
{"version":3,"file":"canton.js","sourceRoot":"","sources":["../src/canton.ts"],"names":[],"mappings":";;;AASA;;;;;;;;;;;GAWG;AACH,MAAa,YAAY;IACM;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C;;;;;OAKG;IACH,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAmB,0BAA0B,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CACjB,MAA+B;QAE/B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,0BAA0B,EAC1B,MAA4C,CAC7C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,MAAyB;QAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAClB,0BAA0B,EAC1B,MAA4C,CAC7C,CAAC;IACJ,CAAC;CACF;AAlCD,oCAkCC"}
|