@oobe-protocol-labs/synapse-sap-sdk 0.1.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 +21 -0
- package/README.md +882 -0
- package/dist/cjs/constants/index.js +43 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/limits.js +161 -0
- package/dist/cjs/constants/limits.js.map +1 -0
- package/dist/cjs/constants/programs.js +78 -0
- package/dist/cjs/constants/programs.js.map +1 -0
- package/dist/cjs/constants/seeds.js +57 -0
- package/dist/cjs/constants/seeds.js.map +1 -0
- package/dist/cjs/core/client.js +391 -0
- package/dist/cjs/core/client.js.map +1 -0
- package/dist/cjs/core/connection.js +319 -0
- package/dist/cjs/core/connection.js.map +1 -0
- package/dist/cjs/core/index.js +24 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/errors/index.js +334 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/events/index.js +136 -0
- package/dist/cjs/events/index.js.map +1 -0
- package/dist/cjs/idl/index.js +63 -0
- package/dist/cjs/idl/index.js.map +1 -0
- package/dist/cjs/idl/synapse_agent_sap.json +9710 -0
- package/dist/cjs/index.js +147 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/agent.js +272 -0
- package/dist/cjs/modules/agent.js.map +1 -0
- package/dist/cjs/modules/attestation.js +147 -0
- package/dist/cjs/modules/attestation.js.map +1 -0
- package/dist/cjs/modules/base.js +128 -0
- package/dist/cjs/modules/base.js.map +1 -0
- package/dist/cjs/modules/escrow.js +246 -0
- package/dist/cjs/modules/escrow.js.map +1 -0
- package/dist/cjs/modules/feedback.js +166 -0
- package/dist/cjs/modules/feedback.js.map +1 -0
- package/dist/cjs/modules/index.js +35 -0
- package/dist/cjs/modules/index.js.map +1 -0
- package/dist/cjs/modules/indexing.js +375 -0
- package/dist/cjs/modules/indexing.js.map +1 -0
- package/dist/cjs/modules/ledger.js +234 -0
- package/dist/cjs/modules/ledger.js.map +1 -0
- package/dist/cjs/modules/tools.js +319 -0
- package/dist/cjs/modules/tools.js.map +1 -0
- package/dist/cjs/modules/vault.js +410 -0
- package/dist/cjs/modules/vault.js.map +1 -0
- package/dist/cjs/pda/index.js +377 -0
- package/dist/cjs/pda/index.js.map +1 -0
- package/dist/cjs/plugin/index.js +934 -0
- package/dist/cjs/plugin/index.js.map +1 -0
- package/dist/cjs/plugin/protocols.js +282 -0
- package/dist/cjs/plugin/protocols.js.map +1 -0
- package/dist/cjs/plugin/schemas.js +831 -0
- package/dist/cjs/plugin/schemas.js.map +1 -0
- package/dist/cjs/postgres/adapter.js +715 -0
- package/dist/cjs/postgres/adapter.js.map +1 -0
- package/dist/cjs/postgres/index.js +50 -0
- package/dist/cjs/postgres/index.js.map +1 -0
- package/dist/cjs/postgres/serializers.js +381 -0
- package/dist/cjs/postgres/serializers.js.map +1 -0
- package/dist/cjs/postgres/sync.js +221 -0
- package/dist/cjs/postgres/sync.js.map +1 -0
- package/dist/cjs/postgres/types.js +44 -0
- package/dist/cjs/postgres/types.js.map +1 -0
- package/dist/cjs/registries/builder.js +414 -0
- package/dist/cjs/registries/builder.js.map +1 -0
- package/dist/cjs/registries/discovery.js +362 -0
- package/dist/cjs/registries/discovery.js.map +1 -0
- package/dist/cjs/registries/index.js +51 -0
- package/dist/cjs/registries/index.js.map +1 -0
- package/dist/cjs/registries/session.js +433 -0
- package/dist/cjs/registries/session.js.map +1 -0
- package/dist/cjs/registries/x402.js +577 -0
- package/dist/cjs/registries/x402.js.map +1 -0
- package/dist/cjs/types/accounts.js +13 -0
- package/dist/cjs/types/accounts.js.map +1 -0
- package/dist/cjs/types/common.js +13 -0
- package/dist/cjs/types/common.js.map +1 -0
- package/dist/cjs/types/enums.js +174 -0
- package/dist/cjs/types/enums.js.map +1 -0
- package/dist/cjs/types/index.js +36 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/instructions.js +92 -0
- package/dist/cjs/types/instructions.js.map +1 -0
- package/dist/cjs/utils/hash.js +58 -0
- package/dist/cjs/utils/hash.js.map +1 -0
- package/dist/cjs/utils/index.js +27 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/serialization.js +105 -0
- package/dist/cjs/utils/serialization.js.map +1 -0
- package/dist/cjs/utils/validation.js +36 -0
- package/dist/cjs/utils/validation.js.map +1 -0
- package/dist/esm/constants/index.js +29 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/limits.js +158 -0
- package/dist/esm/constants/limits.js.map +1 -0
- package/dist/esm/constants/programs.js +75 -0
- package/dist/esm/constants/programs.js.map +1 -0
- package/dist/esm/constants/seeds.js +54 -0
- package/dist/esm/constants/seeds.js.map +1 -0
- package/dist/esm/core/client.js +384 -0
- package/dist/esm/core/client.js.map +1 -0
- package/dist/esm/core/connection.js +315 -0
- package/dist/esm/core/connection.js.map +1 -0
- package/dist/esm/core/index.js +19 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/errors/index.js +325 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/events/index.js +132 -0
- package/dist/esm/events/index.js.map +1 -0
- package/dist/esm/idl/index.js +57 -0
- package/dist/esm/idl/index.js.map +1 -0
- package/dist/esm/idl/synapse_agent_sap.json +9710 -0
- package/dist/esm/index.js +70 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/modules/agent.js +268 -0
- package/dist/esm/modules/agent.js.map +1 -0
- package/dist/esm/modules/attestation.js +143 -0
- package/dist/esm/modules/attestation.js.map +1 -0
- package/dist/esm/modules/base.js +124 -0
- package/dist/esm/modules/base.js.map +1 -0
- package/dist/esm/modules/escrow.js +242 -0
- package/dist/esm/modules/escrow.js.map +1 -0
- package/dist/esm/modules/feedback.js +162 -0
- package/dist/esm/modules/feedback.js.map +1 -0
- package/dist/esm/modules/index.js +23 -0
- package/dist/esm/modules/index.js.map +1 -0
- package/dist/esm/modules/indexing.js +371 -0
- package/dist/esm/modules/indexing.js.map +1 -0
- package/dist/esm/modules/ledger.js +230 -0
- package/dist/esm/modules/ledger.js.map +1 -0
- package/dist/esm/modules/tools.js +315 -0
- package/dist/esm/modules/tools.js.map +1 -0
- package/dist/esm/modules/vault.js +406 -0
- package/dist/esm/modules/vault.js.map +1 -0
- package/dist/esm/pda/index.js +357 -0
- package/dist/esm/pda/index.js.map +1 -0
- package/dist/esm/plugin/index.js +927 -0
- package/dist/esm/plugin/index.js.map +1 -0
- package/dist/esm/plugin/protocols.js +279 -0
- package/dist/esm/plugin/protocols.js.map +1 -0
- package/dist/esm/plugin/schemas.js +828 -0
- package/dist/esm/plugin/schemas.js.map +1 -0
- package/dist/esm/postgres/adapter.js +678 -0
- package/dist/esm/postgres/adapter.js.map +1 -0
- package/dist/esm/postgres/index.js +27 -0
- package/dist/esm/postgres/index.js.map +1 -0
- package/dist/esm/postgres/serializers.js +362 -0
- package/dist/esm/postgres/serializers.js.map +1 -0
- package/dist/esm/postgres/sync.js +217 -0
- package/dist/esm/postgres/sync.js.map +1 -0
- package/dist/esm/postgres/types.js +41 -0
- package/dist/esm/postgres/types.js.map +1 -0
- package/dist/esm/registries/builder.js +410 -0
- package/dist/esm/registries/builder.js.map +1 -0
- package/dist/esm/registries/discovery.js +358 -0
- package/dist/esm/registries/discovery.js.map +1 -0
- package/dist/esm/registries/index.js +44 -0
- package/dist/esm/registries/index.js.map +1 -0
- package/dist/esm/registries/session.js +429 -0
- package/dist/esm/registries/session.js.map +1 -0
- package/dist/esm/registries/x402.js +573 -0
- package/dist/esm/registries/x402.js.map +1 -0
- package/dist/esm/types/accounts.js +12 -0
- package/dist/esm/types/accounts.js.map +1 -0
- package/dist/esm/types/common.js +12 -0
- package/dist/esm/types/common.js.map +1 -0
- package/dist/esm/types/enums.js +171 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/index.js +25 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/instructions.js +89 -0
- package/dist/esm/types/instructions.js.map +1 -0
- package/dist/esm/utils/hash.js +53 -0
- package/dist/esm/utils/hash.js.map +1 -0
- package/dist/esm/utils/index.js +19 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/serialization.js +98 -0
- package/dist/esm/utils/serialization.js.map +1 -0
- package/dist/esm/utils/validation.js +33 -0
- package/dist/esm/utils/validation.js.map +1 -0
- package/dist/types/constants/index.d.ts +27 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/constants/limits.d.ts +149 -0
- package/dist/types/constants/limits.d.ts.map +1 -0
- package/dist/types/constants/programs.d.ts +69 -0
- package/dist/types/constants/programs.d.ts.map +1 -0
- package/dist/types/constants/seeds.d.ts +61 -0
- package/dist/types/constants/seeds.d.ts.map +1 -0
- package/dist/types/core/client.d.ts +323 -0
- package/dist/types/core/client.d.ts.map +1 -0
- package/dist/types/core/connection.d.ts +279 -0
- package/dist/types/core/connection.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +20 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +276 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/events/index.d.ts +248 -0
- package/dist/types/events/index.d.ts.map +1 -0
- package/dist/types/idl/index.d.ts +70 -0
- package/dist/types/idl/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +68 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/modules/agent.d.ts +166 -0
- package/dist/types/modules/agent.d.ts.map +1 -0
- package/dist/types/modules/attestation.d.ts +96 -0
- package/dist/types/modules/attestation.d.ts.map +1 -0
- package/dist/types/modules/base.d.ts +126 -0
- package/dist/types/modules/base.d.ts.map +1 -0
- package/dist/types/modules/escrow.d.ts +151 -0
- package/dist/types/modules/escrow.d.ts.map +1 -0
- package/dist/types/modules/feedback.d.ts +105 -0
- package/dist/types/modules/feedback.d.ts.map +1 -0
- package/dist/types/modules/index.d.ts +24 -0
- package/dist/types/modules/index.d.ts.map +1 -0
- package/dist/types/modules/indexing.d.ts +200 -0
- package/dist/types/modules/indexing.d.ts.map +1 -0
- package/dist/types/modules/ledger.d.ts +150 -0
- package/dist/types/modules/ledger.d.ts.map +1 -0
- package/dist/types/modules/tools.d.ts +182 -0
- package/dist/types/modules/tools.d.ts.map +1 -0
- package/dist/types/modules/vault.d.ts +240 -0
- package/dist/types/modules/vault.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +296 -0
- package/dist/types/pda/index.d.ts.map +1 -0
- package/dist/types/plugin/index.d.ts +171 -0
- package/dist/types/plugin/index.d.ts.map +1 -0
- package/dist/types/plugin/protocols.d.ts +152 -0
- package/dist/types/plugin/protocols.d.ts.map +1 -0
- package/dist/types/plugin/schemas.d.ts +823 -0
- package/dist/types/plugin/schemas.d.ts.map +1 -0
- package/dist/types/postgres/adapter.d.ts +355 -0
- package/dist/types/postgres/adapter.d.ts.map +1 -0
- package/dist/types/postgres/index.d.ts +24 -0
- package/dist/types/postgres/index.d.ts.map +1 -0
- package/dist/types/postgres/serializers.d.ts +30 -0
- package/dist/types/postgres/serializers.d.ts.map +1 -0
- package/dist/types/postgres/sync.d.ts +132 -0
- package/dist/types/postgres/sync.d.ts.map +1 -0
- package/dist/types/postgres/types.d.ts +167 -0
- package/dist/types/postgres/types.d.ts.map +1 -0
- package/dist/types/registries/builder.d.ts +340 -0
- package/dist/types/registries/builder.d.ts.map +1 -0
- package/dist/types/registries/discovery.d.ts +333 -0
- package/dist/types/registries/discovery.d.ts.map +1 -0
- package/dist/types/registries/index.d.ts +48 -0
- package/dist/types/registries/index.d.ts.map +1 -0
- package/dist/types/registries/session.d.ts +323 -0
- package/dist/types/registries/session.d.ts.map +1 -0
- package/dist/types/registries/x402.d.ts +463 -0
- package/dist/types/registries/x402.d.ts.map +1 -0
- package/dist/types/types/accounts.d.ts +565 -0
- package/dist/types/types/accounts.d.ts.map +1 -0
- package/dist/types/types/common.d.ts +166 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/enums.d.ts +238 -0
- package/dist/types/types/enums.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +28 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/instructions.d.ts +366 -0
- package/dist/types/types/instructions.d.ts.map +1 -0
- package/dist/types/utils/hash.d.ts +48 -0
- package/dist/types/utils/hash.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +19 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/serialization.d.ts +69 -0
- package/dist/types/utils/serialization.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +29 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/package.json +178 -0
- package/src/constants/index.ts +44 -0
- package/src/constants/limits.ts +165 -0
- package/src/constants/programs.ts +83 -0
- package/src/constants/seeds.ts +66 -0
- package/src/core/client.ts +416 -0
- package/src/core/connection.ts +409 -0
- package/src/core/index.ts +20 -0
- package/src/errors/index.ts +346 -0
- package/src/events/index.ts +335 -0
- package/src/idl/index.ts +76 -0
- package/src/idl/synapse_agent_sap.json +9710 -0
- package/src/index.ts +253 -0
- package/src/modules/agent.ts +319 -0
- package/src/modules/attestation.ts +168 -0
- package/src/modules/base.ts +158 -0
- package/src/modules/escrow.ts +308 -0
- package/src/modules/feedback.ts +186 -0
- package/src/modules/index.ts +24 -0
- package/src/modules/indexing.ts +444 -0
- package/src/modules/ledger.ts +262 -0
- package/src/modules/tools.ts +411 -0
- package/src/modules/vault.ts +533 -0
- package/src/pda/index.ts +512 -0
- package/src/plugin/index.ts +1202 -0
- package/src/plugin/protocols.ts +404 -0
- package/src/plugin/schemas.ts +909 -0
- package/src/postgres/adapter.ts +904 -0
- package/src/postgres/index.ts +59 -0
- package/src/postgres/schema.sql +683 -0
- package/src/postgres/serializers.ts +485 -0
- package/src/postgres/sync.ts +254 -0
- package/src/postgres/types.ts +245 -0
- package/src/registries/builder.ts +607 -0
- package/src/registries/discovery.ts +572 -0
- package/src/registries/index.ts +77 -0
- package/src/registries/session.ts +613 -0
- package/src/registries/x402.ts +906 -0
- package/src/types/accounts.ts +618 -0
- package/src/types/common.ts +187 -0
- package/src/types/enums.ts +214 -0
- package/src/types/index.ts +92 -0
- package/src/types/instructions.ts +413 -0
- package/src/utils/hash.ts +57 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/serialization.ts +98 -0
- package/src/utils/validation.ts +36 -0
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module registries/builder
|
|
3
|
+
* @description Fluent agent registration builder.
|
|
4
|
+
*
|
|
5
|
+
* Provides a chainable API for registering a fully-configured agent
|
|
6
|
+
* in a single flow — identity, capabilities, pricing tiers, tools,
|
|
7
|
+
* x402 endpoint, and discovery indexes.
|
|
8
|
+
*
|
|
9
|
+
* Instead of calling 5+ separate instructions manually, developers
|
|
10
|
+
* use a single builder chain that validates inputs and batches
|
|
11
|
+
* the registration cleanly.
|
|
12
|
+
*
|
|
13
|
+
* @category Registries
|
|
14
|
+
* @since v0.1.0
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const result = await client.builder
|
|
19
|
+
* .agent("SwapBot")
|
|
20
|
+
* .description("AI-powered Jupiter swap agent")
|
|
21
|
+
* .x402Endpoint("https://swapbot.example.com/x402")
|
|
22
|
+
* .addCapability("jupiter:swap", { protocol: "jupiter", version: "6.0" })
|
|
23
|
+
* .addCapability("jupiter:quote", { protocol: "jupiter", version: "6.0" })
|
|
24
|
+
* .addPricingTier({
|
|
25
|
+
* tierId: "standard",
|
|
26
|
+
* pricePerCall: 1000,
|
|
27
|
+
* rateLimit: 60,
|
|
28
|
+
* tokenType: "sol",
|
|
29
|
+
* settlementMode: "x402",
|
|
30
|
+
* })
|
|
31
|
+
* .addProtocol("jupiter")
|
|
32
|
+
* .register();
|
|
33
|
+
*
|
|
34
|
+
* // Or register with tools:
|
|
35
|
+
* const result = await client.builder
|
|
36
|
+
* .agent("DataBot")
|
|
37
|
+
* .description("Real-time DeFi data feeds")
|
|
38
|
+
* .addTool({ name: "getPrice", protocol: "pyth", category: "data", ... })
|
|
39
|
+
* .registerWithTools();
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import {
|
|
44
|
+
SystemProgram,
|
|
45
|
+
type PublicKey,
|
|
46
|
+
type TransactionSignature,
|
|
47
|
+
} from "@solana/web3.js";
|
|
48
|
+
import { type AnchorProvider, BN } from "@coral-xyz/anchor";
|
|
49
|
+
import type { SapProgram } from "../modules/base";
|
|
50
|
+
import {
|
|
51
|
+
deriveAgent,
|
|
52
|
+
deriveAgentStats,
|
|
53
|
+
deriveTool,
|
|
54
|
+
deriveGlobalRegistry,
|
|
55
|
+
} from "../pda";
|
|
56
|
+
import { sha256, hashToArray, assert } from "../utils";
|
|
57
|
+
import { LIMITS, TOOL_CATEGORY_VALUES, HTTP_METHOD_VALUES } from "../constants";
|
|
58
|
+
import type {
|
|
59
|
+
Capability,
|
|
60
|
+
PricingTier,
|
|
61
|
+
TokenTypeKind,
|
|
62
|
+
SettlementModeKind,
|
|
63
|
+
VolumeCurveBreakpoint,
|
|
64
|
+
} from "../types";
|
|
65
|
+
import { TokenType, SettlementMode } from "../types";
|
|
66
|
+
|
|
67
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
68
|
+
// Public Types
|
|
69
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @interface CapabilityInput
|
|
73
|
+
* @name CapabilityInput
|
|
74
|
+
* @description Simplified capability input for the builder.
|
|
75
|
+
* Defines the protocol, version, and description of a capability
|
|
76
|
+
* to register with the agent.
|
|
77
|
+
* @category Registries
|
|
78
|
+
* @since v0.1.0
|
|
79
|
+
*/
|
|
80
|
+
export interface CapabilityInput {
|
|
81
|
+
readonly protocol?: string;
|
|
82
|
+
readonly version?: string;
|
|
83
|
+
readonly description?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @interface PricingTierInput
|
|
88
|
+
* @name PricingTierInput
|
|
89
|
+
* @description Simplified pricing tier input for the builder.
|
|
90
|
+
* Supports flat-rate, tiered, and volume-curve pricing with
|
|
91
|
+
* configurable token types and settlement modes.
|
|
92
|
+
* @category Registries
|
|
93
|
+
* @since v0.1.0
|
|
94
|
+
*/
|
|
95
|
+
export interface PricingTierInput {
|
|
96
|
+
readonly tierId: string;
|
|
97
|
+
readonly pricePerCall: number | string | BN;
|
|
98
|
+
readonly rateLimit: number;
|
|
99
|
+
readonly maxCallsPerSession?: number;
|
|
100
|
+
readonly burstLimit?: number;
|
|
101
|
+
readonly tokenType?: "sol" | "usdc" | "spl";
|
|
102
|
+
readonly tokenMint?: PublicKey;
|
|
103
|
+
readonly tokenDecimals?: number;
|
|
104
|
+
readonly settlementMode?: "instant" | "escrow" | "batched" | "x402";
|
|
105
|
+
readonly minEscrowDeposit?: number | string | BN;
|
|
106
|
+
readonly batchIntervalSec?: number;
|
|
107
|
+
readonly minPricePerCall?: number | string | BN;
|
|
108
|
+
readonly maxPricePerCall?: number | string | BN;
|
|
109
|
+
readonly volumeCurve?: Array<{ afterCalls: number; pricePerCall: number | string | BN }>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @interface ToolInput
|
|
114
|
+
* @name ToolInput
|
|
115
|
+
* @description Simplified tool input for batch registration via {@link AgentBuilder.registerWithTools}.
|
|
116
|
+
* Defines the tool’s name, protocol, schemas, HTTP method, and category.
|
|
117
|
+
* @category Registries
|
|
118
|
+
* @since v0.1.0
|
|
119
|
+
*/
|
|
120
|
+
export interface ToolInput {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly protocol: string;
|
|
123
|
+
readonly description: string;
|
|
124
|
+
readonly inputSchema: string;
|
|
125
|
+
readonly outputSchema: string;
|
|
126
|
+
readonly httpMethod?: "get" | "post" | "put" | "delete" | "compound";
|
|
127
|
+
readonly category?: keyof typeof TOOL_CATEGORY_VALUES;
|
|
128
|
+
readonly paramsCount: number;
|
|
129
|
+
readonly requiredParams: number;
|
|
130
|
+
readonly isCompound?: boolean;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @interface RegisterResult
|
|
135
|
+
* @name RegisterResult
|
|
136
|
+
* @description Result of a successful agent registration.
|
|
137
|
+
* Contains the transaction signature and derived PDA addresses.
|
|
138
|
+
* Returned by {@link AgentBuilder.register}.
|
|
139
|
+
* @category Registries
|
|
140
|
+
* @since v0.1.0
|
|
141
|
+
*/
|
|
142
|
+
export interface RegisterResult {
|
|
143
|
+
/** Transaction signature for agent registration. */
|
|
144
|
+
readonly txSignature: TransactionSignature;
|
|
145
|
+
/** Derived agent PDA. */
|
|
146
|
+
readonly agentPda: PublicKey;
|
|
147
|
+
/** Derived agent stats PDA. */
|
|
148
|
+
readonly statsPda: PublicKey;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @interface RegisterWithToolsResult
|
|
153
|
+
* @name RegisterWithToolsResult
|
|
154
|
+
* @description Result of agent + tools registration.
|
|
155
|
+
* Extends {@link RegisterResult} with tool publication transaction signatures.
|
|
156
|
+
* Returned by {@link AgentBuilder.registerWithTools}.
|
|
157
|
+
* @category Registries
|
|
158
|
+
* @since v0.1.0
|
|
159
|
+
*/
|
|
160
|
+
export interface RegisterWithToolsResult extends RegisterResult {
|
|
161
|
+
/** Transaction signatures for tool publications. */
|
|
162
|
+
readonly toolSignatures: Array<{
|
|
163
|
+
readonly name: string;
|
|
164
|
+
readonly txSignature: TransactionSignature;
|
|
165
|
+
}>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
169
|
+
// Agent Builder
|
|
170
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @name AgentBuilder
|
|
174
|
+
* @description Fluent builder for registering a fully-configured agent on-chain.
|
|
175
|
+
*
|
|
176
|
+
* Chains identity setters, capability/pricing/protocol adders, and tool
|
|
177
|
+
* definitions into a single validated registration flow. Validates all
|
|
178
|
+
* inputs against on-chain limits before sending transactions.
|
|
179
|
+
*
|
|
180
|
+
* @category Registries
|
|
181
|
+
* @since v0.1.0
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* const result = await client.builder
|
|
186
|
+
* .agent("SwapBot")
|
|
187
|
+
* .description("AI-powered Jupiter swap agent")
|
|
188
|
+
* .x402Endpoint("https://swapbot.example.com/x402")
|
|
189
|
+
* .addCapability("jupiter:swap", { protocol: "jupiter", version: "6.0" })
|
|
190
|
+
* .addPricingTier({ tierId: "standard", pricePerCall: 1000, rateLimit: 60 })
|
|
191
|
+
* .register();
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
export class AgentBuilder {
|
|
195
|
+
private readonly wallet: PublicKey;
|
|
196
|
+
private _name = "";
|
|
197
|
+
private _description = "";
|
|
198
|
+
private _agentId: string | null = null;
|
|
199
|
+
private _agentUri: string | null = null;
|
|
200
|
+
private _x402Endpoint: string | null = null;
|
|
201
|
+
private _capabilities: Capability[] = [];
|
|
202
|
+
private _pricing: PricingTier[] = [];
|
|
203
|
+
private _protocols: string[] = [];
|
|
204
|
+
private _tools: ToolInput[] = [];
|
|
205
|
+
|
|
206
|
+
constructor(private readonly program: SapProgram) {
|
|
207
|
+
this.wallet = (program.provider as AnchorProvider).wallet.publicKey;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ── Fluent Setters ───────────────────────────────────
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @name agent
|
|
214
|
+
* @description Set the agent display name.
|
|
215
|
+
* @param name - Display name (max 64 characters).
|
|
216
|
+
* @returns `this` for chaining.
|
|
217
|
+
* @since v0.1.0
|
|
218
|
+
*/
|
|
219
|
+
agent(name: string): this {
|
|
220
|
+
assert(name.length <= LIMITS.MAX_NAME_LEN, `Name exceeds ${LIMITS.MAX_NAME_LEN} chars`);
|
|
221
|
+
this._name = name;
|
|
222
|
+
return this;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @name description
|
|
227
|
+
* @description Set the agent description.
|
|
228
|
+
* @param desc - Description text (max 256 characters).
|
|
229
|
+
* @returns `this` for chaining.
|
|
230
|
+
* @since v0.1.0
|
|
231
|
+
*/
|
|
232
|
+
description(desc: string): this {
|
|
233
|
+
assert(desc.length <= LIMITS.MAX_DESC_LEN, `Description exceeds ${LIMITS.MAX_DESC_LEN} chars`);
|
|
234
|
+
this._description = desc;
|
|
235
|
+
return this;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @name agentId
|
|
240
|
+
* @description Set a DID-style agent identifier.
|
|
241
|
+
* @param id - Agent identifier string.
|
|
242
|
+
* @returns `this` for chaining.
|
|
243
|
+
* @since v0.1.0
|
|
244
|
+
*/
|
|
245
|
+
agentId(id: string): this {
|
|
246
|
+
assert(id.length <= LIMITS.MAX_AGENT_ID_LEN, `Agent ID exceeds ${LIMITS.MAX_AGENT_ID_LEN} chars`);
|
|
247
|
+
this._agentId = id;
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @name agentUri
|
|
253
|
+
* @description Set an agent metadata URI.
|
|
254
|
+
* @param uri - Metadata URI string.
|
|
255
|
+
* @returns `this` for chaining.
|
|
256
|
+
* @since v0.1.0
|
|
257
|
+
*/
|
|
258
|
+
agentUri(uri: string): this {
|
|
259
|
+
assert(uri.length <= LIMITS.MAX_URI_LEN, `URI exceeds ${LIMITS.MAX_URI_LEN} chars`);
|
|
260
|
+
this._agentUri = uri;
|
|
261
|
+
return this;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @name x402Endpoint
|
|
266
|
+
* @description Set the x402 payment endpoint URL.
|
|
267
|
+
* @param url - The x402 endpoint URL for the agent.
|
|
268
|
+
* @returns `this` for chaining.
|
|
269
|
+
* @since v0.1.0
|
|
270
|
+
*/
|
|
271
|
+
x402Endpoint(url: string): this {
|
|
272
|
+
assert(url.length <= LIMITS.MAX_URI_LEN, `x402 endpoint exceeds ${LIMITS.MAX_URI_LEN} chars`);
|
|
273
|
+
this._x402Endpoint = url;
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @name addCapability
|
|
279
|
+
* @description Add a capability to the agent.
|
|
280
|
+
*
|
|
281
|
+
* @param id - Capability identifier string (e.g. `"jupiter:swap"`).
|
|
282
|
+
* @param opts - Optional capability metadata.
|
|
283
|
+
* @param opts.protocol - Protocol the capability belongs to.
|
|
284
|
+
* @param opts.version - Capability version string.
|
|
285
|
+
* @param opts.description - Human-readable capability description.
|
|
286
|
+
* @returns `this` for chaining.
|
|
287
|
+
* @since v0.1.0
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* builder.addCapability("jupiter:swap", { protocol: "jupiter", version: "6.0" })
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
addCapability(id: string, opts?: CapabilityInput): this {
|
|
295
|
+
assert(
|
|
296
|
+
this._capabilities.length < LIMITS.MAX_CAPABILITIES,
|
|
297
|
+
`Max ${LIMITS.MAX_CAPABILITIES} capabilities`,
|
|
298
|
+
);
|
|
299
|
+
this._capabilities.push({
|
|
300
|
+
id,
|
|
301
|
+
description: opts?.description ?? null,
|
|
302
|
+
protocolId: opts?.protocol ?? null,
|
|
303
|
+
version: opts?.version ?? null,
|
|
304
|
+
});
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @name addPricingTier
|
|
310
|
+
* @description Add a pricing tier for the agent's services.
|
|
311
|
+
* Supports flat-rate, volume-curve, and configurable settlement modes.
|
|
312
|
+
*
|
|
313
|
+
* @param input - Pricing tier configuration.
|
|
314
|
+
* @returns `this` for chaining.
|
|
315
|
+
* @since v0.1.0
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```ts
|
|
319
|
+
* builder.addPricingTier({
|
|
320
|
+
* tierId: "standard",
|
|
321
|
+
* pricePerCall: 1000,
|
|
322
|
+
* rateLimit: 60,
|
|
323
|
+
* tokenType: "sol",
|
|
324
|
+
* settlementMode: "x402",
|
|
325
|
+
* })
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
addPricingTier(input: PricingTierInput): this {
|
|
329
|
+
assert(
|
|
330
|
+
this._pricing.length < LIMITS.MAX_PRICING_TIERS,
|
|
331
|
+
`Max ${LIMITS.MAX_PRICING_TIERS} pricing tiers`,
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
const tokenType = this.resolveTokenType(input.tokenType ?? "sol");
|
|
335
|
+
const settlementMode = input.settlementMode
|
|
336
|
+
? this.resolveSettlementMode(input.settlementMode)
|
|
337
|
+
: null;
|
|
338
|
+
const volumeCurve: VolumeCurveBreakpoint[] | null = input.volumeCurve
|
|
339
|
+
? input.volumeCurve.map((v) => ({
|
|
340
|
+
afterCalls: v.afterCalls,
|
|
341
|
+
pricePerCall: new BN(v.pricePerCall.toString()),
|
|
342
|
+
}))
|
|
343
|
+
: null;
|
|
344
|
+
|
|
345
|
+
this._pricing.push({
|
|
346
|
+
tierId: input.tierId,
|
|
347
|
+
pricePerCall: new BN(input.pricePerCall.toString()),
|
|
348
|
+
minPricePerCall: input.minPricePerCall
|
|
349
|
+
? new BN(input.minPricePerCall.toString())
|
|
350
|
+
: null,
|
|
351
|
+
maxPricePerCall: input.maxPricePerCall
|
|
352
|
+
? new BN(input.maxPricePerCall.toString())
|
|
353
|
+
: null,
|
|
354
|
+
rateLimit: input.rateLimit,
|
|
355
|
+
maxCallsPerSession: input.maxCallsPerSession ?? 0,
|
|
356
|
+
burstLimit: input.burstLimit ?? null,
|
|
357
|
+
tokenType,
|
|
358
|
+
tokenMint: input.tokenMint ?? null,
|
|
359
|
+
tokenDecimals: input.tokenDecimals ?? null,
|
|
360
|
+
settlementMode,
|
|
361
|
+
minEscrowDeposit: input.minEscrowDeposit
|
|
362
|
+
? new BN(input.minEscrowDeposit.toString())
|
|
363
|
+
: null,
|
|
364
|
+
batchIntervalSec: input.batchIntervalSec ?? null,
|
|
365
|
+
volumeCurve,
|
|
366
|
+
});
|
|
367
|
+
return this;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* @name addProtocol
|
|
372
|
+
* @description Add a protocol the agent supports.
|
|
373
|
+
* Duplicates are silently ignored.
|
|
374
|
+
*
|
|
375
|
+
* @param protocolId - Protocol identifier string (e.g. `"jupiter"`).
|
|
376
|
+
* @returns `this` for chaining.
|
|
377
|
+
* @since v0.1.0
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```ts
|
|
381
|
+
* builder.addProtocol("jupiter")
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
addProtocol(protocolId: string): this {
|
|
385
|
+
assert(
|
|
386
|
+
this._protocols.length < LIMITS.MAX_PROTOCOLS,
|
|
387
|
+
`Max ${LIMITS.MAX_PROTOCOLS} protocols`,
|
|
388
|
+
);
|
|
389
|
+
if (!this._protocols.includes(protocolId)) {
|
|
390
|
+
this._protocols.push(protocolId);
|
|
391
|
+
}
|
|
392
|
+
return this;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @name addTool
|
|
397
|
+
* @description Add a tool to be published after registration.
|
|
398
|
+
* Only used with {@link AgentBuilder.registerWithTools}.
|
|
399
|
+
*
|
|
400
|
+
* @param tool - Tool configuration.
|
|
401
|
+
* @returns `this` for chaining.
|
|
402
|
+
* @since v0.1.0
|
|
403
|
+
*/
|
|
404
|
+
addTool(tool: ToolInput): this {
|
|
405
|
+
this._tools.push(tool);
|
|
406
|
+
return this;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// ── Registration ─────────────────────────────────────
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @name register
|
|
413
|
+
* @description Register the agent on-chain.
|
|
414
|
+
* Validates all inputs before sending the transaction.
|
|
415
|
+
*
|
|
416
|
+
* @returns A {@link RegisterResult} with the transaction signature and derived PDAs.
|
|
417
|
+
* @throws If validation fails (missing name, description, or limit exceeded).
|
|
418
|
+
* @since v0.1.0
|
|
419
|
+
*/
|
|
420
|
+
async register(): Promise<RegisterResult> {
|
|
421
|
+
this.validate();
|
|
422
|
+
|
|
423
|
+
const [agentPda] = deriveAgent(this.wallet);
|
|
424
|
+
const [statsPda] = deriveAgentStats(agentPda);
|
|
425
|
+
const [globalPda] = deriveGlobalRegistry();
|
|
426
|
+
|
|
427
|
+
const txSignature = await this.methods
|
|
428
|
+
.registerAgent(
|
|
429
|
+
this._name,
|
|
430
|
+
this._description,
|
|
431
|
+
this._capabilities,
|
|
432
|
+
this._pricing,
|
|
433
|
+
this._protocols,
|
|
434
|
+
this._agentId,
|
|
435
|
+
this._agentUri,
|
|
436
|
+
this._x402Endpoint,
|
|
437
|
+
)
|
|
438
|
+
.accounts({
|
|
439
|
+
wallet: this.wallet,
|
|
440
|
+
agent: agentPda,
|
|
441
|
+
agentStats: statsPda,
|
|
442
|
+
globalRegistry: globalPda,
|
|
443
|
+
systemProgram: SystemProgram.programId,
|
|
444
|
+
})
|
|
445
|
+
.rpc();
|
|
446
|
+
|
|
447
|
+
return { txSignature, agentPda, statsPda };
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @name registerWithTools
|
|
452
|
+
* @description Register the agent AND publish all configured tools.
|
|
453
|
+
* Sends agent registration first, then tool publications sequentially.
|
|
454
|
+
*
|
|
455
|
+
* @returns A {@link RegisterWithToolsResult} with agent and tool transaction signatures.
|
|
456
|
+
* @throws If validation fails or any tool publication fails.
|
|
457
|
+
* @since v0.1.0
|
|
458
|
+
*/
|
|
459
|
+
async registerWithTools(): Promise<RegisterWithToolsResult> {
|
|
460
|
+
const result = await this.register();
|
|
461
|
+
const toolSignatures: Array<{
|
|
462
|
+
name: string;
|
|
463
|
+
txSignature: TransactionSignature;
|
|
464
|
+
}> = [];
|
|
465
|
+
|
|
466
|
+
const [globalPda] = deriveGlobalRegistry();
|
|
467
|
+
|
|
468
|
+
for (const tool of this._tools) {
|
|
469
|
+
const toolNameHash = hashToArray(sha256(tool.name));
|
|
470
|
+
const [toolPda] = deriveTool(result.agentPda, new Uint8Array(toolNameHash));
|
|
471
|
+
|
|
472
|
+
const httpMethod =
|
|
473
|
+
HTTP_METHOD_VALUES[(tool.httpMethod ?? "post") as keyof typeof HTTP_METHOD_VALUES] ?? 1;
|
|
474
|
+
const category =
|
|
475
|
+
TOOL_CATEGORY_VALUES[(tool.category ?? "Custom") as keyof typeof TOOL_CATEGORY_VALUES] ?? 9;
|
|
476
|
+
|
|
477
|
+
const txSignature = await this.methods
|
|
478
|
+
.publishTool(
|
|
479
|
+
tool.name,
|
|
480
|
+
toolNameHash,
|
|
481
|
+
hashToArray(sha256(tool.protocol)),
|
|
482
|
+
hashToArray(sha256(tool.description)),
|
|
483
|
+
hashToArray(sha256(tool.inputSchema)),
|
|
484
|
+
hashToArray(sha256(tool.outputSchema)),
|
|
485
|
+
httpMethod,
|
|
486
|
+
category,
|
|
487
|
+
tool.paramsCount,
|
|
488
|
+
tool.requiredParams,
|
|
489
|
+
tool.isCompound ?? false,
|
|
490
|
+
)
|
|
491
|
+
.accounts({
|
|
492
|
+
wallet: this.wallet,
|
|
493
|
+
agent: result.agentPda,
|
|
494
|
+
tool: toolPda,
|
|
495
|
+
globalRegistry: globalPda,
|
|
496
|
+
systemProgram: SystemProgram.programId,
|
|
497
|
+
})
|
|
498
|
+
.rpc();
|
|
499
|
+
|
|
500
|
+
toolSignatures.push({ name: tool.name, txSignature });
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return { ...result, toolSignatures };
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// ── Reset ────────────────────────────────────────────
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* @name reset
|
|
510
|
+
* @description Reset the builder to its initial state.
|
|
511
|
+
* Clears all configured values so the builder can be reused.
|
|
512
|
+
*
|
|
513
|
+
* @returns `this` for chaining.
|
|
514
|
+
* @since v0.1.0
|
|
515
|
+
*/
|
|
516
|
+
reset(): this {
|
|
517
|
+
this._name = "";
|
|
518
|
+
this._description = "";
|
|
519
|
+
this._agentId = null;
|
|
520
|
+
this._agentUri = null;
|
|
521
|
+
this._x402Endpoint = null;
|
|
522
|
+
this._capabilities = [];
|
|
523
|
+
this._pricing = [];
|
|
524
|
+
this._protocols = [];
|
|
525
|
+
this._tools = [];
|
|
526
|
+
return this;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// ── Validation ───────────────────────────────────────
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* @name validate
|
|
533
|
+
* @description Validate all builder inputs against on-chain limits.
|
|
534
|
+
* @throws If any required field is missing or any limit is exceeded.
|
|
535
|
+
* @private
|
|
536
|
+
*/
|
|
537
|
+
private validate(): void {
|
|
538
|
+
assert(this._name.length > 0, "Agent name is required");
|
|
539
|
+
assert(this._description.length > 0, "Agent description is required");
|
|
540
|
+
assert(
|
|
541
|
+
this._capabilities.length <= LIMITS.MAX_CAPABILITIES,
|
|
542
|
+
`Max ${LIMITS.MAX_CAPABILITIES} capabilities`,
|
|
543
|
+
);
|
|
544
|
+
assert(
|
|
545
|
+
this._pricing.length <= LIMITS.MAX_PRICING_TIERS,
|
|
546
|
+
`Max ${LIMITS.MAX_PRICING_TIERS} pricing tiers`,
|
|
547
|
+
);
|
|
548
|
+
assert(
|
|
549
|
+
this._protocols.length <= LIMITS.MAX_PROTOCOLS,
|
|
550
|
+
`Max ${LIMITS.MAX_PROTOCOLS} protocols`,
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// ── Helpers ──────────────────────────────────────────
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @name resolveTokenType
|
|
558
|
+
* @description Resolve a token type string to the on-chain enum variant.
|
|
559
|
+
* @param t - Token type string (`"sol"`, `"usdc"`, or `"spl"`).
|
|
560
|
+
* @returns The corresponding {@link TokenTypeKind} enum value.
|
|
561
|
+
* @private
|
|
562
|
+
*/
|
|
563
|
+
private resolveTokenType(t: "sol" | "usdc" | "spl"): TokenTypeKind {
|
|
564
|
+
switch (t) {
|
|
565
|
+
case "sol":
|
|
566
|
+
return TokenType.Sol;
|
|
567
|
+
case "usdc":
|
|
568
|
+
return TokenType.Usdc;
|
|
569
|
+
case "spl":
|
|
570
|
+
return TokenType.Spl;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @name resolveSettlementMode
|
|
576
|
+
* @description Resolve a settlement mode string to the on-chain enum variant.
|
|
577
|
+
* @param m - Settlement mode string (`"instant"`, `"escrow"`, `"batched"`, or `"x402"`).
|
|
578
|
+
* @returns The corresponding {@link SettlementModeKind} enum value.
|
|
579
|
+
* @private
|
|
580
|
+
*/
|
|
581
|
+
private resolveSettlementMode(
|
|
582
|
+
m: "instant" | "escrow" | "batched" | "x402",
|
|
583
|
+
): SettlementModeKind {
|
|
584
|
+
switch (m) {
|
|
585
|
+
case "instant":
|
|
586
|
+
return SettlementMode.Instant;
|
|
587
|
+
case "escrow":
|
|
588
|
+
return SettlementMode.Escrow;
|
|
589
|
+
case "batched":
|
|
590
|
+
return SettlementMode.Batched;
|
|
591
|
+
case "x402":
|
|
592
|
+
return SettlementMode.X402;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @name methods
|
|
598
|
+
* @description Accessor for the Anchor program methods namespace.
|
|
599
|
+
* @returns The program methods object for building RPC calls.
|
|
600
|
+
* @private
|
|
601
|
+
*/
|
|
602
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
603
|
+
private get methods(): any {
|
|
604
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
605
|
+
return this.program.methods;
|
|
606
|
+
}
|
|
607
|
+
}
|