@hsuite/smart-engines-sdk 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +116 -0
- package/README.md +51 -0
- package/dist/index.d.ts +19710 -9
- package/dist/index.js +1388 -94
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +7487 -2
- package/dist/nestjs/index.js +303 -5227
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -5479,29 +5479,6 @@ zod.z.object({
|
|
|
5479
5479
|
blockTime: zod.z.number().optional(),
|
|
5480
5480
|
rpcEndpoint: zod.z.string().url().optional()
|
|
5481
5481
|
});
|
|
5482
|
-
var NetworkMembershipTypeSchema = zod.z.enum(["validator", "host", "gateway"]);
|
|
5483
|
-
var MembershipStatusSchema = zod.z.enum(["pending", "active", "exiting", "exited", "banned"]);
|
|
5484
|
-
zod.z.object({
|
|
5485
|
-
nodeId: zod.z.string().min(1),
|
|
5486
|
-
networkType: NetworkMembershipTypeSchema,
|
|
5487
|
-
chain: zod.z.enum(["hedera", "xrpl", "polkadot", "solana"]),
|
|
5488
|
-
endpoint: zod.z.string().url(),
|
|
5489
|
-
publicKey: zod.z.string().min(1),
|
|
5490
|
-
joinedAt: zod.z.string().datetime(),
|
|
5491
|
-
depositTxId: zod.z.string().min(1),
|
|
5492
|
-
status: MembershipStatusSchema,
|
|
5493
|
-
networkConfig: zod.z.record(zod.z.unknown()).optional()
|
|
5494
|
-
});
|
|
5495
|
-
var NetworkDepositRequirementsSchema = zod.z.object({
|
|
5496
|
-
depositAmount: zod.z.string().min(1),
|
|
5497
|
-
lockDurationDays: zod.z.number().int().positive(),
|
|
5498
|
-
renewalWindowDays: zod.z.number().int().positive().optional()
|
|
5499
|
-
});
|
|
5500
|
-
zod.z.object({
|
|
5501
|
-
validator: NetworkDepositRequirementsSchema,
|
|
5502
|
-
host: NetworkDepositRequirementsSchema,
|
|
5503
|
-
gateway: NetworkDepositRequirementsSchema
|
|
5504
|
-
});
|
|
5505
5482
|
var TokenCapabilitiesSchema = zod.z.object({
|
|
5506
5483
|
/**
|
|
5507
5484
|
* Pause all token operations globally
|
|
@@ -5666,74 +5643,6 @@ var PreparedTransactionSovereigntySchema = zod.z.discriminatedUnion("mode", [
|
|
|
5666
5643
|
authorizationSet: PreparedTransactionAuthorizationSetSchema.optional()
|
|
5667
5644
|
})
|
|
5668
5645
|
]);
|
|
5669
|
-
var TransactionStatusSchema = zod.z.enum(["pending", "success", "failed", "expired"]);
|
|
5670
|
-
var TransactionTypeSchema = zod.z.enum([
|
|
5671
|
-
"transfer",
|
|
5672
|
-
"token_transfer",
|
|
5673
|
-
"account_create",
|
|
5674
|
-
"token_create",
|
|
5675
|
-
"token_mint",
|
|
5676
|
-
"token_burn",
|
|
5677
|
-
"contract_call",
|
|
5678
|
-
"contract_create",
|
|
5679
|
-
"topic_message",
|
|
5680
|
-
"other"
|
|
5681
|
-
]);
|
|
5682
|
-
zod.z.object({
|
|
5683
|
-
id: zod.z.string(),
|
|
5684
|
-
chain: ChainTypeSchema,
|
|
5685
|
-
type: TransactionTypeSchema,
|
|
5686
|
-
status: TransactionStatusSchema,
|
|
5687
|
-
timestamp: zod.z.date(),
|
|
5688
|
-
from: AccountIdSchema,
|
|
5689
|
-
to: AccountIdSchema.optional(),
|
|
5690
|
-
amount: zod.z.string().optional(),
|
|
5691
|
-
fee: zod.z.string(),
|
|
5692
|
-
memo: zod.z.string().optional(),
|
|
5693
|
-
metadata: zod.z.record(zod.z.any()).optional()
|
|
5694
|
-
});
|
|
5695
|
-
zod.z.object({
|
|
5696
|
-
transactionId: zod.z.string(),
|
|
5697
|
-
chain: ChainTypeSchema,
|
|
5698
|
-
status: TransactionStatusSchema,
|
|
5699
|
-
blockNumber: zod.z.number().optional(),
|
|
5700
|
-
blockHash: zod.z.string().optional(),
|
|
5701
|
-
timestamp: zod.z.date(),
|
|
5702
|
-
gasUsed: zod.z.string().optional(),
|
|
5703
|
-
effectiveFee: zod.z.string(),
|
|
5704
|
-
logs: zod.z.array(zod.z.any()).optional(),
|
|
5705
|
-
metadata: zod.z.record(zod.z.any()).optional()
|
|
5706
|
-
});
|
|
5707
|
-
var TokenTypeSchema = zod.z.enum(["fungible", "nft", "semi_fungible"]);
|
|
5708
|
-
var TokenSchema = zod.z.object({
|
|
5709
|
-
tokenId: zod.z.string(),
|
|
5710
|
-
chain: ChainTypeSchema,
|
|
5711
|
-
name: zod.z.string(),
|
|
5712
|
-
symbol: zod.z.string(),
|
|
5713
|
-
decimals: zod.z.number().int().min(0),
|
|
5714
|
-
totalSupply: zod.z.string(),
|
|
5715
|
-
type: TokenTypeSchema,
|
|
5716
|
-
creator: AccountIdSchema.optional(),
|
|
5717
|
-
metadata: zod.z.record(zod.z.any()).optional(),
|
|
5718
|
-
createdAt: zod.z.date().optional()
|
|
5719
|
-
});
|
|
5720
|
-
zod.z.object({
|
|
5721
|
-
name: zod.z.string(),
|
|
5722
|
-
description: zod.z.string().optional(),
|
|
5723
|
-
image: zod.z.string().url().optional(),
|
|
5724
|
-
attributes: zod.z.array(
|
|
5725
|
-
zod.z.object({
|
|
5726
|
-
trait_type: zod.z.string(),
|
|
5727
|
-
value: zod.z.union([zod.z.string(), zod.z.number(), zod.z.boolean()])
|
|
5728
|
-
})
|
|
5729
|
-
).optional(),
|
|
5730
|
-
external_url: zod.z.string().url().optional()
|
|
5731
|
-
});
|
|
5732
|
-
TokenSchema.extend({
|
|
5733
|
-
holders: zod.z.number().optional(),
|
|
5734
|
-
transferCount: zod.z.number().optional(),
|
|
5735
|
-
circulatingSupply: zod.z.string().optional()
|
|
5736
|
-
});
|
|
5737
5646
|
var CreateAccountRequestSchema = zod.z.object({
|
|
5738
5647
|
chain: ChainTypeSchema,
|
|
5739
5648
|
initialBalance: zod.z.string(),
|
|
@@ -7070,6 +6979,35 @@ function isRuleRejected(err) {
|
|
|
7070
6979
|
return obj.ruleAtoms.every((a) => typeof a === "string");
|
|
7071
6980
|
}
|
|
7072
6981
|
|
|
6982
|
+
// src/network-presets.ts
|
|
6983
|
+
var KNOWN_NETWORKS = {
|
|
6984
|
+
testnet: {
|
|
6985
|
+
bootstrap: ["https://gateway.testnet.hsuite.network"]
|
|
6986
|
+
},
|
|
6987
|
+
mainnet: {
|
|
6988
|
+
// Mainnet entrypoint reserved. The SDK still resolves the name so
|
|
6989
|
+
// upgrade-by-flipping-NETWORK works; the bootstrap URL is the
|
|
6990
|
+
// pre-allocated DNS we own. If mainnet isn't deployed yet, the discovery
|
|
6991
|
+
// fetch will fail at runtime with the same "no seed reachable" error
|
|
6992
|
+
// any unreachable URL produces — the caller learns the network is not
|
|
6993
|
+
// live, rather than getting a baffling "unknown network" TypeScript
|
|
6994
|
+
// error at compile time.
|
|
6995
|
+
bootstrap: ["https://gateway.hsuite.network"]
|
|
6996
|
+
}
|
|
6997
|
+
};
|
|
6998
|
+
function resolveNetwork(name) {
|
|
6999
|
+
const preset = KNOWN_NETWORKS[name];
|
|
7000
|
+
if (!preset) {
|
|
7001
|
+
throw new Error(
|
|
7002
|
+
`Unknown network: "${name}". Known networks: ${Object.keys(KNOWN_NETWORKS).join(", ")}`
|
|
7003
|
+
);
|
|
7004
|
+
}
|
|
7005
|
+
return preset;
|
|
7006
|
+
}
|
|
7007
|
+
function isKnownNetwork(name) {
|
|
7008
|
+
return Object.prototype.hasOwnProperty.call(KNOWN_NETWORKS, name);
|
|
7009
|
+
}
|
|
7010
|
+
|
|
7073
7011
|
// src/subscription/index.ts
|
|
7074
7012
|
var subscription_exports = {};
|
|
7075
7013
|
__export(subscription_exports, {
|
|
@@ -8168,7 +8106,18 @@ var SmartEngineClient = class _SmartEngineClient {
|
|
|
8168
8106
|
* 2. (Optional) HCS trust-anchor membership cross-check.
|
|
8169
8107
|
* 3. Random-pick over the verified set.
|
|
8170
8108
|
*
|
|
8171
|
-
* @example
|
|
8109
|
+
* @example Zero-config (recommended for smart-app callers)
|
|
8110
|
+
* ```ts
|
|
8111
|
+
* const { client, cluster, session } = await SmartEngineClient.connectToCluster({
|
|
8112
|
+
* network: 'testnet', // resolves canonical gateway entrypoint
|
|
8113
|
+
* chain: 'xrpl',
|
|
8114
|
+
* address: '...',
|
|
8115
|
+
* publicKey: '...',
|
|
8116
|
+
* signFn: async (challenge) => sign(challenge),
|
|
8117
|
+
* });
|
|
8118
|
+
* ```
|
|
8119
|
+
*
|
|
8120
|
+
* @example Custom seeds (private deployments / local dev)
|
|
8172
8121
|
* ```ts
|
|
8173
8122
|
* const { client, cluster, session } = await SmartEngineClient.connectToCluster({
|
|
8174
8123
|
* bootstrap: ['https://sn1.testnet.hsuite.network', 'https://sn2.testnet.hsuite.network'],
|
|
@@ -8181,8 +8130,15 @@ var SmartEngineClient = class _SmartEngineClient {
|
|
|
8181
8130
|
*/
|
|
8182
8131
|
static async connectToCluster(config) {
|
|
8183
8132
|
const allowInsecure = config.allowInsecure ?? false;
|
|
8133
|
+
const bootstrap = config.bootstrap ? [...config.bootstrap] : [...resolveNetwork(config.network).bootstrap];
|
|
8134
|
+
if (bootstrap.length === 0) {
|
|
8135
|
+
throw new SmartEngineError2(
|
|
8136
|
+
"connectToCluster requires either a non-empty `bootstrap` list or a known `network` name.",
|
|
8137
|
+
400
|
|
8138
|
+
);
|
|
8139
|
+
}
|
|
8184
8140
|
const discovery = new ClusterDiscoveryClient({
|
|
8185
|
-
bootstrap
|
|
8141
|
+
bootstrap,
|
|
8186
8142
|
allowInsecure,
|
|
8187
8143
|
trustAnchor: config.trustAnchor ? {
|
|
8188
8144
|
network: config.trustAnchor.network,
|
|
@@ -9168,8 +9124,10 @@ __export(baas_exports, {
|
|
|
9168
9124
|
BaasError: () => BaasError,
|
|
9169
9125
|
DatabaseClient: () => DatabaseClient,
|
|
9170
9126
|
DeploymentClient: () => DeploymentClient,
|
|
9127
|
+
EntitiesClient: () => EntitiesClient,
|
|
9171
9128
|
FunctionsClient: () => FunctionsClient,
|
|
9172
9129
|
MessagingClient: () => MessagingClient,
|
|
9130
|
+
RulesClient: () => RulesClient,
|
|
9173
9131
|
StorageClient: () => StorageClient,
|
|
9174
9132
|
validateAgentRules: () => validateAgentRules
|
|
9175
9133
|
});
|
|
@@ -9568,8 +9526,90 @@ var CustomerSessionClient = class {
|
|
|
9568
9526
|
}
|
|
9569
9527
|
};
|
|
9570
9528
|
|
|
9529
|
+
// src/baas/rules/client.ts
|
|
9530
|
+
var RulesClient = class {
|
|
9531
|
+
constructor(http) {
|
|
9532
|
+
this.http = http;
|
|
9533
|
+
}
|
|
9534
|
+
http;
|
|
9535
|
+
/** Publish a canonical ValidatorRules document to HCS. */
|
|
9536
|
+
async publish(rule) {
|
|
9537
|
+
return this.http.post("/api/rules/publish", rule);
|
|
9538
|
+
}
|
|
9539
|
+
/** Fetch a published rule by its HCS consensus timestamp. */
|
|
9540
|
+
async get(consensusTimestamp) {
|
|
9541
|
+
return this.http.get(`/api/rules/${encodeURIComponent(consensusTimestamp)}`);
|
|
9542
|
+
}
|
|
9543
|
+
/** List rules owned by the authenticated entity, optionally filtered by type. */
|
|
9544
|
+
async listByOwner(filter) {
|
|
9545
|
+
const path = filter?.type ? `/api/rules?type=${encodeURIComponent(filter.type)}` : "/api/rules";
|
|
9546
|
+
return this.http.get(path);
|
|
9547
|
+
}
|
|
9548
|
+
/**
|
|
9549
|
+
* Simulate cluster-side evaluation of an action against a rule. Either
|
|
9550
|
+
* `ruleRef` (published) or `rule` (inline) must be supplied by the caller.
|
|
9551
|
+
*/
|
|
9552
|
+
async simulate(params) {
|
|
9553
|
+
return this.http.post("/api/rules/simulate", params);
|
|
9554
|
+
}
|
|
9555
|
+
/** Walk the version history of a published rule. */
|
|
9556
|
+
async getVersionHistory(consensusTimestamp) {
|
|
9557
|
+
return this.http.get(
|
|
9558
|
+
`/api/rules/${encodeURIComponent(consensusTimestamp)}/versions`
|
|
9559
|
+
);
|
|
9560
|
+
}
|
|
9561
|
+
/** Deprecate a published rule (owner-only). */
|
|
9562
|
+
async deprecate(consensusTimestamp) {
|
|
9563
|
+
return this.http.post(
|
|
9564
|
+
`/api/rules/${encodeURIComponent(consensusTimestamp)}/deprecate`,
|
|
9565
|
+
{}
|
|
9566
|
+
);
|
|
9567
|
+
}
|
|
9568
|
+
};
|
|
9569
|
+
|
|
9570
|
+
// src/baas/entities/client.ts
|
|
9571
|
+
var EntitiesClient = class {
|
|
9572
|
+
constructor(http) {
|
|
9573
|
+
this.http = http;
|
|
9574
|
+
}
|
|
9575
|
+
http;
|
|
9576
|
+
/** Create a canonical token entity bound to a published rule. */
|
|
9577
|
+
async createToken(req) {
|
|
9578
|
+
return this.http.post("/api/entities/createToken", req);
|
|
9579
|
+
}
|
|
9580
|
+
/** Create a canonical account entity bound to a published rule. */
|
|
9581
|
+
async createAccount(req) {
|
|
9582
|
+
return this.http.post("/api/entities/createAccount", req);
|
|
9583
|
+
}
|
|
9584
|
+
/** Create a canonical topic entity bound to a published rule. */
|
|
9585
|
+
async createTopic(req) {
|
|
9586
|
+
return this.http.post("/api/entities/createTopic", req);
|
|
9587
|
+
}
|
|
9588
|
+
/** Create a canonical agent entity bound to a published rule. */
|
|
9589
|
+
async createAgent(req) {
|
|
9590
|
+
return this.http.post("/api/entities/createAgent", req);
|
|
9591
|
+
}
|
|
9592
|
+
/**
|
|
9593
|
+
* Mega-helper: build a token rule with a launchpad ModuleEntry attached,
|
|
9594
|
+
* publish it, create the token, and return the combined result in one HTTP
|
|
9595
|
+
* round-trip.
|
|
9596
|
+
*/
|
|
9597
|
+
async launchpad(req) {
|
|
9598
|
+
return this.http.post("/api/entities/launchpad", req);
|
|
9599
|
+
}
|
|
9600
|
+
/** Fetch an entity by its canonical `entityId`. */
|
|
9601
|
+
async get(entityId) {
|
|
9602
|
+
return this.http.get(`/api/entities/${encodeURIComponent(entityId)}`);
|
|
9603
|
+
}
|
|
9604
|
+
/** List entities owned by the authenticated wallet, optionally filtered by type. */
|
|
9605
|
+
async listByOwner(filter) {
|
|
9606
|
+
const path = filter?.type ? `/api/entities?type=${encodeURIComponent(filter.type)}` : "/api/entities";
|
|
9607
|
+
return this.http.get(path);
|
|
9608
|
+
}
|
|
9609
|
+
};
|
|
9610
|
+
|
|
9571
9611
|
// src/baas/client.ts
|
|
9572
|
-
var BaasClient = class {
|
|
9612
|
+
var BaasClient = class _BaasClient {
|
|
9573
9613
|
hostUrl;
|
|
9574
9614
|
pathPrefix;
|
|
9575
9615
|
appId;
|
|
@@ -9594,6 +9634,10 @@ var BaasClient = class {
|
|
|
9594
9634
|
agents;
|
|
9595
9635
|
/** Customer→smart-app session bridge (TokenGate Face B). */
|
|
9596
9636
|
customerSession;
|
|
9637
|
+
/** Canonical validator-rules authoring surface (publish/get/list/simulate). */
|
|
9638
|
+
rules;
|
|
9639
|
+
/** Canonical entity authoring surface (token/account/topic/agent + launchpad). */
|
|
9640
|
+
entities;
|
|
9597
9641
|
constructor(config) {
|
|
9598
9642
|
this.allowInsecure = config.allowInsecure ?? false;
|
|
9599
9643
|
this.hostUrl = validateUrl2(config.hostUrl, this.allowInsecure);
|
|
@@ -9614,6 +9658,84 @@ var BaasClient = class {
|
|
|
9614
9658
|
this.deployment = new DeploymentClient(this.http);
|
|
9615
9659
|
this.agents = new AgentsClient(this.http);
|
|
9616
9660
|
this.customerSession = new CustomerSessionClient(baseUrlWithPrefix, this.timeout);
|
|
9661
|
+
this.rules = new RulesClient(this.http);
|
|
9662
|
+
this.entities = new EntitiesClient(this.http);
|
|
9663
|
+
}
|
|
9664
|
+
/**
|
|
9665
|
+
* Connect to the Smart Engines BaaS via cluster auto-discovery.
|
|
9666
|
+
*
|
|
9667
|
+
* Zero-config entrypoint flow:
|
|
9668
|
+
*
|
|
9669
|
+
* 1. Resolves the bootstrap seed list:
|
|
9670
|
+
* - `network: 'testnet' | 'mainnet'` → canonical Cloudflare-fronted
|
|
9671
|
+
* gateway via {@link KNOWN_NETWORKS}.
|
|
9672
|
+
* - `bootstrap: string[]` → explicit seed list (private deployments).
|
|
9673
|
+
* 2. Fetches `GET /api/v3/discovery/clusters` from the first reachable
|
|
9674
|
+
* seed; the response carries every active cluster's gateway URL.
|
|
9675
|
+
* 3. Random-picks one active cluster.
|
|
9676
|
+
* 4. Returns a `BaasClient` pointed at that cluster's gatewayUrl, with
|
|
9677
|
+
* `pathPrefix: '/host'` so all BaaS sub-clients (db / storage /
|
|
9678
|
+
* functions / messaging / agents / rules / entities) route through
|
|
9679
|
+
* the gateway's `/host/*` rewrite.
|
|
9680
|
+
*
|
|
9681
|
+
* @example Zero-config (recommended)
|
|
9682
|
+
* ```ts
|
|
9683
|
+
* const baas = await BaasClient.connectToCluster({
|
|
9684
|
+
* network: 'testnet',
|
|
9685
|
+
* appId: 'app_abc',
|
|
9686
|
+
* });
|
|
9687
|
+
*
|
|
9688
|
+
* await baas.db.insert('users', { name: 'Alice' });
|
|
9689
|
+
* ```
|
|
9690
|
+
*
|
|
9691
|
+
* @example Custom seeds (private deployments)
|
|
9692
|
+
* ```ts
|
|
9693
|
+
* const baas = await BaasClient.connectToCluster({
|
|
9694
|
+
* bootstrap: ['https://gateway.my-private-net.example'],
|
|
9695
|
+
* appId: 'app_abc',
|
|
9696
|
+
* });
|
|
9697
|
+
* ```
|
|
9698
|
+
*
|
|
9699
|
+
* @throws {BaasError} `503` when no cluster is reachable via any seed.
|
|
9700
|
+
* @throws {BaasError} `400` when bootstrap resolution yields an empty list
|
|
9701
|
+
* (only possible when the caller passes an empty array explicitly).
|
|
9702
|
+
*/
|
|
9703
|
+
static async connectToCluster(config) {
|
|
9704
|
+
const allowInsecure = config.allowInsecure ?? false;
|
|
9705
|
+
const bootstrap = config.bootstrap ? [...config.bootstrap] : [...resolveNetwork(config.network).bootstrap];
|
|
9706
|
+
if (bootstrap.length === 0) {
|
|
9707
|
+
throw new BaasError(
|
|
9708
|
+
"connectToCluster requires either a non-empty `bootstrap` list or a known `network` name.",
|
|
9709
|
+
400
|
|
9710
|
+
);
|
|
9711
|
+
}
|
|
9712
|
+
const discovery = new ClusterDiscoveryClient({
|
|
9713
|
+
bootstrap,
|
|
9714
|
+
allowInsecure,
|
|
9715
|
+
trustAnchor: config.trustAnchor ? {
|
|
9716
|
+
network: config.trustAnchor.network,
|
|
9717
|
+
registryTopicId: config.trustAnchor.registryTopicId,
|
|
9718
|
+
mirrorNodeUrl: config.trustAnchor.mirrorNodeUrl,
|
|
9719
|
+
allowInsecure
|
|
9720
|
+
} : void 0
|
|
9721
|
+
});
|
|
9722
|
+
const cluster = await discovery.getRandomCluster();
|
|
9723
|
+
if (!cluster) {
|
|
9724
|
+
throw new BaasError(
|
|
9725
|
+
"No active clusters available via bootstrap seeds. Check network reachability or bootstrap URLs.",
|
|
9726
|
+
503
|
|
9727
|
+
);
|
|
9728
|
+
}
|
|
9729
|
+
return new _BaasClient({
|
|
9730
|
+
hostUrl: cluster.endpoints.gatewayUrl,
|
|
9731
|
+
appId: config.appId,
|
|
9732
|
+
appName: config.appName,
|
|
9733
|
+
timeout: config.timeout,
|
|
9734
|
+
allowInsecure,
|
|
9735
|
+
// BaaS traffic is gateway-routed at `/host/*` by default. Callers
|
|
9736
|
+
// pointing at a bare host can override with `pathPrefix: ''`.
|
|
9737
|
+
pathPrefix: config.pathPrefix ?? "/host"
|
|
9738
|
+
});
|
|
9617
9739
|
}
|
|
9618
9740
|
/** Set the app ID (for newly registered apps) */
|
|
9619
9741
|
setAppId(appId) {
|
|
@@ -9627,6 +9749,16 @@ var BaasClient = class {
|
|
|
9627
9749
|
getAppId() {
|
|
9628
9750
|
return this.appId;
|
|
9629
9751
|
}
|
|
9752
|
+
/**
|
|
9753
|
+
* Get the configured host URL. After
|
|
9754
|
+
* {@link BaasClient.connectToCluster} this is the gateway URL of the
|
|
9755
|
+
* cluster the SDK landed on after random-pick — useful for logging,
|
|
9756
|
+
* "behind the curtain" UIs, or debugging which cluster is serving a
|
|
9757
|
+
* given request.
|
|
9758
|
+
*/
|
|
9759
|
+
getHostUrl() {
|
|
9760
|
+
return this.hostUrl;
|
|
9761
|
+
}
|
|
9630
9762
|
/**
|
|
9631
9763
|
* Get HTTP resilience health information
|
|
9632
9764
|
* @returns Object with circuit breaker state and last error (if any)
|
|
@@ -9935,6 +10067,1088 @@ async function verifyPqcAttestation(cert, payload, registrySnapshot) {
|
|
|
9935
10067
|
thresholdMet: true
|
|
9936
10068
|
};
|
|
9937
10069
|
}
|
|
10070
|
+
|
|
10071
|
+
// src/rules/builders/base-builder.ts
|
|
10072
|
+
var RuleBuildError = class extends Error {
|
|
10073
|
+
errors;
|
|
10074
|
+
constructor(message, errors) {
|
|
10075
|
+
super(message);
|
|
10076
|
+
this.name = "RuleBuildError";
|
|
10077
|
+
this.errors = errors;
|
|
10078
|
+
}
|
|
10079
|
+
};
|
|
10080
|
+
var BaseRuleBuilder = class {
|
|
10081
|
+
state;
|
|
10082
|
+
constructor(type, initial) {
|
|
10083
|
+
this.state = initial ?? {};
|
|
10084
|
+
this.state.version = "3.0";
|
|
10085
|
+
this.state.type = type;
|
|
10086
|
+
this.state.created = (/* @__PURE__ */ new Date()).toISOString();
|
|
10087
|
+
if (!this.state.defaultSecurity) this.state.defaultSecurity = "full";
|
|
10088
|
+
if (!this.state.defaultController) this.state.defaultController = "owner";
|
|
10089
|
+
}
|
|
10090
|
+
withSecurity(mode) {
|
|
10091
|
+
this.state.defaultSecurity = mode;
|
|
10092
|
+
return this;
|
|
10093
|
+
}
|
|
10094
|
+
withController(controller) {
|
|
10095
|
+
this.state.defaultController = controller;
|
|
10096
|
+
return this;
|
|
10097
|
+
}
|
|
10098
|
+
withGovernance(governance) {
|
|
10099
|
+
this.state.governance = governance;
|
|
10100
|
+
return this;
|
|
10101
|
+
}
|
|
10102
|
+
withTokenGates(tokenGates) {
|
|
10103
|
+
this.state.tokenGates = tokenGates;
|
|
10104
|
+
return this;
|
|
10105
|
+
}
|
|
10106
|
+
withTimeRange(timeRange) {
|
|
10107
|
+
this.state.timeRange = timeRange;
|
|
10108
|
+
return this;
|
|
10109
|
+
}
|
|
10110
|
+
withMetadata(metadata) {
|
|
10111
|
+
this.state.metadata = metadata;
|
|
10112
|
+
return this;
|
|
10113
|
+
}
|
|
10114
|
+
withModules(modules) {
|
|
10115
|
+
this.state.modules = modules;
|
|
10116
|
+
return this;
|
|
10117
|
+
}
|
|
10118
|
+
/** Add a single module entry on top of any previously set modules. */
|
|
10119
|
+
addModule(module) {
|
|
10120
|
+
this.state.modules = [...this.state.modules ?? [], module];
|
|
10121
|
+
return this;
|
|
10122
|
+
}
|
|
10123
|
+
withInvariants(invariants) {
|
|
10124
|
+
this.state.invariants = invariants;
|
|
10125
|
+
return this;
|
|
10126
|
+
}
|
|
10127
|
+
/** Validate + return the typed, schema-conformant rule. Throws on invalid. */
|
|
10128
|
+
build() {
|
|
10129
|
+
const result = this.schema().safeParse(this.state);
|
|
10130
|
+
if (!result.success) {
|
|
10131
|
+
const errors = result.error.issues.map((issue) => {
|
|
10132
|
+
const path = issue.path.join(".");
|
|
10133
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
10134
|
+
});
|
|
10135
|
+
throw new RuleBuildError(`Invalid ${this.state.type ?? "rule"}: ${errors.join("; ")}`, errors);
|
|
10136
|
+
}
|
|
10137
|
+
return result.data;
|
|
10138
|
+
}
|
|
10139
|
+
/** Return the in-progress partial — handy for templates that finish the rule later. */
|
|
10140
|
+
partial() {
|
|
10141
|
+
return this.state;
|
|
10142
|
+
}
|
|
10143
|
+
};
|
|
10144
|
+
var SmartNodeSecuritySchema = zod.z.enum(["partial", "full"]);
|
|
10145
|
+
var OperationControllerSchema = zod.z.enum(["owner", "dao"]);
|
|
10146
|
+
var OperationLimitsSchema = zod.z.object({
|
|
10147
|
+
maxPerTransaction: zod.z.string().optional(),
|
|
10148
|
+
dailyLimit: zod.z.string().optional(),
|
|
10149
|
+
weeklyLimit: zod.z.string().optional(),
|
|
10150
|
+
monthlyLimit: zod.z.string().optional(),
|
|
10151
|
+
totalLimit: zod.z.string().optional(),
|
|
10152
|
+
cooldownSeconds: zod.z.number().int().min(0).optional(),
|
|
10153
|
+
minPerTransaction: zod.z.string().optional()
|
|
10154
|
+
}).strict();
|
|
10155
|
+
var BaseOperationConfigSchema = zod.z.object({
|
|
10156
|
+
enabled: zod.z.boolean(),
|
|
10157
|
+
controller: OperationControllerSchema.optional(),
|
|
10158
|
+
requiresApproval: zod.z.boolean().optional(),
|
|
10159
|
+
limits: OperationLimitsSchema.optional()
|
|
10160
|
+
}).strict();
|
|
10161
|
+
var MintOperationConfigSchema = BaseOperationConfigSchema.extend({}).strict();
|
|
10162
|
+
var UpdateOperationConfigSchema = BaseOperationConfigSchema.extend({
|
|
10163
|
+
allowedFields: zod.z.array(zod.z.string()).optional()
|
|
10164
|
+
}).strict();
|
|
10165
|
+
var PayloadSchemaRefSchema = zod.z.discriminatedUnion("kind", [
|
|
10166
|
+
zod.z.object({ kind: zod.z.literal("builtin"), id: zod.z.string().min(1) }).strict(),
|
|
10167
|
+
zod.z.object({ kind: zod.z.literal("jsonschema"), schema: zod.z.record(zod.z.unknown()) }).strict()
|
|
10168
|
+
]);
|
|
10169
|
+
var SubmitOperationConfigSchema = BaseOperationConfigSchema.extend({
|
|
10170
|
+
maxMessageSize: zod.z.number().int().min(0).optional(),
|
|
10171
|
+
rateLimit: zod.z.object({
|
|
10172
|
+
maxMessages: zod.z.number().int().min(1),
|
|
10173
|
+
periodSeconds: zod.z.number().int().min(1)
|
|
10174
|
+
}).strict().optional(),
|
|
10175
|
+
payloadSchema: PayloadSchemaRefSchema.optional()
|
|
10176
|
+
}).strict();
|
|
10177
|
+
var BurnOperationConfigSchema = BaseOperationConfigSchema.extend({
|
|
10178
|
+
allowHolderBurn: zod.z.boolean().optional()
|
|
10179
|
+
}).strict();
|
|
10180
|
+
var TransferOperationConfigSchema = BaseOperationConfigSchema.extend({
|
|
10181
|
+
blacklistEnabled: zod.z.boolean().optional(),
|
|
10182
|
+
requiresKyc: zod.z.boolean().optional(),
|
|
10183
|
+
whitelist: zod.z.array(zod.z.string()).optional(),
|
|
10184
|
+
blacklist: zod.z.array(zod.z.string()).optional()
|
|
10185
|
+
}).strict();
|
|
10186
|
+
var FreezeOperationConfigSchema = BaseOperationConfigSchema.extend({
|
|
10187
|
+
requiresMultisig: zod.z.boolean().optional()
|
|
10188
|
+
}).strict();
|
|
10189
|
+
var PauseOperationConfigSchema = BaseOperationConfigSchema.extend({}).strict();
|
|
10190
|
+
var TokenOperationsConfigSchema = zod.z.object({
|
|
10191
|
+
mint: MintOperationConfigSchema.optional(),
|
|
10192
|
+
burn: BurnOperationConfigSchema.optional(),
|
|
10193
|
+
transfer: TransferOperationConfigSchema.optional(),
|
|
10194
|
+
freeze: FreezeOperationConfigSchema.optional(),
|
|
10195
|
+
pause: PauseOperationConfigSchema.optional(),
|
|
10196
|
+
wipe: BaseOperationConfigSchema.optional(),
|
|
10197
|
+
update: UpdateOperationConfigSchema.optional(),
|
|
10198
|
+
associate: BaseOperationConfigSchema.optional(),
|
|
10199
|
+
dissociate: BaseOperationConfigSchema.optional(),
|
|
10200
|
+
grantKyc: BaseOperationConfigSchema.optional(),
|
|
10201
|
+
revokeKyc: BaseOperationConfigSchema.optional()
|
|
10202
|
+
}).strict();
|
|
10203
|
+
var AccountOperationsConfigSchema = zod.z.object({
|
|
10204
|
+
transfer: TransferOperationConfigSchema.optional(),
|
|
10205
|
+
update: UpdateOperationConfigSchema.optional(),
|
|
10206
|
+
delete: BaseOperationConfigSchema.optional(),
|
|
10207
|
+
approveAllowance: BaseOperationConfigSchema.optional(),
|
|
10208
|
+
deleteAllowance: BaseOperationConfigSchema.optional(),
|
|
10209
|
+
stake: BaseOperationConfigSchema.optional(),
|
|
10210
|
+
unstake: BaseOperationConfigSchema.optional()
|
|
10211
|
+
}).strict();
|
|
10212
|
+
var TopicOperationsConfigSchema = zod.z.object({
|
|
10213
|
+
submit: SubmitOperationConfigSchema.optional(),
|
|
10214
|
+
update: UpdateOperationConfigSchema.optional(),
|
|
10215
|
+
delete: BaseOperationConfigSchema.optional()
|
|
10216
|
+
}).strict();
|
|
10217
|
+
var KeyConditionSchema = zod.z.object({
|
|
10218
|
+
enabled: zod.z.boolean().optional(),
|
|
10219
|
+
security: SmartNodeSecuritySchema.optional(),
|
|
10220
|
+
controller: OperationControllerSchema.optional(),
|
|
10221
|
+
requiresApproval: zod.z.boolean().optional(),
|
|
10222
|
+
threshold: zod.z.number().int().min(1).optional()
|
|
10223
|
+
}).strict();
|
|
10224
|
+
var TokenKeyConditionsSchema = zod.z.object({
|
|
10225
|
+
admin: KeyConditionSchema.optional(),
|
|
10226
|
+
supply: KeyConditionSchema.optional(),
|
|
10227
|
+
freeze: KeyConditionSchema.optional(),
|
|
10228
|
+
pause: KeyConditionSchema.optional(),
|
|
10229
|
+
wipe: KeyConditionSchema.optional(),
|
|
10230
|
+
kyc: KeyConditionSchema.optional(),
|
|
10231
|
+
feeSchedule: KeyConditionSchema.optional()
|
|
10232
|
+
}).strict();
|
|
10233
|
+
var AccountKeyConditionsSchema = zod.z.object({
|
|
10234
|
+
admin: KeyConditionSchema.optional(),
|
|
10235
|
+
signing: KeyConditionSchema.optional()
|
|
10236
|
+
}).strict();
|
|
10237
|
+
var TopicKeyConditionsSchema = zod.z.object({
|
|
10238
|
+
admin: KeyConditionSchema.optional(),
|
|
10239
|
+
submit: KeyConditionSchema.optional()
|
|
10240
|
+
}).strict();
|
|
10241
|
+
var FixedFeeConditionSchema = zod.z.object({
|
|
10242
|
+
enabled: zod.z.boolean(),
|
|
10243
|
+
amount: zod.z.string(),
|
|
10244
|
+
feeTokenId: zod.z.string().optional(),
|
|
10245
|
+
feeCollectorAccountId: zod.z.string(),
|
|
10246
|
+
allCollectorsAreExempt: zod.z.boolean().optional()
|
|
10247
|
+
}).strict();
|
|
10248
|
+
var FractionalFeeConditionSchema = zod.z.object({
|
|
10249
|
+
enabled: zod.z.boolean(),
|
|
10250
|
+
numerator: zod.z.number().int(),
|
|
10251
|
+
denominator: zod.z.number().int().min(1),
|
|
10252
|
+
minimumAmount: zod.z.string().optional(),
|
|
10253
|
+
maximumAmount: zod.z.string().optional(),
|
|
10254
|
+
feeCollectorAccountId: zod.z.string(),
|
|
10255
|
+
netOfTransfers: zod.z.boolean().optional()
|
|
10256
|
+
}).strict();
|
|
10257
|
+
var RoyaltyFeeConditionSchema = zod.z.object({
|
|
10258
|
+
enabled: zod.z.boolean(),
|
|
10259
|
+
numerator: zod.z.number().int(),
|
|
10260
|
+
denominator: zod.z.number().int().min(1),
|
|
10261
|
+
fallbackFee: FixedFeeConditionSchema.optional(),
|
|
10262
|
+
feeCollectorAccountId: zod.z.string()
|
|
10263
|
+
}).strict();
|
|
10264
|
+
var FeeConditionsSchema = zod.z.object({
|
|
10265
|
+
fixed: zod.z.array(FixedFeeConditionSchema).optional(),
|
|
10266
|
+
fractional: zod.z.array(FractionalFeeConditionSchema).optional(),
|
|
10267
|
+
royalty: zod.z.array(RoyaltyFeeConditionSchema).optional()
|
|
10268
|
+
}).strict();
|
|
10269
|
+
var TimeRangeSchema = zod.z.object({
|
|
10270
|
+
start: zod.z.union([zod.z.number(), zod.z.string()]),
|
|
10271
|
+
end: zod.z.union([zod.z.number(), zod.z.string()])
|
|
10272
|
+
}).strict();
|
|
10273
|
+
var FungibleTokenGateSchema = zod.z.object({
|
|
10274
|
+
tokenId: zod.z.string(),
|
|
10275
|
+
minBalance: zod.z.string(),
|
|
10276
|
+
timeRange: TimeRangeSchema.optional()
|
|
10277
|
+
}).strict();
|
|
10278
|
+
var NonFungibleTokenGateSchema = zod.z.object({
|
|
10279
|
+
tokenId: zod.z.string(),
|
|
10280
|
+
serialNumbers: zod.z.array(zod.z.string()).optional(),
|
|
10281
|
+
timeRange: TimeRangeSchema.optional()
|
|
10282
|
+
}).strict();
|
|
10283
|
+
var TokenGateConditionsSchema = zod.z.object({
|
|
10284
|
+
fungibles: zod.z.object({
|
|
10285
|
+
tokens: zod.z.array(FungibleTokenGateSchema)
|
|
10286
|
+
}),
|
|
10287
|
+
nonFungibles: zod.z.object({
|
|
10288
|
+
tokens: zod.z.array(NonFungibleTokenGateSchema)
|
|
10289
|
+
}),
|
|
10290
|
+
timeRange: TimeRangeSchema.nullable()
|
|
10291
|
+
}).strict();
|
|
10292
|
+
var GovernanceConfigSchema = zod.z.object({
|
|
10293
|
+
daoTokenId: zod.z.string().optional(),
|
|
10294
|
+
proposalThreshold: zod.z.string().optional(),
|
|
10295
|
+
votingThreshold: zod.z.string().optional(),
|
|
10296
|
+
votingPeriodSeconds: zod.z.number().int().min(0).optional(),
|
|
10297
|
+
timelockSeconds: zod.z.number().int().min(0).optional(),
|
|
10298
|
+
quorumPercentage: zod.z.number().min(0).max(100).optional(),
|
|
10299
|
+
/** Pluggable wisdom-weight function (SDK-GOV-1). Registered server-side under `registryKey`. */
|
|
10300
|
+
wisdomWeightFn: zod.z.object({
|
|
10301
|
+
registryKey: zod.z.string().min(1)
|
|
10302
|
+
}).strict().optional(),
|
|
10303
|
+
/** Multi-hop liquid delegation (SDK-GOV-1 / whitepaper §A.7). */
|
|
10304
|
+
delegation: zod.z.object({
|
|
10305
|
+
maxHops: zod.z.number().int().min(1).max(10),
|
|
10306
|
+
decayPerHop: zod.z.number().min(0).max(1),
|
|
10307
|
+
concentrationAlert: zod.z.number().min(0).max(1).optional()
|
|
10308
|
+
}).strict().optional()
|
|
10309
|
+
}).strict();
|
|
10310
|
+
var ValidatorMetadataSchema = zod.z.object({
|
|
10311
|
+
version: zod.z.string(),
|
|
10312
|
+
previousVersion: zod.z.string().optional(),
|
|
10313
|
+
deprecatedAt: zod.z.string().optional(),
|
|
10314
|
+
expiresAt: zod.z.string().optional(),
|
|
10315
|
+
description: zod.z.string().max(500).optional(),
|
|
10316
|
+
author: zod.z.string().optional(),
|
|
10317
|
+
tags: zod.z.array(zod.z.string()).optional(),
|
|
10318
|
+
documentationUrl: zod.z.string().url().optional()
|
|
10319
|
+
}).strict();
|
|
10320
|
+
var RuleInvariantsSchema = zod.z.object({
|
|
10321
|
+
maxSupply: zod.z.string().optional(),
|
|
10322
|
+
minBalance: zod.z.string().optional(),
|
|
10323
|
+
minQuorumPercentage: zod.z.number().min(0).max(100).optional(),
|
|
10324
|
+
minTimelockSeconds: zod.z.number().int().min(0).optional(),
|
|
10325
|
+
immutableFields: zod.z.array(zod.z.string())
|
|
10326
|
+
}).strict();
|
|
10327
|
+
var SoulboundAllowedActionSchema = zod.z.enum(["burn", "wipe", "mint"]);
|
|
10328
|
+
var SoulboundNftConfigSchema = zod.z.object({
|
|
10329
|
+
enforced: zod.z.boolean(),
|
|
10330
|
+
allowedActions: zod.z.array(SoulboundAllowedActionSchema).optional()
|
|
10331
|
+
}).strict();
|
|
10332
|
+
var ModuleEntrySchema = zod.z.object({
|
|
10333
|
+
type: zod.z.string().min(1).max(64).regex(/^[a-z][a-z0-9-]*$/, "Module type must be lowercase alphanumeric with hyphens"),
|
|
10334
|
+
version: zod.z.string().min(1).max(20).regex(/^\d+\.\d+\.\d+$/, "Version must be semver (e.g. 1.0.0)"),
|
|
10335
|
+
config: zod.z.record(zod.z.unknown())
|
|
10336
|
+
});
|
|
10337
|
+
var TokenValidatorRulesSchema = zod.z.object({
|
|
10338
|
+
version: zod.z.literal("3.0"),
|
|
10339
|
+
type: zod.z.literal("token"),
|
|
10340
|
+
created: zod.z.string(),
|
|
10341
|
+
smartNodeSecurity: SmartNodeSecuritySchema.optional(),
|
|
10342
|
+
defaultSecurity: SmartNodeSecuritySchema.optional(),
|
|
10343
|
+
defaultController: OperationControllerSchema.optional(),
|
|
10344
|
+
operations: TokenOperationsConfigSchema,
|
|
10345
|
+
keys: TokenKeyConditionsSchema.optional(),
|
|
10346
|
+
fees: FeeConditionsSchema.optional(),
|
|
10347
|
+
tokenGates: TokenGateConditionsSchema.optional(),
|
|
10348
|
+
timeRange: TimeRangeSchema.nullable().optional(),
|
|
10349
|
+
governance: GovernanceConfigSchema.optional(),
|
|
10350
|
+
metadata: ValidatorMetadataSchema.optional(),
|
|
10351
|
+
modules: zod.z.array(ModuleEntrySchema).max(10).optional(),
|
|
10352
|
+
soulbound: SoulboundNftConfigSchema.optional(),
|
|
10353
|
+
invariants: RuleInvariantsSchema.optional()
|
|
10354
|
+
}).strict().refine((data) => data.smartNodeSecurity || data.defaultSecurity, {
|
|
10355
|
+
message: "Either smartNodeSecurity or defaultSecurity must be provided"
|
|
10356
|
+
});
|
|
10357
|
+
var AccountValidatorRulesSchema = zod.z.object({
|
|
10358
|
+
version: zod.z.literal("3.0"),
|
|
10359
|
+
type: zod.z.literal("account"),
|
|
10360
|
+
created: zod.z.string(),
|
|
10361
|
+
smartNodeSecurity: SmartNodeSecuritySchema.optional(),
|
|
10362
|
+
defaultSecurity: SmartNodeSecuritySchema.optional(),
|
|
10363
|
+
defaultController: OperationControllerSchema.optional(),
|
|
10364
|
+
operations: AccountOperationsConfigSchema,
|
|
10365
|
+
keys: AccountKeyConditionsSchema.optional(),
|
|
10366
|
+
tokenGates: TokenGateConditionsSchema.optional(),
|
|
10367
|
+
timeRange: TimeRangeSchema.nullable().optional(),
|
|
10368
|
+
governance: GovernanceConfigSchema.optional(),
|
|
10369
|
+
metadata: ValidatorMetadataSchema.optional(),
|
|
10370
|
+
modules: zod.z.array(ModuleEntrySchema).max(10).optional(),
|
|
10371
|
+
invariants: RuleInvariantsSchema.optional()
|
|
10372
|
+
}).strict().refine((data) => data.smartNodeSecurity || data.defaultSecurity, {
|
|
10373
|
+
message: "Either smartNodeSecurity or defaultSecurity must be provided"
|
|
10374
|
+
});
|
|
10375
|
+
var TopicValidatorRulesSchema = zod.z.object({
|
|
10376
|
+
version: zod.z.literal("3.0"),
|
|
10377
|
+
type: zod.z.literal("topic"),
|
|
10378
|
+
created: zod.z.string(),
|
|
10379
|
+
smartNodeSecurity: SmartNodeSecuritySchema.optional(),
|
|
10380
|
+
defaultSecurity: SmartNodeSecuritySchema.optional(),
|
|
10381
|
+
defaultController: OperationControllerSchema.optional(),
|
|
10382
|
+
operations: TopicOperationsConfigSchema,
|
|
10383
|
+
keys: TopicKeyConditionsSchema.optional(),
|
|
10384
|
+
tokenGates: TokenGateConditionsSchema.optional(),
|
|
10385
|
+
timeRange: TimeRangeSchema.nullable().optional(),
|
|
10386
|
+
governance: GovernanceConfigSchema.optional(),
|
|
10387
|
+
metadata: ValidatorMetadataSchema.optional(),
|
|
10388
|
+
modules: zod.z.array(ModuleEntrySchema).max(10).optional(),
|
|
10389
|
+
invariants: RuleInvariantsSchema.optional()
|
|
10390
|
+
}).strict().refine((data) => data.smartNodeSecurity || data.defaultSecurity, {
|
|
10391
|
+
message: "Either smartNodeSecurity or defaultSecurity must be provided"
|
|
10392
|
+
});
|
|
10393
|
+
var AgentTypeSchema = zod.z.enum(["trading", "monitoring", "analytics", "custom"]);
|
|
10394
|
+
var AgentPermissionScopeSchema = zod.z.enum(["read", "execute", "modify", "admin"]);
|
|
10395
|
+
var AgentControllerTypeSchema = zod.z.enum(["owner", "dao", "multisig", "automated"]);
|
|
10396
|
+
var AgentAccessControlModeSchema = zod.z.enum([
|
|
10397
|
+
"whitelist",
|
|
10398
|
+
"blacklist",
|
|
10399
|
+
"public",
|
|
10400
|
+
"token_gated"
|
|
10401
|
+
]);
|
|
10402
|
+
var AgentPermissionEntrySchema = zod.z.object({
|
|
10403
|
+
accountId: zod.z.string(),
|
|
10404
|
+
scope: AgentPermissionScopeSchema.optional(),
|
|
10405
|
+
expiresAt: zod.z.union([zod.z.string(), zod.z.date()]).optional(),
|
|
10406
|
+
label: zod.z.string().optional(),
|
|
10407
|
+
metadata: zod.z.record(zod.z.unknown()).optional()
|
|
10408
|
+
}).strict();
|
|
10409
|
+
var AgentPermissionsSchema = zod.z.object({
|
|
10410
|
+
mode: AgentAccessControlModeSchema.optional(),
|
|
10411
|
+
entries: zod.z.array(AgentPermissionEntrySchema),
|
|
10412
|
+
controller: AgentControllerTypeSchema.optional(),
|
|
10413
|
+
allowSelfAdd: zod.z.boolean().optional(),
|
|
10414
|
+
maxEntries: zod.z.number().int().min(0).optional(),
|
|
10415
|
+
requiredScope: AgentPermissionScopeSchema.optional(),
|
|
10416
|
+
allowWildcards: zod.z.boolean().optional()
|
|
10417
|
+
}).strict();
|
|
10418
|
+
var AgentTradeLimitsSchema = zod.z.object({
|
|
10419
|
+
maxPerTrade: zod.z.string(),
|
|
10420
|
+
dailyLimit: zod.z.string(),
|
|
10421
|
+
periodMs: zod.z.number().int().min(0).optional(),
|
|
10422
|
+
decimals: zod.z.number().int().min(0).optional()
|
|
10423
|
+
}).strict();
|
|
10424
|
+
var AgentTokenPairSchema = zod.z.object({
|
|
10425
|
+
baseToken: zod.z.string(),
|
|
10426
|
+
quoteToken: zod.z.string(),
|
|
10427
|
+
chain: zod.z.string()
|
|
10428
|
+
}).strict();
|
|
10429
|
+
var AgentApprovedPairsSchema = zod.z.object({
|
|
10430
|
+
pairs: zod.z.array(AgentTokenPairSchema),
|
|
10431
|
+
strictMode: zod.z.boolean().optional()
|
|
10432
|
+
}).strict();
|
|
10433
|
+
var AgentCooldownSchema = zod.z.object({
|
|
10434
|
+
cooldownMs: zod.z.number().int().min(0),
|
|
10435
|
+
perAction: zod.z.record(zod.z.string(), zod.z.number().int().min(0)).optional()
|
|
10436
|
+
}).strict();
|
|
10437
|
+
var AgentApprovalThresholdSchema = zod.z.object({
|
|
10438
|
+
threshold: zod.z.string(),
|
|
10439
|
+
currency: zod.z.string().optional(),
|
|
10440
|
+
decimals: zod.z.number().int().min(0).optional(),
|
|
10441
|
+
controller: OperationControllerSchema.optional()
|
|
10442
|
+
}).strict();
|
|
10443
|
+
var AgentOperationalWindowSchema = zod.z.object({
|
|
10444
|
+
from: zod.z.union([zod.z.number(), zod.z.string()]),
|
|
10445
|
+
to: zod.z.union([zod.z.number(), zod.z.string()]),
|
|
10446
|
+
timezone: zod.z.string().optional(),
|
|
10447
|
+
inclusive: zod.z.boolean().optional()
|
|
10448
|
+
}).strict();
|
|
10449
|
+
var AgentAllocationLimitsSchema = zod.z.object({
|
|
10450
|
+
min: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
10451
|
+
max: zod.z.union([zod.z.number(), zod.z.string()]).optional(),
|
|
10452
|
+
tokenId: zod.z.string().optional(),
|
|
10453
|
+
decimals: zod.z.number().int().min(0).optional(),
|
|
10454
|
+
inclusive: zod.z.boolean().optional()
|
|
10455
|
+
}).strict();
|
|
10456
|
+
var AgentValidatorRulesSchema = zod.z.object({
|
|
10457
|
+
version: zod.z.literal("3.0"),
|
|
10458
|
+
type: zod.z.literal("agent"),
|
|
10459
|
+
created: zod.z.string(),
|
|
10460
|
+
smartNodeSecurity: SmartNodeSecuritySchema.optional(),
|
|
10461
|
+
defaultSecurity: SmartNodeSecuritySchema.optional(),
|
|
10462
|
+
defaultController: OperationControllerSchema.optional(),
|
|
10463
|
+
name: zod.z.string().optional(),
|
|
10464
|
+
agentType: AgentTypeSchema.optional(),
|
|
10465
|
+
permissions: AgentPermissionsSchema.optional(),
|
|
10466
|
+
tradeLimits: AgentTradeLimitsSchema.optional(),
|
|
10467
|
+
approvedPairs: AgentApprovedPairsSchema.optional(),
|
|
10468
|
+
cooldown: AgentCooldownSchema.optional(),
|
|
10469
|
+
approvalThreshold: AgentApprovalThresholdSchema.optional(),
|
|
10470
|
+
operationalWindow: AgentOperationalWindowSchema.optional(),
|
|
10471
|
+
allocationLimits: AgentAllocationLimitsSchema.optional(),
|
|
10472
|
+
tokenGates: TokenGateConditionsSchema.optional(),
|
|
10473
|
+
timeRange: TimeRangeSchema.nullable().optional(),
|
|
10474
|
+
governance: GovernanceConfigSchema.optional(),
|
|
10475
|
+
metadata: ValidatorMetadataSchema.optional(),
|
|
10476
|
+
modules: zod.z.array(ModuleEntrySchema).max(10).optional(),
|
|
10477
|
+
invariants: RuleInvariantsSchema.optional()
|
|
10478
|
+
}).strict().refine((data) => data.smartNodeSecurity || data.defaultSecurity, {
|
|
10479
|
+
message: "Either smartNodeSecurity or defaultSecurity must be provided"
|
|
10480
|
+
});
|
|
10481
|
+
var ValidatorRulesSchema = zod.z.union([
|
|
10482
|
+
TokenValidatorRulesSchema,
|
|
10483
|
+
AccountValidatorRulesSchema,
|
|
10484
|
+
TopicValidatorRulesSchema,
|
|
10485
|
+
AgentValidatorRulesSchema
|
|
10486
|
+
]);
|
|
10487
|
+
|
|
10488
|
+
// src/rules/builders/token-rules-builder.ts
|
|
10489
|
+
var TokenRulesBuilder = class extends BaseRuleBuilder {
|
|
10490
|
+
constructor() {
|
|
10491
|
+
super("token");
|
|
10492
|
+
}
|
|
10493
|
+
schema() {
|
|
10494
|
+
return TokenValidatorRulesSchema;
|
|
10495
|
+
}
|
|
10496
|
+
/** Set the full operations config (required by the canonical schema). */
|
|
10497
|
+
withOperations(operations) {
|
|
10498
|
+
this.state.operations = operations;
|
|
10499
|
+
return this;
|
|
10500
|
+
}
|
|
10501
|
+
/** Patch-style operations merge: pass only the ops you want to set/change. */
|
|
10502
|
+
patchOperations(partial) {
|
|
10503
|
+
this.state.operations = { ...this.state.operations ?? {}, ...partial };
|
|
10504
|
+
return this;
|
|
10505
|
+
}
|
|
10506
|
+
withKeys(keys) {
|
|
10507
|
+
this.state.keys = keys;
|
|
10508
|
+
return this;
|
|
10509
|
+
}
|
|
10510
|
+
withFees(fees) {
|
|
10511
|
+
this.state.fees = fees;
|
|
10512
|
+
return this;
|
|
10513
|
+
}
|
|
10514
|
+
withSoulbound(soulbound) {
|
|
10515
|
+
this.state.soulbound = soulbound;
|
|
10516
|
+
return this;
|
|
10517
|
+
}
|
|
10518
|
+
};
|
|
10519
|
+
function forToken() {
|
|
10520
|
+
return new TokenRulesBuilder();
|
|
10521
|
+
}
|
|
10522
|
+
|
|
10523
|
+
// src/rules/builders/account-rules-builder.ts
|
|
10524
|
+
var AccountRulesBuilder = class extends BaseRuleBuilder {
|
|
10525
|
+
constructor() {
|
|
10526
|
+
super("account");
|
|
10527
|
+
}
|
|
10528
|
+
schema() {
|
|
10529
|
+
return AccountValidatorRulesSchema;
|
|
10530
|
+
}
|
|
10531
|
+
withOperations(operations) {
|
|
10532
|
+
this.state.operations = operations;
|
|
10533
|
+
return this;
|
|
10534
|
+
}
|
|
10535
|
+
patchOperations(partial) {
|
|
10536
|
+
this.state.operations = { ...this.state.operations ?? {}, ...partial };
|
|
10537
|
+
return this;
|
|
10538
|
+
}
|
|
10539
|
+
withKeys(keys) {
|
|
10540
|
+
this.state.keys = keys;
|
|
10541
|
+
return this;
|
|
10542
|
+
}
|
|
10543
|
+
};
|
|
10544
|
+
function forAccount() {
|
|
10545
|
+
return new AccountRulesBuilder();
|
|
10546
|
+
}
|
|
10547
|
+
|
|
10548
|
+
// src/rules/builders/topic-rules-builder.ts
|
|
10549
|
+
var TopicRulesBuilder = class extends BaseRuleBuilder {
|
|
10550
|
+
constructor() {
|
|
10551
|
+
super("topic");
|
|
10552
|
+
}
|
|
10553
|
+
schema() {
|
|
10554
|
+
return TopicValidatorRulesSchema;
|
|
10555
|
+
}
|
|
10556
|
+
withOperations(operations) {
|
|
10557
|
+
this.state.operations = operations;
|
|
10558
|
+
return this;
|
|
10559
|
+
}
|
|
10560
|
+
patchOperations(partial) {
|
|
10561
|
+
this.state.operations = { ...this.state.operations ?? {}, ...partial };
|
|
10562
|
+
return this;
|
|
10563
|
+
}
|
|
10564
|
+
withKeys(keys) {
|
|
10565
|
+
this.state.keys = keys;
|
|
10566
|
+
return this;
|
|
10567
|
+
}
|
|
10568
|
+
/**
|
|
10569
|
+
* Convenience: set the submit operation in one call.
|
|
10570
|
+
* Common usage on topics that gate message shape via JSON-Schema payload.
|
|
10571
|
+
*/
|
|
10572
|
+
withSubmit(submit) {
|
|
10573
|
+
this.state.operations = {
|
|
10574
|
+
...this.state.operations ?? {},
|
|
10575
|
+
submit
|
|
10576
|
+
};
|
|
10577
|
+
return this;
|
|
10578
|
+
}
|
|
10579
|
+
/**
|
|
10580
|
+
* Convenience: attach a JSON-Schema payload validation to the submit op.
|
|
10581
|
+
* Equivalent to `withSubmit({ enabled: true, payloadSchema: ref })`.
|
|
10582
|
+
*/
|
|
10583
|
+
withPayloadSchema(payloadSchema) {
|
|
10584
|
+
return this.withSubmit({
|
|
10585
|
+
...this.state.operations?.submit ?? { enabled: true },
|
|
10586
|
+
payloadSchema
|
|
10587
|
+
});
|
|
10588
|
+
}
|
|
10589
|
+
};
|
|
10590
|
+
function forTopic() {
|
|
10591
|
+
return new TopicRulesBuilder();
|
|
10592
|
+
}
|
|
10593
|
+
|
|
10594
|
+
// src/rules/builders/agent-rules-builder.ts
|
|
10595
|
+
var AgentRulesBuilder = class extends BaseRuleBuilder {
|
|
10596
|
+
constructor() {
|
|
10597
|
+
super("agent");
|
|
10598
|
+
}
|
|
10599
|
+
schema() {
|
|
10600
|
+
return AgentValidatorRulesSchema;
|
|
10601
|
+
}
|
|
10602
|
+
withName(name) {
|
|
10603
|
+
this.state.name = name;
|
|
10604
|
+
return this;
|
|
10605
|
+
}
|
|
10606
|
+
withAgentType(agentType) {
|
|
10607
|
+
this.state.agentType = agentType;
|
|
10608
|
+
return this;
|
|
10609
|
+
}
|
|
10610
|
+
withPermissions(permissions) {
|
|
10611
|
+
this.state.permissions = permissions;
|
|
10612
|
+
return this;
|
|
10613
|
+
}
|
|
10614
|
+
withTradeLimits(tradeLimits) {
|
|
10615
|
+
this.state.tradeLimits = tradeLimits;
|
|
10616
|
+
return this;
|
|
10617
|
+
}
|
|
10618
|
+
withApprovedPairs(approvedPairs) {
|
|
10619
|
+
this.state.approvedPairs = approvedPairs;
|
|
10620
|
+
return this;
|
|
10621
|
+
}
|
|
10622
|
+
withCooldown(cooldown) {
|
|
10623
|
+
this.state.cooldown = cooldown;
|
|
10624
|
+
return this;
|
|
10625
|
+
}
|
|
10626
|
+
withApprovalThreshold(approvalThreshold) {
|
|
10627
|
+
this.state.approvalThreshold = approvalThreshold;
|
|
10628
|
+
return this;
|
|
10629
|
+
}
|
|
10630
|
+
withOperationalWindow(window) {
|
|
10631
|
+
this.state.operationalWindow = window;
|
|
10632
|
+
return this;
|
|
10633
|
+
}
|
|
10634
|
+
withAllocationLimits(allocationLimits) {
|
|
10635
|
+
this.state.allocationLimits = allocationLimits;
|
|
10636
|
+
return this;
|
|
10637
|
+
}
|
|
10638
|
+
};
|
|
10639
|
+
function forAgent() {
|
|
10640
|
+
return new AgentRulesBuilder();
|
|
10641
|
+
}
|
|
10642
|
+
|
|
10643
|
+
// src/rules/validate.ts
|
|
10644
|
+
function formatIssue(issue) {
|
|
10645
|
+
const path = issue.path.join(".");
|
|
10646
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
10647
|
+
}
|
|
10648
|
+
function pickArm(rule) {
|
|
10649
|
+
if (rule && typeof rule === "object" && "type" in rule) {
|
|
10650
|
+
const t = rule.type;
|
|
10651
|
+
if (t === "token") return TokenValidatorRulesSchema;
|
|
10652
|
+
if (t === "account") return AccountValidatorRulesSchema;
|
|
10653
|
+
if (t === "topic") return TopicValidatorRulesSchema;
|
|
10654
|
+
if (t === "agent") return AgentValidatorRulesSchema;
|
|
10655
|
+
}
|
|
10656
|
+
return ValidatorRulesSchema;
|
|
10657
|
+
}
|
|
10658
|
+
function validate(rule) {
|
|
10659
|
+
const result = pickArm(rule).safeParse(rule);
|
|
10660
|
+
if (result.success) {
|
|
10661
|
+
return { valid: true, errors: [] };
|
|
10662
|
+
}
|
|
10663
|
+
return {
|
|
10664
|
+
valid: false,
|
|
10665
|
+
errors: result.error.issues.map(formatIssue)
|
|
10666
|
+
};
|
|
10667
|
+
}
|
|
10668
|
+
|
|
10669
|
+
// src/rules/atoms/index.ts
|
|
10670
|
+
var atom = {
|
|
10671
|
+
timeRange: (cfg) => ({
|
|
10672
|
+
inclusive: true,
|
|
10673
|
+
timezone: "UTC",
|
|
10674
|
+
...cfg
|
|
10675
|
+
}),
|
|
10676
|
+
limits: (cfg) => ({
|
|
10677
|
+
decimals: 0,
|
|
10678
|
+
inclusive: true,
|
|
10679
|
+
...cfg
|
|
10680
|
+
}),
|
|
10681
|
+
permissionList: (cfg) => ({
|
|
10682
|
+
mode: "whitelist",
|
|
10683
|
+
controller: "owner",
|
|
10684
|
+
allowSelfAdd: false,
|
|
10685
|
+
allowWildcards: false,
|
|
10686
|
+
requiredScope: "execute",
|
|
10687
|
+
entries: [],
|
|
10688
|
+
...cfg
|
|
10689
|
+
}),
|
|
10690
|
+
rateLimiter: (cfg) => ({
|
|
10691
|
+
strategy: "all",
|
|
10692
|
+
includeCurrentOperation: true,
|
|
10693
|
+
...cfg
|
|
10694
|
+
}),
|
|
10695
|
+
cooldown: (cfg) => ({ ...cfg }),
|
|
10696
|
+
approvalThreshold: (cfg) => ({
|
|
10697
|
+
decimals: 0,
|
|
10698
|
+
...cfg
|
|
10699
|
+
}),
|
|
10700
|
+
approvedPairs: (cfg) => ({
|
|
10701
|
+
strictMode: true,
|
|
10702
|
+
...cfg
|
|
10703
|
+
}),
|
|
10704
|
+
tradeLimit: (cfg) => ({
|
|
10705
|
+
periodMs: 864e5,
|
|
10706
|
+
decimals: 0,
|
|
10707
|
+
...cfg
|
|
10708
|
+
}),
|
|
10709
|
+
snapshot: (cfg) => ({
|
|
10710
|
+
validationMode: "minimum",
|
|
10711
|
+
...cfg
|
|
10712
|
+
}),
|
|
10713
|
+
cronSchedule: (cfg) => ({
|
|
10714
|
+
allowOutsideSchedule: false,
|
|
10715
|
+
toleranceMs: 0,
|
|
10716
|
+
...cfg
|
|
10717
|
+
}),
|
|
10718
|
+
countApproval: (cfg) => ({
|
|
10719
|
+
maxCount: 0,
|
|
10720
|
+
allowDuplicates: false,
|
|
10721
|
+
maxApprovalAgeSec: 0,
|
|
10722
|
+
allowSelfApproval: false,
|
|
10723
|
+
...cfg
|
|
10724
|
+
}),
|
|
10725
|
+
externalEvidence: (cfg) => ({
|
|
10726
|
+
requiredSignatures: 1,
|
|
10727
|
+
maxEvidenceAgeSec: 3600,
|
|
10728
|
+
verifyPayloadHash: true,
|
|
10729
|
+
...cfg
|
|
10730
|
+
}),
|
|
10731
|
+
fieldValues: (cfg) => ({
|
|
10732
|
+
requireAll: true,
|
|
10733
|
+
...cfg,
|
|
10734
|
+
constraints: cfg.constraints.map((c) => ({
|
|
10735
|
+
caseInsensitive: false,
|
|
10736
|
+
denyMode: false,
|
|
10737
|
+
...c
|
|
10738
|
+
}))
|
|
10739
|
+
}),
|
|
10740
|
+
registryReference: (cfg) => ({
|
|
10741
|
+
requireAll: true,
|
|
10742
|
+
...cfg,
|
|
10743
|
+
references: cfg.references.map((r) => ({ required: true, ...r }))
|
|
10744
|
+
}),
|
|
10745
|
+
schemaValidation: (cfg) => ({
|
|
10746
|
+
strict: false,
|
|
10747
|
+
allErrors: true,
|
|
10748
|
+
validateFormats: false,
|
|
10749
|
+
errorPrefix: "Schema validation failed",
|
|
10750
|
+
removeAdditional: false,
|
|
10751
|
+
useDefaults: false,
|
|
10752
|
+
coerceTypes: false,
|
|
10753
|
+
...cfg
|
|
10754
|
+
}),
|
|
10755
|
+
stopLoss: (cfg) => ({ ...cfg }),
|
|
10756
|
+
workflowState: (cfg) => ({
|
|
10757
|
+
allowSelfTransition: false,
|
|
10758
|
+
...cfg
|
|
10759
|
+
})
|
|
10760
|
+
};
|
|
10761
|
+
|
|
10762
|
+
// src/rules/molecules/index.ts
|
|
10763
|
+
var molecule = {
|
|
10764
|
+
tokenGate: (cfg) => ({
|
|
10765
|
+
overallOperator: "AND",
|
|
10766
|
+
allowDelegation: false,
|
|
10767
|
+
...cfg,
|
|
10768
|
+
fungibles: cfg.fungibles ? { operator: "AND", ...cfg.fungibles } : void 0,
|
|
10769
|
+
nonFungibles: cfg.nonFungibles ? { operator: "OR", ...cfg.nonFungibles } : void 0
|
|
10770
|
+
}),
|
|
10771
|
+
airdrop: (cfg) => ({
|
|
10772
|
+
decimals: 0,
|
|
10773
|
+
claimMethod: "manual",
|
|
10774
|
+
...cfg
|
|
10775
|
+
}),
|
|
10776
|
+
vesting: (cfg) => ({
|
|
10777
|
+
decimals: 0,
|
|
10778
|
+
cliffDurationMs: 0,
|
|
10779
|
+
initialUnlockPercent: 0,
|
|
10780
|
+
revocable: false,
|
|
10781
|
+
returnToTreasury: true,
|
|
10782
|
+
...cfg
|
|
10783
|
+
}),
|
|
10784
|
+
governance: (cfg) => ({
|
|
10785
|
+
decimals: 0,
|
|
10786
|
+
votingPowerMethod: "token_balance",
|
|
10787
|
+
quorumPercent: 10,
|
|
10788
|
+
approvalThresholdPercent: 50,
|
|
10789
|
+
timeLockMs: 0,
|
|
10790
|
+
allowDelegation: true,
|
|
10791
|
+
allowVoteChange: false,
|
|
10792
|
+
maxActiveProposalsPerAccount: 3,
|
|
10793
|
+
proposalCooldownMs: 0,
|
|
10794
|
+
...cfg
|
|
10795
|
+
}),
|
|
10796
|
+
streaming: (cfg) => ({
|
|
10797
|
+
decimals: 0,
|
|
10798
|
+
type: "linear",
|
|
10799
|
+
cancellable: true,
|
|
10800
|
+
pausable: false,
|
|
10801
|
+
cancelController: "sender",
|
|
10802
|
+
cliffDurationMs: 0,
|
|
10803
|
+
autoTopUp: false,
|
|
10804
|
+
...cfg
|
|
10805
|
+
}),
|
|
10806
|
+
swap: (cfg = {}) => ({
|
|
10807
|
+
type: "atomic",
|
|
10808
|
+
requireAtomicity: true,
|
|
10809
|
+
...cfg
|
|
10810
|
+
})
|
|
10811
|
+
};
|
|
10812
|
+
|
|
10813
|
+
// src/rules/modules/index.ts
|
|
10814
|
+
function withLaunchpadDefaults(c) {
|
|
10815
|
+
return {
|
|
10816
|
+
launchTokenDecimals: 0,
|
|
10817
|
+
paymentTokenDecimals: 0,
|
|
10818
|
+
refundOnFailure: true,
|
|
10819
|
+
overflowPolicy: "proportional",
|
|
10820
|
+
platformFeePercent: 0,
|
|
10821
|
+
...c
|
|
10822
|
+
};
|
|
10823
|
+
}
|
|
10824
|
+
function withStakingPoolDefaults(c) {
|
|
10825
|
+
return {
|
|
10826
|
+
stakingTokenDecimals: 0,
|
|
10827
|
+
distributionMethod: "proportional",
|
|
10828
|
+
lockPeriodMs: 0,
|
|
10829
|
+
earlyUnstakePenalty: 0,
|
|
10830
|
+
autoCompound: false,
|
|
10831
|
+
withdrawalCooldownMs: 0,
|
|
10832
|
+
emergencyWithdrawEnabled: true,
|
|
10833
|
+
...c
|
|
10834
|
+
};
|
|
10835
|
+
}
|
|
10836
|
+
function withDaoDefaults(c) {
|
|
10837
|
+
return { smartNodeSecurity: "partial", ...c };
|
|
10838
|
+
}
|
|
10839
|
+
function withDexDefaults(c) {
|
|
10840
|
+
return {
|
|
10841
|
+
defaultSwapFeePercent: 0.3,
|
|
10842
|
+
multiHopEnabled: true,
|
|
10843
|
+
maxHops: 3,
|
|
10844
|
+
defaultSlippagePercent: 0.5,
|
|
10845
|
+
...c
|
|
10846
|
+
};
|
|
10847
|
+
}
|
|
10848
|
+
var module_ = {
|
|
10849
|
+
launchpad: (config) => ({
|
|
10850
|
+
type: "launchpad",
|
|
10851
|
+
version: "1.0.0",
|
|
10852
|
+
config: withLaunchpadDefaults(config)
|
|
10853
|
+
}),
|
|
10854
|
+
stakingPool: (config) => ({
|
|
10855
|
+
type: "staking-pool",
|
|
10856
|
+
version: "1.0.0",
|
|
10857
|
+
config: withStakingPoolDefaults(config)
|
|
10858
|
+
}),
|
|
10859
|
+
dao: (config) => ({
|
|
10860
|
+
type: "dao",
|
|
10861
|
+
version: "1.0.0",
|
|
10862
|
+
config: withDaoDefaults(config)
|
|
10863
|
+
}),
|
|
10864
|
+
dex: (config) => ({
|
|
10865
|
+
type: "dex",
|
|
10866
|
+
version: "1.0.0",
|
|
10867
|
+
config: withDexDefaults(config)
|
|
10868
|
+
}),
|
|
10869
|
+
agent: (config) => ({
|
|
10870
|
+
type: "agent",
|
|
10871
|
+
version: "1.0.0",
|
|
10872
|
+
config
|
|
10873
|
+
})
|
|
10874
|
+
};
|
|
10875
|
+
|
|
10876
|
+
// src/rules/templates/index.ts
|
|
10877
|
+
function toEpoch(d) {
|
|
10878
|
+
return typeof d === "number" ? d : d.getTime();
|
|
10879
|
+
}
|
|
10880
|
+
function meta(templateName, description) {
|
|
10881
|
+
return {
|
|
10882
|
+
version: "1.0.0",
|
|
10883
|
+
description: description ?? `${templateName} (Rules.template.${templateName})`,
|
|
10884
|
+
tags: [`template:${templateName}`]
|
|
10885
|
+
};
|
|
10886
|
+
}
|
|
10887
|
+
function fairLaunch(p) {
|
|
10888
|
+
const launchpad = module_.launchpad({
|
|
10889
|
+
name: p.name,
|
|
10890
|
+
launchTokenId: p.launchTokenId,
|
|
10891
|
+
launchTokenDecimals: p.launchTokenDecimals,
|
|
10892
|
+
paymentTokenId: p.paymentTokenId,
|
|
10893
|
+
paymentTokenDecimals: p.paymentTokenDecimals,
|
|
10894
|
+
totalTokensForSale: p.totalTokensForSale,
|
|
10895
|
+
pricePerToken: p.pricePerToken,
|
|
10896
|
+
hardCap: p.hardCap,
|
|
10897
|
+
softCap: p.softCap,
|
|
10898
|
+
publicWindow: atom.timeRange({
|
|
10899
|
+
from: toEpoch(p.publicStart),
|
|
10900
|
+
to: toEpoch(p.publicEnd)
|
|
10901
|
+
}),
|
|
10902
|
+
treasuryAccount: p.treasuryAccount,
|
|
10903
|
+
vestingSchedule: p.vestingSchedule,
|
|
10904
|
+
refundOnFailure: true,
|
|
10905
|
+
overflowPolicy: "proportional",
|
|
10906
|
+
description: `Fair-launch IDO for ${p.symbol}`
|
|
10907
|
+
});
|
|
10908
|
+
return forToken().withOperations({
|
|
10909
|
+
mint: { enabled: true, controller: "owner" },
|
|
10910
|
+
transfer: { enabled: true, controller: "owner" }
|
|
10911
|
+
}).addModule(launchpad).withMetadata(meta("fairLaunch", p.description)).build();
|
|
10912
|
+
}
|
|
10913
|
+
function tieredIDO(p) {
|
|
10914
|
+
const lowestTierBalance = p.tiers.reduce((acc, t) => {
|
|
10915
|
+
if (acc === "") return t.requiredBalance;
|
|
10916
|
+
const len = Math.max(acc.length, t.requiredBalance.length);
|
|
10917
|
+
const a = acc.padStart(len, "0");
|
|
10918
|
+
const b = t.requiredBalance.padStart(len, "0");
|
|
10919
|
+
return a < b ? acc : t.requiredBalance;
|
|
10920
|
+
}, "");
|
|
10921
|
+
const eligibility = molecule.tokenGate({
|
|
10922
|
+
fungibles: {
|
|
10923
|
+
tokens: [
|
|
10924
|
+
{
|
|
10925
|
+
tokenId: p.governanceTokenId,
|
|
10926
|
+
minBalance: lowestTierBalance || "0",
|
|
10927
|
+
checkBalance: true
|
|
10928
|
+
}
|
|
10929
|
+
],
|
|
10930
|
+
operator: "AND"
|
|
10931
|
+
},
|
|
10932
|
+
overallOperator: "AND"
|
|
10933
|
+
});
|
|
10934
|
+
const launchpad = module_.launchpad({
|
|
10935
|
+
name: p.name,
|
|
10936
|
+
launchTokenId: p.launchTokenId,
|
|
10937
|
+
paymentTokenId: p.paymentTokenId,
|
|
10938
|
+
totalTokensForSale: p.totalTokensForSale,
|
|
10939
|
+
pricePerToken: p.pricePerToken,
|
|
10940
|
+
hardCap: p.hardCap,
|
|
10941
|
+
softCap: p.softCap,
|
|
10942
|
+
registrationWindow: atom.timeRange({
|
|
10943
|
+
from: toEpoch(p.registrationStart),
|
|
10944
|
+
to: toEpoch(p.registrationEnd)
|
|
10945
|
+
}),
|
|
10946
|
+
guaranteedWindow: atom.timeRange({
|
|
10947
|
+
from: toEpoch(p.guaranteedStart),
|
|
10948
|
+
to: toEpoch(p.guaranteedEnd)
|
|
10949
|
+
}),
|
|
10950
|
+
publicWindow: atom.timeRange({
|
|
10951
|
+
from: toEpoch(p.publicStart),
|
|
10952
|
+
to: toEpoch(p.publicEnd)
|
|
10953
|
+
}),
|
|
10954
|
+
eligibility,
|
|
10955
|
+
tiers: p.tiers,
|
|
10956
|
+
treasuryAccount: p.treasuryAccount,
|
|
10957
|
+
refundOnFailure: true,
|
|
10958
|
+
overflowPolicy: "proportional",
|
|
10959
|
+
description: `Tiered IDO for ${p.symbol}`
|
|
10960
|
+
});
|
|
10961
|
+
return forToken().withOperations({
|
|
10962
|
+
mint: { enabled: true, controller: "owner" },
|
|
10963
|
+
transfer: { enabled: true, controller: "owner" }
|
|
10964
|
+
}).addModule(launchpad).withMetadata(meta("tieredIDO", p.description)).build();
|
|
10965
|
+
}
|
|
10966
|
+
function simpleStaking(p) {
|
|
10967
|
+
const startEpoch = toEpoch(p.startAt);
|
|
10968
|
+
const endEpoch = p.endAt !== void 0 ? toEpoch(p.endAt) : void 0;
|
|
10969
|
+
const stakingPool = module_.stakingPool({
|
|
10970
|
+
name: p.name,
|
|
10971
|
+
poolType: "single",
|
|
10972
|
+
stakingTokenId: p.stakingTokenId,
|
|
10973
|
+
rewardTokens: [
|
|
10974
|
+
{
|
|
10975
|
+
tokenId: p.rewardTokenId,
|
|
10976
|
+
rewardRate: p.rewardRate,
|
|
10977
|
+
totalRewards: p.totalRewards
|
|
10978
|
+
}
|
|
10979
|
+
],
|
|
10980
|
+
distributionMethod: "proportional",
|
|
10981
|
+
startAt: new Date(startEpoch).toISOString(),
|
|
10982
|
+
endAt: endEpoch !== void 0 ? new Date(endEpoch).toISOString() : void 0,
|
|
10983
|
+
lockPeriodMs: p.lockPeriodMs ?? 0,
|
|
10984
|
+
autoCompound: false,
|
|
10985
|
+
emergencyWithdrawEnabled: true,
|
|
10986
|
+
description: `Single-asset staking pool: ${p.name}`
|
|
10987
|
+
});
|
|
10988
|
+
return forToken().withOperations({
|
|
10989
|
+
transfer: { enabled: true, controller: "owner" }
|
|
10990
|
+
}).addModule(stakingPool).withMetadata(meta("simpleStaking", p.description)).build();
|
|
10991
|
+
}
|
|
10992
|
+
function tokenDAO(p) {
|
|
10993
|
+
const quorum = p.quorumPercent ?? 10;
|
|
10994
|
+
const timeLockMs = p.timeLockMs ?? 0;
|
|
10995
|
+
const governance = molecule.governance({
|
|
10996
|
+
governanceTokenId: p.governanceTokenId,
|
|
10997
|
+
quorumPercent: quorum,
|
|
10998
|
+
approvalThresholdPercent: p.approvalThresholdPercent ?? 50,
|
|
10999
|
+
proposalThreshold: p.proposalThreshold,
|
|
11000
|
+
votingPeriodMs: p.votingPeriodMs,
|
|
11001
|
+
timeLockMs
|
|
11002
|
+
});
|
|
11003
|
+
const dao = module_.dao({
|
|
11004
|
+
name: p.name,
|
|
11005
|
+
daoType: "token_governed",
|
|
11006
|
+
smartNodeSecurity: "full",
|
|
11007
|
+
governance,
|
|
11008
|
+
treasury: {
|
|
11009
|
+
accountId: p.treasuryAccountId,
|
|
11010
|
+
controlledTokens: p.controlledTokens
|
|
11011
|
+
},
|
|
11012
|
+
description: `Token-governed DAO: ${p.name}`
|
|
11013
|
+
});
|
|
11014
|
+
return forToken().withController("dao").withOperations({
|
|
11015
|
+
mint: { enabled: true, controller: "dao", requiresApproval: true },
|
|
11016
|
+
burn: { enabled: true, controller: "dao", requiresApproval: true },
|
|
11017
|
+
transfer: { enabled: true, controller: "owner" }
|
|
11018
|
+
}).withGovernance({
|
|
11019
|
+
daoTokenId: p.governanceTokenId,
|
|
11020
|
+
proposalThreshold: p.proposalThreshold,
|
|
11021
|
+
votingPeriodSeconds: Math.floor(p.votingPeriodMs / 1e3),
|
|
11022
|
+
timelockSeconds: Math.floor(timeLockMs / 1e3),
|
|
11023
|
+
quorumPercentage: quorum
|
|
11024
|
+
}).addModule(dao).withInvariants({
|
|
11025
|
+
minQuorumPercentage: quorum,
|
|
11026
|
+
minTimelockSeconds: Math.floor(timeLockMs / 1e3),
|
|
11027
|
+
immutableFields: ["governance", "treasury"]
|
|
11028
|
+
}).withMetadata(meta("tokenDAO", p.description)).build();
|
|
11029
|
+
}
|
|
11030
|
+
function multisigDAO(p) {
|
|
11031
|
+
if (p.threshold < 1 || p.threshold > p.signers.length) {
|
|
11032
|
+
throw new Error(
|
|
11033
|
+
`multisigDAO: threshold ${p.threshold} must be between 1 and signers.length (${p.signers.length})`
|
|
11034
|
+
);
|
|
11035
|
+
}
|
|
11036
|
+
const proposalExpirationMs = p.proposalExpirationMs ?? 7 * 24 * 60 * 60 * 1e3;
|
|
11037
|
+
const governance = molecule.governance({
|
|
11038
|
+
governanceTokenId: "multisig",
|
|
11039
|
+
proposalThreshold: "0",
|
|
11040
|
+
votingPeriodMs: proposalExpirationMs,
|
|
11041
|
+
quorumPercent: 0,
|
|
11042
|
+
approvalThresholdPercent: Math.floor(p.threshold / p.signers.length * 100)
|
|
11043
|
+
});
|
|
11044
|
+
const dao = module_.dao({
|
|
11045
|
+
name: p.name,
|
|
11046
|
+
daoType: "multisig",
|
|
11047
|
+
smartNodeSecurity: "full",
|
|
11048
|
+
governance,
|
|
11049
|
+
treasury: {
|
|
11050
|
+
accountId: p.treasuryAccountId,
|
|
11051
|
+
controlledTokens: p.controlledTokens
|
|
11052
|
+
},
|
|
11053
|
+
multisig: {
|
|
11054
|
+
signers: p.signers,
|
|
11055
|
+
threshold: p.threshold,
|
|
11056
|
+
proposalExpirationMs
|
|
11057
|
+
},
|
|
11058
|
+
description: `Multisig DAO: ${p.name}`
|
|
11059
|
+
});
|
|
11060
|
+
return forToken().withController("owner").withOperations({
|
|
11061
|
+
transfer: { enabled: true, controller: "owner", requiresApproval: true }
|
|
11062
|
+
}).addModule(dao).withMetadata(meta("multisigDAO", p.description)).build();
|
|
11063
|
+
}
|
|
11064
|
+
function simpleAMM(p) {
|
|
11065
|
+
const swapFeePercent = p.swapFeePercent ?? 0.3;
|
|
11066
|
+
const poolId = `${p.tokenA.tokenId}-${p.tokenB.tokenId}`;
|
|
11067
|
+
const dex = module_.dex({
|
|
11068
|
+
name: p.name,
|
|
11069
|
+
dexType: "amm",
|
|
11070
|
+
pools: [
|
|
11071
|
+
{
|
|
11072
|
+
poolId,
|
|
11073
|
+
tokenA: p.tokenA,
|
|
11074
|
+
tokenB: p.tokenB,
|
|
11075
|
+
curveType: "constant_product",
|
|
11076
|
+
swapFeePercent
|
|
11077
|
+
}
|
|
11078
|
+
],
|
|
11079
|
+
defaultSwapFeePercent: swapFeePercent,
|
|
11080
|
+
multiHopEnabled: false,
|
|
11081
|
+
description: `Single-pool AMM: ${poolId}`
|
|
11082
|
+
});
|
|
11083
|
+
return forToken().withOperations({
|
|
11084
|
+
transfer: { enabled: true, controller: "owner" }
|
|
11085
|
+
}).addModule(dex).withMetadata(meta("simpleAMM", p.description)).build();
|
|
11086
|
+
}
|
|
11087
|
+
function vestingSchedule(p) {
|
|
11088
|
+
const startEpoch = toEpoch(p.startAt);
|
|
11089
|
+
const vestingMolecule = molecule.vesting({
|
|
11090
|
+
tokenId: p.tokenId,
|
|
11091
|
+
totalAmount: p.totalAmount,
|
|
11092
|
+
beneficiary: p.beneficiary,
|
|
11093
|
+
scheduleType: p.scheduleType,
|
|
11094
|
+
startAt: new Date(startEpoch).toISOString(),
|
|
11095
|
+
cliffDurationMs: p.cliffDurationMs ?? 0,
|
|
11096
|
+
vestingDurationMs: p.vestingDurationMs,
|
|
11097
|
+
treasuryAccount: p.treasuryAccount,
|
|
11098
|
+
returnToTreasury: p.treasuryAccount !== void 0
|
|
11099
|
+
});
|
|
11100
|
+
const vestingModule = {
|
|
11101
|
+
type: "vesting",
|
|
11102
|
+
version: "1.0.0",
|
|
11103
|
+
config: vestingMolecule
|
|
11104
|
+
};
|
|
11105
|
+
return forAccount().withOperations({
|
|
11106
|
+
transfer: { enabled: true, controller: "owner" }
|
|
11107
|
+
}).addModule(vestingModule).withMetadata(meta("vestingSchedule", p.description)).build();
|
|
11108
|
+
}
|
|
11109
|
+
function tradingAgent(p) {
|
|
11110
|
+
return forAgent().withName(p.name).withAgentType("trading").withTradeLimits({
|
|
11111
|
+
maxPerTrade: p.maxPerTrade,
|
|
11112
|
+
dailyLimit: p.dailyLimit
|
|
11113
|
+
}).withApprovedPairs({
|
|
11114
|
+
pairs: p.approvedPairs,
|
|
11115
|
+
strictMode: true
|
|
11116
|
+
}).withCooldown({ cooldownMs: p.cooldownMs ?? 0 }).withApprovalThreshold({
|
|
11117
|
+
threshold: p.approvalThreshold ?? "999999999"
|
|
11118
|
+
}).withMetadata(meta("tradingAgent", p.description)).build();
|
|
11119
|
+
}
|
|
11120
|
+
var template = {
|
|
11121
|
+
fairLaunch,
|
|
11122
|
+
tieredIDO,
|
|
11123
|
+
simpleStaking,
|
|
11124
|
+
tokenDAO,
|
|
11125
|
+
multisigDAO,
|
|
11126
|
+
simpleAMM,
|
|
11127
|
+
vestingSchedule,
|
|
11128
|
+
tradingAgent
|
|
11129
|
+
};
|
|
11130
|
+
|
|
11131
|
+
// src/rules/index.ts
|
|
11132
|
+
var Rules = {
|
|
11133
|
+
/** Build a canonical `TokenValidatorRules`. */
|
|
11134
|
+
forToken,
|
|
11135
|
+
/** Build a canonical `AccountValidatorRules`. */
|
|
11136
|
+
forAccount,
|
|
11137
|
+
/** Build a canonical `TopicValidatorRules`. */
|
|
11138
|
+
forTopic,
|
|
11139
|
+
/** Build a canonical `AgentValidatorRules`. */
|
|
11140
|
+
forAgent,
|
|
11141
|
+
/** Local preflight — runs the canonical Zod schema, returns `{valid, errors}`. */
|
|
11142
|
+
validate,
|
|
11143
|
+
/** Atom factories — typed config for primitive rule pieces (`timeRange`, `limits`, …). */
|
|
11144
|
+
atom,
|
|
11145
|
+
/** Molecule factories — typed config for compound rules (`tokenGate`, `governance`, …). */
|
|
11146
|
+
molecule,
|
|
11147
|
+
/** Module factories — typed organism configs wrapped as canonical `ModuleEntry`. */
|
|
11148
|
+
module: module_,
|
|
11149
|
+
/** One-call template factories — ready-to-publish canonical ValidatorRules. */
|
|
11150
|
+
template
|
|
11151
|
+
};
|
|
9938
11152
|
/*! Bundled license information:
|
|
9939
11153
|
|
|
9940
11154
|
@scure/base/lib/index.js:
|
|
@@ -9952,9 +11166,31 @@ async function verifyPqcAttestation(cert, payload, registrySnapshot) {
|
|
|
9952
11166
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
9953
11167
|
*/
|
|
9954
11168
|
|
|
11169
|
+
exports.AccountKeyConditionsSchema = AccountKeyConditionsSchema;
|
|
11170
|
+
exports.AccountOperationsConfigSchema = AccountOperationsConfigSchema;
|
|
11171
|
+
exports.AccountRulesBuilder = AccountRulesBuilder;
|
|
11172
|
+
exports.AccountValidatorRulesSchema = AccountValidatorRulesSchema;
|
|
11173
|
+
exports.AgentAccessControlModeSchema = AgentAccessControlModeSchema;
|
|
11174
|
+
exports.AgentAllocationLimitsSchema = AgentAllocationLimitsSchema;
|
|
11175
|
+
exports.AgentApprovalThresholdSchema = AgentApprovalThresholdSchema;
|
|
11176
|
+
exports.AgentApprovedPairsSchema = AgentApprovedPairsSchema;
|
|
11177
|
+
exports.AgentControllerTypeSchema = AgentControllerTypeSchema;
|
|
11178
|
+
exports.AgentCooldownSchema = AgentCooldownSchema;
|
|
11179
|
+
exports.AgentOperationalWindowSchema = AgentOperationalWindowSchema;
|
|
11180
|
+
exports.AgentPermissionEntrySchema = AgentPermissionEntrySchema;
|
|
11181
|
+
exports.AgentPermissionScopeSchema = AgentPermissionScopeSchema;
|
|
11182
|
+
exports.AgentPermissionsSchema = AgentPermissionsSchema;
|
|
11183
|
+
exports.AgentRulesBuilder = AgentRulesBuilder;
|
|
11184
|
+
exports.AgentTokenPairSchema = AgentTokenPairSchema;
|
|
11185
|
+
exports.AgentTradeLimitsSchema = AgentTradeLimitsSchema;
|
|
11186
|
+
exports.AgentTypeSchema = AgentTypeSchema;
|
|
11187
|
+
exports.AgentValidatorRulesSchema = AgentValidatorRulesSchema;
|
|
9955
11188
|
exports.AgentsClient = AgentsClient;
|
|
9956
11189
|
exports.BaasClient = BaasClient;
|
|
9957
11190
|
exports.BaasError = BaasError;
|
|
11191
|
+
exports.BaseOperationConfigSchema = BaseOperationConfigSchema;
|
|
11192
|
+
exports.BaseRuleBuilder = BaseRuleBuilder;
|
|
11193
|
+
exports.BurnOperationConfigSchema = BurnOperationConfigSchema;
|
|
9958
11194
|
exports.CapabilityNotEnabledError = CapabilityNotEnabledError;
|
|
9959
11195
|
exports.CapabilityValidationError = CapabilityValidationError;
|
|
9960
11196
|
exports.CircuitBreaker = CircuitBreaker;
|
|
@@ -9967,39 +11203,79 @@ exports.DatabaseClient = DatabaseClient;
|
|
|
9967
11203
|
exports.DeploymentClient = DeploymentClient;
|
|
9968
11204
|
exports.DnsClient = DnsClient;
|
|
9969
11205
|
exports.DomainsClient = DomainsClient;
|
|
11206
|
+
exports.EntitiesClient = EntitiesClient;
|
|
9970
11207
|
exports.ErrorCode = ErrorCode;
|
|
11208
|
+
exports.FeeConditionsSchema = FeeConditionsSchema;
|
|
11209
|
+
exports.FixedFeeConditionSchema = FixedFeeConditionSchema;
|
|
11210
|
+
exports.FractionalFeeConditionSchema = FractionalFeeConditionSchema;
|
|
11211
|
+
exports.FreezeOperationConfigSchema = FreezeOperationConfigSchema;
|
|
9971
11212
|
exports.FunctionsClient = FunctionsClient;
|
|
11213
|
+
exports.FungibleTokenGateSchema = FungibleTokenGateSchema;
|
|
9972
11214
|
exports.GovernanceClient = GovernanceClient;
|
|
11215
|
+
exports.GovernanceConfigSchema = GovernanceConfigSchema;
|
|
9973
11216
|
exports.HederaTransactionsClient = HederaTransactionsClient;
|
|
9974
11217
|
exports.HistoricalBalanceClient = HistoricalBalanceClient;
|
|
9975
11218
|
exports.HistoricalBalanceClientError = HistoricalBalanceClientError;
|
|
9976
11219
|
exports.IPFSClient = IPFSClient;
|
|
11220
|
+
exports.KNOWN_NETWORKS = KNOWN_NETWORKS;
|
|
11221
|
+
exports.KeyConditionSchema = KeyConditionSchema;
|
|
9977
11222
|
exports.MIRROR_NODE_URLS = MIRROR_NODE_URLS;
|
|
9978
11223
|
exports.MessagingClient = MessagingClient;
|
|
11224
|
+
exports.MintOperationConfigSchema = MintOperationConfigSchema;
|
|
9979
11225
|
exports.MirrorNodeClient = MirrorNodeClient;
|
|
9980
11226
|
exports.MirrorNodeError = MirrorNodeError;
|
|
11227
|
+
exports.ModuleEntrySchema = ModuleEntrySchema;
|
|
11228
|
+
exports.NonFungibleTokenGateSchema = NonFungibleTokenGateSchema;
|
|
11229
|
+
exports.OperationControllerSchema = OperationControllerSchema;
|
|
11230
|
+
exports.OperationLimitsSchema = OperationLimitsSchema;
|
|
9981
11231
|
exports.PERSONHOOD_VERIFIER_NOT_CONFIGURED = PERSONHOOD_VERIFIER_NOT_CONFIGURED;
|
|
11232
|
+
exports.PauseOperationConfigSchema = PauseOperationConfigSchema;
|
|
11233
|
+
exports.PayloadSchemaRefSchema = PayloadSchemaRefSchema;
|
|
9982
11234
|
exports.PersonhoodClient = PersonhoodClient;
|
|
9983
11235
|
exports.PolkadotTransactionsClient = PolkadotTransactionsClient;
|
|
9984
11236
|
exports.PqcCertV1Schema = PqcCertV1Schema;
|
|
9985
11237
|
exports.RateLimiter = RateLimiter;
|
|
9986
11238
|
exports.RoutingClient = RoutingClient;
|
|
11239
|
+
exports.RoyaltyFeeConditionSchema = RoyaltyFeeConditionSchema;
|
|
11240
|
+
exports.RuleBuildError = RuleBuildError;
|
|
11241
|
+
exports.RuleInvariantsSchema = RuleInvariantsSchema;
|
|
11242
|
+
exports.Rules = Rules;
|
|
11243
|
+
exports.RulesClient = RulesClient;
|
|
9987
11244
|
exports.SdkHttpError = SdkHttpError;
|
|
9988
11245
|
exports.SettlementClient = SettlementClient;
|
|
9989
11246
|
exports.SmartEngineClient = SmartEngineClient;
|
|
9990
11247
|
exports.SmartEngineError = SmartEngineError;
|
|
9991
11248
|
exports.SmartGatewayClient = SmartGatewayClient;
|
|
11249
|
+
exports.SmartNodeSecuritySchema = SmartNodeSecuritySchema;
|
|
9992
11250
|
exports.SnapshotsClient = SnapshotsClient;
|
|
9993
11251
|
exports.SolanaTransactionsClient = SolanaTransactionsClient;
|
|
11252
|
+
exports.SoulboundAllowedActionSchema = SoulboundAllowedActionSchema;
|
|
11253
|
+
exports.SoulboundNftConfigSchema = SoulboundNftConfigSchema;
|
|
9994
11254
|
exports.StorageClient = StorageClient;
|
|
11255
|
+
exports.SubmitOperationConfigSchema = SubmitOperationConfigSchema;
|
|
9995
11256
|
exports.SubscriptionClient = SubscriptionClient;
|
|
9996
11257
|
exports.TSSClient = TSSClient;
|
|
11258
|
+
exports.TimeRangeSchema = TimeRangeSchema;
|
|
11259
|
+
exports.TokenGateConditionsSchema = TokenGateConditionsSchema;
|
|
11260
|
+
exports.TokenKeyConditionsSchema = TokenKeyConditionsSchema;
|
|
11261
|
+
exports.TokenOperationsConfigSchema = TokenOperationsConfigSchema;
|
|
11262
|
+
exports.TokenRulesBuilder = TokenRulesBuilder;
|
|
11263
|
+
exports.TokenValidatorRulesSchema = TokenValidatorRulesSchema;
|
|
11264
|
+
exports.TopicKeyConditionsSchema = TopicKeyConditionsSchema;
|
|
11265
|
+
exports.TopicOperationsConfigSchema = TopicOperationsConfigSchema;
|
|
11266
|
+
exports.TopicRulesBuilder = TopicRulesBuilder;
|
|
11267
|
+
exports.TopicValidatorRulesSchema = TopicValidatorRulesSchema;
|
|
9997
11268
|
exports.TransactionsClient = TransactionsClient;
|
|
11269
|
+
exports.TransferOperationConfigSchema = TransferOperationConfigSchema;
|
|
9998
11270
|
exports.UnsupportedCapabilityError = UnsupportedCapabilityError;
|
|
11271
|
+
exports.UpdateOperationConfigSchema = UpdateOperationConfigSchema;
|
|
9999
11272
|
exports.ValidatorAuthClient = ValidatorAuthClient;
|
|
10000
11273
|
exports.ValidatorAuthError = ValidatorAuthError;
|
|
10001
11274
|
exports.ValidatorDiscoveryClient = ValidatorDiscoveryClient;
|
|
11275
|
+
exports.ValidatorMetadataSchema = ValidatorMetadataSchema;
|
|
11276
|
+
exports.ValidatorRulesSchema = ValidatorRulesSchema;
|
|
10002
11277
|
exports.XrplTransactionsClient = XrplTransactionsClient;
|
|
11278
|
+
exports.atom = atom;
|
|
10003
11279
|
exports.auth = auth_exports;
|
|
10004
11280
|
exports.baas = baas_exports;
|
|
10005
11281
|
exports.chains = chains_exports;
|
|
@@ -10008,17 +11284,35 @@ exports.createResilientFetchWithBreaker = createResilientFetchWithBreaker;
|
|
|
10008
11284
|
exports.createXrplWeb3Signer = createXrplWeb3Signer;
|
|
10009
11285
|
exports.discovery = discovery_exports;
|
|
10010
11286
|
exports.encodePathParam = encodePathParam;
|
|
11287
|
+
exports.fairLaunch = fairLaunch;
|
|
10011
11288
|
exports.fetchRegistrySnapshot = fetchRegistrySnapshot;
|
|
11289
|
+
exports.forAccount = forAccount;
|
|
11290
|
+
exports.forAgent = forAgent;
|
|
11291
|
+
exports.forToken = forToken;
|
|
11292
|
+
exports.forTopic = forTopic;
|
|
10012
11293
|
exports.governance = governance_exports;
|
|
11294
|
+
exports.isKnownNetwork = isKnownNetwork;
|
|
10013
11295
|
exports.isPersonhoodVerifierNotConfigured = isPersonhoodVerifierNotConfigured;
|
|
10014
11296
|
exports.isRuleRejected = isRuleRejected;
|
|
11297
|
+
exports.module_ = module_;
|
|
11298
|
+
exports.molecule = molecule;
|
|
11299
|
+
exports.multisigDAO = multisigDAO;
|
|
10015
11300
|
exports.parsePqcCert = parsePqcCert;
|
|
10016
11301
|
exports.personhood = personhood_exports;
|
|
10017
11302
|
exports.pqcVerify = pqc_verify_exports;
|
|
10018
11303
|
exports.resilientFetch = resilientFetch;
|
|
11304
|
+
exports.resolveNetwork = resolveNetwork;
|
|
10019
11305
|
exports.settlement = settlement_exports;
|
|
11306
|
+
exports.simpleAMM = simpleAMM;
|
|
11307
|
+
exports.simpleStaking = simpleStaking;
|
|
10020
11308
|
exports.subscription = subscription_exports;
|
|
11309
|
+
exports.template = template;
|
|
11310
|
+
exports.tieredIDO = tieredIDO;
|
|
11311
|
+
exports.tokenDAO = tokenDAO;
|
|
11312
|
+
exports.tradingAgent = tradingAgent;
|
|
11313
|
+
exports.validate = validate;
|
|
10021
11314
|
exports.validateAgentRules = validateAgentRules;
|
|
10022
11315
|
exports.verifyPqcAttestation = verifyPqcAttestation;
|
|
11316
|
+
exports.vestingSchedule = vestingSchedule;
|
|
10023
11317
|
//# sourceMappingURL=index.js.map
|
|
10024
11318
|
//# sourceMappingURL=index.js.map
|