UNPKG

@ghostspeak/sdk

Version:

TypeScript SDK for GhostSpeak AI Agent Commerce Protocol - Production Ready Beta

814 lines (812 loc) 26.7 kB
import { containsBytes, fixEncoderSize, getBytesEncoder, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1 } from '@solana/kit'; // src/generated/programs/ghostspeakMarketplace.ts var GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS = "4wHjA2a5YC4twZb4NQpwZpixo5FgxxzuJUrCG7UnF9pB"; var GhostspeakMarketplaceAccount = /* @__PURE__ */ ((GhostspeakMarketplaceAccount2) => { GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["Agent"] = 0] = "Agent"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["AgentReputationAuth"] = 1] = "AgentReputationAuth"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["AgentTreeConfig"] = 2] = "AgentTreeConfig"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["AgentVerification"] = 3] = "AgentVerification"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["AuditTrail"] = 4] = "AuditTrail"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["AuthorizationUsageRecord"] = 5] = "AuthorizationUsageRecord"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["ComplianceReport"] = 6] = "ComplianceReport"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["Credential"] = 7] = "Credential"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["CredentialTemplate"] = 8] = "CredentialTemplate"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["CredentialType"] = 9] = "CredentialType"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["DidDocument"] = 10] = "DidDocument"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["ExternalIdMapping"] = 11] = "ExternalIdMapping"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["GhostProtectEscrow"] = 12] = "GhostProtectEscrow"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["GovernanceProposal"] = 13] = "GovernanceProposal"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["Multisig"] = 14] = "Multisig"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["ProtocolConfig"] = 15] = "ProtocolConfig"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["RbacConfig"] = 16] = "RbacConfig"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["ReentrancyGuard"] = 17] = "ReentrancyGuard"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["ReputationMetrics"] = 18] = "ReputationMetrics"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["StakingAccount"] = 19] = "StakingAccount"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["StakingConfig"] = 20] = "StakingConfig"; GhostspeakMarketplaceAccount2[GhostspeakMarketplaceAccount2["UserRegistry"] = 21] = "UserRegistry"; return GhostspeakMarketplaceAccount2; })(GhostspeakMarketplaceAccount || {}); function identifyGhostspeakMarketplaceAccount(account) { const data = "data" in account ? account.data : account; if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([47, 166, 112, 147, 155, 197, 86, 7]) ), 0 )) { return 0 /* Agent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([30, 249, 165, 44, 155, 194, 188, 175]) ), 0 )) { return 1 /* AgentReputationAuth */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([145, 145, 156, 0, 197, 232, 130, 245]) ), 0 )) { return 2 /* AgentTreeConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([128, 155, 95, 241, 66, 207, 166, 59]) ), 0 )) { return 3 /* AgentVerification */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([171, 223, 253, 181, 134, 88, 66, 26]) ), 0 )) { return 4 /* AuditTrail */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([109, 102, 102, 17, 210, 84, 85, 210]) ), 0 )) { return 5 /* AuthorizationUsageRecord */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([75, 146, 78, 26, 130, 240, 228, 35]) ), 0 )) { return 6 /* ComplianceReport */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([145, 44, 68, 220, 67, 46, 100, 135]) ), 0 )) { return 7 /* Credential */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([229, 129, 99, 91, 179, 207, 66, 75]) ), 0 )) { return 8 /* CredentialTemplate */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([132, 171, 20, 181, 39, 219, 217, 112]) ), 0 )) { return 9 /* CredentialType */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([109, 220, 168, 224, 33, 173, 192, 166]) ), 0 )) { return 10 /* DidDocument */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([180, 218, 64, 128, 181, 84, 116, 180]) ), 0 )) { return 11 /* ExternalIdMapping */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([38, 0, 98, 160, 102, 4, 51, 160]) ), 0 )) { return 12 /* GhostProtectEscrow */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([53, 107, 240, 190, 43, 73, 65, 143]) ), 0 )) { return 13 /* GovernanceProposal */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([224, 116, 121, 186, 68, 161, 79, 236]) ), 0 )) { return 14 /* Multisig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([207, 91, 250, 28, 152, 179, 215, 209]) ), 0 )) { return 15 /* ProtocolConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([177, 94, 184, 202, 221, 112, 110, 38]) ), 0 )) { return 16 /* RbacConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([207, 227, 141, 11, 194, 21, 193, 32]) ), 0 )) { return 17 /* ReentrancyGuard */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([8, 160, 71, 30, 66, 150, 108, 33]) ), 0 )) { return 18 /* ReputationMetrics */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([52, 178, 251, 157, 180, 186, 98, 234]) ), 0 )) { return 19 /* StakingAccount */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([45, 134, 252, 82, 37, 57, 84, 25]) ), 0 )) { return 20 /* StakingConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([37, 84, 98, 14, 130, 63, 210, 138]) ), 0 )) { return 21 /* UserRegistry */; } throw new Error( "The provided account could not be identified as a ghostspeakMarketplace account." ); } var GhostspeakMarketplaceInstruction = /* @__PURE__ */ ((GhostspeakMarketplaceInstruction2) => { GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ActivateAgent"] = 0] = "ActivateAgent"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ApproveDelivery"] = 1] = "ApproveDelivery"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ArbitrateDispute"] = 2] = "ArbitrateDispute"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["AutoCreateGhost"] = 3] = "AutoCreateGhost"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ClaimGhost"] = 4] = "ClaimGhost"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateAgentAuthorization"] = 5] = "CreateAgentAuthorization"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateCredentialTemplate"] = 6] = "CreateCredentialTemplate"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateCredentialType"] = 7] = "CreateCredentialType"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateDidDocument"] = 8] = "CreateDidDocument"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateEscrow"] = 9] = "CreateEscrow"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["CreateMultisig"] = 10] = "CreateMultisig"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["DeactivateAgent"] = 11] = "DeactivateAgent"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["DeactivateCredentialTemplate"] = 12] = "DeactivateCredentialTemplate"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["DeactivateCredentialType"] = 13] = "DeactivateCredentialType"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["DeactivateDidDocument"] = 14] = "DeactivateDidDocument"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["EnableProtocolFees"] = 15] = "EnableProtocolFees"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["FileDispute"] = 16] = "FileDispute"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["GenerateComplianceReport"] = 17] = "GenerateComplianceReport"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitReentrancyGuard"] = 18] = "InitReentrancyGuard"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeAuditTrail"] = 19] = "InitializeAuditTrail"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeGovernanceProposal"] = 20] = "InitializeGovernanceProposal"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeProtocolConfig"] = 21] = "InitializeProtocolConfig"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeRbacConfig"] = 22] = "InitializeRbacConfig"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeReputationMetrics"] = 23] = "InitializeReputationMetrics"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["InitializeStakingConfig"] = 24] = "InitializeStakingConfig"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["IssueCredential"] = 25] = "IssueCredential"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["LinkExternalId"] = 26] = "LinkExternalId"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ManageAgentStatus"] = 27] = "ManageAgentStatus"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RecordPayaiPayment"] = 28] = "RecordPayaiPayment"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RegisterAgent"] = 29] = "RegisterAgent"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RegisterAgentCompressed"] = 30] = "RegisterAgentCompressed"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RegisterGhostMetadata"] = 31] = "RegisterGhostMetadata"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ResetReentrancyGuard"] = 32] = "ResetReentrancyGuard"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["ResolveDidDocument"] = 33] = "ResolveDidDocument"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RevokeAuthorization"] = 34] = "RevokeAuthorization"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["RevokeCredential"] = 35] = "RevokeCredential"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["SlashStake"] = 36] = "SlashStake"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["StakeGhost"] = 37] = "StakeGhost"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["SubmitDelivery"] = 38] = "SubmitDelivery"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["SubmitServiceRating"] = 39] = "SubmitServiceRating"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UnstakeGhost"] = 40] = "UnstakeGhost"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateAgent"] = 41] = "UpdateAgent"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateAgentReputation"] = 42] = "UpdateAgentReputation"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateAgentService"] = 43] = "UpdateAgentService"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateCrosschainStatus"] = 44] = "UpdateCrosschainStatus"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateDidDocument"] = 45] = "UpdateDidDocument"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateGhostScore"] = 46] = "UpdateGhostScore"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateProtocolConfig"] = 47] = "UpdateProtocolConfig"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateReputationTags"] = 48] = "UpdateReputationTags"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateReputationWithAuth"] = 49] = "UpdateReputationWithAuth"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["UpdateSourceReputation"] = 50] = "UpdateSourceReputation"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["VerifyAgent"] = 51] = "VerifyAgent"; GhostspeakMarketplaceInstruction2[GhostspeakMarketplaceInstruction2["VerifyAuthorization"] = 52] = "VerifyAuthorization"; return GhostspeakMarketplaceInstruction2; })(GhostspeakMarketplaceInstruction || {}); function identifyGhostspeakMarketplaceInstruction(instruction) { const data = "data" in instruction ? instruction.data : instruction; if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([252, 139, 87, 21, 195, 152, 29, 217]) ), 0 )) { return 0 /* ActivateAgent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([28, 233, 51, 115, 33, 220, 41, 28]) ), 0 )) { return 1 /* ApproveDelivery */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([225, 89, 166, 101, 215, 40, 191, 4]) ), 0 )) { return 2 /* ArbitrateDispute */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([50, 170, 232, 73, 238, 200, 180, 16]) ), 0 )) { return 3 /* AutoCreateGhost */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([149, 107, 35, 233, 252, 101, 148, 225]) ), 0 )) { return 4 /* ClaimGhost */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([48, 219, 232, 202, 151, 97, 230, 20]) ), 0 )) { return 5 /* CreateAgentAuthorization */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([183, 109, 12, 128, 134, 8, 139, 144]) ), 0 )) { return 6 /* CreateCredentialTemplate */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([211, 208, 67, 175, 20, 248, 8, 227]) ), 0 )) { return 7 /* CreateCredentialType */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([253, 40, 200, 239, 69, 147, 82, 182]) ), 0 )) { return 8 /* CreateDidDocument */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([253, 215, 165, 116, 36, 108, 68, 80]) ), 0 )) { return 9 /* CreateEscrow */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([148, 146, 240, 10, 226, 215, 167, 174]) ), 0 )) { return 10 /* CreateMultisig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([205, 171, 239, 225, 82, 126, 96, 166]) ), 0 )) { return 11 /* DeactivateAgent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([177, 8, 195, 104, 56, 34, 84, 162]) ), 0 )) { return 12 /* DeactivateCredentialTemplate */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([110, 174, 221, 244, 36, 206, 60, 237]) ), 0 )) { return 13 /* DeactivateCredentialType */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([77, 13, 56, 161, 67, 155, 206, 119]) ), 0 )) { return 14 /* DeactivateDidDocument */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([9, 115, 79, 19, 158, 209, 221, 38]) ), 0 )) { return 15 /* EnableProtocolFees */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([210, 63, 221, 114, 212, 97, 195, 156]) ), 0 )) { return 16 /* FileDispute */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([213, 97, 79, 234, 22, 228, 14, 32]) ), 0 )) { return 17 /* GenerateComplianceReport */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([156, 109, 115, 85, 12, 60, 245, 99]) ), 0 )) { return 18 /* InitReentrancyGuard */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([145, 182, 236, 249, 212, 17, 175, 161]) ), 0 )) { return 19 /* InitializeAuditTrail */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([137, 84, 234, 206, 17, 58, 54, 215]) ), 0 )) { return 20 /* InitializeGovernanceProposal */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([28, 50, 43, 233, 244, 98, 123, 118]) ), 0 )) { return 21 /* InitializeProtocolConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([215, 68, 129, 228, 237, 165, 0, 240]) ), 0 )) { return 22 /* InitializeRbacConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([228, 11, 207, 44, 52, 188, 169, 237]) ), 0 )) { return 23 /* InitializeReputationMetrics */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([78, 164, 6, 115, 206, 48, 168, 105]) ), 0 )) { return 24 /* InitializeStakingConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([255, 193, 171, 224, 68, 171, 194, 87]) ), 0 )) { return 25 /* IssueCredential */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([156, 102, 141, 155, 175, 13, 29, 86]) ), 0 )) { return 26 /* LinkExternalId */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([164, 219, 91, 38, 45, 31, 33, 47]) ), 0 )) { return 27 /* ManageAgentStatus */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([165, 202, 159, 139, 65, 65, 36, 163]) ), 0 )) { return 28 /* RecordPayaiPayment */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([135, 157, 66, 195, 2, 113, 175, 30]) ), 0 )) { return 29 /* RegisterAgent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([15, 6, 94, 55, 65, 80, 123, 248]) ), 0 )) { return 30 /* RegisterAgentCompressed */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([34, 233, 111, 236, 212, 22, 26, 254]) ), 0 )) { return 31 /* RegisterGhostMetadata */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([93, 74, 168, 125, 46, 153, 9, 255]) ), 0 )) { return 32 /* ResetReentrancyGuard */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([168, 180, 218, 211, 184, 19, 102, 12]) ), 0 )) { return 33 /* ResolveDidDocument */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([222, 179, 207, 59, 191, 78, 24, 248]) ), 0 )) { return 34 /* RevokeAuthorization */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([38, 123, 95, 95, 223, 158, 169, 87]) ), 0 )) { return 35 /* RevokeCredential */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([190, 242, 137, 27, 41, 18, 233, 37]) ), 0 )) { return 36 /* SlashStake */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([5, 196, 24, 54, 196, 56, 173, 191]) ), 0 )) { return 37 /* StakeGhost */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([217, 177, 33, 54, 136, 185, 123, 96]) ), 0 )) { return 38 /* SubmitDelivery */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([23, 160, 228, 88, 168, 145, 129, 19]) ), 0 )) { return 39 /* SubmitServiceRating */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([252, 101, 172, 252, 1, 4, 12, 116]) ), 0 )) { return 40 /* UnstakeGhost */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([85, 2, 178, 9, 119, 139, 102, 164]) ), 0 )) { return 41 /* UpdateAgent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([80, 227, 92, 245, 231, 37, 99, 180]) ), 0 )) { return 42 /* UpdateAgentReputation */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([87, 146, 181, 198, 252, 68, 243, 102]) ), 0 )) { return 43 /* UpdateAgentService */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([22, 167, 59, 238, 22, 231, 239, 146]) ), 0 )) { return 44 /* UpdateCrosschainStatus */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([64, 216, 17, 91, 205, 94, 45, 57]) ), 0 )) { return 45 /* UpdateDidDocument */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([213, 152, 5, 80, 163, 224, 151, 120]) ), 0 )) { return 46 /* UpdateGhostScore */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([197, 97, 123, 54, 221, 168, 11, 135]) ), 0 )) { return 47 /* UpdateProtocolConfig */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([206, 96, 254, 186, 129, 180, 103, 198]) ), 0 )) { return 48 /* UpdateReputationTags */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([61, 236, 225, 167, 134, 43, 53, 93]) ), 0 )) { return 49 /* UpdateReputationWithAuth */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([161, 240, 255, 69, 130, 227, 71, 123]) ), 0 )) { return 50 /* UpdateSourceReputation */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([206, 212, 108, 12, 105, 61, 100, 66]) ), 0 )) { return 51 /* VerifyAgent */; } if (containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([43, 9, 131, 59, 74, 118, 113, 170]) ), 0 )) { return 52 /* VerifyAuthorization */; } throw new Error( "The provided instruction could not be identified as a ghostspeakMarketplace instruction." ); } function expectSome(value) { if (value === null || value === void 0) { throw new Error("Expected a value but received null or undefined."); } return value; } function expectAddress(value) { if (!value) { throw new Error("Expected a Address."); } if (typeof value === "object" && "address" in value) { return value.address; } if (Array.isArray(value)) { return value[0]; } return value; } function getAccountMetaFactory(programAddress, optionalAccountStrategy) { return (account) => { if (!account.value) { if (optionalAccountStrategy === "omitted") return; return Object.freeze({ address: programAddress, role: AccountRole.READONLY }); } const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY; return Object.freeze({ address: expectAddress(account.value), role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole, ...isTransactionSigner(account.value) ? { signer: account.value } : {} }); }; } function isTransactionSigner(value) { return !!value && typeof value === "object" && "address" in value && isTransactionSigner$1(value); } export { GHOSTSPEAK_MARKETPLACE_PROGRAM_ADDRESS, GhostspeakMarketplaceAccount, GhostspeakMarketplaceInstruction, expectAddress, expectSome, getAccountMetaFactory, identifyGhostspeakMarketplaceAccount, identifyGhostspeakMarketplaceInstruction }; //# sourceMappingURL=chunk-AWMGX3OX.js.map //# sourceMappingURL=chunk-AWMGX3OX.js.map