tenzro-sdk 0.1.0 → 0.2.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/LICENSE +4 -15
- package/README.md +196 -3
- package/dist/adaptive-burn.d.ts +40 -0
- package/dist/adaptive-burn.d.ts.map +1 -0
- package/dist/adaptive-burn.js +53 -0
- package/dist/adaptive-burn.js.map +1 -0
- package/dist/agent.d.ts +8 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +14 -2
- package/dist/agent.js.map +1 -1
- package/dist/ap2.d.ts +96 -0
- package/dist/ap2.d.ts.map +1 -1
- package/dist/ap2.js +65 -0
- package/dist/ap2.js.map +1 -1
- package/dist/app.js +4 -4
- package/dist/app.js.map +1 -1
- package/dist/auth.d.ts +357 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +226 -0
- package/dist/auth.js.map +1 -0
- package/dist/bond.d.ts +70 -0
- package/dist/bond.d.ts.map +1 -0
- package/dist/bond.js +172 -0
- package/dist/bond.js.map +1 -0
- package/dist/cct.d.ts +53 -0
- package/dist/cct.d.ts.map +1 -0
- package/dist/cct.js +30 -0
- package/dist/cct.js.map +1 -0
- package/dist/client.d.ts +134 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +196 -12
- package/dist/client.js.map +1 -1
- package/dist/cortex.d.ts +227 -0
- package/dist/cortex.d.ts.map +1 -0
- package/dist/cortex.js +137 -0
- package/dist/cortex.js.map +1 -0
- package/dist/custody.d.ts +251 -0
- package/dist/custody.d.ts.map +1 -1
- package/dist/custody.js +216 -0
- package/dist/custody.js.map +1 -1
- package/dist/eip6963.d.ts +63 -0
- package/dist/eip6963.d.ts.map +1 -0
- package/dist/eip6963.js +67 -0
- package/dist/eip6963.js.map +1 -0
- package/dist/erc8004.d.ts +97 -0
- package/dist/erc8004.d.ts.map +1 -0
- package/dist/erc8004.js +182 -0
- package/dist/erc8004.js.map +1 -0
- package/dist/identity.d.ts +15 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +18 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +28 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -1
- package/dist/index.js.map +1 -1
- package/dist/insurance.d.ts +38 -0
- package/dist/insurance.d.ts.map +1 -0
- package/dist/insurance.js +51 -0
- package/dist/insurance.js.map +1 -0
- package/dist/lifecycle.d.ts +41 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +56 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/marketplace.d.ts +30 -2
- package/dist/marketplace.d.ts.map +1 -1
- package/dist/marketplace.js +36 -2
- package/dist/marketplace.js.map +1 -1
- package/dist/payment.d.ts +14 -1
- package/dist/payment.d.ts.map +1 -1
- package/dist/payment.js +15 -0
- package/dist/payment.js.map +1 -1
- package/dist/principal-chain.d.ts +41 -0
- package/dist/principal-chain.d.ts.map +1 -0
- package/dist/principal-chain.js +56 -0
- package/dist/principal-chain.js.map +1 -0
- package/dist/provider.d.ts +2 -2
- package/dist/provider.js +1 -1
- package/dist/quota.d.ts +54 -0
- package/dist/quota.d.ts.map +1 -0
- package/dist/quota.js +71 -0
- package/dist/quota.js.map +1 -0
- package/dist/rpc.d.ts +43 -4
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +110 -3
- package/dist/rpc.js.map +1 -1
- package/dist/seed-agent.d.ts +52 -0
- package/dist/seed-agent.d.ts.map +1 -0
- package/dist/seed-agent.js +69 -0
- package/dist/seed-agent.js.map +1 -0
- package/dist/settlement.d.ts +52 -10
- package/dist/settlement.d.ts.map +1 -1
- package/dist/settlement.js +197 -16
- package/dist/settlement.js.map +1 -1
- package/dist/streaming.js.map +1 -1
- package/dist/svm-cross-vm.d.ts +109 -0
- package/dist/svm-cross-vm.d.ts.map +1 -0
- package/dist/svm-cross-vm.js +215 -0
- package/dist/svm-cross-vm.js.map +1 -0
- package/dist/types.d.ts +175 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wallet.d.ts +26 -9
- package/dist/wallet.d.ts.map +1 -1
- package/dist/wallet.js +34 -19
- package/dist/wallet.js.map +1 -1
- package/dist/wormhole.d.ts +76 -0
- package/dist/wormhole.d.ts.map +1 -0
- package/dist/wormhole.js +56 -0
- package/dist/wormhole.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LifecycleClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Client for agent lifecycle and kill-switch queries.
|
|
6
|
+
*
|
|
7
|
+
* The kill-switch records every `TerminateAgent` event — including
|
|
8
|
+
* cascaded terminations from a parent agent — with the canonical reason
|
|
9
|
+
* code, the slash applied to the bond, and the controller that
|
|
10
|
+
* authorised it. These endpoints are read-only inspections of that
|
|
11
|
+
* audit trail; mutations flow through `TerminateAgent` typed
|
|
12
|
+
* transactions.
|
|
13
|
+
*/
|
|
14
|
+
class LifecycleClient {
|
|
15
|
+
rpc;
|
|
16
|
+
constructor(rpc) {
|
|
17
|
+
this.rpc = rpc;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the current `AgentLifecycleInfo` for an agent (state, last
|
|
21
|
+
* transition, controller, registration receipt id).
|
|
22
|
+
* @param agentId - Agent identifier (DID or 32-byte id)
|
|
23
|
+
* @returns Lifecycle record or null if unknown
|
|
24
|
+
*/
|
|
25
|
+
async getAgentLifecycle(agentId) {
|
|
26
|
+
return this.rpc.call("tenzro_getAgentLifecycle", [agentId]);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List every kill-switch receipt whose target is the given agent.
|
|
30
|
+
* @param agentId - Agent identifier (DID or 32-byte id)
|
|
31
|
+
* @returns Array of kill-switch receipts
|
|
32
|
+
*/
|
|
33
|
+
async listKillSwitchByAgent(agentId) {
|
|
34
|
+
return this.rpc.call("tenzro_listKillSwitchByAgent", [agentId]);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* List every kill-switch receipt authored by the given controller DID.
|
|
38
|
+
* @param controllerDid - Controller DID
|
|
39
|
+
* @returns Array of kill-switch receipts
|
|
40
|
+
*/
|
|
41
|
+
async listKillSwitchByController(controllerDid) {
|
|
42
|
+
return this.rpc.call("tenzro_listKillSwitchByController", [
|
|
43
|
+
controllerDid,
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Fetch a single kill-switch receipt by its 32-byte id.
|
|
48
|
+
* @param receiptId - Receipt identifier (hex)
|
|
49
|
+
* @returns Kill-switch receipt or null if unknown
|
|
50
|
+
*/
|
|
51
|
+
async getKillSwitchReceipt(receiptId) {
|
|
52
|
+
return this.rpc.call("tenzro_getKillSwitchReceipt", [receiptId]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.LifecycleClient = LifecycleClient;
|
|
56
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACH,MAAa,eAAe;IACN;IAApB,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAEtC;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAe;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,qBAAqB,CAAC,OAAe;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAQ,8BAA8B,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,0BAA0B,CAAC,aAAqB;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAQ,mCAAmC,EAAE;YAC/D,aAAa;SACd,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB,CAAC,SAAiB;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACnE,CAAC;CACF;AAzCD,0CAyCC"}
|
package/dist/marketplace.d.ts
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import type { RpcClient } from './rpc';
|
|
2
|
-
import type { AgentTemplate, AgentTemplateFilter, RegisterAgentTemplateParams, UpdateAgentTemplateParams, AgentTemplateStats } from './types';
|
|
2
|
+
import type { AgentTemplate, AgentTemplateFilter, RegisterAgentTemplateParams, UpdateAgentTemplateParams, AgentTemplateStats, RunAgentTemplateParams, RunAgentTemplateReport } from './types';
|
|
3
3
|
export declare class MarketplaceClient {
|
|
4
4
|
private readonly rpc;
|
|
5
5
|
constructor(rpc: RpcClient);
|
|
6
6
|
listAgentTemplates(filter?: AgentTemplateFilter): Promise<AgentTemplate[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Register a new agent template on the marketplace.
|
|
9
|
+
*
|
|
10
|
+
* Paid-agent marketplace semantics:
|
|
11
|
+
* - `creator_did` (optional): bind the template to a `did:tenzro:` / `did:pdis:`
|
|
12
|
+
* identity at registration time (immutable afterwards).
|
|
13
|
+
* - `creator_wallet` (**mandatory** for non-free pricing): payout wallet. Each
|
|
14
|
+
* invocation fee is split 95/5 — 5% flows to the network treasury as
|
|
15
|
+
* `AGENT_MARKETPLACE_COMMISSION_BPS`, the remainder is paid here.
|
|
16
|
+
* - `pricing`: either the canonical `AgentPricingModel` object or the compact
|
|
17
|
+
* string form (`"free"`, `"per_execution:<u128>"`, `"per_token:<u128>"`,
|
|
18
|
+
* `"subscription:<u128>"`, `"revenue_share:<bps>"`).
|
|
19
|
+
*/
|
|
7
20
|
registerAgentTemplate(params: RegisterAgentTemplateParams): Promise<AgentTemplate>;
|
|
21
|
+
/**
|
|
22
|
+
* Invoke (run) a spawned agent template end-to-end.
|
|
23
|
+
*
|
|
24
|
+
* For paid templates, `payer_wallet` is charged the per-invocation fee and
|
|
25
|
+
* the report contains the detailed fee-split breakdown (treasury commission,
|
|
26
|
+
* creator share, invocation counters, total revenue).
|
|
27
|
+
*/
|
|
28
|
+
runAgentTemplate(params: RunAgentTemplateParams): Promise<RunAgentTemplateReport>;
|
|
8
29
|
getAgentTemplate(templateId: string): Promise<AgentTemplate>;
|
|
9
30
|
/**
|
|
10
31
|
* Update a registered agent template (must be the creator).
|
|
@@ -15,11 +36,18 @@ export declare class MarketplaceClient {
|
|
|
15
36
|
updateAgentTemplate(templateId: string, params: UpdateAgentTemplateParams): Promise<AgentTemplate>;
|
|
16
37
|
/**
|
|
17
38
|
* Spawn a new agent instance from a template.
|
|
39
|
+
*
|
|
40
|
+
* When `parentMachineDid` is supplied, the spawned agent's effective
|
|
41
|
+
* delegation scope is the strict intersection of the parent's scope and
|
|
42
|
+
* the template's spec — the child can never be broader than its parent
|
|
43
|
+
* on any axis (numeric ceilings, allow-lists, time bound).
|
|
44
|
+
*
|
|
18
45
|
* @param templateId - The template to spawn from
|
|
19
46
|
* @param name - Name for the new agent instance
|
|
47
|
+
* @param parentMachineDid - Optional parent machine DID to attenuate against
|
|
20
48
|
* @returns Spawn result with agent ID
|
|
21
49
|
*/
|
|
22
|
-
spawnAgentFromTemplate(templateId: string, name: string): Promise<any>;
|
|
50
|
+
spawnAgentFromTemplate(templateId: string, name: string, parentMachineDid?: string): Promise<any>;
|
|
23
51
|
/**
|
|
24
52
|
* Rate an agent template.
|
|
25
53
|
* @param templateId - The template to rate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../src/marketplace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,C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G,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAK7E"}
|
package/dist/marketplace.js
CHANGED
|
@@ -9,9 +9,32 @@ class MarketplaceClient {
|
|
|
9
9
|
async listAgentTemplates(filter) {
|
|
10
10
|
return this.rpc.call('tenzro_listAgentTemplates', [filter ?? {}]);
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Register a new agent template on the marketplace.
|
|
14
|
+
*
|
|
15
|
+
* Paid-agent marketplace semantics:
|
|
16
|
+
* - `creator_did` (optional): bind the template to a `did:tenzro:` / `did:pdis:`
|
|
17
|
+
* identity at registration time (immutable afterwards).
|
|
18
|
+
* - `creator_wallet` (**mandatory** for non-free pricing): payout wallet. Each
|
|
19
|
+
* invocation fee is split 95/5 — 5% flows to the network treasury as
|
|
20
|
+
* `AGENT_MARKETPLACE_COMMISSION_BPS`, the remainder is paid here.
|
|
21
|
+
* - `pricing`: either the canonical `AgentPricingModel` object or the compact
|
|
22
|
+
* string form (`"free"`, `"per_execution:<u128>"`, `"per_token:<u128>"`,
|
|
23
|
+
* `"subscription:<u128>"`, `"revenue_share:<bps>"`).
|
|
24
|
+
*/
|
|
12
25
|
async registerAgentTemplate(params) {
|
|
13
26
|
return this.rpc.call('tenzro_registerAgentTemplate', [params]);
|
|
14
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Invoke (run) a spawned agent template end-to-end.
|
|
30
|
+
*
|
|
31
|
+
* For paid templates, `payer_wallet` is charged the per-invocation fee and
|
|
32
|
+
* the report contains the detailed fee-split breakdown (treasury commission,
|
|
33
|
+
* creator share, invocation counters, total revenue).
|
|
34
|
+
*/
|
|
35
|
+
async runAgentTemplate(params) {
|
|
36
|
+
return this.rpc.call('tenzro_runAgentTemplate', [params]);
|
|
37
|
+
}
|
|
15
38
|
async getAgentTemplate(templateId) {
|
|
16
39
|
return this.rpc.call('tenzro_getAgentTemplate', [{ template_id: templateId }]);
|
|
17
40
|
}
|
|
@@ -28,13 +51,24 @@ class MarketplaceClient {
|
|
|
28
51
|
}
|
|
29
52
|
/**
|
|
30
53
|
* Spawn a new agent instance from a template.
|
|
54
|
+
*
|
|
55
|
+
* When `parentMachineDid` is supplied, the spawned agent's effective
|
|
56
|
+
* delegation scope is the strict intersection of the parent's scope and
|
|
57
|
+
* the template's spec — the child can never be broader than its parent
|
|
58
|
+
* on any axis (numeric ceilings, allow-lists, time bound).
|
|
59
|
+
*
|
|
31
60
|
* @param templateId - The template to spawn from
|
|
32
61
|
* @param name - Name for the new agent instance
|
|
62
|
+
* @param parentMachineDid - Optional parent machine DID to attenuate against
|
|
33
63
|
* @returns Spawn result with agent ID
|
|
34
64
|
*/
|
|
35
|
-
async spawnAgentFromTemplate(templateId, name) {
|
|
65
|
+
async spawnAgentFromTemplate(templateId, name, parentMachineDid) {
|
|
36
66
|
return this.rpc.call('tenzro_spawnAgentFromTemplate', [
|
|
37
|
-
{
|
|
67
|
+
{
|
|
68
|
+
template_id: templateId,
|
|
69
|
+
name,
|
|
70
|
+
parent_machine_did: parentMachineDid,
|
|
71
|
+
},
|
|
38
72
|
]);
|
|
39
73
|
}
|
|
40
74
|
/**
|
package/dist/marketplace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../src/marketplace.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../src/marketplace.ts"],"names":[],"mappings":";;;AAWA,MAAa,iBAAiB;IACC;IAA7B,YAA6B,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAE/C,KAAK,CAAC,kBAAkB,CAAC,MAA4B;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAkB,2BAA2B,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,qBAAqB,CAA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AAG,CAAC,IAAI,CAAkB,6BAA6B,EAAE;YACnE,EAAE,KAAK,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,qBAAqB,CAAC,UAAkB;QAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,8BAA8B,EAAE;YACvE,EAAE,WAAW,EAAE,UAAU,EAAE;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AAvHD,8CAuHC"}
|
package/dist/payment.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RpcClient } from "./rpc";
|
|
2
|
-
import { PaymentChallenge, PaymentReceipt, PaymentSessionInfo, GatewayInfo } from "./types";
|
|
2
|
+
import { PaymentChallenge, PaymentReceipt, PaymentSessionInfo, GatewayInfo, X402SchemeRegistry } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Client for payment protocol operations (MPP / x402).
|
|
5
5
|
* Supports HTTP 402-based payments with session management.
|
|
@@ -47,6 +47,19 @@ export declare class PaymentClient {
|
|
|
47
47
|
* @returns Gateway status and supported protocols/assets
|
|
48
48
|
*/
|
|
49
49
|
gatewayInfo(): Promise<GatewayInfo>;
|
|
50
|
+
/**
|
|
51
|
+
* List the x402 scheme backends registered on the connected node.
|
|
52
|
+
*
|
|
53
|
+
* Each scheme corresponds to a different verification path under the x402
|
|
54
|
+
* protocol: `tenzro-hybrid` (Ed25519 hybrid signature over canonical
|
|
55
|
+
* preimage), `exact-eip3009` (USDC EIP-3009 meta-transaction via the CDP
|
|
56
|
+
* facilitator), `permit2` (Uniswap Permit2 via the CDP facilitator), and
|
|
57
|
+
* `erc7710` (delegation redemption). Use the returned ids in the
|
|
58
|
+
* `extra.scheme` field of an x402 PaymentRequirement.
|
|
59
|
+
*
|
|
60
|
+
* @returns Snapshot of the node's x402 scheme registry
|
|
61
|
+
*/
|
|
62
|
+
listX402Schemes(): Promise<X402SchemeRegistry>;
|
|
50
63
|
/**
|
|
51
64
|
* Pay via Visa TAP protocol.
|
|
52
65
|
* @param credential - Visa TAP payment credential
|
package/dist/payment.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,WAAW,
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAElC;;;;;;;OAOG;IACG,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAe,EACtB,QAAQ,GAAE,MAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAM5B;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMrE;;;;;OAKG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMtE;;;;OAIG;IACG,YAAY,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAM5E;;;;OAIG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAM5D;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAIzC;;;;;;;;;;;OAWG;IACG,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIpD;;;;OAIG;IACG,UAAU,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAI/C;;;;OAIG;IACG,aAAa,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlD;;;;;;OAMG;IACG,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,CAAC;CAK3B"}
|
package/dist/payment.js
CHANGED
|
@@ -72,6 +72,21 @@ class PaymentClient {
|
|
|
72
72
|
async gatewayInfo() {
|
|
73
73
|
return this.rpc.call("tenzro_paymentGatewayInfo");
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* List the x402 scheme backends registered on the connected node.
|
|
77
|
+
*
|
|
78
|
+
* Each scheme corresponds to a different verification path under the x402
|
|
79
|
+
* protocol: `tenzro-hybrid` (Ed25519 hybrid signature over canonical
|
|
80
|
+
* preimage), `exact-eip3009` (USDC EIP-3009 meta-transaction via the CDP
|
|
81
|
+
* facilitator), `permit2` (Uniswap Permit2 via the CDP facilitator), and
|
|
82
|
+
* `erc7710` (delegation redemption). Use the returned ids in the
|
|
83
|
+
* `extra.scheme` field of an x402 PaymentRequirement.
|
|
84
|
+
*
|
|
85
|
+
* @returns Snapshot of the node's x402 scheme registry
|
|
86
|
+
*/
|
|
87
|
+
async listX402Schemes() {
|
|
88
|
+
return this.rpc.call("tenzro_listX402Schemes");
|
|
89
|
+
}
|
|
75
90
|
/**
|
|
76
91
|
* Pay via Visa TAP protocol.
|
|
77
92
|
* @param credential - Visa TAP payment credential
|
package/dist/payment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":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AAC,GAAG,CAAC,IAAI,CAAc,2BAA2B,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAqB,wBAAwB,CAAC,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,UAAe;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,UAAe;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,GAAW,EACX,MAAc;QAEd,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAiB,eAAe,EAAE;YACpD,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE;SACrC,CAAC,CAAC;IACL,CAAC;CACF;AA9HD,sCA8HC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RpcClient } from "./rpc";
|
|
2
|
+
/**
|
|
3
|
+
* Client for receipt principal-chain queries (Spec 5).
|
|
4
|
+
*
|
|
5
|
+
* Every receipt produced by the network carries a principal chain that
|
|
6
|
+
* traces it back from the acting agent (`actor`) through the chain of
|
|
7
|
+
* delegations to the ultimate human or organisational `controller`.
|
|
8
|
+
* These endpoints let auditors, dashboards, and seed-agent governance
|
|
9
|
+
* walk that chain efficiently and aggregate per-controller activity.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PrincipalChainClient {
|
|
12
|
+
private rpc;
|
|
13
|
+
constructor(rpc: RpcClient);
|
|
14
|
+
/**
|
|
15
|
+
* Fetch the full principal chain for a single receipt.
|
|
16
|
+
* @param receiptId - 32-byte receipt identifier (hex)
|
|
17
|
+
* @returns Principal chain (actor → … → controller) or null if unknown
|
|
18
|
+
*/
|
|
19
|
+
getReceiptPrincipalChain(receiptId: string): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* List every receipt whose immediate `actor` is the given DID.
|
|
22
|
+
* @param actorDid - Actor DID (typically a machine DID)
|
|
23
|
+
* @returns Array of receipt summaries
|
|
24
|
+
*/
|
|
25
|
+
listReceiptsByActor(actorDid: string): Promise<any[]>;
|
|
26
|
+
/**
|
|
27
|
+
* List every receipt whose principal chain terminates at the given
|
|
28
|
+
* controller DID.
|
|
29
|
+
* @param controllerDid - Controller DID (human or organisational root)
|
|
30
|
+
* @returns Array of receipt summaries
|
|
31
|
+
*/
|
|
32
|
+
listReceiptsByController(controllerDid: string): Promise<any[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns aggregate activity metrics for a controller — receipt counts
|
|
35
|
+
* by kind, total spend, slashing events, etc.
|
|
36
|
+
* @param controllerDid - Controller DID
|
|
37
|
+
* @returns Controller summary record
|
|
38
|
+
*/
|
|
39
|
+
summarizeController(controllerDid: string): Promise<any>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=principal-chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principal-chain.d.ts","sourceRoot":"","sources":["../src/principal-chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;;GAQG;AACH,qBAAa,oBAAoB;IACnB,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAElC;;;;OAIG;IACG,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI/D;;;;OAIG;IACG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAI3D;;;;;OAKG;IACG,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAMrE;;;;;OAKG;IACG,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAG/D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrincipalChainClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Client for receipt principal-chain queries (Spec 5).
|
|
6
|
+
*
|
|
7
|
+
* Every receipt produced by the network carries a principal chain that
|
|
8
|
+
* traces it back from the acting agent (`actor`) through the chain of
|
|
9
|
+
* delegations to the ultimate human or organisational `controller`.
|
|
10
|
+
* These endpoints let auditors, dashboards, and seed-agent governance
|
|
11
|
+
* walk that chain efficiently and aggregate per-controller activity.
|
|
12
|
+
*/
|
|
13
|
+
class PrincipalChainClient {
|
|
14
|
+
rpc;
|
|
15
|
+
constructor(rpc) {
|
|
16
|
+
this.rpc = rpc;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fetch the full principal chain for a single receipt.
|
|
20
|
+
* @param receiptId - 32-byte receipt identifier (hex)
|
|
21
|
+
* @returns Principal chain (actor → … → controller) or null if unknown
|
|
22
|
+
*/
|
|
23
|
+
async getReceiptPrincipalChain(receiptId) {
|
|
24
|
+
return this.rpc.call("tenzro_getReceiptPrincipalChain", [receiptId]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List every receipt whose immediate `actor` is the given DID.
|
|
28
|
+
* @param actorDid - Actor DID (typically a machine DID)
|
|
29
|
+
* @returns Array of receipt summaries
|
|
30
|
+
*/
|
|
31
|
+
async listReceiptsByActor(actorDid) {
|
|
32
|
+
return this.rpc.call("tenzro_listReceiptsByActor", [actorDid]);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* List every receipt whose principal chain terminates at the given
|
|
36
|
+
* controller DID.
|
|
37
|
+
* @param controllerDid - Controller DID (human or organisational root)
|
|
38
|
+
* @returns Array of receipt summaries
|
|
39
|
+
*/
|
|
40
|
+
async listReceiptsByController(controllerDid) {
|
|
41
|
+
return this.rpc.call("tenzro_listReceiptsByController", [
|
|
42
|
+
controllerDid,
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns aggregate activity metrics for a controller — receipt counts
|
|
47
|
+
* by kind, total spend, slashing events, etc.
|
|
48
|
+
* @param controllerDid - Controller DID
|
|
49
|
+
* @returns Controller summary record
|
|
50
|
+
*/
|
|
51
|
+
async summarizeController(controllerDid) {
|
|
52
|
+
return this.rpc.call("tenzro_summarizeController", [controllerDid]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.PrincipalChainClient = PrincipalChainClient;
|
|
56
|
+
//# sourceMappingURL=principal-chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principal-chain.js","sourceRoot":"","sources":["../src/principal-chain.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,MAAa,oBAAoB;IACX;IAApB,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAEtC;;;;OAIG;IACH,KAAK,CAAC,wBAAwB,CAAC,SAAiB;QAC9C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iCAAiC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,mBAAmB,CAAC,QAAgB;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAQ,4BAA4B,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,wBAAwB,CAAC,aAAqB;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAQ,iCAAiC,EAAE;YAC7D,aAAa;SACd,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,mBAAmB,CAAC,aAAqB;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,CAAC;CACF;AA1CD,oDA0CC"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface HardwareProfile {
|
|
|
36
36
|
* A provider discovered on the Tenzro Network via gossipsub announcements.
|
|
37
37
|
*
|
|
38
38
|
* Providers broadcast a `ProviderAnnouncement` every 60 seconds on the
|
|
39
|
-
* `tenzro/providers
|
|
39
|
+
* `tenzro/providers` gossipsub topic. All peers merge incoming
|
|
40
40
|
* announcements into their `network_providers` cache so any node can
|
|
41
41
|
* discover every provider without a central registry.
|
|
42
42
|
*
|
|
@@ -255,7 +255,7 @@ export declare class ProviderClient {
|
|
|
255
255
|
*
|
|
256
256
|
* Queries the `tenzro_listProviders` JSON-RPC method which merges:
|
|
257
257
|
* - The local node's own provider info (if it is serving models)
|
|
258
|
-
* - All remote providers discovered via the `tenzro/providers
|
|
258
|
+
* - All remote providers discovered via the `tenzro/providers`
|
|
259
259
|
* gossipsub topic (announcements refreshed every 60 seconds)
|
|
260
260
|
*
|
|
261
261
|
* @param providerType - Optional filter by provider type (e.g. "llm", "tee", "general")
|
package/dist/provider.js
CHANGED
|
@@ -225,7 +225,7 @@ class ProviderClient {
|
|
|
225
225
|
*
|
|
226
226
|
* Queries the `tenzro_listProviders` JSON-RPC method which merges:
|
|
227
227
|
* - The local node's own provider info (if it is serving models)
|
|
228
|
-
* - All remote providers discovered via the `tenzro/providers
|
|
228
|
+
* - All remote providers discovered via the `tenzro/providers`
|
|
229
229
|
* gossipsub topic (announcements refreshed every 60 seconds)
|
|
230
230
|
*
|
|
231
231
|
* @param providerType - Optional filter by provider type (e.g. "llm", "tee", "general")
|
package/dist/quota.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RpcClient } from "./rpc";
|
|
2
|
+
/**
|
|
3
|
+
* Client for node-level quota and resource-pressure queries.
|
|
4
|
+
*
|
|
5
|
+
* Surfaces the dual-rail burn quota (Spec 3), the prioritised mempool
|
|
6
|
+
* lanes, per-account contention from the hot-state subsystem (Spec 6),
|
|
7
|
+
* and the data-availability backend registry. All endpoints are
|
|
8
|
+
* read-only.
|
|
9
|
+
*/
|
|
10
|
+
export declare class QuotaClient {
|
|
11
|
+
private rpc;
|
|
12
|
+
constructor(rpc: RpcClient);
|
|
13
|
+
/**
|
|
14
|
+
* Returns the current dual-rail burn quota state (Spec 3).
|
|
15
|
+
* @returns Burn quota snapshot
|
|
16
|
+
*/
|
|
17
|
+
getBurnQuota(): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns aggregate mempool statistics across all lanes.
|
|
20
|
+
* @returns Mempool stats snapshot
|
|
21
|
+
*/
|
|
22
|
+
getMempoolStats(): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the depth, fee floor, and admission stats for a single
|
|
25
|
+
* mempool lane.
|
|
26
|
+
* @param lane - Lane identifier (e.g. `"delegated"`, `"public"`,
|
|
27
|
+
* `"priority"`)
|
|
28
|
+
* @returns Lane snapshot
|
|
29
|
+
*/
|
|
30
|
+
getMempoolLane(lane: string): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the hot-state contention score for a single account
|
|
33
|
+
* (Spec 6 hot-state). Used by parallel-execution scheduling and
|
|
34
|
+
* fee-market congestion signals.
|
|
35
|
+
* @param address - Account address
|
|
36
|
+
* @returns Contention metrics
|
|
37
|
+
*/
|
|
38
|
+
getAccountContention(address: string): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* List the registered data-availability backends (EigenDA, Celestia,
|
|
41
|
+
* Avail, inline fallback) and their current health.
|
|
42
|
+
* @returns Array of DA backend descriptors
|
|
43
|
+
*/
|
|
44
|
+
getDaBackends(): Promise<any[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Verify that the payload referenced by a `DaPointer` is currently
|
|
47
|
+
* available on its backing DA backend.
|
|
48
|
+
* @param pointer - The `DaPointer` (backend, namespace, locator,
|
|
49
|
+
* commitment_kzg, attestation_root)
|
|
50
|
+
* @returns Verification result
|
|
51
|
+
*/
|
|
52
|
+
verifyDaPointer(pointer: Record<string, unknown>): Promise<any>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=quota.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota.d.ts","sourceRoot":"","sources":["../src/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC;;;;;;;GAOG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,SAAS;IAElC;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC;IAIlC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;IAIrC;;;;;;OAMG;IACG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhD;;;;;;OAMG;IACG,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAIrC;;;;;;OAMG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;CAGtE"}
|
package/dist/quota.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuotaClient = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Client for node-level quota and resource-pressure queries.
|
|
6
|
+
*
|
|
7
|
+
* Surfaces the dual-rail burn quota (Spec 3), the prioritised mempool
|
|
8
|
+
* lanes, per-account contention from the hot-state subsystem (Spec 6),
|
|
9
|
+
* and the data-availability backend registry. All endpoints are
|
|
10
|
+
* read-only.
|
|
11
|
+
*/
|
|
12
|
+
class QuotaClient {
|
|
13
|
+
rpc;
|
|
14
|
+
constructor(rpc) {
|
|
15
|
+
this.rpc = rpc;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the current dual-rail burn quota state (Spec 3).
|
|
19
|
+
* @returns Burn quota snapshot
|
|
20
|
+
*/
|
|
21
|
+
async getBurnQuota() {
|
|
22
|
+
return this.rpc.call("tenzro_getBurnQuota", []);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns aggregate mempool statistics across all lanes.
|
|
26
|
+
* @returns Mempool stats snapshot
|
|
27
|
+
*/
|
|
28
|
+
async getMempoolStats() {
|
|
29
|
+
return this.rpc.call("tenzro_getMempoolStats", []);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the depth, fee floor, and admission stats for a single
|
|
33
|
+
* mempool lane.
|
|
34
|
+
* @param lane - Lane identifier (e.g. `"delegated"`, `"public"`,
|
|
35
|
+
* `"priority"`)
|
|
36
|
+
* @returns Lane snapshot
|
|
37
|
+
*/
|
|
38
|
+
async getMempoolLane(lane) {
|
|
39
|
+
return this.rpc.call("tenzro_getMempoolLane", [lane]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the hot-state contention score for a single account
|
|
43
|
+
* (Spec 6 hot-state). Used by parallel-execution scheduling and
|
|
44
|
+
* fee-market congestion signals.
|
|
45
|
+
* @param address - Account address
|
|
46
|
+
* @returns Contention metrics
|
|
47
|
+
*/
|
|
48
|
+
async getAccountContention(address) {
|
|
49
|
+
return this.rpc.call("tenzro_getAccountContention", [address]);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* List the registered data-availability backends (EigenDA, Celestia,
|
|
53
|
+
* Avail, inline fallback) and their current health.
|
|
54
|
+
* @returns Array of DA backend descriptors
|
|
55
|
+
*/
|
|
56
|
+
async getDaBackends() {
|
|
57
|
+
return this.rpc.call("tenzro_getDaBackends", []);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Verify that the payload referenced by a `DaPointer` is currently
|
|
61
|
+
* available on its backing DA backend.
|
|
62
|
+
* @param pointer - The `DaPointer` (backend, namespace, locator,
|
|
63
|
+
* commitment_kzg, attestation_root)
|
|
64
|
+
* @returns Verification result
|
|
65
|
+
*/
|
|
66
|
+
async verifyDaPointer(pointer) {
|
|
67
|
+
return this.rpc.call("tenzro_verifyDaPointer", [pointer]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.QuotaClient = QuotaClient;
|
|
71
|
+
//# sourceMappingURL=quota.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota.js","sourceRoot":"","sources":["../src/quota.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,MAAa,WAAW;IACF;IAApB,YAAoB,GAAc;QAAd,QAAG,GAAH,GAAG,CAAW;IAAG,CAAC;IAEtC;;;OAGG;IACH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,cAAc,CAAC,IAAY;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB,CAAC,OAAe;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAQ,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,eAAe,CAAC,OAAgC;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,CAAC;CACF;AA5DD,kCA4DC"}
|
package/dist/rpc.d.ts
CHANGED
|
@@ -15,21 +15,60 @@ export interface RpcError {
|
|
|
15
15
|
message: string;
|
|
16
16
|
data?: unknown;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Pluggable transport for JSON-RPC calls.
|
|
20
|
+
*
|
|
21
|
+
* The default transport `fetch`es the configured endpoint with the
|
|
22
|
+
* usual `Content-Type: application/json` body. Browser-extension dApps
|
|
23
|
+
* can supply an EIP-1193 provider instead — `provider.request({method,
|
|
24
|
+
* params})` then handles auth (DPoP, session), routing, and user
|
|
25
|
+
* confirmation, and the SDK never touches a private key or token.
|
|
26
|
+
*/
|
|
27
|
+
export interface RpcTransport {
|
|
28
|
+
call<T>(method: string, params: unknown[] | Record<string, unknown>): Promise<T>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Adapter that turns an EIP-1193 provider into an `RpcTransport`. Used
|
|
32
|
+
* by `TenzroClient.fromInjected()` and any direct consumer that wants
|
|
33
|
+
* to route SDK calls through `window.tenzro` rather than a network
|
|
34
|
+
* endpoint.
|
|
35
|
+
*/
|
|
36
|
+
export declare class Eip1193Transport implements RpcTransport {
|
|
37
|
+
private readonly provider;
|
|
38
|
+
constructor(provider: {
|
|
39
|
+
request<T = unknown>(args: {
|
|
40
|
+
method: string;
|
|
41
|
+
params?: readonly unknown[] | Record<string, unknown>;
|
|
42
|
+
}): Promise<T>;
|
|
43
|
+
});
|
|
44
|
+
call<T>(method: string, params?: unknown[] | Record<string, unknown>): Promise<T>;
|
|
45
|
+
}
|
|
18
46
|
export declare class RpcClient {
|
|
19
47
|
private endpoint;
|
|
20
48
|
private apiEndpoint;
|
|
21
49
|
private timeout;
|
|
22
50
|
private requestId;
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
private readonly transport;
|
|
52
|
+
constructor(endpoint: string, apiEndpoint?: string, timeout?: number, transport?: RpcTransport);
|
|
53
|
+
call<T>(method: string, params?: unknown[] | Record<string, unknown>): Promise<T>;
|
|
25
54
|
get<T>(path: string): Promise<T>;
|
|
26
55
|
post<T>(path: string, body: unknown): Promise<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Authenticated POST to the Web API. The `/wallet/*` endpoints
|
|
58
|
+
* require a fresh DPoP proof per request that signs over the exact
|
|
59
|
+
* `(method, htu)` pair — only the wallet kernel can produce that
|
|
60
|
+
* proof, so the SDK accepts both the bearer JWT and the proof as
|
|
61
|
+
* explicit arguments instead of reading them from ambient env.
|
|
62
|
+
*/
|
|
63
|
+
postWithAuth<T>(path: string, body: unknown, bearerJwt: string, dpopProof: string): Promise<T>;
|
|
64
|
+
/** Authenticated GET counterpart to {@link postWithAuth}. */
|
|
65
|
+
getWithAuth<T>(path: string, bearerJwt: string, dpopProof: string): Promise<T>;
|
|
27
66
|
getEndpoint(): string;
|
|
28
67
|
getApiEndpoint(): string;
|
|
29
68
|
}
|
|
30
69
|
export declare class RpcCallError extends Error {
|
|
31
70
|
code: number;
|
|
32
|
-
data?: unknown;
|
|
33
|
-
constructor(code: number, message: string, data?: unknown);
|
|
71
|
+
data?: unknown | undefined;
|
|
72
|
+
constructor(code: number, message: string, data?: unknown | undefined);
|
|
34
73
|
}
|
|
35
74
|
//# sourceMappingURL=rpc.d.ts.map
|
package/dist/rpc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA,MAAM,WA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