@ghostspeak/sdk 2.0.7 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/{GhostSpeakClient-CWmGaM9Q.d.ts → GhostSpeakClient-qdLGyuDp.d.ts} +11 -7
- package/dist/{StakingModule-C5rzuOWb.d.ts → StakingModule-CPhp_ZY0.d.ts} +263 -343
- package/dist/{agent-5YLZ7DAC.js → agent-S42FIMR7.js} +3 -3
- package/dist/{agent-5YLZ7DAC.js.map → agent-S42FIMR7.js.map} +1 -1
- package/dist/browser-D1TpjbjZ.d.ts +234 -0
- package/dist/browser.d.ts +4 -64
- package/dist/browser.js +9 -9
- package/dist/{chunk-SFTSZ3LC.js → chunk-46QWY3MG.js} +3 -3
- package/dist/{chunk-SFTSZ3LC.js.map → chunk-46QWY3MG.js.map} +1 -1
- package/dist/{chunk-IHVDQ4YI.js → chunk-5QZVFUXB.js} +201 -256
- package/dist/chunk-5QZVFUXB.js.map +1 -0
- package/dist/{chunk-E3FD2CNY.js → chunk-5SS3OL4B.js} +20 -24
- package/dist/chunk-5SS3OL4B.js.map +1 -0
- package/dist/{chunk-SZGFSCNU.js → chunk-63A7F2YP.js} +504 -326
- package/dist/chunk-63A7F2YP.js.map +1 -0
- package/dist/{chunk-JV2SWONF.js → chunk-A7ALCVUI.js} +3 -3
- package/dist/{chunk-JV2SWONF.js.map → chunk-A7ALCVUI.js.map} +1 -1
- package/dist/{chunk-AL3HQN73.js → chunk-AWMGX3OX.js} +172 -112
- package/dist/chunk-AWMGX3OX.js.map +1 -0
- package/dist/{chunk-G7S6B6WB.js → chunk-EU6PHSM5.js} +7 -7
- package/dist/{chunk-G7S6B6WB.js.map → chunk-EU6PHSM5.js.map} +1 -1
- package/dist/{chunk-C5CDA3WX.js → chunk-HIDBANFS.js} +529 -4
- package/dist/chunk-HIDBANFS.js.map +1 -0
- package/dist/{chunk-S74EH3KD.js → chunk-IQM5RASO.js} +637 -25
- package/dist/chunk-IQM5RASO.js.map +1 -0
- package/dist/{chunk-KB6CKIUK.js → chunk-QLRWUHN2.js} +3 -3
- package/dist/{chunk-KB6CKIUK.js.map → chunk-QLRWUHN2.js.map} +1 -1
- package/dist/{chunk-BQDGRTVP.js → chunk-QWQTPTZ4.js} +39 -51
- package/dist/chunk-QWQTPTZ4.js.map +1 -0
- package/dist/client.d.ts +3 -4
- package/dist/client.js +10 -10
- package/dist/{createAgentAuthorization-ULG47ZJI.js → createAgentAuthorization-KGZNXZBT.js} +4 -4
- package/dist/{createAgentAuthorization-ULG47ZJI.js.map → createAgentAuthorization-KGZNXZBT.js.map} +1 -1
- package/dist/generated-QJREJQ2C.js +9 -0
- package/dist/{generated-EG5USUFG.js.map → generated-QJREJQ2C.js.map} +1 -1
- package/dist/index.d.ts +345 -236
- package/dist/index.js +372 -537
- package/dist/index.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/minimal/core-minimal.d.ts +266 -189
- package/dist/minimal/core-minimal.js +6 -6
- package/dist/minimal/core-minimal.js.map +1 -1
- package/dist/{revokeAuthorization-OK7E7OK3.js → revokeAuthorization-2ZRO6GUZ.js} +4 -4
- package/dist/{revokeAuthorization-OK7E7OK3.js.map → revokeAuthorization-2ZRO6GUZ.js.map} +1 -1
- package/dist/{signature-verification-DGxR4aYQ.d.ts → signature-verification-BDzoR1MG.d.ts} +0 -5
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js → updateReputationWithAuth-PCEUOCFV.js} +4 -4
- package/dist/{updateReputationWithAuth-Y4ONEVSP.js.map → updateReputationWithAuth-PCEUOCFV.js.map} +1 -1
- package/dist/utils.d.ts +143 -2
- package/dist/utils.js +10 -10
- package/dist/utils.js.map +1 -1
- package/package.json +5 -3
- package/dist/chunk-AL3HQN73.js.map +0 -1
- package/dist/chunk-BQDGRTVP.js.map +0 -1
- package/dist/chunk-C5CDA3WX.js.map +0 -1
- package/dist/chunk-E3FD2CNY.js.map +0 -1
- package/dist/chunk-IHVDQ4YI.js.map +0 -1
- package/dist/chunk-S74EH3KD.js.map +0 -1
- package/dist/chunk-SZGFSCNU.js.map +0 -1
- package/dist/generated-EG5USUFG.js +0 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __esm, __export } from './chunk-UP2VWCW5.js';
|
|
2
|
+
import { createSolanaClient } from 'gill';
|
|
2
3
|
import { address } from '@solana/addresses';
|
|
3
4
|
import '@solana/sysvars';
|
|
4
5
|
|
|
@@ -750,11 +751,87 @@ var PRIVACY_CONSTANTS = {
|
|
|
750
751
|
|
|
751
752
|
// src/types/index.ts
|
|
752
753
|
init_reputation_tags();
|
|
754
|
+
|
|
755
|
+
// src/types/api-types.ts
|
|
756
|
+
var GhostNotFoundError = class extends Error {
|
|
757
|
+
constructor(address2) {
|
|
758
|
+
super(`Ghost not found: ${address2}`);
|
|
759
|
+
this.name = "GhostNotFoundError";
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
var ExternalIdNotFoundError = class extends Error {
|
|
763
|
+
constructor(platform, externalId) {
|
|
764
|
+
super(`No Ghost found for ${platform}:${externalId}`);
|
|
765
|
+
this.platform = platform;
|
|
766
|
+
this.externalId = externalId;
|
|
767
|
+
this.name = "ExternalIdNotFoundError";
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
// src/types/index.ts
|
|
772
|
+
var GhostSpeakError = class extends Error {
|
|
773
|
+
constructor(message, code) {
|
|
774
|
+
super(message);
|
|
775
|
+
this.code = code;
|
|
776
|
+
this.name = "GhostSpeakError";
|
|
777
|
+
}
|
|
778
|
+
};
|
|
753
779
|
function isIPFSUploadResponse(data) {
|
|
754
780
|
if (typeof data !== "object" || data === null) return false;
|
|
755
781
|
const obj = data;
|
|
756
782
|
return typeof obj.IpfsHash === "string";
|
|
757
783
|
}
|
|
784
|
+
var DEFAULT_ENDPOINTS = {
|
|
785
|
+
devnet: "https://api.devnet.solana.com",
|
|
786
|
+
mainnet: "https://api.mainnet-beta.solana.com",
|
|
787
|
+
localnet: "http://127.0.0.1:8899",
|
|
788
|
+
testnet: "https://api.testnet.solana.com"
|
|
789
|
+
};
|
|
790
|
+
var _defaultClient = null;
|
|
791
|
+
var _cachedEndpoint = null;
|
|
792
|
+
function createSolanaClient2(config) {
|
|
793
|
+
return createSolanaClient({ urlOrMoniker: config.urlOrMoniker });
|
|
794
|
+
}
|
|
795
|
+
function getDefaultSolanaClient(endpoint) {
|
|
796
|
+
const targetEndpoint = endpoint || DEFAULT_ENDPOINTS.devnet;
|
|
797
|
+
if (_cachedEndpoint !== targetEndpoint) {
|
|
798
|
+
_defaultClient = null;
|
|
799
|
+
_cachedEndpoint = targetEndpoint;
|
|
800
|
+
}
|
|
801
|
+
if (!_defaultClient) {
|
|
802
|
+
_defaultClient = createSolanaClient({ urlOrMoniker: targetEndpoint });
|
|
803
|
+
}
|
|
804
|
+
return _defaultClient;
|
|
805
|
+
}
|
|
806
|
+
function resetDefaultClient() {
|
|
807
|
+
_defaultClient = null;
|
|
808
|
+
_cachedEndpoint = null;
|
|
809
|
+
}
|
|
810
|
+
function createNetworkClient(network) {
|
|
811
|
+
return createSolanaClient({ urlOrMoniker: network });
|
|
812
|
+
}
|
|
813
|
+
function isNetworkMoniker(endpoint) {
|
|
814
|
+
return ["devnet", "mainnet", "localnet", "testnet"].includes(endpoint);
|
|
815
|
+
}
|
|
816
|
+
function getDefaultEndpoint(network) {
|
|
817
|
+
return DEFAULT_ENDPOINTS[network];
|
|
818
|
+
}
|
|
819
|
+
function detectNetworkFromEndpoint(endpoint) {
|
|
820
|
+
const lowerEndpoint = endpoint.toLowerCase();
|
|
821
|
+
if (lowerEndpoint.includes("devnet") || lowerEndpoint.includes("api.devnet.solana.com")) {
|
|
822
|
+
return "devnet";
|
|
823
|
+
}
|
|
824
|
+
if (lowerEndpoint.includes("mainnet") || lowerEndpoint.includes("api.mainnet-beta.solana.com")) {
|
|
825
|
+
return "mainnet";
|
|
826
|
+
}
|
|
827
|
+
if (lowerEndpoint.includes("testnet") || lowerEndpoint.includes("api.testnet.solana.com")) {
|
|
828
|
+
return "testnet";
|
|
829
|
+
}
|
|
830
|
+
if (lowerEndpoint.includes("localhost") || lowerEndpoint.includes("127.0.0.1")) {
|
|
831
|
+
return "localnet";
|
|
832
|
+
}
|
|
833
|
+
return "unknown";
|
|
834
|
+
}
|
|
758
835
|
|
|
759
836
|
// src/generated/instruction-mappings.ts
|
|
760
837
|
var instructionAccountMappings = {
|
|
@@ -1112,6 +1189,224 @@ var instructionAccountMappings = {
|
|
|
1112
1189
|
}
|
|
1113
1190
|
]
|
|
1114
1191
|
},
|
|
1192
|
+
"auto_create_ghost": {
|
|
1193
|
+
"name": "auto_create_ghost",
|
|
1194
|
+
"expectedAccounts": [
|
|
1195
|
+
{
|
|
1196
|
+
"name": "agent_account",
|
|
1197
|
+
"pda": true
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"name": "authority",
|
|
1201
|
+
"pda": false
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
"name": "system_program",
|
|
1205
|
+
"pda": false
|
|
1206
|
+
}
|
|
1207
|
+
],
|
|
1208
|
+
"accounts": [
|
|
1209
|
+
{
|
|
1210
|
+
"name": "agent_account",
|
|
1211
|
+
"writable": true,
|
|
1212
|
+
"signer": false,
|
|
1213
|
+
"optional": false,
|
|
1214
|
+
"docs": [],
|
|
1215
|
+
"pda": {
|
|
1216
|
+
"seeds": [
|
|
1217
|
+
{
|
|
1218
|
+
"kind": "const",
|
|
1219
|
+
"value": [
|
|
1220
|
+
97,
|
|
1221
|
+
103,
|
|
1222
|
+
101,
|
|
1223
|
+
110,
|
|
1224
|
+
116
|
|
1225
|
+
]
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
"kind": "arg",
|
|
1229
|
+
"path": "payment_address"
|
|
1230
|
+
}
|
|
1231
|
+
]
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
"name": "authority",
|
|
1236
|
+
"writable": true,
|
|
1237
|
+
"signer": true,
|
|
1238
|
+
"optional": false,
|
|
1239
|
+
"docs": []
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
"name": "system_program",
|
|
1243
|
+
"writable": false,
|
|
1244
|
+
"signer": false,
|
|
1245
|
+
"optional": false,
|
|
1246
|
+
"docs": [],
|
|
1247
|
+
"address": "11111111111111111111111111111111"
|
|
1248
|
+
}
|
|
1249
|
+
],
|
|
1250
|
+
"docs": 'Auto-create a Ghost from discovered x402 transaction (indexer service only) Used by the off-chain indexer service when it discovers a new agent via x402 payment transactions. Creates an Unregistered Ghost. Parameters: - payment_address: The x402_payment_address (merchant address) of the discovered agent - first_tx_signature: Transaction signature where this agent was first discovered - discovery_source: Source identifier (e.g., "http:payai", "blockchain:direct") - initial_ghost_score: Optional initial Ghost Score from backfill metrics',
|
|
1251
|
+
"discriminator": [
|
|
1252
|
+
50,
|
|
1253
|
+
170,
|
|
1254
|
+
232,
|
|
1255
|
+
73,
|
|
1256
|
+
238,
|
|
1257
|
+
200,
|
|
1258
|
+
180,
|
|
1259
|
+
16
|
|
1260
|
+
],
|
|
1261
|
+
"args": [
|
|
1262
|
+
{
|
|
1263
|
+
"name": "payment_address",
|
|
1264
|
+
"type": "pubkey"
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
"name": "first_tx_signature",
|
|
1268
|
+
"type": "string"
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
"name": "discovery_source",
|
|
1272
|
+
"type": "string"
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
"name": "initial_ghost_score",
|
|
1276
|
+
"type": {
|
|
1277
|
+
"option": "u64"
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
]
|
|
1281
|
+
},
|
|
1282
|
+
"claim_ghost": {
|
|
1283
|
+
"name": "claim_ghost",
|
|
1284
|
+
"expectedAccounts": [
|
|
1285
|
+
{
|
|
1286
|
+
"name": "agent_account",
|
|
1287
|
+
"pda": false
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
"name": "did_document",
|
|
1291
|
+
"pda": true
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"name": "sas_attestation",
|
|
1295
|
+
"pda": false
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"name": "claimer",
|
|
1299
|
+
"pda": false
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
"name": "system_program",
|
|
1303
|
+
"pda": false
|
|
1304
|
+
}
|
|
1305
|
+
],
|
|
1306
|
+
"accounts": [
|
|
1307
|
+
{
|
|
1308
|
+
"name": "agent_account",
|
|
1309
|
+
"writable": true,
|
|
1310
|
+
"signer": false,
|
|
1311
|
+
"optional": false,
|
|
1312
|
+
"docs": []
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
"name": "did_document",
|
|
1316
|
+
"writable": true,
|
|
1317
|
+
"signer": false,
|
|
1318
|
+
"optional": false,
|
|
1319
|
+
"docs": [
|
|
1320
|
+
"DID document to create for this Ghost",
|
|
1321
|
+
'Seeds: [b"did_document", agent_account.x402_payment_address.as_ref()]'
|
|
1322
|
+
],
|
|
1323
|
+
"pda": {
|
|
1324
|
+
"seeds": [
|
|
1325
|
+
{
|
|
1326
|
+
"kind": "const",
|
|
1327
|
+
"value": [
|
|
1328
|
+
100,
|
|
1329
|
+
105,
|
|
1330
|
+
100,
|
|
1331
|
+
95,
|
|
1332
|
+
100,
|
|
1333
|
+
111,
|
|
1334
|
+
99,
|
|
1335
|
+
117,
|
|
1336
|
+
109,
|
|
1337
|
+
101,
|
|
1338
|
+
110,
|
|
1339
|
+
116
|
|
1340
|
+
]
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
"kind": "account",
|
|
1344
|
+
"path": "agent_account.x402_payment_address",
|
|
1345
|
+
"account": "Agent"
|
|
1346
|
+
}
|
|
1347
|
+
]
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"name": "sas_attestation",
|
|
1352
|
+
"writable": false,
|
|
1353
|
+
"signer": false,
|
|
1354
|
+
"optional": false,
|
|
1355
|
+
"docs": [
|
|
1356
|
+
"SAS Attestation proving ownership of x402_payment_address",
|
|
1357
|
+
'PDA: [b"attestation", sas_credential, sas_schema, x402_payment_address]'
|
|
1358
|
+
]
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
"name": "claimer",
|
|
1362
|
+
"writable": true,
|
|
1363
|
+
"signer": true,
|
|
1364
|
+
"optional": false,
|
|
1365
|
+
"docs": [
|
|
1366
|
+
"The claimer must have created a SAS attestation proving they own x402_payment_address"
|
|
1367
|
+
]
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"name": "system_program",
|
|
1371
|
+
"writable": false,
|
|
1372
|
+
"signer": false,
|
|
1373
|
+
"optional": false,
|
|
1374
|
+
"docs": [],
|
|
1375
|
+
"address": "11111111111111111111111111111111"
|
|
1376
|
+
}
|
|
1377
|
+
],
|
|
1378
|
+
"docs": 'Claim ownership of a Ghost using Solana Attestation Service (SAS) Security: Uses SAS for trustless ownership verification. The claimer must have created a SAS attestation proving they own the x402_payment_address. Auto-creates: DID document with did:sol:<network>:<address> format Transitions: Unregistered/Registered \u2192 Claimed SAS Attestation Requirements: - Credential: GhostSpeak ownership credential (issuer) - Schema: Ghost ownership schema defining attestation data structure - Nonce: x402_payment_address (ensures PDA uniqueness) - Data: Contains x402_payment_address as proof of ownership Parameters: - sas_credential: Pubkey of the SAS Credential (issuer) for ownership attestations - sas_schema: Pubkey of the SAS Schema defining the ownership attestation format - ipfs_metadata_uri: Optional IPFS URI for agent metadata (ipfs://...) - network: Network identifier ("devnet", "mainnet-beta", "testnet")',
|
|
1379
|
+
"discriminator": [
|
|
1380
|
+
149,
|
|
1381
|
+
107,
|
|
1382
|
+
35,
|
|
1383
|
+
233,
|
|
1384
|
+
252,
|
|
1385
|
+
101,
|
|
1386
|
+
148,
|
|
1387
|
+
225
|
|
1388
|
+
],
|
|
1389
|
+
"args": [
|
|
1390
|
+
{
|
|
1391
|
+
"name": "sas_credential",
|
|
1392
|
+
"type": "pubkey"
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
"name": "sas_schema",
|
|
1396
|
+
"type": "pubkey"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
"name": "ipfs_metadata_uri",
|
|
1400
|
+
"type": {
|
|
1401
|
+
"option": "string"
|
|
1402
|
+
}
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
"name": "network",
|
|
1406
|
+
"type": "string"
|
|
1407
|
+
}
|
|
1408
|
+
]
|
|
1409
|
+
},
|
|
1115
1410
|
"create_agent_authorization": {
|
|
1116
1411
|
"name": "create_agent_authorization",
|
|
1117
1412
|
"expectedAccounts": [
|
|
@@ -3206,6 +3501,111 @@ var instructionAccountMappings = {
|
|
|
3206
3501
|
}
|
|
3207
3502
|
]
|
|
3208
3503
|
},
|
|
3504
|
+
"link_external_id": {
|
|
3505
|
+
"name": "link_external_id",
|
|
3506
|
+
"expectedAccounts": [
|
|
3507
|
+
{
|
|
3508
|
+
"name": "agent_account",
|
|
3509
|
+
"pda": false
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
"name": "external_id_mapping",
|
|
3513
|
+
"pda": true
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
"name": "authority",
|
|
3517
|
+
"pda": false
|
|
3518
|
+
},
|
|
3519
|
+
{
|
|
3520
|
+
"name": "system_program",
|
|
3521
|
+
"pda": false
|
|
3522
|
+
}
|
|
3523
|
+
],
|
|
3524
|
+
"accounts": [
|
|
3525
|
+
{
|
|
3526
|
+
"name": "agent_account",
|
|
3527
|
+
"writable": true,
|
|
3528
|
+
"signer": false,
|
|
3529
|
+
"optional": false,
|
|
3530
|
+
"docs": []
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
"name": "external_id_mapping",
|
|
3534
|
+
"writable": true,
|
|
3535
|
+
"signer": false,
|
|
3536
|
+
"optional": false,
|
|
3537
|
+
"docs": [],
|
|
3538
|
+
"pda": {
|
|
3539
|
+
"seeds": [
|
|
3540
|
+
{
|
|
3541
|
+
"kind": "const",
|
|
3542
|
+
"value": [
|
|
3543
|
+
101,
|
|
3544
|
+
120,
|
|
3545
|
+
116,
|
|
3546
|
+
101,
|
|
3547
|
+
114,
|
|
3548
|
+
110,
|
|
3549
|
+
97,
|
|
3550
|
+
108,
|
|
3551
|
+
95,
|
|
3552
|
+
105,
|
|
3553
|
+
100
|
|
3554
|
+
]
|
|
3555
|
+
},
|
|
3556
|
+
{
|
|
3557
|
+
"kind": "arg",
|
|
3558
|
+
"path": "platform"
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
"kind": "arg",
|
|
3562
|
+
"path": "external_id"
|
|
3563
|
+
}
|
|
3564
|
+
]
|
|
3565
|
+
}
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
"name": "authority",
|
|
3569
|
+
"writable": true,
|
|
3570
|
+
"signer": true,
|
|
3571
|
+
"optional": false,
|
|
3572
|
+
"docs": []
|
|
3573
|
+
},
|
|
3574
|
+
{
|
|
3575
|
+
"name": "system_program",
|
|
3576
|
+
"writable": false,
|
|
3577
|
+
"signer": false,
|
|
3578
|
+
"optional": false,
|
|
3579
|
+
"docs": [],
|
|
3580
|
+
"address": "11111111111111111111111111111111"
|
|
3581
|
+
}
|
|
3582
|
+
],
|
|
3583
|
+
"docs": 'Link a platform-specific external ID to a Ghost Creates a cross-platform identity mapping for this Ghost. Only the Ghost owner can link external IDs. Parameters: - platform: Platform identifier (e.g., "payai", "eliza", "github") (max 32 chars) - external_id: Platform-specific agent ID (max 128 chars) - verified: Whether this external ID has been verified',
|
|
3584
|
+
"discriminator": [
|
|
3585
|
+
156,
|
|
3586
|
+
102,
|
|
3587
|
+
141,
|
|
3588
|
+
155,
|
|
3589
|
+
175,
|
|
3590
|
+
13,
|
|
3591
|
+
29,
|
|
3592
|
+
86
|
|
3593
|
+
],
|
|
3594
|
+
"args": [
|
|
3595
|
+
{
|
|
3596
|
+
"name": "platform",
|
|
3597
|
+
"type": "string"
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
"name": "external_id",
|
|
3601
|
+
"type": "string"
|
|
3602
|
+
},
|
|
3603
|
+
{
|
|
3604
|
+
"name": "verified",
|
|
3605
|
+
"type": "bool"
|
|
3606
|
+
}
|
|
3607
|
+
]
|
|
3608
|
+
},
|
|
3209
3609
|
"manage_agent_status": {
|
|
3210
3610
|
"name": "manage_agent_status",
|
|
3211
3611
|
"expectedAccounts": [
|
|
@@ -3778,6 +4178,71 @@ var instructionAccountMappings = {
|
|
|
3778
4178
|
}
|
|
3779
4179
|
]
|
|
3780
4180
|
},
|
|
4181
|
+
"register_ghost_metadata": {
|
|
4182
|
+
"name": "register_ghost_metadata",
|
|
4183
|
+
"expectedAccounts": [
|
|
4184
|
+
{
|
|
4185
|
+
"name": "agent_account",
|
|
4186
|
+
"pda": false
|
|
4187
|
+
},
|
|
4188
|
+
{
|
|
4189
|
+
"name": "authority",
|
|
4190
|
+
"pda": false
|
|
4191
|
+
}
|
|
4192
|
+
],
|
|
4193
|
+
"accounts": [
|
|
4194
|
+
{
|
|
4195
|
+
"name": "agent_account",
|
|
4196
|
+
"writable": true,
|
|
4197
|
+
"signer": false,
|
|
4198
|
+
"optional": false,
|
|
4199
|
+
"docs": []
|
|
4200
|
+
},
|
|
4201
|
+
{
|
|
4202
|
+
"name": "authority",
|
|
4203
|
+
"writable": true,
|
|
4204
|
+
"signer": true,
|
|
4205
|
+
"optional": false,
|
|
4206
|
+
"docs": [
|
|
4207
|
+
"Anyone can add metadata to an Unregistered Ghost",
|
|
4208
|
+
"Claiming proves ownership later"
|
|
4209
|
+
]
|
|
4210
|
+
}
|
|
4211
|
+
],
|
|
4212
|
+
"docs": "Register metadata for an Unregistered Ghost Adds name, description, capabilities, and service endpoint to a discovered Ghost. Transitions: Unregistered \u2192 Registered Anyone can add metadata to an Unregistered Ghost. Parameters: - name: Agent name (max 64 chars) - description: Agent description (max 128 chars) - capabilities: List of capabilities (max 5) - service_endpoint: Optional HTTP endpoint for the agent service",
|
|
4213
|
+
"discriminator": [
|
|
4214
|
+
34,
|
|
4215
|
+
233,
|
|
4216
|
+
111,
|
|
4217
|
+
236,
|
|
4218
|
+
212,
|
|
4219
|
+
22,
|
|
4220
|
+
26,
|
|
4221
|
+
254
|
|
4222
|
+
],
|
|
4223
|
+
"args": [
|
|
4224
|
+
{
|
|
4225
|
+
"name": "name",
|
|
4226
|
+
"type": "string"
|
|
4227
|
+
},
|
|
4228
|
+
{
|
|
4229
|
+
"name": "description",
|
|
4230
|
+
"type": "string"
|
|
4231
|
+
},
|
|
4232
|
+
{
|
|
4233
|
+
"name": "capabilities",
|
|
4234
|
+
"type": {
|
|
4235
|
+
"vec": "string"
|
|
4236
|
+
}
|
|
4237
|
+
},
|
|
4238
|
+
{
|
|
4239
|
+
"name": "service_endpoint",
|
|
4240
|
+
"type": {
|
|
4241
|
+
"option": "string"
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
]
|
|
4245
|
+
},
|
|
3781
4246
|
"reset_reentrancy_guard": {
|
|
3782
4247
|
"name": "reset_reentrancy_guard",
|
|
3783
4248
|
"expectedAccounts": [
|
|
@@ -5224,6 +5689,66 @@ var instructionAccountMappings = {
|
|
|
5224
5689
|
}
|
|
5225
5690
|
]
|
|
5226
5691
|
},
|
|
5692
|
+
"update_ghost_score": {
|
|
5693
|
+
"name": "update_ghost_score",
|
|
5694
|
+
"expectedAccounts": [
|
|
5695
|
+
{
|
|
5696
|
+
"name": "agent_account",
|
|
5697
|
+
"pda": false
|
|
5698
|
+
},
|
|
5699
|
+
{
|
|
5700
|
+
"name": "authority",
|
|
5701
|
+
"pda": false
|
|
5702
|
+
}
|
|
5703
|
+
],
|
|
5704
|
+
"accounts": [
|
|
5705
|
+
{
|
|
5706
|
+
"name": "agent_account",
|
|
5707
|
+
"writable": true,
|
|
5708
|
+
"signer": false,
|
|
5709
|
+
"optional": false,
|
|
5710
|
+
"docs": []
|
|
5711
|
+
},
|
|
5712
|
+
{
|
|
5713
|
+
"name": "authority",
|
|
5714
|
+
"writable": false,
|
|
5715
|
+
"signer": true,
|
|
5716
|
+
"optional": false,
|
|
5717
|
+
"docs": [
|
|
5718
|
+
"Authority allowed to update scores (could be governance/oracle)"
|
|
5719
|
+
]
|
|
5720
|
+
}
|
|
5721
|
+
],
|
|
5722
|
+
"docs": "Update Ghost Score from off-chain calculation Called by the reputation oracle/calculator service. Updates the weighted Ghost Score and optionally the reputation components. Parameters: - new_score: New Ghost Score (0-1000) - components: Optional reputation component breakdown",
|
|
5723
|
+
"discriminator": [
|
|
5724
|
+
213,
|
|
5725
|
+
152,
|
|
5726
|
+
5,
|
|
5727
|
+
80,
|
|
5728
|
+
163,
|
|
5729
|
+
224,
|
|
5730
|
+
151,
|
|
5731
|
+
120
|
|
5732
|
+
],
|
|
5733
|
+
"args": [
|
|
5734
|
+
{
|
|
5735
|
+
"name": "new_score",
|
|
5736
|
+
"type": "u64"
|
|
5737
|
+
},
|
|
5738
|
+
{
|
|
5739
|
+
"name": "components",
|
|
5740
|
+
"type": {
|
|
5741
|
+
"option": {
|
|
5742
|
+
"vec": {
|
|
5743
|
+
"defined": {
|
|
5744
|
+
"name": "ReputationComponent"
|
|
5745
|
+
}
|
|
5746
|
+
}
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
}
|
|
5750
|
+
]
|
|
5751
|
+
},
|
|
5227
5752
|
"update_protocol_config": {
|
|
5228
5753
|
"name": "update_protocol_config",
|
|
5229
5754
|
"expectedAccounts": [
|
|
@@ -7016,7 +7541,7 @@ var ReputationCalculator = class {
|
|
|
7016
7541
|
detect: (data) => {
|
|
7017
7542
|
if (data.categoryReputations.length < 5) return false;
|
|
7018
7543
|
const recentCategories = data.categoryReputations.sort((a, b) => b.lastActivity - a.lastActivity).slice(0, 5);
|
|
7019
|
-
const daysSinceOldest = (Date.now() - recentCategories[4].lastActivity) /
|
|
7544
|
+
const daysSinceOldest = (Date.now() / 1e3 - recentCategories[4].lastActivity) / 86400;
|
|
7020
7545
|
return daysSinceOldest < 7;
|
|
7021
7546
|
}
|
|
7022
7547
|
},
|
|
@@ -7309,6 +7834,6 @@ var ReputationCalculator = class {
|
|
|
7309
7834
|
}
|
|
7310
7835
|
};
|
|
7311
7836
|
|
|
7312
|
-
export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, debugInstructionCall, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, logEnhancedError, reputation_tag_engine_exports, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
|
|
7313
|
-
//# sourceMappingURL=chunk-
|
|
7314
|
-
//# sourceMappingURL=chunk-
|
|
7837
|
+
export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, BadgeType, BehaviorTag, ComplianceTag, DEFAULT_TAG_DECAY, ExternalIdNotFoundError, GhostNotFoundError, GhostSpeakError, GhostSpeakSDKError, INSTRUCTION_MAPPINGS, IPFSClient, InstructionValidationError, NATIVE_MINT_ADDRESS, PRIVACY_CONSTANTS, PrivacyMode, PrivacyPresets, REPUTATION_CONSTANTS, ReputationCalculator, ReputationTagEngine, ReputationTier2 as ReputationTier, SYSTEM_PROGRAM_ADDRESS, ScoreRange, SkillTag, TAG_CONSTANTS, TOKEN_2022_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, TagCategory, TagConfidenceLevel, VisibilityLevel, createAccountMismatchError, createErrorContext, createNetworkClient, createSolanaClient2 as createSolanaClient, debugInstructionCall, detectNetworkFromEndpoint, enhanceErrorMessage, enhanceTransactionError, extractInstructionName, generateAccountValidationError, getAccountRequirements, getDefaultEndpoint, getDefaultSolanaClient, getInstructionMapping, getPDAAccounts, getRequiredSigners, getWritableAccounts, init_reputation_tag_engine, init_reputation_tags, ipfs_client_exports, isKnownInstruction, isNetworkMoniker, logEnhancedError, reputation_tag_engine_exports, resetDefaultClient, validateInstructionAccounts, validatePreconditions, withEnhancedErrors, withEnhancedErrorsSync };
|
|
7838
|
+
//# sourceMappingURL=chunk-HIDBANFS.js.map
|
|
7839
|
+
//# sourceMappingURL=chunk-HIDBANFS.js.map
|