@elisym/sdk 0.25.4 → 0.26.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/dist/agent-store.cjs +16 -4
- package/dist/agent-store.cjs.map +1 -1
- package/dist/agent-store.d.cts +11 -4
- package/dist/agent-store.d.ts +11 -4
- package/dist/agent-store.js +17 -6
- package/dist/agent-store.js.map +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.js.map +1 -1
- package/dist/skills.cjs +190 -2
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.d.cts +161 -10
- package/dist/skills.d.ts +161 -10
- package/dist/skills.js +189 -3
- package/dist/skills.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, TransactionSigner, Rpc, SolanaRpcApi, Signature } from '@solana/kit';
|
|
1
|
+
import { Address, TransactionSigner, Rpc, SolanaRpcApi, Signature, KeyPairSigner } from '@solana/kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Filter, Event } from 'nostr-tools';
|
|
4
4
|
import { A as Asset } from './assets-C-nzSYD4.cjs';
|
|
@@ -417,18 +417,20 @@ interface CapabilityCard {
|
|
|
417
417
|
/**
|
|
418
418
|
* MIME the capability expects as a file input (from a dynamic-script skill's
|
|
419
419
|
* `input_mime`). Discovery hint only; the provider still content-sniffs the
|
|
420
|
-
* actual file. Its presence means the capability
|
|
421
|
-
*
|
|
422
|
-
*
|
|
420
|
+
* actual file. Its presence means the capability accepts a file input (the web
|
|
421
|
+
* app sends it over encrypted Blossom; the MCP/CLI over iroh), so clients show a
|
|
422
|
+
* file picker. `*` = any file, `image/*` = any image, `image/png` = exact.
|
|
423
423
|
*/
|
|
424
424
|
inputMime?: string;
|
|
425
425
|
/** MIME of a file result the capability produces (from `output_mime`). */
|
|
426
426
|
outputMime?: string;
|
|
427
427
|
/**
|
|
428
|
-
*
|
|
429
|
-
* `'none'` = file only, `'optional'` = file +
|
|
430
|
-
*
|
|
431
|
-
*
|
|
428
|
+
* How a file-input capability treats the text prompt (from `input_text`):
|
|
429
|
+
* `'none'` = file only, `'optional'` = file optional + instruction required (a
|
|
430
|
+
* generate-or-edit skill), `'required'` = file + text both required. Omitted =
|
|
431
|
+
* file required + optional note. Discovery hint; the web app shows/hides/gates its
|
|
432
|
+
* text box and file picker accordingly. Only meaningful with `inputMime`.
|
|
433
|
+
* Untrusted - gate on it, never render the raw value.
|
|
432
434
|
*/
|
|
433
435
|
inputText?: 'required' | 'optional' | 'none';
|
|
434
436
|
}
|
|
@@ -1702,6 +1704,23 @@ interface OnchainNetworkStats {
|
|
|
1702
1704
|
}
|
|
1703
1705
|
declare function getNetworkStats(rpc: Rpc<SolanaRpcApi>, programId: Address): Promise<OnchainNetworkStats | null>;
|
|
1704
1706
|
|
|
1707
|
+
/**
|
|
1708
|
+
* Extract the 64-byte secret key (32-byte private seed + 32-byte public key)
|
|
1709
|
+
* from an extractable KeyPairSigner. This matches the format used by
|
|
1710
|
+
* solana-keygen and `createKeyPairSignerFromBytes`, and - base58-encoded -
|
|
1711
|
+
* the at-rest `solana_secret_key` format in `.secrets.json`.
|
|
1712
|
+
*/
|
|
1713
|
+
declare function exportKeyPairBytes(signer: KeyPairSigner): Promise<Uint8Array>;
|
|
1714
|
+
/** Encode raw 64 keypair bytes (e.g. a solana-keygen JSON array) into the at-rest base58 form. */
|
|
1715
|
+
declare function encodeSecretKeyBase58(bytes: Uint8Array): string;
|
|
1716
|
+
/** Decode the at-rest base58 `solana_secret_key` (64 bytes: seed + public key) into a signer. */
|
|
1717
|
+
declare function signerFromSecretKeyBase58(secretKeyBase58: string): Promise<KeyPairSigner>;
|
|
1718
|
+
/** Generate a fresh extractable Solana wallet plus its at-rest base58 secret. */
|
|
1719
|
+
declare function generateSolanaWallet(): Promise<{
|
|
1720
|
+
signer: KeyPairSigner;
|
|
1721
|
+
secretKeyBase58: string;
|
|
1722
|
+
}>;
|
|
1723
|
+
|
|
1705
1724
|
/**
|
|
1706
1725
|
* Snapshot of the on-chain elisym-config program state.
|
|
1707
1726
|
*
|
|
@@ -1896,4 +1915,4 @@ declare const LIMITS: {
|
|
|
1896
1915
|
*/
|
|
1897
1916
|
declare function utf8ByteLength(value: string): number;
|
|
1898
1917
|
|
|
1899
|
-
export { ACCEPT_TRANSPORTS_TAG, type Agent, type AgentPolicy, type AggregateNetworkStatsOptions, Asset, type BlobDescriptor, type BlossomBlobTransport, BlossomService, type BlossomUploadFallback, BoundedSet, type BuildTransactionOptions, type CapabilityCard, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, type DecodedJobPayload, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, type ElisymClientConfig, type ElisymClientFullConfig, ElisymIdentity, type EncryptedBytes, type EstimatePriorityFeeOptions, type EstimateSolFeeOptions, type FileAttachment, type FileTransport, type GetProtocolConfigOptions, INPUT_REDACT_PATHS, type Job, type JobErrorKind, type JobPayloadEnvelope, type JobStatus, type JobSubscriptionOptions, type JobUpdateCallbacks, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, type Network, type NetworkBaselineEstimate, type NetworkBaselineOptions, type NetworkStats, type NetworkStatsResult, NostrPool, type OnchainNetworkStats, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, type ParseOptions, type ParseResult, type ParsedPaymentRequest, type PaymentAssetRef, type PaymentInfo, type PaymentRequestData, PaymentRequestSchema, type PaymentStrategy, type PaymentValidationCode, type PaymentValidationError, type PingResult, PingService, PoliciesService, type PolicyInput, type ProtocolCluster, type ProtocolConfig, type ProtocolConfigInput, type QuickVerifyReason, type QuickVerifyResult, RELAYS, type RankKey, SECRET_REDACT_PATHS, type Signer, type SolFeeEstimate, SolanaPaymentStrategy, type SubCloser, type SubmitJobOptions, type TransportKind, type VerifyOptions, type VerifyResult, aggregateNetworkStats, assertExpiry, assertLamports, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, fetchEncryptedFileOutput, formatFeeBreakdown, formatNetworkBaseline, formatSol, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
|
1918
|
+
export { ACCEPT_TRANSPORTS_TAG, type Agent, type AgentPolicy, type AggregateNetworkStatsOptions, Asset, type BlobDescriptor, type BlossomBlobTransport, BlossomService, type BlossomUploadFallback, BoundedSet, type BuildTransactionOptions, type CapabilityCard, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, type DecodedJobPayload, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, type ElisymClientConfig, type ElisymClientFullConfig, ElisymIdentity, type EncryptedBytes, type EstimatePriorityFeeOptions, type EstimateSolFeeOptions, type FileAttachment, type FileTransport, type GetProtocolConfigOptions, INPUT_REDACT_PATHS, type Job, type JobErrorKind, type JobPayloadEnvelope, type JobStatus, type JobSubscriptionOptions, type JobUpdateCallbacks, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, type Network, type NetworkBaselineEstimate, type NetworkBaselineOptions, type NetworkStats, type NetworkStatsResult, NostrPool, type OnchainNetworkStats, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, type ParseOptions, type ParseResult, type ParsedPaymentRequest, type PaymentAssetRef, type PaymentInfo, type PaymentRequestData, PaymentRequestSchema, type PaymentStrategy, type PaymentValidationCode, type PaymentValidationError, type PingResult, PingService, PoliciesService, type PolicyInput, type ProtocolCluster, type ProtocolConfig, type ProtocolConfigInput, type QuickVerifyReason, type QuickVerifyResult, RELAYS, type RankKey, SECRET_REDACT_PATHS, type Signer, type SolFeeEstimate, SolanaPaymentStrategy, type SubCloser, type SubmitJobOptions, type TransportKind, type VerifyOptions, type VerifyResult, aggregateNetworkStats, assertExpiry, assertLamports, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encodeSecretKeyBase58, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, exportKeyPairBytes, fetchEncryptedFileOutput, formatFeeBreakdown, formatNetworkBaseline, formatSol, generateSolanaWallet, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, signerFromSecretKeyBase58, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, TransactionSigner, Rpc, SolanaRpcApi, Signature } from '@solana/kit';
|
|
1
|
+
import { Address, TransactionSigner, Rpc, SolanaRpcApi, Signature, KeyPairSigner } from '@solana/kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Filter, Event } from 'nostr-tools';
|
|
4
4
|
import { A as Asset } from './assets-C-nzSYD4.js';
|
|
@@ -417,18 +417,20 @@ interface CapabilityCard {
|
|
|
417
417
|
/**
|
|
418
418
|
* MIME the capability expects as a file input (from a dynamic-script skill's
|
|
419
419
|
* `input_mime`). Discovery hint only; the provider still content-sniffs the
|
|
420
|
-
* actual file. Its presence means the capability
|
|
421
|
-
*
|
|
422
|
-
*
|
|
420
|
+
* actual file. Its presence means the capability accepts a file input (the web
|
|
421
|
+
* app sends it over encrypted Blossom; the MCP/CLI over iroh), so clients show a
|
|
422
|
+
* file picker. `*` = any file, `image/*` = any image, `image/png` = exact.
|
|
423
423
|
*/
|
|
424
424
|
inputMime?: string;
|
|
425
425
|
/** MIME of a file result the capability produces (from `output_mime`). */
|
|
426
426
|
outputMime?: string;
|
|
427
427
|
/**
|
|
428
|
-
*
|
|
429
|
-
* `'none'` = file only, `'optional'` = file +
|
|
430
|
-
*
|
|
431
|
-
*
|
|
428
|
+
* How a file-input capability treats the text prompt (from `input_text`):
|
|
429
|
+
* `'none'` = file only, `'optional'` = file optional + instruction required (a
|
|
430
|
+
* generate-or-edit skill), `'required'` = file + text both required. Omitted =
|
|
431
|
+
* file required + optional note. Discovery hint; the web app shows/hides/gates its
|
|
432
|
+
* text box and file picker accordingly. Only meaningful with `inputMime`.
|
|
433
|
+
* Untrusted - gate on it, never render the raw value.
|
|
432
434
|
*/
|
|
433
435
|
inputText?: 'required' | 'optional' | 'none';
|
|
434
436
|
}
|
|
@@ -1702,6 +1704,23 @@ interface OnchainNetworkStats {
|
|
|
1702
1704
|
}
|
|
1703
1705
|
declare function getNetworkStats(rpc: Rpc<SolanaRpcApi>, programId: Address): Promise<OnchainNetworkStats | null>;
|
|
1704
1706
|
|
|
1707
|
+
/**
|
|
1708
|
+
* Extract the 64-byte secret key (32-byte private seed + 32-byte public key)
|
|
1709
|
+
* from an extractable KeyPairSigner. This matches the format used by
|
|
1710
|
+
* solana-keygen and `createKeyPairSignerFromBytes`, and - base58-encoded -
|
|
1711
|
+
* the at-rest `solana_secret_key` format in `.secrets.json`.
|
|
1712
|
+
*/
|
|
1713
|
+
declare function exportKeyPairBytes(signer: KeyPairSigner): Promise<Uint8Array>;
|
|
1714
|
+
/** Encode raw 64 keypair bytes (e.g. a solana-keygen JSON array) into the at-rest base58 form. */
|
|
1715
|
+
declare function encodeSecretKeyBase58(bytes: Uint8Array): string;
|
|
1716
|
+
/** Decode the at-rest base58 `solana_secret_key` (64 bytes: seed + public key) into a signer. */
|
|
1717
|
+
declare function signerFromSecretKeyBase58(secretKeyBase58: string): Promise<KeyPairSigner>;
|
|
1718
|
+
/** Generate a fresh extractable Solana wallet plus its at-rest base58 secret. */
|
|
1719
|
+
declare function generateSolanaWallet(): Promise<{
|
|
1720
|
+
signer: KeyPairSigner;
|
|
1721
|
+
secretKeyBase58: string;
|
|
1722
|
+
}>;
|
|
1723
|
+
|
|
1705
1724
|
/**
|
|
1706
1725
|
* Snapshot of the on-chain elisym-config program state.
|
|
1707
1726
|
*
|
|
@@ -1896,4 +1915,4 @@ declare const LIMITS: {
|
|
|
1896
1915
|
*/
|
|
1897
1916
|
declare function utf8ByteLength(value: string): number;
|
|
1898
1917
|
|
|
1899
|
-
export { ACCEPT_TRANSPORTS_TAG, type Agent, type AgentPolicy, type AggregateNetworkStatsOptions, Asset, type BlobDescriptor, type BlossomBlobTransport, BlossomService, type BlossomUploadFallback, BoundedSet, type BuildTransactionOptions, type CapabilityCard, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, type DecodedJobPayload, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, type ElisymClientConfig, type ElisymClientFullConfig, ElisymIdentity, type EncryptedBytes, type EstimatePriorityFeeOptions, type EstimateSolFeeOptions, type FileAttachment, type FileTransport, type GetProtocolConfigOptions, INPUT_REDACT_PATHS, type Job, type JobErrorKind, type JobPayloadEnvelope, type JobStatus, type JobSubscriptionOptions, type JobUpdateCallbacks, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, type Network, type NetworkBaselineEstimate, type NetworkBaselineOptions, type NetworkStats, type NetworkStatsResult, NostrPool, type OnchainNetworkStats, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, type ParseOptions, type ParseResult, type ParsedPaymentRequest, type PaymentAssetRef, type PaymentInfo, type PaymentRequestData, PaymentRequestSchema, type PaymentStrategy, type PaymentValidationCode, type PaymentValidationError, type PingResult, PingService, PoliciesService, type PolicyInput, type ProtocolCluster, type ProtocolConfig, type ProtocolConfigInput, type QuickVerifyReason, type QuickVerifyResult, RELAYS, type RankKey, SECRET_REDACT_PATHS, type Signer, type SolFeeEstimate, SolanaPaymentStrategy, type SubCloser, type SubmitJobOptions, type TransportKind, type VerifyOptions, type VerifyResult, aggregateNetworkStats, assertExpiry, assertLamports, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, fetchEncryptedFileOutput, formatFeeBreakdown, formatNetworkBaseline, formatSol, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
|
1918
|
+
export { ACCEPT_TRANSPORTS_TAG, type Agent, type AgentPolicy, type AggregateNetworkStatsOptions, Asset, type BlobDescriptor, type BlossomBlobTransport, BlossomService, type BlossomUploadFallback, BoundedSet, type BuildTransactionOptions, type CapabilityCard, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, type DecodedJobPayload, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, type ElisymClientConfig, type ElisymClientFullConfig, ElisymIdentity, type EncryptedBytes, type EstimatePriorityFeeOptions, type EstimateSolFeeOptions, type FileAttachment, type FileTransport, type GetProtocolConfigOptions, INPUT_REDACT_PATHS, type Job, type JobErrorKind, type JobPayloadEnvelope, type JobStatus, type JobSubscriptionOptions, type JobUpdateCallbacks, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, type Network, type NetworkBaselineEstimate, type NetworkBaselineOptions, type NetworkStats, type NetworkStatsResult, NostrPool, type OnchainNetworkStats, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, type ParseOptions, type ParseResult, type ParsedPaymentRequest, type PaymentAssetRef, type PaymentInfo, type PaymentRequestData, PaymentRequestSchema, type PaymentStrategy, type PaymentValidationCode, type PaymentValidationError, type PingResult, PingService, PoliciesService, type PolicyInput, type ProtocolCluster, type ProtocolConfig, type ProtocolConfigInput, type QuickVerifyReason, type QuickVerifyResult, RELAYS, type RankKey, SECRET_REDACT_PATHS, type Signer, type SolFeeEstimate, SolanaPaymentStrategy, type SubCloser, type SubmitJobOptions, type TransportKind, type VerifyOptions, type VerifyResult, aggregateNetworkStats, assertExpiry, assertLamports, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encodeSecretKeyBase58, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, exportKeyPairBytes, fetchEncryptedFileOutput, formatFeeBreakdown, formatNetworkBaseline, formatSol, generateSolanaWallet, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, signerFromSecretKeyBase58, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageComputeUnitLimit, setTransactionMessageComputeUnitPrice, appendTransactionMessageInstructions, signTransactionMessageWithSigners, address, AccountRole, isAddress, getProgramDerivedAddress, assertAccountExists, getAddressDecoder, fetchEncodedAccount, transformEncoder, getStructEncoder, fixEncoderSize, getBytesEncoder, getU64Encoder, getBooleanEncoder, decodeAccount, upgradeRoleToSigner, getStructDecoder, fixDecoderSize, getBytesDecoder, getU8Decoder, getU64Decoder, getU128Decoder, getI64Decoder, getOptionDecoder, getU16Decoder, getBooleanDecoder, isTransactionSigner as isTransactionSigner$1 } from '@solana/kit';
|
|
1
|
+
import { pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageComputeUnitLimit, setTransactionMessageComputeUnitPrice, appendTransactionMessageInstructions, signTransactionMessageWithSigners, address, AccountRole, isAddress, getBase58Decoder, createKeyPairSignerFromBytes, getBase58Encoder, generateKeyPairSigner, getProgramDerivedAddress, assertAccountExists, getAddressDecoder, fetchEncodedAccount, transformEncoder, getStructEncoder, fixEncoderSize, getBytesEncoder, getU64Encoder, getBooleanEncoder, decodeAccount, upgradeRoleToSigner, getStructDecoder, fixDecoderSize, getBytesDecoder, getU8Decoder, getU64Decoder, getU128Decoder, getI64Decoder, getOptionDecoder, getU16Decoder, getBooleanDecoder, isTransactionSigner as isTransactionSigner$1 } from '@solana/kit';
|
|
2
2
|
import { getAddMemoInstruction } from '@solana-program/memo';
|
|
3
3
|
import { getTransferSolInstruction } from '@solana-program/system';
|
|
4
4
|
import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS, getCreateAssociatedTokenIdempotentInstruction, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, getTransferCheckedInstruction } from '@solana-program/token';
|
|
@@ -9,6 +9,8 @@ import * as nip44 from 'nostr-tools/nip44';
|
|
|
9
9
|
|
|
10
10
|
// src/constants.ts
|
|
11
11
|
var RELAYS = [
|
|
12
|
+
// Dedicated elisym relay (self-hosted) first, public relays as fallback.
|
|
13
|
+
"wss://relay.elisym.network",
|
|
12
14
|
"wss://relay.damus.io",
|
|
13
15
|
"wss://nos.lol",
|
|
14
16
|
"wss://relay.nostr.band",
|
|
@@ -4213,6 +4215,30 @@ async function getNetworkStats(rpc, programId) {
|
|
|
4213
4215
|
volumeUsdc: account.data.volumeUsdc
|
|
4214
4216
|
};
|
|
4215
4217
|
}
|
|
4218
|
+
async function exportKeyPairBytes(signer) {
|
|
4219
|
+
const { privateKey, publicKey } = signer.keyPair;
|
|
4220
|
+
const [pkcs8, rawPub] = await Promise.all([
|
|
4221
|
+
crypto.subtle.exportKey("pkcs8", privateKey),
|
|
4222
|
+
crypto.subtle.exportKey("raw", publicKey)
|
|
4223
|
+
]);
|
|
4224
|
+
const privateBytes = new Uint8Array(pkcs8).slice(16);
|
|
4225
|
+
const publicBytes = new Uint8Array(rawPub);
|
|
4226
|
+
const bytes = new Uint8Array(64);
|
|
4227
|
+
bytes.set(privateBytes, 0);
|
|
4228
|
+
bytes.set(publicBytes, 32);
|
|
4229
|
+
return bytes;
|
|
4230
|
+
}
|
|
4231
|
+
function encodeSecretKeyBase58(bytes) {
|
|
4232
|
+
return getBase58Decoder().decode(bytes);
|
|
4233
|
+
}
|
|
4234
|
+
async function signerFromSecretKeyBase58(secretKeyBase58) {
|
|
4235
|
+
return createKeyPairSignerFromBytes(new Uint8Array(getBase58Encoder().encode(secretKeyBase58)));
|
|
4236
|
+
}
|
|
4237
|
+
async function generateSolanaWallet() {
|
|
4238
|
+
const signer = await generateKeyPairSigner(true);
|
|
4239
|
+
const bytes = await exportKeyPairBytes(signer);
|
|
4240
|
+
return { signer, secretKeyBase58: encodeSecretKeyBase58(bytes) };
|
|
4241
|
+
}
|
|
4216
4242
|
var SessionSpendLimitEntrySchema = z.object({
|
|
4217
4243
|
chain: z.enum(["solana"]),
|
|
4218
4244
|
token: z.string().min(1).max(16).regex(/^[a-z0-9]+$/, "token must be lowercase alphanumeric"),
|
|
@@ -4422,6 +4448,6 @@ function makeCensor() {
|
|
|
4422
4448
|
};
|
|
4423
4449
|
}
|
|
4424
4450
|
|
|
4425
|
-
export { ACCEPT_TRANSPORTS_TAG, BlossomService, BoundedSet, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, ElisymIdentity, GlobalConfigSchema, INPUT_REDACT_PATHS, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, KNOWN_ASSETS, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, NATIVE_SOL, NostrPool, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, PaymentRequestSchema, PingService, PoliciesService, RELAYS, SECRET_REDACT_PATHS, SessionSpendLimitEntrySchema, SolanaPaymentStrategy, USDC_SOLANA_DEVNET, aggregateNetworkStats, assertExpiry, assertLamports, assetByKey, assetKey, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, createSlidingWindowLimiter, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, fetchEncryptedFileOutput, formatAssetAmount, formatFeeBreakdown, formatNetworkBaseline, formatSol, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parseAssetAmount, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, resolveAssetFromPaymentRequest, resolveKnownAsset, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
|
4451
|
+
export { ACCEPT_TRANSPORTS_TAG, BlossomService, BoundedSet, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, DiscoveryService, ELISYM_PROTOCOL_TAG, ENVELOPE_VERSION, ElisymClient, ElisymIdentity, GlobalConfigSchema, INPUT_REDACT_PATHS, JobWaitTimeoutError, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_LONG_FORM_ARTICLE, KIND_PING, KIND_PONG, KNOWN_ASSETS, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, NATIVE_SOL, NostrPool, POLICY_D_TAG_PREFIX, POLICY_TYPE_REGEX, POLICY_T_TAG, PROTOCOL_PROGRAM_ID_DEVNET, PaymentRequestSchema, PingService, PoliciesService, RELAYS, SECRET_REDACT_PATHS, SessionSpendLimitEntrySchema, SolanaPaymentStrategy, USDC_SOLANA_DEVNET, aggregateNetworkStats, assertExpiry, assertLamports, assetByKey, assetKey, attachmentsOf, buildAcceptTransportsTag, buildEncryptedFileInput, buildPaymentInstructions, calculateProtocolFee, classifyJobError, clearPriorityFeeCache, clearProtocolConfigCache, clearQuickVerifyCache, compareAgentsByRank, computeRankKey, createBlossomTransport, createPaymentRequestWithOnchainConfig, createSlidingWindowLimiter, decodeJobPayload, decryptBytesFromSender, encodeJobPayload, encodeSecretKeyBase58, encryptBytesForRecipient, estimateNetworkBaseline, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, exportKeyPairBytes, fetchEncryptedFileOutput, formatAssetAmount, formatFeeBreakdown, formatNetworkBaseline, formatSol, generateSolanaWallet, getNetworkStats, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parseAssetAmount, parsePaymentRequest, pickPercentileFee, prepareEncryptedFileInput, readAcceptedTransports, resolveAssetFromPaymentRequest, resolveKnownAsset, signerFromSecretKeyBase58, timeAgo, toDTag, truncateKey, utf8ByteLength, validateAgentName, validateExpiry, verifyJobPaymentQuick };
|
|
4426
4452
|
//# sourceMappingURL=index.js.map
|
|
4427
4453
|
//# sourceMappingURL=index.js.map
|