@lobstercove/lichen-sdk 1.0.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/README.md +50 -0
- package/dist/bincode.d.ts +5 -0
- package/dist/bincode.js +91 -0
- package/dist/bountyboard.d.ts +57 -0
- package/dist/bountyboard.js +205 -0
- package/dist/connection.d.ts +482 -0
- package/dist/connection.js +813 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +27 -0
- package/dist/keypair.d.ts +40 -0
- package/dist/keypair.js +69 -0
- package/dist/lichenid.d.ts +271 -0
- package/dist/lichenid.js +628 -0
- package/dist/lichenswap.d.ts +79 -0
- package/dist/lichenswap.js +311 -0
- package/dist/pq.d.ts +57 -0
- package/dist/pq.js +178 -0
- package/dist/publickey.d.ts +35 -0
- package/dist/publickey.js +71 -0
- package/dist/sporepay.d.ts +57 -0
- package/dist/sporepay.js +208 -0
- package/dist/sporevault.d.ts +43 -0
- package/dist/sporevault.js +176 -0
- package/dist/thalllend.d.ts +51 -0
- package/dist/thalllend.js +206 -0
- package/dist/transaction.d.ts +100 -0
- package/dist/transaction.js +202 -0
- package/package.json +56 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { PublicKey } from './publickey.js';
|
|
2
|
+
export { PublicKey as Address } from './publickey.js';
|
|
3
|
+
export { Keypair } from './keypair.js';
|
|
4
|
+
export { Connection } from './connection.js';
|
|
5
|
+
export { LichenIdClient, LICHEN_ID_DELEGATE_PERMISSIONS, estimateLichenIdNameRegistrationCost, } from './lichenid.js';
|
|
6
|
+
export { ThallLendClient } from './thalllend.js';
|
|
7
|
+
export { LichenSwapClient } from './lichenswap.js';
|
|
8
|
+
export { SporePayClient } from './sporepay.js';
|
|
9
|
+
export { SporeVaultClient } from './sporevault.js';
|
|
10
|
+
export { BountyBoardClient } from './bountyboard.js';
|
|
11
|
+
export { ML_DSA_65_PUBLIC_KEY_BYTES, ML_DSA_65_SIGNATURE_BYTES, PQ_SCHEME_ML_DSA_65, PqPublicKey, PqSignature, } from './pq.js';
|
|
12
|
+
export { Transaction, TransactionBuilder, Instruction, Message, } from './transaction.js';
|
|
13
|
+
export type { Balance, Account, Block, Validator, NetworkInfo, ChainStatus, Metrics, ProofStep, ReadonlyContractResult, TransactionProof, } from './connection.js';
|
|
14
|
+
export type { AddSkillParams, ApproveRecoveryParams, AttestSkillParams, BidNameAuctionParams, LichenIdAgentDirectory, LichenIdAgentDirectoryEntry, LichenIdAgentDirectoryOptions, LichenIdAvailabilityInput, LichenIdAvailabilityStatus, LichenIdDelegatePermissionKey, LichenIdDelegateRecord, LichenIdGivenVouch, LichenIdMetadata, LichenIdNameAuction, LichenIdNameResolution, LichenIdProfile, LichenIdReputation, LichenIdReceivedVouch, LichenIdSkill, LichenIdStats, LichenIdVouches, CreateNameAuctionParams, ExecuteRecoveryParams, FinalizeNameAuctionParams, RegisterIdentityParams, RegisterNameParams, RevokeAttestationParams, SetAvailabilityParams, SetAvailabilityAsParams, SetDelegateParams, SetEndpointParams, SetEndpointAsParams, SetMetadataParams, SetMetadataAsParams, SetRateParams, SetRateAsParams, SetRecoveryGuardiansParams, UpdateAgentTypeAsParams, } from './lichenid.js';
|
|
15
|
+
export type { LiquidateParams, ThallLendAccountInfo, ThallLendInterestRate, ThallLendProtocolStats, ThallLendStats, } from './thalllend.js';
|
|
16
|
+
export type { AddLiquidityParams, CreatePoolParams, LichenSwapPoolInfo, LichenSwapProtocolFees, LichenSwapStats, LichenSwapSwapStats, LichenSwapTwapCumulatives, LichenSwapVolumeTotals, SwapParams, SwapWithDeadlineParams, } from './lichenswap.js';
|
|
17
|
+
export type { CreateStreamParams, CreateStreamWithCliffParams, SporePayStats, SporePayStream, SporePayStreamInfo, TransferStreamParams, WithdrawFromStreamParams, } from './sporepay.js';
|
|
18
|
+
export type { SporeVaultStats, SporeVaultStrategyInfo, SporeVaultUserPosition, SporeVaultVaultStats, } from './sporevault.js';
|
|
19
|
+
export type { ApproveWorkParams, BountyBoardBountyInfo, BountyBoardPlatformStats, BountyBoardStats, CreateBountyParams, SubmitWorkParams, } from './bountyboard.js';
|
|
20
|
+
export { BOUNTY_STATUS_OPEN, BOUNTY_STATUS_COMPLETED, BOUNTY_STATUS_CANCELLED, } from './bountyboard.js';
|
|
21
|
+
/**
|
|
22
|
+
* SDK version
|
|
23
|
+
*/
|
|
24
|
+
export declare const VERSION = "1.0.0";
|
|
25
|
+
/**
|
|
26
|
+
* Default RPC URL (override with LICHEN_RPC_URL env var)
|
|
27
|
+
*/
|
|
28
|
+
export declare const DEFAULT_RPC_URL: string;
|
|
29
|
+
/**
|
|
30
|
+
* Default WebSocket URL (override with LICHEN_WS_URL env var)
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_WS_URL: string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Lichen JavaScript/TypeScript SDK
|
|
2
|
+
// Official SDK for interacting with Lichen blockchain
|
|
3
|
+
export { PublicKey } from './publickey.js';
|
|
4
|
+
export { PublicKey as Address } from './publickey.js';
|
|
5
|
+
export { Keypair } from './keypair.js';
|
|
6
|
+
export { Connection } from './connection.js';
|
|
7
|
+
export { LichenIdClient, LICHEN_ID_DELEGATE_PERMISSIONS, estimateLichenIdNameRegistrationCost, } from './lichenid.js';
|
|
8
|
+
export { ThallLendClient } from './thalllend.js';
|
|
9
|
+
export { LichenSwapClient } from './lichenswap.js';
|
|
10
|
+
export { SporePayClient } from './sporepay.js';
|
|
11
|
+
export { SporeVaultClient } from './sporevault.js';
|
|
12
|
+
export { BountyBoardClient } from './bountyboard.js';
|
|
13
|
+
export { ML_DSA_65_PUBLIC_KEY_BYTES, ML_DSA_65_SIGNATURE_BYTES, PQ_SCHEME_ML_DSA_65, PqPublicKey, PqSignature, } from './pq.js';
|
|
14
|
+
export { TransactionBuilder, } from './transaction.js';
|
|
15
|
+
export { BOUNTY_STATUS_OPEN, BOUNTY_STATUS_COMPLETED, BOUNTY_STATUS_CANCELLED, } from './bountyboard.js';
|
|
16
|
+
/**
|
|
17
|
+
* SDK version
|
|
18
|
+
*/
|
|
19
|
+
export const VERSION = '1.0.0';
|
|
20
|
+
/**
|
|
21
|
+
* Default RPC URL (override with LICHEN_RPC_URL env var)
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_RPC_URL = (typeof process !== 'undefined' && process.env?.LICHEN_RPC_URL) || 'http://localhost:8899';
|
|
24
|
+
/**
|
|
25
|
+
* Default WebSocket URL (override with LICHEN_WS_URL env var)
|
|
26
|
+
*/
|
|
27
|
+
export const DEFAULT_WS_URL = (typeof process !== 'undefined' && process.env?.LICHEN_WS_URL) || 'ws://localhost:8900';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PublicKey } from './publickey.js';
|
|
2
|
+
import { PqPublicKey, PqSignature } from './pq.js';
|
|
3
|
+
export declare class Keypair {
|
|
4
|
+
readonly publicKey: PqPublicKey;
|
|
5
|
+
/**
|
|
6
|
+
* The secret key is stored privately to prevent accidental leakage via
|
|
7
|
+
* toString(), JSON.stringify(), or console.log(). Use getSecretKey()
|
|
8
|
+
* when you explicitly need the raw secret key bytes.
|
|
9
|
+
*/
|
|
10
|
+
private readonly _secretKey;
|
|
11
|
+
private readonly _seed;
|
|
12
|
+
private constructor();
|
|
13
|
+
static generate(): Keypair;
|
|
14
|
+
static fromSeed(seed: Uint8Array): Keypair;
|
|
15
|
+
pubkey(): PublicKey;
|
|
16
|
+
address(): PublicKey;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the 32-byte seed used to derive the PQ keypair.
|
|
19
|
+
*
|
|
20
|
+
* **WARNING**: Handle with extreme care. Never log, serialize, or transmit
|
|
21
|
+
* the returned value. Prefer using sign() instead of accessing key material
|
|
22
|
+
* directly.
|
|
23
|
+
*/
|
|
24
|
+
getSecretKey(): Uint8Array;
|
|
25
|
+
toSeed(): Uint8Array;
|
|
26
|
+
sign(message: Uint8Array): PqSignature;
|
|
27
|
+
static verify(address: PublicKey, message: Uint8Array, signature: PqSignature): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a safe string representation containing only the address.
|
|
30
|
+
*/
|
|
31
|
+
toString(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a JSON-safe representation containing only the address and verifying key.
|
|
34
|
+
* Prevents secret key leakage via JSON.stringify().
|
|
35
|
+
*/
|
|
36
|
+
toJSON(): {
|
|
37
|
+
address: string;
|
|
38
|
+
publicKey: ReturnType<PqPublicKey['toJSON']>;
|
|
39
|
+
};
|
|
40
|
+
}
|
package/dist/keypair.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Lichen SDK - Keypair utilities
|
|
2
|
+
// AUDIT-FIX H1-01: Private key protected from accidental exposure via
|
|
3
|
+
// toString(), toJSON(), and console.log(). Use getSecretKey() explicitly.
|
|
4
|
+
import { generateMlDsa65Seed, PqPublicKey, PqSignature } from './pq.js';
|
|
5
|
+
import { ml_dsa65 } from '@noble/post-quantum/ml-dsa.js';
|
|
6
|
+
export class Keypair {
|
|
7
|
+
constructor(publicKey, secretKey, seed) {
|
|
8
|
+
this.publicKey = PqPublicKey.mlDsa65(publicKey);
|
|
9
|
+
this._secretKey = new Uint8Array(secretKey);
|
|
10
|
+
this._seed = new Uint8Array(seed);
|
|
11
|
+
}
|
|
12
|
+
static generate() {
|
|
13
|
+
return Keypair.fromSeed(generateMlDsa65Seed());
|
|
14
|
+
}
|
|
15
|
+
static fromSeed(seed) {
|
|
16
|
+
if (seed.length !== 32) {
|
|
17
|
+
throw new Error('Seed must be 32 bytes');
|
|
18
|
+
}
|
|
19
|
+
const keypair = ml_dsa65.keygen(seed);
|
|
20
|
+
return new Keypair(keypair.publicKey, keypair.secretKey, seed);
|
|
21
|
+
}
|
|
22
|
+
pubkey() {
|
|
23
|
+
return this.publicKey.address();
|
|
24
|
+
}
|
|
25
|
+
address() {
|
|
26
|
+
return this.pubkey();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the 32-byte seed used to derive the PQ keypair.
|
|
30
|
+
*
|
|
31
|
+
* **WARNING**: Handle with extreme care. Never log, serialize, or transmit
|
|
32
|
+
* the returned value. Prefer using sign() instead of accessing key material
|
|
33
|
+
* directly.
|
|
34
|
+
*/
|
|
35
|
+
getSecretKey() {
|
|
36
|
+
return this.toSeed();
|
|
37
|
+
}
|
|
38
|
+
toSeed() {
|
|
39
|
+
return new Uint8Array(this._seed);
|
|
40
|
+
}
|
|
41
|
+
sign(message) {
|
|
42
|
+
return PqSignature.mlDsa65(this.publicKey, ml_dsa65.sign(message, this._secretKey));
|
|
43
|
+
}
|
|
44
|
+
static verify(address, message, signature) {
|
|
45
|
+
return address.equals(signature.signerAddress()) && signature.verify(message);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns a safe string representation containing only the address.
|
|
49
|
+
*/
|
|
50
|
+
toString() {
|
|
51
|
+
return `Keypair(address: ${this.pubkey().toBase58()})`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Returns a JSON-safe representation containing only the address and verifying key.
|
|
55
|
+
* Prevents secret key leakage via JSON.stringify().
|
|
56
|
+
*/
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
address: this.pubkey().toBase58(),
|
|
60
|
+
publicKey: this.publicKey.toJSON(),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Custom inspect for Node.js console.log() — never reveals secret key.
|
|
65
|
+
*/
|
|
66
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
67
|
+
return this.toString();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Connection } from './connection.js';
|
|
2
|
+
import { Keypair } from './keypair.js';
|
|
3
|
+
import { PublicKey } from './publickey.js';
|
|
4
|
+
export declare const LICHEN_ID_DELEGATE_PERMISSIONS: {
|
|
5
|
+
readonly PROFILE: 1;
|
|
6
|
+
readonly AGENT_TYPE: 2;
|
|
7
|
+
readonly SKILLS: 4;
|
|
8
|
+
readonly NAMING: 8;
|
|
9
|
+
};
|
|
10
|
+
declare const AVAILABILITY_BY_NAME: {
|
|
11
|
+
readonly offline: 0;
|
|
12
|
+
readonly available: 1;
|
|
13
|
+
readonly busy: 2;
|
|
14
|
+
readonly online: 1;
|
|
15
|
+
};
|
|
16
|
+
export type LichenIdAvailabilityStatus = 0 | 1 | 2;
|
|
17
|
+
export type LichenIdAvailabilityInput = LichenIdAvailabilityStatus | keyof typeof AVAILABILITY_BY_NAME;
|
|
18
|
+
export type LichenIdDelegatePermissionKey = keyof typeof LICHEN_ID_DELEGATE_PERMISSIONS;
|
|
19
|
+
export type LichenIdMetadata = Record<string, unknown> | unknown[] | string;
|
|
20
|
+
export interface LichenIdReputation {
|
|
21
|
+
address: string;
|
|
22
|
+
score: number;
|
|
23
|
+
tier: number;
|
|
24
|
+
tier_name: string;
|
|
25
|
+
}
|
|
26
|
+
export interface LichenIdNameResolution {
|
|
27
|
+
name: string;
|
|
28
|
+
owner: string;
|
|
29
|
+
registered_slot: number;
|
|
30
|
+
expiry_slot: number;
|
|
31
|
+
}
|
|
32
|
+
export interface LichenIdSkill {
|
|
33
|
+
index: number;
|
|
34
|
+
name: string;
|
|
35
|
+
proficiency: number;
|
|
36
|
+
attestation_count: number;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
}
|
|
39
|
+
export interface LichenIdReceivedVouch {
|
|
40
|
+
voucher: string;
|
|
41
|
+
voucher_name: string | null;
|
|
42
|
+
timestamp: number;
|
|
43
|
+
}
|
|
44
|
+
export interface LichenIdGivenVouch {
|
|
45
|
+
vouchee: string;
|
|
46
|
+
vouchee_name: string | null;
|
|
47
|
+
timestamp: number;
|
|
48
|
+
}
|
|
49
|
+
export interface LichenIdVouches {
|
|
50
|
+
received: LichenIdReceivedVouch[];
|
|
51
|
+
given: LichenIdGivenVouch[];
|
|
52
|
+
}
|
|
53
|
+
export interface LichenIdNameAuction {
|
|
54
|
+
name: string;
|
|
55
|
+
active: boolean;
|
|
56
|
+
start_slot: number;
|
|
57
|
+
end_slot: number;
|
|
58
|
+
reserve_bid: number;
|
|
59
|
+
highest_bid: number;
|
|
60
|
+
highest_bidder: string;
|
|
61
|
+
current_slot: number;
|
|
62
|
+
ended: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface LichenIdAgentDirectoryEntry {
|
|
65
|
+
address: string;
|
|
66
|
+
name: string;
|
|
67
|
+
licn_name: string | null;
|
|
68
|
+
agent_type: number;
|
|
69
|
+
agent_type_name: string;
|
|
70
|
+
reputation: number;
|
|
71
|
+
trust_tier: number;
|
|
72
|
+
trust_tier_name: string;
|
|
73
|
+
availability: number;
|
|
74
|
+
available: boolean;
|
|
75
|
+
rate: number;
|
|
76
|
+
endpoint: string | null;
|
|
77
|
+
skill_count: number;
|
|
78
|
+
vouch_count: number;
|
|
79
|
+
created_at: number;
|
|
80
|
+
updated_at: number;
|
|
81
|
+
}
|
|
82
|
+
export interface LichenIdAgentDirectory {
|
|
83
|
+
agents: LichenIdAgentDirectoryEntry[];
|
|
84
|
+
count: number;
|
|
85
|
+
total: number;
|
|
86
|
+
}
|
|
87
|
+
export interface LichenIdStats {
|
|
88
|
+
total_identities: number;
|
|
89
|
+
total_names: number;
|
|
90
|
+
total_skills: number;
|
|
91
|
+
total_vouches: number;
|
|
92
|
+
total_attestations: number;
|
|
93
|
+
tier_distribution: Record<string, number>;
|
|
94
|
+
}
|
|
95
|
+
export interface LichenIdDelegateRecord {
|
|
96
|
+
owner: string;
|
|
97
|
+
delegate: string;
|
|
98
|
+
permissions: number;
|
|
99
|
+
expiresAtMs: number;
|
|
100
|
+
createdAtMs: number;
|
|
101
|
+
active: boolean;
|
|
102
|
+
canProfile: boolean;
|
|
103
|
+
canAgentType: boolean;
|
|
104
|
+
canSkills: boolean;
|
|
105
|
+
canNaming: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface LichenIdProfile {
|
|
108
|
+
identity: {
|
|
109
|
+
address: string;
|
|
110
|
+
owner: string;
|
|
111
|
+
name: string;
|
|
112
|
+
agent_type: number;
|
|
113
|
+
agent_type_name: string;
|
|
114
|
+
reputation: number;
|
|
115
|
+
created_at: number;
|
|
116
|
+
updated_at: number;
|
|
117
|
+
skill_count: number;
|
|
118
|
+
vouch_count: number;
|
|
119
|
+
is_active: boolean;
|
|
120
|
+
};
|
|
121
|
+
licn_name: string | null;
|
|
122
|
+
reputation: {
|
|
123
|
+
score: number;
|
|
124
|
+
tier: number;
|
|
125
|
+
tier_name: string;
|
|
126
|
+
};
|
|
127
|
+
skills: LichenIdSkill[];
|
|
128
|
+
vouches: LichenIdVouches;
|
|
129
|
+
achievements: Array<Record<string, unknown>>;
|
|
130
|
+
agent: {
|
|
131
|
+
endpoint: string | null;
|
|
132
|
+
metadata: LichenIdMetadata | null;
|
|
133
|
+
availability: number;
|
|
134
|
+
availability_name: string;
|
|
135
|
+
rate: number;
|
|
136
|
+
};
|
|
137
|
+
contributions: Record<string, number>;
|
|
138
|
+
}
|
|
139
|
+
export interface RegisterIdentityParams {
|
|
140
|
+
agentType: number;
|
|
141
|
+
name: string;
|
|
142
|
+
}
|
|
143
|
+
export interface RegisterNameParams {
|
|
144
|
+
name: string;
|
|
145
|
+
durationYears?: number;
|
|
146
|
+
valueSpores?: number | bigint;
|
|
147
|
+
}
|
|
148
|
+
export interface AddSkillParams {
|
|
149
|
+
name: string;
|
|
150
|
+
proficiency?: number;
|
|
151
|
+
}
|
|
152
|
+
export interface SetEndpointParams {
|
|
153
|
+
url: string;
|
|
154
|
+
}
|
|
155
|
+
export interface SetMetadataParams {
|
|
156
|
+
metadata: LichenIdMetadata;
|
|
157
|
+
}
|
|
158
|
+
export interface SetRateParams {
|
|
159
|
+
rateSpores: number | bigint;
|
|
160
|
+
}
|
|
161
|
+
export interface SetAvailabilityParams {
|
|
162
|
+
status: LichenIdAvailabilityInput;
|
|
163
|
+
}
|
|
164
|
+
export interface SetDelegateParams {
|
|
165
|
+
delegate: PublicKey | string;
|
|
166
|
+
permissions: number;
|
|
167
|
+
expiresAtMs: number | bigint;
|
|
168
|
+
}
|
|
169
|
+
export interface SetEndpointAsParams {
|
|
170
|
+
owner: PublicKey | string;
|
|
171
|
+
url: string;
|
|
172
|
+
}
|
|
173
|
+
export interface SetMetadataAsParams {
|
|
174
|
+
owner: PublicKey | string;
|
|
175
|
+
metadata: LichenIdMetadata;
|
|
176
|
+
}
|
|
177
|
+
export interface SetAvailabilityAsParams {
|
|
178
|
+
owner: PublicKey | string;
|
|
179
|
+
status: LichenIdAvailabilityInput;
|
|
180
|
+
}
|
|
181
|
+
export interface SetRateAsParams {
|
|
182
|
+
owner: PublicKey | string;
|
|
183
|
+
rateSpores: number | bigint;
|
|
184
|
+
}
|
|
185
|
+
export interface UpdateAgentTypeAsParams {
|
|
186
|
+
owner: PublicKey | string;
|
|
187
|
+
agentType: number;
|
|
188
|
+
}
|
|
189
|
+
export interface SetRecoveryGuardiansParams {
|
|
190
|
+
guardians: Array<PublicKey | string>;
|
|
191
|
+
}
|
|
192
|
+
export interface ApproveRecoveryParams {
|
|
193
|
+
target: PublicKey | string;
|
|
194
|
+
newOwner: PublicKey | string;
|
|
195
|
+
}
|
|
196
|
+
export interface ExecuteRecoveryParams {
|
|
197
|
+
target: PublicKey | string;
|
|
198
|
+
newOwner: PublicKey | string;
|
|
199
|
+
}
|
|
200
|
+
export interface AttestSkillParams {
|
|
201
|
+
identity: PublicKey | string;
|
|
202
|
+
name: string;
|
|
203
|
+
level?: number;
|
|
204
|
+
}
|
|
205
|
+
export interface RevokeAttestationParams {
|
|
206
|
+
identity: PublicKey | string;
|
|
207
|
+
name: string;
|
|
208
|
+
}
|
|
209
|
+
export interface CreateNameAuctionParams {
|
|
210
|
+
name: string;
|
|
211
|
+
reserveBidSpores: number | bigint;
|
|
212
|
+
endSlot: number | bigint;
|
|
213
|
+
}
|
|
214
|
+
export interface BidNameAuctionParams {
|
|
215
|
+
name: string;
|
|
216
|
+
bidAmountSpores: number | bigint;
|
|
217
|
+
}
|
|
218
|
+
export interface FinalizeNameAuctionParams {
|
|
219
|
+
name: string;
|
|
220
|
+
durationYears?: number;
|
|
221
|
+
}
|
|
222
|
+
export interface LichenIdAgentDirectoryOptions {
|
|
223
|
+
type?: number;
|
|
224
|
+
available?: boolean;
|
|
225
|
+
min_reputation?: number;
|
|
226
|
+
limit?: number;
|
|
227
|
+
offset?: number;
|
|
228
|
+
}
|
|
229
|
+
export declare function estimateLichenIdNameRegistrationCost(name: string, durationYears?: number): bigint;
|
|
230
|
+
export declare class LichenIdClient {
|
|
231
|
+
private readonly connection;
|
|
232
|
+
private resolvedProgram?;
|
|
233
|
+
constructor(connection: Connection, programId?: PublicKey);
|
|
234
|
+
private callReadonly;
|
|
235
|
+
getProgramId(): Promise<PublicKey>;
|
|
236
|
+
getProfile(address: PublicKey | string): Promise<LichenIdProfile | null>;
|
|
237
|
+
getReputation(address: PublicKey | string): Promise<LichenIdReputation | null>;
|
|
238
|
+
getSkills(address: PublicKey | string): Promise<LichenIdSkill[]>;
|
|
239
|
+
getVouches(address: PublicKey | string): Promise<LichenIdVouches>;
|
|
240
|
+
resolveName(name: string): Promise<LichenIdNameResolution | null>;
|
|
241
|
+
getMetadata(address: PublicKey | string): Promise<LichenIdMetadata | null>;
|
|
242
|
+
getDelegate(owner: PublicKey | string, delegate: PublicKey | string): Promise<LichenIdDelegateRecord | null>;
|
|
243
|
+
getAttestations(identity: PublicKey | string, skillName: string): Promise<number>;
|
|
244
|
+
getNameAuction(name: string): Promise<LichenIdNameAuction | null>;
|
|
245
|
+
getAgentDirectory(options?: LichenIdAgentDirectoryOptions): Promise<LichenIdAgentDirectory>;
|
|
246
|
+
getStats(): Promise<LichenIdStats>;
|
|
247
|
+
registerIdentity(owner: Keypair, params: RegisterIdentityParams): Promise<string>;
|
|
248
|
+
registerName(owner: Keypair, params: RegisterNameParams): Promise<string>;
|
|
249
|
+
addSkill(owner: Keypair, params: AddSkillParams): Promise<string>;
|
|
250
|
+
vouch(owner: Keypair, vouchee: PublicKey | string): Promise<string>;
|
|
251
|
+
setEndpoint(owner: Keypair, params: SetEndpointParams): Promise<string>;
|
|
252
|
+
setMetadata(owner: Keypair, params: SetMetadataParams): Promise<string>;
|
|
253
|
+
setRate(owner: Keypair, params: SetRateParams): Promise<string>;
|
|
254
|
+
setAvailability(owner: Keypair, params: SetAvailabilityParams): Promise<string>;
|
|
255
|
+
setDelegate(owner: Keypair, params: SetDelegateParams): Promise<string>;
|
|
256
|
+
revokeDelegate(owner: Keypair, delegate: PublicKey | string): Promise<string>;
|
|
257
|
+
setEndpointAs(delegate: Keypair, params: SetEndpointAsParams): Promise<string>;
|
|
258
|
+
setMetadataAs(delegate: Keypair, params: SetMetadataAsParams): Promise<string>;
|
|
259
|
+
setAvailabilityAs(delegate: Keypair, params: SetAvailabilityAsParams): Promise<string>;
|
|
260
|
+
setRateAs(delegate: Keypair, params: SetRateAsParams): Promise<string>;
|
|
261
|
+
updateAgentTypeAs(delegate: Keypair, params: UpdateAgentTypeAsParams): Promise<string>;
|
|
262
|
+
setRecoveryGuardians(owner: Keypair, params: SetRecoveryGuardiansParams): Promise<string>;
|
|
263
|
+
approveRecovery(guardian: Keypair, params: ApproveRecoveryParams): Promise<string>;
|
|
264
|
+
executeRecovery(guardian: Keypair, params: ExecuteRecoveryParams): Promise<string>;
|
|
265
|
+
attestSkill(attester: Keypair, params: AttestSkillParams): Promise<string>;
|
|
266
|
+
revokeAttestation(attester: Keypair, params: RevokeAttestationParams): Promise<string>;
|
|
267
|
+
createNameAuction(owner: Keypair, params: CreateNameAuctionParams): Promise<string>;
|
|
268
|
+
bidNameAuction(owner: Keypair, params: BidNameAuctionParams): Promise<string>;
|
|
269
|
+
finalizeNameAuction(owner: Keypair, params: FinalizeNameAuctionParams): Promise<string>;
|
|
270
|
+
}
|
|
271
|
+
export {};
|