@cascade-fyi/sati-sdk 0.4.2 → 0.6.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 +33 -0
- package/README.md +43 -0
- package/dist/index.cjs +330 -213
- package/dist/index.d.cts +240 -161
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +240 -161
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +329 -214
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -3804,9 +3804,19 @@ var SATILightClientImpl = class {
|
|
|
3804
3804
|
};
|
|
3805
3805
|
}
|
|
3806
3806
|
async queryAttestations(filter, deserializer) {
|
|
3807
|
+
const memcmpFilters = [];
|
|
3808
|
+
memcmpFilters.push({
|
|
3809
|
+
offset: BORSH_OFFSETS.SAS_SCHEMA,
|
|
3810
|
+
bytes: filter.sasSchema
|
|
3811
|
+
});
|
|
3812
|
+
if (filter.agentMint) memcmpFilters.push({
|
|
3813
|
+
offset: BORSH_OFFSETS.AGENT_MINT,
|
|
3814
|
+
bytes: filter.agentMint
|
|
3815
|
+
});
|
|
3807
3816
|
const result = await this.rpc.getCompressedAccountsByOwner(this.programId, {
|
|
3808
3817
|
cursor: filter.cursor,
|
|
3809
|
-
limit: filter.limit
|
|
3818
|
+
limit: filter.limit,
|
|
3819
|
+
filters: memcmpFilters
|
|
3810
3820
|
});
|
|
3811
3821
|
const attestations = [];
|
|
3812
3822
|
for (const account of result.items) {
|
|
@@ -3814,8 +3824,8 @@ var SATILightClientImpl = class {
|
|
|
3814
3824
|
try {
|
|
3815
3825
|
const parsed = this.parseAttestation(account, deserializer);
|
|
3816
3826
|
if (!parsed) continue;
|
|
3817
|
-
if (parsed.
|
|
3818
|
-
if (filter.
|
|
3827
|
+
if (filter.counterparty && parsed.data.counterparty !== filter.counterparty) continue;
|
|
3828
|
+
if (filter.outcome !== void 0 && parsed.data.outcome !== filter.outcome) continue;
|
|
3819
3829
|
attestations.push(parsed);
|
|
3820
3830
|
} catch {}
|
|
3821
3831
|
}
|
|
@@ -4601,6 +4611,81 @@ function deserializeEncryptedPayload(bytes) {
|
|
|
4601
4611
|
};
|
|
4602
4612
|
}
|
|
4603
4613
|
|
|
4614
|
+
//#endregion
|
|
4615
|
+
//#region src/uploaders.ts
|
|
4616
|
+
const SATI_UPLOAD_URL = "https://sati.cascade.fyi/api/upload-metadata";
|
|
4617
|
+
/**
|
|
4618
|
+
* Create a hosted SATI metadata uploader.
|
|
4619
|
+
*
|
|
4620
|
+
* Uploads JSON to the SATI Identity Service which pins it to IPFS via Pinata.
|
|
4621
|
+
* No API keys needed - zero-config alternative to `createPinataUploader()`.
|
|
4622
|
+
*
|
|
4623
|
+
* @returns MetadataUploader that uploads via sati.cascade.fyi
|
|
4624
|
+
*
|
|
4625
|
+
* @example
|
|
4626
|
+
* ```typescript
|
|
4627
|
+
* const uploader = createSatiUploader();
|
|
4628
|
+
* const uri = await uploader.upload({ name: "MyAgent" });
|
|
4629
|
+
* // "ipfs://QmXyz..."
|
|
4630
|
+
* ```
|
|
4631
|
+
*/
|
|
4632
|
+
function createSatiUploader() {
|
|
4633
|
+
return { async upload(data) {
|
|
4634
|
+
const response = await fetch(SATI_UPLOAD_URL, {
|
|
4635
|
+
method: "POST",
|
|
4636
|
+
headers: { "Content-Type": "application/json" },
|
|
4637
|
+
body: JSON.stringify(data)
|
|
4638
|
+
});
|
|
4639
|
+
if (!response.ok) {
|
|
4640
|
+
const text = await response.text();
|
|
4641
|
+
throw new Error(`Metadata upload failed (${response.status}): ${text}`);
|
|
4642
|
+
}
|
|
4643
|
+
return (await response.json()).uri;
|
|
4644
|
+
} };
|
|
4645
|
+
}
|
|
4646
|
+
/**
|
|
4647
|
+
* Create a Pinata IPFS uploader using the v3 Files API.
|
|
4648
|
+
*
|
|
4649
|
+
* @param jwt - Pinata API JWT token (requires `files:write` permission)
|
|
4650
|
+
* @returns MetadataUploader that pins JSON to public IPFS via Pinata
|
|
4651
|
+
*
|
|
4652
|
+
* @example
|
|
4653
|
+
* ```typescript
|
|
4654
|
+
* const uploader = createPinataUploader(process.env.PINATA_JWT!);
|
|
4655
|
+
* const uri = await uploader.upload({ name: "MyAgent" });
|
|
4656
|
+
* // "ipfs://QmXyz..."
|
|
4657
|
+
* ```
|
|
4658
|
+
*/
|
|
4659
|
+
function createPinataUploader(jwt) {
|
|
4660
|
+
return { async upload(data) {
|
|
4661
|
+
const jsonStr = JSON.stringify(data, null, 2);
|
|
4662
|
+
const blob = new Blob([jsonStr], { type: "application/json" });
|
|
4663
|
+
const formData = new FormData();
|
|
4664
|
+
formData.append("file", blob, "registration.json");
|
|
4665
|
+
formData.append("network", "public");
|
|
4666
|
+
const response = await fetch("https://uploads.pinata.cloud/v3/files", {
|
|
4667
|
+
method: "POST",
|
|
4668
|
+
headers: { Authorization: `Bearer ${jwt}` },
|
|
4669
|
+
body: formData
|
|
4670
|
+
});
|
|
4671
|
+
if (!response.ok) {
|
|
4672
|
+
const text = await response.text();
|
|
4673
|
+
throw new Error(`IPFS upload failed (${response.status}): ${text}`);
|
|
4674
|
+
}
|
|
4675
|
+
const result = await response.json();
|
|
4676
|
+
const cid = result.data?.cid;
|
|
4677
|
+
if (!cid) throw new Error(`No CID returned from Pinata. Response: ${JSON.stringify(result)}`);
|
|
4678
|
+
try {
|
|
4679
|
+
const verifyResponse = await fetch(`https://gateway.pinata.cloud/ipfs/${cid}`, { signal: AbortSignal.timeout(5e3) });
|
|
4680
|
+
if (!verifyResponse.ok && verifyResponse.status !== 429) throw new Error(`Pinata returned CID ${cid} but content not accessible on gateway (HTTP ${verifyResponse.status})`);
|
|
4681
|
+
} catch (verifyError) {
|
|
4682
|
+
if (verifyError instanceof Error && !verifyError.message.includes("not accessible")) console.warn(`[SATI] Pinata gateway verification skipped for ${cid}: ${verifyError.message}`);
|
|
4683
|
+
else throw verifyError;
|
|
4684
|
+
}
|
|
4685
|
+
return `ipfs://${cid}`;
|
|
4686
|
+
} };
|
|
4687
|
+
}
|
|
4688
|
+
|
|
4604
4689
|
//#endregion
|
|
4605
4690
|
//#region src/deployed/devnet.json
|
|
4606
4691
|
var config$1 = {
|
|
@@ -4663,6 +4748,221 @@ function getDeployedNetworks() {
|
|
|
4663
4748
|
return Object.entries(configs).filter(([_, config$2]) => config$2 !== null).map(([network]) => network);
|
|
4664
4749
|
}
|
|
4665
4750
|
|
|
4751
|
+
//#endregion
|
|
4752
|
+
//#region src/registration.ts
|
|
4753
|
+
/**
|
|
4754
|
+
* SATI Registration File
|
|
4755
|
+
*
|
|
4756
|
+
* Helpers for building, fetching, and working with ERC-8004 + Phantom
|
|
4757
|
+
* compatible registration files.
|
|
4758
|
+
*
|
|
4759
|
+
* @example
|
|
4760
|
+
* ```typescript
|
|
4761
|
+
* import {
|
|
4762
|
+
* buildRegistrationFile,
|
|
4763
|
+
* fetchRegistrationFile,
|
|
4764
|
+
* getImageUrl,
|
|
4765
|
+
* } from "@cascade-fyi/sati-sdk";
|
|
4766
|
+
*
|
|
4767
|
+
* // Build a registration file
|
|
4768
|
+
* const file = buildRegistrationFile({
|
|
4769
|
+
* name: "MyAgent",
|
|
4770
|
+
* description: "AI assistant",
|
|
4771
|
+
* image: "https://example.com/avatar.png",
|
|
4772
|
+
* });
|
|
4773
|
+
*
|
|
4774
|
+
* // Fetch from URI
|
|
4775
|
+
* const metadata = await fetchRegistrationFile(uri);
|
|
4776
|
+
* const imageUrl = getImageUrl(metadata);
|
|
4777
|
+
* ```
|
|
4778
|
+
*/
|
|
4779
|
+
const PropertyFileSchema = z.object({
|
|
4780
|
+
uri: z.url(),
|
|
4781
|
+
type: z.string()
|
|
4782
|
+
});
|
|
4783
|
+
const PropertiesSchema = z.object({
|
|
4784
|
+
files: z.array(PropertyFileSchema).min(1),
|
|
4785
|
+
category: z.enum([
|
|
4786
|
+
"image",
|
|
4787
|
+
"video",
|
|
4788
|
+
"audio"
|
|
4789
|
+
]).optional()
|
|
4790
|
+
});
|
|
4791
|
+
const EndpointSchema = z.object({
|
|
4792
|
+
name: z.string(),
|
|
4793
|
+
endpoint: z.string(),
|
|
4794
|
+
version: z.string().optional(),
|
|
4795
|
+
mcpTools: z.array(z.string()).optional(),
|
|
4796
|
+
mcpPrompts: z.array(z.string()).optional(),
|
|
4797
|
+
mcpResources: z.array(z.string()).optional(),
|
|
4798
|
+
a2aSkills: z.array(z.string()).optional(),
|
|
4799
|
+
skills: z.array(z.string()).optional(),
|
|
4800
|
+
domains: z.array(z.string()).optional()
|
|
4801
|
+
});
|
|
4802
|
+
const RegistrationEntrySchema = z.object({
|
|
4803
|
+
agentId: z.union([z.string(), z.number()]),
|
|
4804
|
+
agentRegistry: z.string()
|
|
4805
|
+
});
|
|
4806
|
+
const TrustMechanismSchema = z.enum([
|
|
4807
|
+
"reputation",
|
|
4808
|
+
"crypto-economic",
|
|
4809
|
+
"tee-attestation"
|
|
4810
|
+
]);
|
|
4811
|
+
const RegistrationFileSchema = z.object({
|
|
4812
|
+
type: z.literal("https://eips.ethereum.org/EIPS/eip-8004#registration-v1"),
|
|
4813
|
+
name: z.string().min(1),
|
|
4814
|
+
description: z.string().min(1),
|
|
4815
|
+
image: z.url(),
|
|
4816
|
+
properties: PropertiesSchema,
|
|
4817
|
+
external_url: z.url().optional(),
|
|
4818
|
+
endpoints: z.array(EndpointSchema).optional(),
|
|
4819
|
+
registrations: z.array(RegistrationEntrySchema).optional(),
|
|
4820
|
+
supportedTrust: z.array(TrustMechanismSchema).optional(),
|
|
4821
|
+
active: z.boolean().optional().default(true),
|
|
4822
|
+
x402support: z.boolean().optional()
|
|
4823
|
+
});
|
|
4824
|
+
const MIME_TYPES = {
|
|
4825
|
+
png: "image/png",
|
|
4826
|
+
jpg: "image/jpeg",
|
|
4827
|
+
jpeg: "image/jpeg",
|
|
4828
|
+
gif: "image/gif",
|
|
4829
|
+
webp: "image/webp",
|
|
4830
|
+
svg: "image/svg+xml"
|
|
4831
|
+
};
|
|
4832
|
+
/**
|
|
4833
|
+
* Infer MIME type from image URL extension.
|
|
4834
|
+
* Returns "image/png" as default if unrecognized.
|
|
4835
|
+
*/
|
|
4836
|
+
function inferMimeType(url) {
|
|
4837
|
+
return MIME_TYPES[url.split(".").pop()?.toLowerCase().split("?")[0] ?? ""] ?? "image/png";
|
|
4838
|
+
}
|
|
4839
|
+
/**
|
|
4840
|
+
* Build a registration file from parameters.
|
|
4841
|
+
*
|
|
4842
|
+
* Automatically:
|
|
4843
|
+
* - Sets the ERC-8004 type identifier
|
|
4844
|
+
* - Generates properties.files from image URL
|
|
4845
|
+
* - Infers MIME type from extension
|
|
4846
|
+
* - Sets active to true by default
|
|
4847
|
+
*
|
|
4848
|
+
* @throws Error if required fields are missing or invalid
|
|
4849
|
+
*/
|
|
4850
|
+
function buildRegistrationFile(params) {
|
|
4851
|
+
const mimeType = params.imageMimeType ?? inferMimeType(params.image);
|
|
4852
|
+
const file = {
|
|
4853
|
+
type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
|
|
4854
|
+
name: params.name,
|
|
4855
|
+
description: params.description,
|
|
4856
|
+
image: params.image,
|
|
4857
|
+
properties: {
|
|
4858
|
+
files: [{
|
|
4859
|
+
uri: params.image,
|
|
4860
|
+
type: mimeType
|
|
4861
|
+
}],
|
|
4862
|
+
category: "image"
|
|
4863
|
+
},
|
|
4864
|
+
...params.externalUrl && { external_url: params.externalUrl },
|
|
4865
|
+
...params.endpoints?.length && { endpoints: params.endpoints },
|
|
4866
|
+
...params.registrations?.length && { registrations: params.registrations },
|
|
4867
|
+
...params.supportedTrust?.length && { supportedTrust: params.supportedTrust },
|
|
4868
|
+
active: params.active ?? true,
|
|
4869
|
+
...params.x402support !== void 0 && { x402support: params.x402support }
|
|
4870
|
+
};
|
|
4871
|
+
return RegistrationFileSchema.parse(file);
|
|
4872
|
+
}
|
|
4873
|
+
/**
|
|
4874
|
+
* Fetch and parse a registration file from URI.
|
|
4875
|
+
*
|
|
4876
|
+
* - Returns null on network errors or invalid URIs
|
|
4877
|
+
* - Validates structure, logs warnings for non-conforming files
|
|
4878
|
+
* - Never throws
|
|
4879
|
+
*/
|
|
4880
|
+
async function fetchRegistrationFile(uri) {
|
|
4881
|
+
if (!uri) return null;
|
|
4882
|
+
let url = uri;
|
|
4883
|
+
if (uri.startsWith("ipfs://")) url = `https://ipfs.io/ipfs/${uri.slice(7)}`;
|
|
4884
|
+
else if (uri.startsWith("ar://")) url = `https://arweave.net/${uri.slice(5)}`;
|
|
4885
|
+
else if (!uri.startsWith("http://") && !uri.startsWith("https://")) return null;
|
|
4886
|
+
try {
|
|
4887
|
+
const response = await fetch(url);
|
|
4888
|
+
if (!response.ok) {
|
|
4889
|
+
console.warn(`[SATI] Failed to fetch metadata from ${url}: ${response.status}`);
|
|
4890
|
+
return null;
|
|
4891
|
+
}
|
|
4892
|
+
const data = await response.json();
|
|
4893
|
+
const result = RegistrationFileSchema.safeParse(data);
|
|
4894
|
+
if (!result.success) {
|
|
4895
|
+
console.warn(`[SATI] Registration file validation issues:`, result.error.issues);
|
|
4896
|
+
return data;
|
|
4897
|
+
}
|
|
4898
|
+
return result.data;
|
|
4899
|
+
} catch (error) {
|
|
4900
|
+
console.warn(`[SATI] Failed to fetch metadata from ${uri}:`, error);
|
|
4901
|
+
return null;
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
/**
|
|
4905
|
+
* Extract image URL from a registration file.
|
|
4906
|
+
*
|
|
4907
|
+
* Prefers properties.files (Phantom format), falls back to image field.
|
|
4908
|
+
* Handles IPFS/Arweave URI conversion.
|
|
4909
|
+
*/
|
|
4910
|
+
function getImageUrl(file) {
|
|
4911
|
+
if (!file) return null;
|
|
4912
|
+
const uri = file.properties?.files?.[0]?.uri ?? file.image;
|
|
4913
|
+
if (!uri) return null;
|
|
4914
|
+
if (uri.startsWith("ipfs://")) return `https://ipfs.io/ipfs/${uri.slice(7)}`;
|
|
4915
|
+
if (uri.startsWith("ar://")) return `https://arweave.net/${uri.slice(5)}`;
|
|
4916
|
+
if (uri.startsWith("http://") || uri.startsWith("https://")) return uri;
|
|
4917
|
+
return null;
|
|
4918
|
+
}
|
|
4919
|
+
/**
|
|
4920
|
+
* Serialize a registration file to JSON string.
|
|
4921
|
+
*/
|
|
4922
|
+
function stringifyRegistrationFile(file, space = 2) {
|
|
4923
|
+
return JSON.stringify(file, null, space);
|
|
4924
|
+
}
|
|
4925
|
+
/** CAIP-2 chain identifier for Solana mainnet */
|
|
4926
|
+
const SATI_CHAIN_ID = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
4927
|
+
/** SATI program ID */
|
|
4928
|
+
const SATI_PROGRAM_ID = "satiRkxEiwZ51cv8PRu8UMzuaqeaNU9jABo6oAFMsLe";
|
|
4929
|
+
/**
|
|
4930
|
+
* Build a registrations[] entry for linking a SATI agent to an off-chain registration file.
|
|
4931
|
+
*
|
|
4932
|
+
* @param agentMint - SATI agent mint address
|
|
4933
|
+
* @returns RegistrationEntry for the registrations[] array
|
|
4934
|
+
*
|
|
4935
|
+
* @example
|
|
4936
|
+
* ```typescript
|
|
4937
|
+
* const entry = buildSatiRegistrationEntry("AgentMint...");
|
|
4938
|
+
* // { agentId: "AgentMint...", agentRegistry: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:satiR3q7..." }
|
|
4939
|
+
* ```
|
|
4940
|
+
*/
|
|
4941
|
+
function buildSatiRegistrationEntry(agentMint) {
|
|
4942
|
+
return {
|
|
4943
|
+
agentId: agentMint,
|
|
4944
|
+
agentRegistry: `${SATI_CHAIN_ID}:${SATI_PROGRAM_ID}`
|
|
4945
|
+
};
|
|
4946
|
+
}
|
|
4947
|
+
/**
|
|
4948
|
+
* Check if a registration file contains a SATI registration.
|
|
4949
|
+
*
|
|
4950
|
+
* @param file - Registration file to check
|
|
4951
|
+
* @returns true if file contains at least one SATI registration
|
|
4952
|
+
*/
|
|
4953
|
+
function hasSatiRegistration(file) {
|
|
4954
|
+
return file.registrations?.some((r) => typeof r.agentRegistry === "string" && r.agentRegistry.startsWith(SATI_CHAIN_ID)) ?? false;
|
|
4955
|
+
}
|
|
4956
|
+
/**
|
|
4957
|
+
* Find SATI agent IDs from a registration file.
|
|
4958
|
+
*
|
|
4959
|
+
* @param file - Registration file to search
|
|
4960
|
+
* @returns Array of SATI agent mint addresses
|
|
4961
|
+
*/
|
|
4962
|
+
function getSatiAgentIds(file) {
|
|
4963
|
+
return file.registrations?.filter((r) => typeof r.agentRegistry === "string" && r.agentRegistry.startsWith(SATI_CHAIN_ID)).map((r) => String(r.agentId)) ?? [];
|
|
4964
|
+
}
|
|
4965
|
+
|
|
4666
4966
|
//#endregion
|
|
4667
4967
|
//#region src/client.ts
|
|
4668
4968
|
/**
|
|
@@ -4689,6 +4989,11 @@ const WS_URLS = {
|
|
|
4689
4989
|
devnet: "wss://api.devnet.solana.com",
|
|
4690
4990
|
localnet: "ws://127.0.0.1:8900"
|
|
4691
4991
|
};
|
|
4992
|
+
const PHOTON_URLS = {
|
|
4993
|
+
mainnet: "https://sati.cascade.fyi/api/photon/mainnet",
|
|
4994
|
+
devnet: "https://sati.cascade.fyi/api/photon/devnet",
|
|
4995
|
+
localnet: "http://127.0.0.1:8899"
|
|
4996
|
+
};
|
|
4692
4997
|
/**
|
|
4693
4998
|
* Convert an Address to Base58EncodedBytes for RPC memcmp filters.
|
|
4694
4999
|
*/
|
|
@@ -4761,7 +5066,7 @@ var Sati = class {
|
|
|
4761
5066
|
rpc: this.rpc,
|
|
4762
5067
|
rpcSubscriptions: this.rpcSubscriptions
|
|
4763
5068
|
});
|
|
4764
|
-
this.lightClient = createSATILightClient(options.photonRpcUrl ??
|
|
5069
|
+
this.lightClient = createSATILightClient(options.photonRpcUrl ?? PHOTON_URLS[options.network]);
|
|
4765
5070
|
}
|
|
4766
5071
|
/** @internal */
|
|
4767
5072
|
getRpc() {
|
|
@@ -4814,6 +5119,25 @@ var Sati = class {
|
|
|
4814
5119
|
};
|
|
4815
5120
|
}
|
|
4816
5121
|
/**
|
|
5122
|
+
* Build a registration file from params, upload it via the provided uploader,
|
|
5123
|
+
* and return the resulting URI.
|
|
5124
|
+
*
|
|
5125
|
+
* @example
|
|
5126
|
+
* ```typescript
|
|
5127
|
+
* import { createPinataUploader } from "@cascade-fyi/sati-sdk";
|
|
5128
|
+
*
|
|
5129
|
+
* const uploader = createPinataUploader(process.env.PINATA_JWT!);
|
|
5130
|
+
* const uri = await sati.uploadRegistrationFile(
|
|
5131
|
+
* { name: "MyAgent", description: "AI assistant", image: "https://example.com/img.png" },
|
|
5132
|
+
* uploader,
|
|
5133
|
+
* );
|
|
5134
|
+
* ```
|
|
5135
|
+
*/
|
|
5136
|
+
async uploadRegistrationFile(params, uploader) {
|
|
5137
|
+
const regFile = buildRegistrationFile(params);
|
|
5138
|
+
return uploader.upload(regFile);
|
|
5139
|
+
}
|
|
5140
|
+
/**
|
|
4817
5141
|
* Load agent identity from mint address
|
|
4818
5142
|
*/
|
|
4819
5143
|
async loadAgent(mint) {
|
|
@@ -5864,215 +6188,6 @@ var Sati = class {
|
|
|
5864
6188
|
}
|
|
5865
6189
|
};
|
|
5866
6190
|
|
|
5867
|
-
//#endregion
|
|
5868
|
-
//#region src/registration.ts
|
|
5869
|
-
/**
|
|
5870
|
-
* SATI Registration File
|
|
5871
|
-
*
|
|
5872
|
-
* Helpers for building, fetching, and working with ERC-8004 + Phantom
|
|
5873
|
-
* compatible registration files.
|
|
5874
|
-
*
|
|
5875
|
-
* @example
|
|
5876
|
-
* ```typescript
|
|
5877
|
-
* import {
|
|
5878
|
-
* buildRegistrationFile,
|
|
5879
|
-
* fetchRegistrationFile,
|
|
5880
|
-
* getImageUrl,
|
|
5881
|
-
* } from "@cascade-fyi/sati-sdk";
|
|
5882
|
-
*
|
|
5883
|
-
* // Build a registration file
|
|
5884
|
-
* const file = buildRegistrationFile({
|
|
5885
|
-
* name: "MyAgent",
|
|
5886
|
-
* description: "AI assistant",
|
|
5887
|
-
* image: "https://example.com/avatar.png",
|
|
5888
|
-
* });
|
|
5889
|
-
*
|
|
5890
|
-
* // Fetch from URI
|
|
5891
|
-
* const metadata = await fetchRegistrationFile(uri);
|
|
5892
|
-
* const imageUrl = getImageUrl(metadata);
|
|
5893
|
-
* ```
|
|
5894
|
-
*/
|
|
5895
|
-
const PropertyFileSchema = z.object({
|
|
5896
|
-
uri: z.url(),
|
|
5897
|
-
type: z.string()
|
|
5898
|
-
});
|
|
5899
|
-
const PropertiesSchema = z.object({
|
|
5900
|
-
files: z.array(PropertyFileSchema).min(1),
|
|
5901
|
-
category: z.enum([
|
|
5902
|
-
"image",
|
|
5903
|
-
"video",
|
|
5904
|
-
"audio"
|
|
5905
|
-
]).optional()
|
|
5906
|
-
});
|
|
5907
|
-
const EndpointSchema = z.object({
|
|
5908
|
-
name: z.string(),
|
|
5909
|
-
endpoint: z.string(),
|
|
5910
|
-
version: z.string().optional()
|
|
5911
|
-
});
|
|
5912
|
-
const RegistrationEntrySchema = z.object({
|
|
5913
|
-
agentId: z.union([z.string(), z.number()]),
|
|
5914
|
-
agentRegistry: z.string()
|
|
5915
|
-
});
|
|
5916
|
-
const TrustMechanismSchema = z.enum([
|
|
5917
|
-
"reputation",
|
|
5918
|
-
"crypto-economic",
|
|
5919
|
-
"tee-attestation"
|
|
5920
|
-
]);
|
|
5921
|
-
const RegistrationFileSchema = z.object({
|
|
5922
|
-
type: z.literal("https://eips.ethereum.org/EIPS/eip-8004#registration-v1"),
|
|
5923
|
-
name: z.string().min(1),
|
|
5924
|
-
description: z.string().min(1),
|
|
5925
|
-
image: z.url(),
|
|
5926
|
-
properties: PropertiesSchema,
|
|
5927
|
-
external_url: z.url().optional(),
|
|
5928
|
-
endpoints: z.array(EndpointSchema).optional(),
|
|
5929
|
-
registrations: z.array(RegistrationEntrySchema).optional(),
|
|
5930
|
-
supportedTrust: z.array(TrustMechanismSchema).optional(),
|
|
5931
|
-
active: z.boolean().optional().default(true),
|
|
5932
|
-
x402support: z.boolean().optional()
|
|
5933
|
-
});
|
|
5934
|
-
const MIME_TYPES = {
|
|
5935
|
-
png: "image/png",
|
|
5936
|
-
jpg: "image/jpeg",
|
|
5937
|
-
jpeg: "image/jpeg",
|
|
5938
|
-
gif: "image/gif",
|
|
5939
|
-
webp: "image/webp",
|
|
5940
|
-
svg: "image/svg+xml"
|
|
5941
|
-
};
|
|
5942
|
-
/**
|
|
5943
|
-
* Infer MIME type from image URL extension.
|
|
5944
|
-
* Returns "image/png" as default if unrecognized.
|
|
5945
|
-
*/
|
|
5946
|
-
function inferMimeType(url) {
|
|
5947
|
-
return MIME_TYPES[url.split(".").pop()?.toLowerCase().split("?")[0] ?? ""] ?? "image/png";
|
|
5948
|
-
}
|
|
5949
|
-
/**
|
|
5950
|
-
* Build a registration file from parameters.
|
|
5951
|
-
*
|
|
5952
|
-
* Automatically:
|
|
5953
|
-
* - Sets the ERC-8004 type identifier
|
|
5954
|
-
* - Generates properties.files from image URL
|
|
5955
|
-
* - Infers MIME type from extension
|
|
5956
|
-
* - Sets active to true by default
|
|
5957
|
-
*
|
|
5958
|
-
* @throws Error if required fields are missing or invalid
|
|
5959
|
-
*/
|
|
5960
|
-
function buildRegistrationFile(params) {
|
|
5961
|
-
const mimeType = params.imageMimeType ?? inferMimeType(params.image);
|
|
5962
|
-
const file = {
|
|
5963
|
-
type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
|
|
5964
|
-
name: params.name,
|
|
5965
|
-
description: params.description,
|
|
5966
|
-
image: params.image,
|
|
5967
|
-
properties: {
|
|
5968
|
-
files: [{
|
|
5969
|
-
uri: params.image,
|
|
5970
|
-
type: mimeType
|
|
5971
|
-
}],
|
|
5972
|
-
category: "image"
|
|
5973
|
-
},
|
|
5974
|
-
...params.externalUrl && { external_url: params.externalUrl },
|
|
5975
|
-
...params.endpoints?.length && { endpoints: params.endpoints },
|
|
5976
|
-
...params.registrations?.length && { registrations: params.registrations },
|
|
5977
|
-
...params.supportedTrust?.length && { supportedTrust: params.supportedTrust },
|
|
5978
|
-
active: params.active ?? true,
|
|
5979
|
-
...params.x402support !== void 0 && { x402support: params.x402support }
|
|
5980
|
-
};
|
|
5981
|
-
return RegistrationFileSchema.parse(file);
|
|
5982
|
-
}
|
|
5983
|
-
/**
|
|
5984
|
-
* Fetch and parse a registration file from URI.
|
|
5985
|
-
*
|
|
5986
|
-
* - Returns null on network errors or invalid URIs
|
|
5987
|
-
* - Validates structure, logs warnings for non-conforming files
|
|
5988
|
-
* - Never throws
|
|
5989
|
-
*/
|
|
5990
|
-
async function fetchRegistrationFile(uri) {
|
|
5991
|
-
if (!uri) return null;
|
|
5992
|
-
let url = uri;
|
|
5993
|
-
if (uri.startsWith("ipfs://")) url = `https://ipfs.io/ipfs/${uri.slice(7)}`;
|
|
5994
|
-
else if (uri.startsWith("ar://")) url = `https://arweave.net/${uri.slice(5)}`;
|
|
5995
|
-
else if (!uri.startsWith("http://") && !uri.startsWith("https://")) return null;
|
|
5996
|
-
try {
|
|
5997
|
-
const response = await fetch(url);
|
|
5998
|
-
if (!response.ok) {
|
|
5999
|
-
console.warn(`[SATI] Failed to fetch metadata from ${url}: ${response.status}`);
|
|
6000
|
-
return null;
|
|
6001
|
-
}
|
|
6002
|
-
const data = await response.json();
|
|
6003
|
-
const result = RegistrationFileSchema.safeParse(data);
|
|
6004
|
-
if (!result.success) {
|
|
6005
|
-
console.warn(`[SATI] Registration file validation issues:`, result.error.issues);
|
|
6006
|
-
return data;
|
|
6007
|
-
}
|
|
6008
|
-
return result.data;
|
|
6009
|
-
} catch (error) {
|
|
6010
|
-
console.warn(`[SATI] Failed to fetch metadata from ${uri}:`, error);
|
|
6011
|
-
return null;
|
|
6012
|
-
}
|
|
6013
|
-
}
|
|
6014
|
-
/**
|
|
6015
|
-
* Extract image URL from a registration file.
|
|
6016
|
-
*
|
|
6017
|
-
* Prefers properties.files (Phantom format), falls back to image field.
|
|
6018
|
-
* Handles IPFS/Arweave URI conversion.
|
|
6019
|
-
*/
|
|
6020
|
-
function getImageUrl(file) {
|
|
6021
|
-
if (!file) return null;
|
|
6022
|
-
const uri = file.properties?.files?.[0]?.uri ?? file.image;
|
|
6023
|
-
if (!uri) return null;
|
|
6024
|
-
if (uri.startsWith("ipfs://")) return `https://ipfs.io/ipfs/${uri.slice(7)}`;
|
|
6025
|
-
if (uri.startsWith("ar://")) return `https://arweave.net/${uri.slice(5)}`;
|
|
6026
|
-
if (uri.startsWith("http://") || uri.startsWith("https://")) return uri;
|
|
6027
|
-
return null;
|
|
6028
|
-
}
|
|
6029
|
-
/**
|
|
6030
|
-
* Serialize a registration file to JSON string.
|
|
6031
|
-
*/
|
|
6032
|
-
function stringifyRegistrationFile(file, space = 2) {
|
|
6033
|
-
return JSON.stringify(file, null, space);
|
|
6034
|
-
}
|
|
6035
|
-
/** CAIP-2 chain identifier for Solana mainnet */
|
|
6036
|
-
const SATI_CHAIN_ID = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
6037
|
-
/** SATI program ID */
|
|
6038
|
-
const SATI_PROGRAM_ID = "satiRkxEiwZ51cv8PRu8UMzuaqeaNU9jABo6oAFMsLe";
|
|
6039
|
-
/**
|
|
6040
|
-
* Build a registrations[] entry for linking a SATI agent to an off-chain registration file.
|
|
6041
|
-
*
|
|
6042
|
-
* @param agentMint - SATI agent mint address
|
|
6043
|
-
* @returns RegistrationEntry for the registrations[] array
|
|
6044
|
-
*
|
|
6045
|
-
* @example
|
|
6046
|
-
* ```typescript
|
|
6047
|
-
* const entry = buildSatiRegistrationEntry("AgentMint...");
|
|
6048
|
-
* // { agentId: "AgentMint...", agentRegistry: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:satiR3q7..." }
|
|
6049
|
-
* ```
|
|
6050
|
-
*/
|
|
6051
|
-
function buildSatiRegistrationEntry(agentMint) {
|
|
6052
|
-
return {
|
|
6053
|
-
agentId: agentMint,
|
|
6054
|
-
agentRegistry: `${SATI_CHAIN_ID}:${SATI_PROGRAM_ID}`
|
|
6055
|
-
};
|
|
6056
|
-
}
|
|
6057
|
-
/**
|
|
6058
|
-
* Check if a registration file contains a SATI registration.
|
|
6059
|
-
*
|
|
6060
|
-
* @param file - Registration file to check
|
|
6061
|
-
* @returns true if file contains at least one SATI registration
|
|
6062
|
-
*/
|
|
6063
|
-
function hasSatiRegistration(file) {
|
|
6064
|
-
return file.registrations?.some((r) => typeof r.agentRegistry === "string" && r.agentRegistry.startsWith(SATI_CHAIN_ID)) ?? false;
|
|
6065
|
-
}
|
|
6066
|
-
/**
|
|
6067
|
-
* Find SATI agent IDs from a registration file.
|
|
6068
|
-
*
|
|
6069
|
-
* @param file - Registration file to search
|
|
6070
|
-
* @returns Array of SATI agent mint addresses
|
|
6071
|
-
*/
|
|
6072
|
-
function getSatiAgentIds(file) {
|
|
6073
|
-
return file.registrations?.filter((r) => typeof r.agentRegistry === "string" && r.agentRegistry.startsWith(SATI_CHAIN_ID)).map((r) => String(r.agentId)) ?? [];
|
|
6074
|
-
}
|
|
6075
|
-
|
|
6076
6191
|
//#endregion
|
|
6077
6192
|
//#region src/errors.ts
|
|
6078
6193
|
/** Base class for all SATI SDK errors */
|
|
@@ -6237,5 +6352,5 @@ function handleTransactionError(error) {
|
|
|
6237
6352
|
}
|
|
6238
6353
|
|
|
6239
6354
|
//#endregion
|
|
6240
|
-
export { AGENT_INDEX_DISCRIMINATOR, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, ATTESTATION_SEED, AgentNotFoundError, BASE_OFFSETS, CLOSE_COMPRESSED_ATTESTATION_DISCRIMINATOR, CLOSE_REGULAR_ATTESTATION_DISCRIMINATOR, COMPRESSED_OFFSETS, CREATE_COMPRESSED_ATTESTATION_DISCRIMINATOR, CREATE_REGULAR_ATTESTATION_DISCRIMINATOR, CREDENTIAL_SEED, ContentType, DOMAINS, DataType, DuplicateAttestationError, ED25519_PROGRAM_ADDRESS, ENCRYPTION_VERSION, FEEDBACK_OFFSETS, INITIALIZE_DISCRIMINATOR, LIGHT_ERROR_CODES, LINK_EVM_ADDRESS_DISCRIMINATOR, MAX_CONTENT_SIZE, MAX_DUAL_SIGNATURE_CONTENT_SIZE, MAX_PLAINTEXT_SIZE, MAX_SINGLE_SIGNATURE_CONTENT_SIZE, MIN_BASE_LAYOUT_SIZE, MIN_ENCRYPTED_SIZE, NONCE_SIZE, OFFSETS, Outcome, PRIVKEY_SIZE, PUBKEY_SIZE, REGISTER_AGENT_DISCRIMINATOR, REGISTER_SCHEMA_CONFIG_DISCRIMINATOR, REGISTRY_CONFIG_DISCRIMINATOR, REPUTATION_SCHEMA_NAME, REPUTATION_SCHEMA_VERSION, REPUTATION_SCORE_OFFSETS, SAS_DATA_LEN_OFFSET, SAS_HEADER_SIZE, SAS_PROGRAM_ADDRESS, SATILightClientImpl, SATI_ATTESTATION_SEED, SATI_CHAIN_ID, SATI_ERROR__AGENT_ATA_EMPTY, SATI_ERROR__AGENT_ATA_MINT_MISMATCH, SATI_ERROR__AGENT_ATA_REQUIRED, SATI_ERROR__AGENT_MINT_ACCOUNT_MISMATCH, SATI_ERROR__AGENT_MINT_MISMATCH, SATI_ERROR__AGENT_SIGNATURE_NOT_FOUND, SATI_ERROR__ATTESTATION_DATA_TOO_LARGE, SATI_ERROR__ATTESTATION_DATA_TOO_SMALL, SATI_ERROR__ATTESTATION_NOT_CLOSEABLE, SATI_ERROR__CONTENT_TOO_LARGE, SATI_ERROR__COUNTERPARTY_SIGNATURE_NOT_FOUND, SATI_ERROR__DELEGATE_MISMATCH, SATI_ERROR__DELEGATION_ATTESTATION_REQUIRED, SATI_ERROR__DELEGATION_EXPIRED, SATI_ERROR__DELEGATION_OWNER_MISMATCH, SATI_ERROR__DUPLICATE_SIGNERS, SATI_ERROR__ED25519_INSTRUCTION_NOT_FOUND, SATI_ERROR__EVM_ADDRESS_MISMATCH, SATI_ERROR__IMMUTABLE_AUTHORITY, SATI_ERROR__INVALID_AUTHORITY, SATI_ERROR__INVALID_CONTENT_TYPE, SATI_ERROR__INVALID_DELEGATION_P_D_A, SATI_ERROR__INVALID_ED25519_INSTRUCTION, SATI_ERROR__INVALID_EVM_ADDRESS_RECOVERY, SATI_ERROR__INVALID_GROUP_MINT, SATI_ERROR__INVALID_INSTRUCTIONS_SYSVAR, SATI_ERROR__INVALID_OUTCOME, SATI_ERROR__INVALID_SECP256K1_SIGNATURE, SATI_ERROR__INVALID_SIGNATURE, SATI_ERROR__INVALID_SIGNATURE_COUNT, SATI_ERROR__LIGHT_CPI_INVOCATION_FAILED, SATI_ERROR__MESSAGE_MISMATCH, SATI_ERROR__METADATA_KEY_TOO_LONG, SATI_ERROR__METADATA_VALUE_TOO_LONG, SATI_ERROR__MINT_AUTHORITY_NOT_RENOUNCED, SATI_ERROR__MISSING_SIGNATURES, SATI_ERROR__NAME_TOO_LONG, SATI_ERROR__OVERFLOW, SATI_ERROR__OWNER_ONLY, SATI_ERROR__SCHEMA_CONFIG_NOT_FOUND, SATI_ERROR__SECP256K1_RECOVERY_FAILED, SATI_ERROR__SELF_ATTESTATION_NOT_ALLOWED, SATI_ERROR__SIGNATURE_MISMATCH, SATI_ERROR__STORAGE_TYPE_MISMATCH, SATI_ERROR__STORAGE_TYPE_NOT_SUPPORTED, SATI_ERROR__SYMBOL_TOO_LONG, SATI_ERROR__TOO_MANY_METADATA_ENTRIES, SATI_ERROR__UNAUTHORIZED_CLOSE, SATI_ERROR__UNSUPPORTED_LAYOUT_VERSION, SATI_ERROR__URI_TOO_LONG, SATI_PROGRAM_ADDRESS, SATI_PROGRAM_ID, SCHEMA_CONFIG_DISCRIMINATOR, SCHEMA_SEED, SOLANA_CHAIN_REFS, Sati, SatiAccount, SatiError, SatiInstruction, SchemaNotFoundError, SignatureMode, StorageType, TAG_SIZE, TOKEN_2022_PROGRAM_ADDRESS, UPDATE_REGISTRY_AUTHORITY_DISCRIMINATOR, VALIDATION_OFFSETS, ValidationType, address, addressToBytes, buildCounterpartyMessage, buildFeedbackSigningMessage, buildRegistrationFile, buildSatiRegistrationEntry, bytesToAddress, computeAttestationNonce, computeDataHash, computeDataHashFromHashes, computeDataHashFromStrings, computeEvmLinkHash, computeInteractionHash, computeReputationNonce, createBatchEd25519Instruction, createEd25519Instruction, createJsonContent, createSATILightClient, decodeAgentIndex, decodeRegistryConfig, decodeSchemaConfig, decryptContent, deriveEncryptionKeypair, deriveEncryptionPublicKey, deriveReputationAttestationPda, deriveReputationSchemaPda, deriveSasEventAuthorityPda, deriveSatiPda, deriveSatiProgramCredentialPda, deserializeEncryptedPayload, deserializeFeedback, deserializeReputationScore, deserializeUniversalLayout, deserializeValidation, duplicateAttestationMessage, encryptContent, fetchAgentIndex, fetchAllAgentIndex, fetchAllMaybeAgentIndex, fetchAllMaybeRegistryConfig, fetchAllMaybeSchemaConfig, fetchAllRegistryConfig, fetchAllSchemaConfig, fetchMaybeAgentIndex, fetchMaybeRegistryConfig, fetchMaybeSchemaConfig, fetchRegistrationFile, fetchRegistryConfig, fetchSchemaConfig, findAgentIndexPda, findAssociatedTokenAddress, findRegistryConfigPda, findSchemaConfigPda, formatCaip10, getAgentIndexCodec, getAgentIndexDecoder, getAgentIndexDiscriminatorBytes, getAgentIndexEncoder, getAgentIndexSize, getAgentRegisteredCodec, getAgentRegisteredDecoder, getAgentRegisteredEncoder, getAttestationClosedCodec, getAttestationClosedDecoder, getAttestationClosedEncoder, getAttestationCreatedCodec, getAttestationCreatedDecoder, getAttestationCreatedEncoder, getCloseCompressedAttestationDiscriminatorBytes, getCloseCompressedAttestationInstruction, getCloseCompressedAttestationInstructionAsync, getCloseCompressedAttestationInstructionDataCodec, getCloseCompressedAttestationInstructionDataDecoder, getCloseCompressedAttestationInstructionDataEncoder, getCloseRegularAttestationDiscriminatorBytes, getCloseRegularAttestationInstruction, getCloseRegularAttestationInstructionAsync, getCloseRegularAttestationInstructionDataCodec, getCloseRegularAttestationInstructionDataDecoder, getCloseRegularAttestationInstructionDataEncoder, getCompressedAccountMetaCodec, getCompressedAccountMetaDecoder, getCompressedAccountMetaEncoder, getCompressedProofCodec, getCompressedProofDecoder, getCompressedProofEncoder, getContentTypeLabel, getCreateCompressedAttestationDiscriminatorBytes, getCreateCompressedAttestationInstruction, getCreateCompressedAttestationInstructionAsync, getCreateCompressedAttestationInstructionDataCodec, getCreateCompressedAttestationInstructionDataDecoder, getCreateCompressedAttestationInstructionDataEncoder, getCreateRegularAttestationDiscriminatorBytes, getCreateRegularAttestationInstruction, getCreateRegularAttestationInstructionAsync, getCreateRegularAttestationInstructionDataCodec, getCreateRegularAttestationInstructionDataDecoder, getCreateRegularAttestationInstructionDataEncoder, getDeployedNetworks, getEvmAddressLinkedCodec, getEvmAddressLinkedDecoder, getEvmAddressLinkedEncoder, getImageUrl, getInitializeDiscriminatorBytes, getInitializeInstruction, getInitializeInstructionAsync, getInitializeInstructionDataCodec, getInitializeInstructionDataDecoder, getInitializeInstructionDataEncoder, getLinkEvmAddressDiscriminatorBytes, getLinkEvmAddressInstruction, getLinkEvmAddressInstructionAsync, getLinkEvmAddressInstructionDataCodec, getLinkEvmAddressInstructionDataDecoder, getLinkEvmAddressInstructionDataEncoder, getMaxContentSize, getMetadataEntryCodec, getMetadataEntryDecoder, getMetadataEntryEncoder, getOutcomeLabel, getPackedAddressTreeInfoCodec, getPackedAddressTreeInfoDecoder, getPackedAddressTreeInfoEncoder, getPackedStateTreeInfoCodec, getPackedStateTreeInfoDecoder, getPackedStateTreeInfoEncoder, getRegisterAgentDiscriminatorBytes, getRegisterAgentInstruction, getRegisterAgentInstructionAsync, getRegisterAgentInstructionDataCodec, getRegisterAgentInstructionDataDecoder, getRegisterAgentInstructionDataEncoder, getRegisterSchemaConfigDiscriminatorBytes, getRegisterSchemaConfigInstruction, getRegisterSchemaConfigInstructionAsync, getRegisterSchemaConfigInstructionDataCodec, getRegisterSchemaConfigInstructionDataDecoder, getRegisterSchemaConfigInstructionDataEncoder, getRegistryAuthorityUpdatedCodec, getRegistryAuthorityUpdatedDecoder, getRegistryAuthorityUpdatedEncoder, getRegistryConfigCodec, getRegistryConfigDecoder, getRegistryConfigDiscriminatorBytes, getRegistryConfigEncoder, getRegistryConfigSize, getRegistryInitializedCodec, getRegistryInitializedDecoder, getRegistryInitializedEncoder, getSatiAgentIds, getSatiErrorMessage, getSchemaConfigCodec, getSchemaConfigDecoder, getSchemaConfigDiscriminatorBytes, getSchemaConfigEncoder, getSchemaConfigRegisteredCodec, getSchemaConfigRegisteredDecoder, getSchemaConfigRegisteredEncoder, getSignatureModeCodec, getSignatureModeDecoder, getSignatureModeEncoder, getStorageTypeCodec, getStorageTypeDecoder, getStorageTypeEncoder, getUpdateRegistryAuthorityDiscriminatorBytes, getUpdateRegistryAuthorityInstruction, getUpdateRegistryAuthorityInstructionAsync, getUpdateRegistryAuthorityInstructionDataCodec, getUpdateRegistryAuthorityInstructionDataDecoder, getUpdateRegistryAuthorityInstructionDataEncoder, getValidityProofCodec, getValidityProofDecoder, getValidityProofEncoder, handleTransactionError, hasDeployedConfig, hasSatiRegistration, identifySatiAccount, identifySatiInstruction, inferMimeType, isSatiError, loadDeployedConfig, networkErrorMessage, outcomeToScore, parseCloseCompressedAttestationInstruction, parseCloseRegularAttestationInstruction, parseCreateCompressedAttestationInstruction, parseCreateRegularAttestationInstruction, parseFeedbackContent, parseInitializeInstruction, parseLinkEvmAddressInstruction, parseRegisterAgentInstruction, parseRegisterSchemaConfigInstruction, parseReputationScoreContent, parseUpdateRegistryAuthorityInstruction, parseValidationContent, serializeEncryptedPayload, serializeFeedback, serializeReputationScore, serializeUniversalLayout, serializeValidation, stringifyRegistrationFile, transactionExpiredMessage, transactionFailedMessage, validateBaseLayout, validateContentSize, validateReputationScoreContent, walletDisconnectedMessage, walletRejectedMessage, zeroDataHash };
|
|
6355
|
+
export { AGENT_INDEX_DISCRIMINATOR, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, ATTESTATION_SEED, AgentNotFoundError, BASE_OFFSETS, CLOSE_COMPRESSED_ATTESTATION_DISCRIMINATOR, CLOSE_REGULAR_ATTESTATION_DISCRIMINATOR, COMPRESSED_OFFSETS, CREATE_COMPRESSED_ATTESTATION_DISCRIMINATOR, CREATE_REGULAR_ATTESTATION_DISCRIMINATOR, CREDENTIAL_SEED, ContentType, DOMAINS, DataType, DuplicateAttestationError, ED25519_PROGRAM_ADDRESS, ENCRYPTION_VERSION, FEEDBACK_OFFSETS, INITIALIZE_DISCRIMINATOR, LIGHT_ERROR_CODES, LINK_EVM_ADDRESS_DISCRIMINATOR, MAX_CONTENT_SIZE, MAX_DUAL_SIGNATURE_CONTENT_SIZE, MAX_PLAINTEXT_SIZE, MAX_SINGLE_SIGNATURE_CONTENT_SIZE, MIN_BASE_LAYOUT_SIZE, MIN_ENCRYPTED_SIZE, NONCE_SIZE, OFFSETS, Outcome, PRIVKEY_SIZE, PUBKEY_SIZE, REGISTER_AGENT_DISCRIMINATOR, REGISTER_SCHEMA_CONFIG_DISCRIMINATOR, REGISTRY_CONFIG_DISCRIMINATOR, REPUTATION_SCHEMA_NAME, REPUTATION_SCHEMA_VERSION, REPUTATION_SCORE_OFFSETS, SAS_DATA_LEN_OFFSET, SAS_HEADER_SIZE, SAS_PROGRAM_ADDRESS, SATILightClientImpl, SATI_ATTESTATION_SEED, SATI_CHAIN_ID, SATI_ERROR__AGENT_ATA_EMPTY, SATI_ERROR__AGENT_ATA_MINT_MISMATCH, SATI_ERROR__AGENT_ATA_REQUIRED, SATI_ERROR__AGENT_MINT_ACCOUNT_MISMATCH, SATI_ERROR__AGENT_MINT_MISMATCH, SATI_ERROR__AGENT_SIGNATURE_NOT_FOUND, SATI_ERROR__ATTESTATION_DATA_TOO_LARGE, SATI_ERROR__ATTESTATION_DATA_TOO_SMALL, SATI_ERROR__ATTESTATION_NOT_CLOSEABLE, SATI_ERROR__CONTENT_TOO_LARGE, SATI_ERROR__COUNTERPARTY_SIGNATURE_NOT_FOUND, SATI_ERROR__DELEGATE_MISMATCH, SATI_ERROR__DELEGATION_ATTESTATION_REQUIRED, SATI_ERROR__DELEGATION_EXPIRED, SATI_ERROR__DELEGATION_OWNER_MISMATCH, SATI_ERROR__DUPLICATE_SIGNERS, SATI_ERROR__ED25519_INSTRUCTION_NOT_FOUND, SATI_ERROR__EVM_ADDRESS_MISMATCH, SATI_ERROR__IMMUTABLE_AUTHORITY, SATI_ERROR__INVALID_AUTHORITY, SATI_ERROR__INVALID_CONTENT_TYPE, SATI_ERROR__INVALID_DELEGATION_P_D_A, SATI_ERROR__INVALID_ED25519_INSTRUCTION, SATI_ERROR__INVALID_EVM_ADDRESS_RECOVERY, SATI_ERROR__INVALID_GROUP_MINT, SATI_ERROR__INVALID_INSTRUCTIONS_SYSVAR, SATI_ERROR__INVALID_OUTCOME, SATI_ERROR__INVALID_SECP256K1_SIGNATURE, SATI_ERROR__INVALID_SIGNATURE, SATI_ERROR__INVALID_SIGNATURE_COUNT, SATI_ERROR__LIGHT_CPI_INVOCATION_FAILED, SATI_ERROR__MESSAGE_MISMATCH, SATI_ERROR__METADATA_KEY_TOO_LONG, SATI_ERROR__METADATA_VALUE_TOO_LONG, SATI_ERROR__MINT_AUTHORITY_NOT_RENOUNCED, SATI_ERROR__MISSING_SIGNATURES, SATI_ERROR__NAME_TOO_LONG, SATI_ERROR__OVERFLOW, SATI_ERROR__OWNER_ONLY, SATI_ERROR__SCHEMA_CONFIG_NOT_FOUND, SATI_ERROR__SECP256K1_RECOVERY_FAILED, SATI_ERROR__SELF_ATTESTATION_NOT_ALLOWED, SATI_ERROR__SIGNATURE_MISMATCH, SATI_ERROR__STORAGE_TYPE_MISMATCH, SATI_ERROR__STORAGE_TYPE_NOT_SUPPORTED, SATI_ERROR__SYMBOL_TOO_LONG, SATI_ERROR__TOO_MANY_METADATA_ENTRIES, SATI_ERROR__UNAUTHORIZED_CLOSE, SATI_ERROR__UNSUPPORTED_LAYOUT_VERSION, SATI_ERROR__URI_TOO_LONG, SATI_PROGRAM_ADDRESS, SATI_PROGRAM_ID, SCHEMA_CONFIG_DISCRIMINATOR, SCHEMA_SEED, SOLANA_CHAIN_REFS, Sati, SatiAccount, SatiError, SatiInstruction, SchemaNotFoundError, SignatureMode, StorageType, TAG_SIZE, TOKEN_2022_PROGRAM_ADDRESS, UPDATE_REGISTRY_AUTHORITY_DISCRIMINATOR, VALIDATION_OFFSETS, ValidationType, address, addressToBytes, buildCounterpartyMessage, buildFeedbackSigningMessage, buildRegistrationFile, buildSatiRegistrationEntry, bytesToAddress, computeAttestationNonce, computeDataHash, computeDataHashFromHashes, computeDataHashFromStrings, computeEvmLinkHash, computeInteractionHash, computeReputationNonce, createBatchEd25519Instruction, createEd25519Instruction, createJsonContent, createPinataUploader, createSATILightClient, createSatiUploader, decodeAgentIndex, decodeRegistryConfig, decodeSchemaConfig, decryptContent, deriveEncryptionKeypair, deriveEncryptionPublicKey, deriveReputationAttestationPda, deriveReputationSchemaPda, deriveSasEventAuthorityPda, deriveSatiPda, deriveSatiProgramCredentialPda, deserializeEncryptedPayload, deserializeFeedback, deserializeReputationScore, deserializeUniversalLayout, deserializeValidation, duplicateAttestationMessage, encryptContent, fetchAgentIndex, fetchAllAgentIndex, fetchAllMaybeAgentIndex, fetchAllMaybeRegistryConfig, fetchAllMaybeSchemaConfig, fetchAllRegistryConfig, fetchAllSchemaConfig, fetchMaybeAgentIndex, fetchMaybeRegistryConfig, fetchMaybeSchemaConfig, fetchRegistrationFile, fetchRegistryConfig, fetchSchemaConfig, findAgentIndexPda, findAssociatedTokenAddress, findRegistryConfigPda, findSchemaConfigPda, formatCaip10, getAgentIndexCodec, getAgentIndexDecoder, getAgentIndexDiscriminatorBytes, getAgentIndexEncoder, getAgentIndexSize, getAgentRegisteredCodec, getAgentRegisteredDecoder, getAgentRegisteredEncoder, getAttestationClosedCodec, getAttestationClosedDecoder, getAttestationClosedEncoder, getAttestationCreatedCodec, getAttestationCreatedDecoder, getAttestationCreatedEncoder, getCloseCompressedAttestationDiscriminatorBytes, getCloseCompressedAttestationInstruction, getCloseCompressedAttestationInstructionAsync, getCloseCompressedAttestationInstructionDataCodec, getCloseCompressedAttestationInstructionDataDecoder, getCloseCompressedAttestationInstructionDataEncoder, getCloseRegularAttestationDiscriminatorBytes, getCloseRegularAttestationInstruction, getCloseRegularAttestationInstructionAsync, getCloseRegularAttestationInstructionDataCodec, getCloseRegularAttestationInstructionDataDecoder, getCloseRegularAttestationInstructionDataEncoder, getCompressedAccountMetaCodec, getCompressedAccountMetaDecoder, getCompressedAccountMetaEncoder, getCompressedProofCodec, getCompressedProofDecoder, getCompressedProofEncoder, getContentTypeLabel, getCreateCompressedAttestationDiscriminatorBytes, getCreateCompressedAttestationInstruction, getCreateCompressedAttestationInstructionAsync, getCreateCompressedAttestationInstructionDataCodec, getCreateCompressedAttestationInstructionDataDecoder, getCreateCompressedAttestationInstructionDataEncoder, getCreateRegularAttestationDiscriminatorBytes, getCreateRegularAttestationInstruction, getCreateRegularAttestationInstructionAsync, getCreateRegularAttestationInstructionDataCodec, getCreateRegularAttestationInstructionDataDecoder, getCreateRegularAttestationInstructionDataEncoder, getDeployedNetworks, getEvmAddressLinkedCodec, getEvmAddressLinkedDecoder, getEvmAddressLinkedEncoder, getImageUrl, getInitializeDiscriminatorBytes, getInitializeInstruction, getInitializeInstructionAsync, getInitializeInstructionDataCodec, getInitializeInstructionDataDecoder, getInitializeInstructionDataEncoder, getLinkEvmAddressDiscriminatorBytes, getLinkEvmAddressInstruction, getLinkEvmAddressInstructionAsync, getLinkEvmAddressInstructionDataCodec, getLinkEvmAddressInstructionDataDecoder, getLinkEvmAddressInstructionDataEncoder, getMaxContentSize, getMetadataEntryCodec, getMetadataEntryDecoder, getMetadataEntryEncoder, getOutcomeLabel, getPackedAddressTreeInfoCodec, getPackedAddressTreeInfoDecoder, getPackedAddressTreeInfoEncoder, getPackedStateTreeInfoCodec, getPackedStateTreeInfoDecoder, getPackedStateTreeInfoEncoder, getRegisterAgentDiscriminatorBytes, getRegisterAgentInstruction, getRegisterAgentInstructionAsync, getRegisterAgentInstructionDataCodec, getRegisterAgentInstructionDataDecoder, getRegisterAgentInstructionDataEncoder, getRegisterSchemaConfigDiscriminatorBytes, getRegisterSchemaConfigInstruction, getRegisterSchemaConfigInstructionAsync, getRegisterSchemaConfigInstructionDataCodec, getRegisterSchemaConfigInstructionDataDecoder, getRegisterSchemaConfigInstructionDataEncoder, getRegistryAuthorityUpdatedCodec, getRegistryAuthorityUpdatedDecoder, getRegistryAuthorityUpdatedEncoder, getRegistryConfigCodec, getRegistryConfigDecoder, getRegistryConfigDiscriminatorBytes, getRegistryConfigEncoder, getRegistryConfigSize, getRegistryInitializedCodec, getRegistryInitializedDecoder, getRegistryInitializedEncoder, getSatiAgentIds, getSatiErrorMessage, getSchemaConfigCodec, getSchemaConfigDecoder, getSchemaConfigDiscriminatorBytes, getSchemaConfigEncoder, getSchemaConfigRegisteredCodec, getSchemaConfigRegisteredDecoder, getSchemaConfigRegisteredEncoder, getSignatureModeCodec, getSignatureModeDecoder, getSignatureModeEncoder, getStorageTypeCodec, getStorageTypeDecoder, getStorageTypeEncoder, getUpdateRegistryAuthorityDiscriminatorBytes, getUpdateRegistryAuthorityInstruction, getUpdateRegistryAuthorityInstructionAsync, getUpdateRegistryAuthorityInstructionDataCodec, getUpdateRegistryAuthorityInstructionDataDecoder, getUpdateRegistryAuthorityInstructionDataEncoder, getValidityProofCodec, getValidityProofDecoder, getValidityProofEncoder, handleTransactionError, hasDeployedConfig, hasSatiRegistration, identifySatiAccount, identifySatiInstruction, inferMimeType, isSatiError, loadDeployedConfig, networkErrorMessage, outcomeToScore, parseCloseCompressedAttestationInstruction, parseCloseRegularAttestationInstruction, parseCreateCompressedAttestationInstruction, parseCreateRegularAttestationInstruction, parseFeedbackContent, parseInitializeInstruction, parseLinkEvmAddressInstruction, parseRegisterAgentInstruction, parseRegisterSchemaConfigInstruction, parseReputationScoreContent, parseUpdateRegistryAuthorityInstruction, parseValidationContent, serializeEncryptedPayload, serializeFeedback, serializeReputationScore, serializeUniversalLayout, serializeValidation, stringifyRegistrationFile, transactionExpiredMessage, transactionFailedMessage, validateBaseLayout, validateContentSize, validateReputationScoreContent, walletDisconnectedMessage, walletRejectedMessage, zeroDataHash };
|
|
6241
6356
|
//# sourceMappingURL=index.mjs.map
|