@iqlabs-official/solana-sdk 0.1.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 +421 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +4 -0
- package/dist/contract/constants.d.ts +17 -0
- package/dist/contract/constants.js +20 -0
- package/dist/contract/discriminators.d.ts +2 -0
- package/dist/contract/discriminators.js +4 -0
- package/dist/contract/index.d.ts +5 -0
- package/dist/contract/index.js +21 -0
- package/dist/contract/instructions.d.ts +246 -0
- package/dist/contract/instructions.js +129 -0
- package/dist/contract/pda.d.ts +16 -0
- package/dist/contract/pda.js +104 -0
- package/dist/contract/profile.d.ts +3 -0
- package/dist/contract/profile.js +14 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +63 -0
- package/dist/sdk/constants.d.ts +5 -0
- package/dist/sdk/constants.js +8 -0
- package/dist/sdk/reader/index.d.ts +5 -0
- package/dist/sdk/reader/index.js +19 -0
- package/dist/sdk/reader/iqdb.d.ts +19 -0
- package/dist/sdk/reader/iqdb.js +166 -0
- package/dist/sdk/reader/read_code_in.d.ts +4 -0
- package/dist/sdk/reader/read_code_in.js +19 -0
- package/dist/sdk/reader/reader_context.d.ts +11 -0
- package/dist/sdk/reader/reader_context.js +50 -0
- package/dist/sdk/reader/reader_profile.d.ts +6 -0
- package/dist/sdk/reader/reader_profile.js +67 -0
- package/dist/sdk/reader/reader_utils.d.ts +34 -0
- package/dist/sdk/reader/reader_utils.js +238 -0
- package/dist/sdk/reader/reading_flow.d.ts +26 -0
- package/dist/sdk/reader/reading_flow.js +169 -0
- package/dist/sdk/reader/reading_methods.d.ts +10 -0
- package/dist/sdk/reader/reading_methods.js +233 -0
- package/dist/sdk/utils/ata.d.ts +3 -0
- package/dist/sdk/utils/ata.js +24 -0
- package/dist/sdk/utils/concurrency.d.ts +1 -0
- package/dist/sdk/utils/concurrency.js +22 -0
- package/dist/sdk/utils/connection_helper.d.ts +13 -0
- package/dist/sdk/utils/connection_helper.js +78 -0
- package/dist/sdk/utils/global_fetch.d.ts +52 -0
- package/dist/sdk/utils/global_fetch.js +125 -0
- package/dist/sdk/utils/index.d.ts +1 -0
- package/dist/sdk/utils/index.js +6 -0
- package/dist/sdk/utils/rate_limiter.d.ts +3 -0
- package/dist/sdk/utils/rate_limiter.js +22 -0
- package/dist/sdk/utils/seed.d.ts +4 -0
- package/dist/sdk/utils/seed.js +24 -0
- package/dist/sdk/utils/session_speed.d.ts +21 -0
- package/dist/sdk/utils/session_speed.js +18 -0
- package/dist/sdk/utils/wallet.d.ts +8 -0
- package/dist/sdk/utils/wallet.js +36 -0
- package/dist/sdk/writer/code_in.d.ts +24 -0
- package/dist/sdk/writer/code_in.js +124 -0
- package/dist/sdk/writer/index.d.ts +2 -0
- package/dist/sdk/writer/index.js +11 -0
- package/dist/sdk/writer/iqdb.d.ts +7 -0
- package/dist/sdk/writer/iqdb.js +256 -0
- package/dist/sdk/writer/uploading_methods.d.ts +10 -0
- package/dist/sdk/writer/uploading_methods.js +101 -0
- package/dist/sdk/writer/writer_utils.d.ts +17 -0
- package/dist/sdk/writer/writer_utils.js +145 -0
- package/idl/code_in.json +4983 -0
- package/package.json +28 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { BN, type Idl } from "@coral-xyz/anchor";
|
|
2
|
+
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
+
export type Bytes = Uint8Array;
|
|
4
|
+
export type OptionalPubkey = PublicKey | null;
|
|
5
|
+
export type OptionalPubkeyList = PublicKey[] | null;
|
|
6
|
+
export type InstructionName = "create_admin_table" | "create_ext_table" | "create_private_table" | "create_session" | "create_table" | "database_instruction" | "db_code_in" | "db_instruction_code_in" | "wallet_connection_code_in" | "user_inventory_code_in" | "user_inventory_code_in_for_free" | "initialize_config" | "initialize_db_root" | "manage_connection" | "post_chunk" | "request_connection" | "send_code" | "server_initialize" | "set_merkle_root" | "update_db_root_table_list" | "update_table" | "update_user_metadata" | "user_initialize" | "write_connection_data" | "write_data";
|
|
7
|
+
export type SessionFinalize = {
|
|
8
|
+
seq: BN;
|
|
9
|
+
total_chunks: number;
|
|
10
|
+
};
|
|
11
|
+
export type InstructionBuilder = {
|
|
12
|
+
programId: PublicKey;
|
|
13
|
+
build: <TArgs extends Record<string, unknown> | undefined>(name: InstructionName, accounts: Record<string, PublicKey | undefined>, args?: TArgs) => TransactionInstruction;
|
|
14
|
+
};
|
|
15
|
+
export declare const createInstructionBuilder: (idl: Idl, programId: PublicKey) => InstructionBuilder;
|
|
16
|
+
export type TableCreateArgs = {
|
|
17
|
+
db_root_id: Bytes;
|
|
18
|
+
table_seed: Bytes;
|
|
19
|
+
table_name: Bytes;
|
|
20
|
+
column_names: Bytes[];
|
|
21
|
+
id_col: Bytes;
|
|
22
|
+
ext_keys: Bytes[];
|
|
23
|
+
gate_mint_opt: OptionalPubkey;
|
|
24
|
+
writers_opt: OptionalPubkeyList;
|
|
25
|
+
};
|
|
26
|
+
export type CreateAdminTableAccounts = {
|
|
27
|
+
signer: PublicKey;
|
|
28
|
+
db_root: PublicKey;
|
|
29
|
+
table: PublicKey;
|
|
30
|
+
instruction_table: PublicKey;
|
|
31
|
+
system_program?: PublicKey;
|
|
32
|
+
};
|
|
33
|
+
export declare const createAdminTableInstruction: (builder: InstructionBuilder, accounts: CreateAdminTableAccounts, args: TableCreateArgs) => TransactionInstruction;
|
|
34
|
+
export declare const createExtTableInstruction: (builder: InstructionBuilder, accounts: CreateAdminTableAccounts, args: TableCreateArgs) => TransactionInstruction;
|
|
35
|
+
export declare const createPrivateTableInstruction: (builder: InstructionBuilder, accounts: CreateAdminTableAccounts, args: TableCreateArgs) => TransactionInstruction;
|
|
36
|
+
export declare const createSessionInstruction: (builder: InstructionBuilder, accounts: {
|
|
37
|
+
user: PublicKey;
|
|
38
|
+
user_state: PublicKey;
|
|
39
|
+
session: PublicKey;
|
|
40
|
+
system_program?: PublicKey;
|
|
41
|
+
}, args: {
|
|
42
|
+
seq: BN;
|
|
43
|
+
}) => TransactionInstruction;
|
|
44
|
+
export declare const createTableInstruction: (builder: InstructionBuilder, accounts: {
|
|
45
|
+
db_root: PublicKey;
|
|
46
|
+
receiver: PublicKey;
|
|
47
|
+
signer: PublicKey;
|
|
48
|
+
table: PublicKey;
|
|
49
|
+
instruction_table: PublicKey;
|
|
50
|
+
system_program?: PublicKey;
|
|
51
|
+
}, args: TableCreateArgs) => TransactionInstruction;
|
|
52
|
+
export declare const userInventoryCodeInInstruction: (builder: InstructionBuilder, accounts: {
|
|
53
|
+
user: PublicKey;
|
|
54
|
+
user_inventory: PublicKey;
|
|
55
|
+
system_program?: PublicKey;
|
|
56
|
+
receiver: PublicKey;
|
|
57
|
+
session?: PublicKey;
|
|
58
|
+
iq_ata?: PublicKey;
|
|
59
|
+
}, args: {
|
|
60
|
+
on_chain_path: string;
|
|
61
|
+
metadata: string;
|
|
62
|
+
session: SessionFinalize | null;
|
|
63
|
+
}) => TransactionInstruction;
|
|
64
|
+
export declare const userInventoryCodeInForFreeInstruction: (builder: InstructionBuilder, accounts: {
|
|
65
|
+
user: PublicKey;
|
|
66
|
+
user_inventory: PublicKey;
|
|
67
|
+
config: PublicKey;
|
|
68
|
+
system_program?: PublicKey;
|
|
69
|
+
session?: PublicKey;
|
|
70
|
+
}, args: {
|
|
71
|
+
on_chain_path: string;
|
|
72
|
+
metadata: string;
|
|
73
|
+
session: SessionFinalize | null;
|
|
74
|
+
proof: Bytes[];
|
|
75
|
+
}) => TransactionInstruction;
|
|
76
|
+
export declare const initializeConfigInstruction: (builder: InstructionBuilder, accounts: {
|
|
77
|
+
user: PublicKey;
|
|
78
|
+
config: PublicKey;
|
|
79
|
+
system_program?: PublicKey;
|
|
80
|
+
}, args: {
|
|
81
|
+
merkle_root: Bytes;
|
|
82
|
+
}) => TransactionInstruction;
|
|
83
|
+
export declare const initializeDbRootInstruction: (builder: InstructionBuilder, accounts: {
|
|
84
|
+
db_root: PublicKey;
|
|
85
|
+
signer: PublicKey;
|
|
86
|
+
system_program?: PublicKey;
|
|
87
|
+
}, args: {
|
|
88
|
+
db_root_id: Bytes;
|
|
89
|
+
}) => TransactionInstruction;
|
|
90
|
+
export declare const manageConnectionInstruction: (builder: InstructionBuilder, accounts: {
|
|
91
|
+
db_root: PublicKey;
|
|
92
|
+
connection_table: PublicKey;
|
|
93
|
+
signer: PublicKey;
|
|
94
|
+
}, args: {
|
|
95
|
+
db_root_id: Bytes;
|
|
96
|
+
connection_seed: Bytes;
|
|
97
|
+
new_status: number;
|
|
98
|
+
}) => TransactionInstruction;
|
|
99
|
+
export declare const postChunkInstruction: (builder: InstructionBuilder, accounts: {
|
|
100
|
+
user: PublicKey;
|
|
101
|
+
session: PublicKey;
|
|
102
|
+
}, args: {
|
|
103
|
+
index: number;
|
|
104
|
+
chunk: string;
|
|
105
|
+
method: number;
|
|
106
|
+
decode_break: number;
|
|
107
|
+
}) => TransactionInstruction;
|
|
108
|
+
export declare const requestConnectionInstruction: (builder: InstructionBuilder, accounts: {
|
|
109
|
+
requester: PublicKey;
|
|
110
|
+
db_root: PublicKey;
|
|
111
|
+
connection_table: PublicKey;
|
|
112
|
+
instruction_table: PublicKey;
|
|
113
|
+
requester_user: PublicKey;
|
|
114
|
+
receiver_user: PublicKey;
|
|
115
|
+
table_ref: PublicKey;
|
|
116
|
+
target_table_ref: PublicKey;
|
|
117
|
+
system_program?: PublicKey;
|
|
118
|
+
}, args: {
|
|
119
|
+
db_root_id: Bytes;
|
|
120
|
+
connection_seed: Bytes;
|
|
121
|
+
receiver: PublicKey;
|
|
122
|
+
table_name: Bytes;
|
|
123
|
+
column_names: Bytes[];
|
|
124
|
+
id_col: Bytes;
|
|
125
|
+
ext_keys: Bytes[];
|
|
126
|
+
user_payload: Bytes;
|
|
127
|
+
}) => TransactionInstruction;
|
|
128
|
+
export declare const sendCodeInstruction: (builder: InstructionBuilder, accounts: {
|
|
129
|
+
user: PublicKey;
|
|
130
|
+
code_account: PublicKey;
|
|
131
|
+
system_program?: PublicKey;
|
|
132
|
+
}, args: {
|
|
133
|
+
code: string;
|
|
134
|
+
before_tx: string;
|
|
135
|
+
method: number;
|
|
136
|
+
decode_break: number;
|
|
137
|
+
}) => TransactionInstruction;
|
|
138
|
+
export declare const serverInitializeInstruction: (builder: InstructionBuilder, accounts: {
|
|
139
|
+
user: PublicKey;
|
|
140
|
+
server_account: PublicKey;
|
|
141
|
+
system_program?: PublicKey;
|
|
142
|
+
}, args: {
|
|
143
|
+
server_id: string;
|
|
144
|
+
server_type: string;
|
|
145
|
+
allowed_merkle_root: string;
|
|
146
|
+
}) => TransactionInstruction;
|
|
147
|
+
export declare const setMerkleRootInstruction: (builder: InstructionBuilder, accounts: {
|
|
148
|
+
authority: PublicKey;
|
|
149
|
+
config: PublicKey;
|
|
150
|
+
}, args: {
|
|
151
|
+
new_root: Bytes;
|
|
152
|
+
new_authority: OptionalPubkey;
|
|
153
|
+
}) => TransactionInstruction;
|
|
154
|
+
export declare const updateDbRootTableListInstruction: (builder: InstructionBuilder, accounts: {
|
|
155
|
+
db_root: PublicKey;
|
|
156
|
+
signer: PublicKey;
|
|
157
|
+
}, args: {
|
|
158
|
+
db_root_id: Bytes;
|
|
159
|
+
new_table_seeds: Bytes[];
|
|
160
|
+
}) => TransactionInstruction;
|
|
161
|
+
export declare const updateTableInstruction: (builder: InstructionBuilder, accounts: {
|
|
162
|
+
db_root: PublicKey;
|
|
163
|
+
table: PublicKey;
|
|
164
|
+
signer: PublicKey;
|
|
165
|
+
}, args: {
|
|
166
|
+
db_root_id: Bytes;
|
|
167
|
+
table_seed: Bytes;
|
|
168
|
+
table_name: Bytes;
|
|
169
|
+
column_names: Bytes[];
|
|
170
|
+
id_col: Bytes;
|
|
171
|
+
ext_keys: Bytes[];
|
|
172
|
+
writers_opt: OptionalPubkeyList;
|
|
173
|
+
}) => TransactionInstruction;
|
|
174
|
+
export declare const updateUserMetadataInstruction: (builder: InstructionBuilder, accounts: {
|
|
175
|
+
user: PublicKey;
|
|
176
|
+
db_root: PublicKey;
|
|
177
|
+
signer: PublicKey;
|
|
178
|
+
system_program?: PublicKey;
|
|
179
|
+
}, args: {
|
|
180
|
+
db_root_id: Bytes;
|
|
181
|
+
meta: Bytes;
|
|
182
|
+
}) => TransactionInstruction;
|
|
183
|
+
export declare const userInitializeInstruction: (builder: InstructionBuilder, accounts: {
|
|
184
|
+
user: PublicKey;
|
|
185
|
+
code_account: PublicKey;
|
|
186
|
+
user_state: PublicKey;
|
|
187
|
+
user_inventory: PublicKey;
|
|
188
|
+
system_program?: PublicKey;
|
|
189
|
+
}) => TransactionInstruction;
|
|
190
|
+
export declare const walletConnectionCodeInInstruction: (builder: InstructionBuilder, accounts: {
|
|
191
|
+
user: PublicKey;
|
|
192
|
+
signer?: PublicKey;
|
|
193
|
+
user_inventory: PublicKey;
|
|
194
|
+
db_root: PublicKey;
|
|
195
|
+
connection_table: PublicKey;
|
|
196
|
+
table_ref: PublicKey;
|
|
197
|
+
system_program?: PublicKey;
|
|
198
|
+
receiver: PublicKey;
|
|
199
|
+
session?: PublicKey;
|
|
200
|
+
iq_ata?: PublicKey;
|
|
201
|
+
}, args: {
|
|
202
|
+
db_root_id: Bytes;
|
|
203
|
+
connection_seed: Bytes;
|
|
204
|
+
on_chain_path: string;
|
|
205
|
+
metadata: string;
|
|
206
|
+
session: SessionFinalize | null;
|
|
207
|
+
}) => TransactionInstruction;
|
|
208
|
+
export declare const dbCodeInInstruction: (builder: InstructionBuilder, accounts: {
|
|
209
|
+
user: PublicKey;
|
|
210
|
+
signer?: PublicKey;
|
|
211
|
+
user_inventory: PublicKey;
|
|
212
|
+
db_root: PublicKey;
|
|
213
|
+
table: PublicKey;
|
|
214
|
+
signer_ata?: PublicKey;
|
|
215
|
+
system_program?: PublicKey;
|
|
216
|
+
receiver: PublicKey;
|
|
217
|
+
session?: PublicKey;
|
|
218
|
+
iq_ata?: PublicKey;
|
|
219
|
+
}, args: {
|
|
220
|
+
db_root_id: Bytes;
|
|
221
|
+
table_seed: Bytes;
|
|
222
|
+
on_chain_path: string;
|
|
223
|
+
metadata: string;
|
|
224
|
+
session: SessionFinalize | null;
|
|
225
|
+
}) => TransactionInstruction;
|
|
226
|
+
export declare const dbInstructionCodeInInstruction: (builder: InstructionBuilder, accounts: {
|
|
227
|
+
user: PublicKey;
|
|
228
|
+
signer?: PublicKey;
|
|
229
|
+
user_inventory: PublicKey;
|
|
230
|
+
db_root: PublicKey;
|
|
231
|
+
table: PublicKey;
|
|
232
|
+
instruction_table: PublicKey;
|
|
233
|
+
signer_ata?: PublicKey;
|
|
234
|
+
system_program?: PublicKey;
|
|
235
|
+
receiver: PublicKey;
|
|
236
|
+
session?: PublicKey;
|
|
237
|
+
iq_ata?: PublicKey;
|
|
238
|
+
}, args: {
|
|
239
|
+
db_root_id: Bytes;
|
|
240
|
+
table_seed: Bytes;
|
|
241
|
+
table_name: Bytes;
|
|
242
|
+
target_tx: Bytes;
|
|
243
|
+
on_chain_path: string;
|
|
244
|
+
metadata: string;
|
|
245
|
+
session: SessionFinalize | null;
|
|
246
|
+
}) => TransactionInstruction;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dbInstructionCodeInInstruction = exports.dbCodeInInstruction = exports.walletConnectionCodeInInstruction = exports.userInitializeInstruction = exports.updateUserMetadataInstruction = exports.updateTableInstruction = exports.updateDbRootTableListInstruction = exports.setMerkleRootInstruction = exports.serverInitializeInstruction = exports.sendCodeInstruction = exports.requestConnectionInstruction = exports.postChunkInstruction = exports.manageConnectionInstruction = exports.initializeDbRootInstruction = exports.initializeConfigInstruction = exports.userInventoryCodeInForFreeInstruction = exports.userInventoryCodeInInstruction = exports.createTableInstruction = exports.createSessionInstruction = exports.createPrivateTableInstruction = exports.createExtTableInstruction = exports.createAdminTableInstruction = exports.createInstructionBuilder = void 0;
|
|
4
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
5
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
6
|
+
const toAccountMeta = (account, accounts, programId) => {
|
|
7
|
+
const pubkey = account.address
|
|
8
|
+
? new web3_js_1.PublicKey(account.address)
|
|
9
|
+
: accounts[account.name];
|
|
10
|
+
if (!pubkey) {
|
|
11
|
+
if (account.optional) {
|
|
12
|
+
// For optional accounts, pass the program ID as a placeholder
|
|
13
|
+
// This is how Anchor handles optional accounts - they expect the
|
|
14
|
+
// program ID to signal "None" rather than omitting the account
|
|
15
|
+
return {
|
|
16
|
+
pubkey: programId,
|
|
17
|
+
isSigner: false,
|
|
18
|
+
isWritable: false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Missing account: ${account.name}`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
pubkey,
|
|
25
|
+
isSigner: Boolean(account.signer),
|
|
26
|
+
isWritable: Boolean(account.writable),
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const createInstructionBuilder = (idl, programId) => {
|
|
30
|
+
const coder = new anchor_1.BorshInstructionCoder(idl);
|
|
31
|
+
const instructions = (idl.instructions ?? []);
|
|
32
|
+
const instructionMap = new Map(instructions.map((instruction) => [instruction.name, instruction]));
|
|
33
|
+
const build = (name, accounts, args) => {
|
|
34
|
+
const instruction = instructionMap.get(name);
|
|
35
|
+
if (!instruction) {
|
|
36
|
+
throw new Error(`Unknown instruction: ${name}`);
|
|
37
|
+
}
|
|
38
|
+
const keys = instruction.accounts.map((account) => toAccountMeta(account, accounts, programId));
|
|
39
|
+
const data = coder.encode(name, args ?? {});
|
|
40
|
+
return new web3_js_1.TransactionInstruction({ programId, keys, data });
|
|
41
|
+
};
|
|
42
|
+
return { programId, build };
|
|
43
|
+
};
|
|
44
|
+
exports.createInstructionBuilder = createInstructionBuilder;
|
|
45
|
+
const createAdminTableInstruction = (builder, accounts, args) => builder.build("create_admin_table", accounts, args);
|
|
46
|
+
exports.createAdminTableInstruction = createAdminTableInstruction;
|
|
47
|
+
const createExtTableInstruction = (builder, accounts, args) => builder.build("create_ext_table", accounts, args);
|
|
48
|
+
exports.createExtTableInstruction = createExtTableInstruction;
|
|
49
|
+
const createPrivateTableInstruction = (builder, accounts, args) => builder.build("create_private_table", accounts, args);
|
|
50
|
+
exports.createPrivateTableInstruction = createPrivateTableInstruction;
|
|
51
|
+
const createSessionInstruction = (builder, accounts, args) => builder.build("create_session", accounts, args);
|
|
52
|
+
exports.createSessionInstruction = createSessionInstruction;
|
|
53
|
+
const createTableInstruction = (builder, accounts, args) => builder.build("create_table", accounts, args);
|
|
54
|
+
exports.createTableInstruction = createTableInstruction;
|
|
55
|
+
const userInventoryCodeInInstruction = (builder, accounts, args) => builder.build("user_inventory_code_in", accounts, args);
|
|
56
|
+
exports.userInventoryCodeInInstruction = userInventoryCodeInInstruction;
|
|
57
|
+
// SDK writer does not wrap this instruction yet; add a helper if needed.
|
|
58
|
+
const userInventoryCodeInForFreeInstruction = (builder, accounts, args) => builder.build("user_inventory_code_in_for_free", accounts, args);
|
|
59
|
+
exports.userInventoryCodeInForFreeInstruction = userInventoryCodeInForFreeInstruction;
|
|
60
|
+
const initializeConfigInstruction = (builder, accounts, args) => builder.build("initialize_config", accounts, args);
|
|
61
|
+
exports.initializeConfigInstruction = initializeConfigInstruction;
|
|
62
|
+
const initializeDbRootInstruction = (builder, accounts, args) => builder.build("initialize_db_root", accounts, args);
|
|
63
|
+
exports.initializeDbRootInstruction = initializeDbRootInstruction;
|
|
64
|
+
const manageConnectionInstruction = (builder, accounts, args) => builder.build("manage_connection", accounts, args);
|
|
65
|
+
exports.manageConnectionInstruction = manageConnectionInstruction;
|
|
66
|
+
const postChunkInstruction = (builder, accounts, args) => builder.build("post_chunk", accounts, args);
|
|
67
|
+
exports.postChunkInstruction = postChunkInstruction;
|
|
68
|
+
const requestConnectionInstruction = (builder, accounts, args) => builder.build("request_connection", accounts, args);
|
|
69
|
+
exports.requestConnectionInstruction = requestConnectionInstruction;
|
|
70
|
+
const sendCodeInstruction = (builder, accounts, args) => builder.build("send_code", accounts, args);
|
|
71
|
+
exports.sendCodeInstruction = sendCodeInstruction;
|
|
72
|
+
const serverInitializeInstruction = (builder, accounts, args) => builder.build("server_initialize", accounts, args);
|
|
73
|
+
exports.serverInitializeInstruction = serverInitializeInstruction;
|
|
74
|
+
const setMerkleRootInstruction = (builder, accounts, args) => builder.build("set_merkle_root", accounts, args);
|
|
75
|
+
exports.setMerkleRootInstruction = setMerkleRootInstruction;
|
|
76
|
+
const updateDbRootTableListInstruction = (builder, accounts, args) => builder.build("update_db_root_table_list", accounts, args);
|
|
77
|
+
exports.updateDbRootTableListInstruction = updateDbRootTableListInstruction;
|
|
78
|
+
const updateTableInstruction = (builder, accounts, args) => builder.build("update_table", accounts, args);
|
|
79
|
+
exports.updateTableInstruction = updateTableInstruction;
|
|
80
|
+
const updateUserMetadataInstruction = (builder, accounts, args) => builder.build("update_user_metadata", accounts, args);
|
|
81
|
+
exports.updateUserMetadataInstruction = updateUserMetadataInstruction;
|
|
82
|
+
const userInitializeInstruction = (builder, accounts) => builder.build("user_initialize", accounts);
|
|
83
|
+
exports.userInitializeInstruction = userInitializeInstruction;
|
|
84
|
+
// export const writeConnectionDataInstruction = (
|
|
85
|
+
// builder: InstructionBuilder,
|
|
86
|
+
// accounts: {
|
|
87
|
+
// db_root: PublicKey;
|
|
88
|
+
// connection_table: PublicKey;
|
|
89
|
+
// table_ref: PublicKey;
|
|
90
|
+
// signer: PublicKey;
|
|
91
|
+
// },
|
|
92
|
+
// args: {
|
|
93
|
+
// db_root_id: Bytes;
|
|
94
|
+
// connection_seed: Bytes;
|
|
95
|
+
// row_json_tx: Bytes;
|
|
96
|
+
// },
|
|
97
|
+
// ) => builder.build("write_connection_data", accounts, args);
|
|
98
|
+
//
|
|
99
|
+
// export const writeDataInstruction = (
|
|
100
|
+
// builder: InstructionBuilder,
|
|
101
|
+
// accounts: {
|
|
102
|
+
// db_root: PublicKey;
|
|
103
|
+
// table: PublicKey;
|
|
104
|
+
// signer_ata?: PublicKey;
|
|
105
|
+
// signer: PublicKey;
|
|
106
|
+
// },
|
|
107
|
+
// args: {
|
|
108
|
+
// db_root_id: Bytes;
|
|
109
|
+
// table_seed: Bytes;
|
|
110
|
+
// row_json_tx: Bytes;
|
|
111
|
+
// },
|
|
112
|
+
// ) => builder.build("write_data", accounts, args);
|
|
113
|
+
// export const databaseInstructionInstruction = (
|
|
114
|
+
// builder: InstructionBuilder,
|
|
115
|
+
// accounts: {
|
|
116
|
+
// db_root: PublicKey;
|
|
117
|
+
// table: PublicKey;
|
|
118
|
+
// instruction_table: PublicKey;
|
|
119
|
+
// signer_ata?: PublicKey;
|
|
120
|
+
// signer: PublicKey
|
|
121
|
+
// },
|
|
122
|
+
// args: { db_root_id: Bytes; table_seed: Bytes; table_name: Bytes; target_tx: Bytes; content_json_tx: Bytes },
|
|
123
|
+
// ) => builder.build("database_instruction", accounts, args);
|
|
124
|
+
const walletConnectionCodeInInstruction = (builder, accounts, args) => builder.build("wallet_connection_code_in", accounts, args);
|
|
125
|
+
exports.walletConnectionCodeInInstruction = walletConnectionCodeInInstruction;
|
|
126
|
+
const dbCodeInInstruction = (builder, accounts, args) => builder.build("db_code_in", accounts, args);
|
|
127
|
+
exports.dbCodeInInstruction = dbCodeInInstruction;
|
|
128
|
+
const dbInstructionCodeInInstruction = (builder, accounts, args) => builder.build("db_instruction_code_in", accounts, args);
|
|
129
|
+
exports.dbInstructionCodeInInstruction = dbInstructionCodeInInstruction;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
type Bytes = Uint8Array<any>;
|
|
3
|
+
export declare const getDbRootPda: (dbRootId: Bytes, programId?: PublicKey) => PublicKey;
|
|
4
|
+
export declare const getTablePda: (dbRoot: PublicKey, tableSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
5
|
+
export declare const getInstructionTablePda: (dbRoot: PublicKey, tableSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
6
|
+
export declare const getConnectionTablePda: (dbRoot: PublicKey, connectionSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
7
|
+
export declare const getConnectionInstructionTablePda: (dbRoot: PublicKey, connectionSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
8
|
+
export declare const getConnectionTableRefPda: (dbRoot: PublicKey, connectionSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
9
|
+
export declare const getTargetTableRefPda: (dbRoot: PublicKey, tableSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
10
|
+
export declare const getTargetConnectionTableRefPda: (dbRoot: PublicKey, connectionSeed: Bytes, programId?: PublicKey) => PublicKey;
|
|
11
|
+
export declare const getUserPda: (user: PublicKey, programId?: PublicKey) => PublicKey;
|
|
12
|
+
export declare const getSessionPda: (user: PublicKey, seq: bigint | number, programId?: PublicKey) => PublicKey;
|
|
13
|
+
export declare const getCodeAccountPda: (user: PublicKey, programId?: PublicKey) => PublicKey;
|
|
14
|
+
export declare const getUserInventoryPda: (user: PublicKey, programId?: PublicKey) => PublicKey;
|
|
15
|
+
export declare const getServerAccountPda: (user: PublicKey, serverId: string, programId?: PublicKey) => PublicKey;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getServerAccountPda = exports.getUserInventoryPda = exports.getCodeAccountPda = exports.getSessionPda = exports.getUserPda = exports.getTargetConnectionTableRefPda = exports.getTargetTableRefPda = exports.getConnectionTableRefPda = exports.getConnectionInstructionTablePda = exports.getConnectionTablePda = exports.getInstructionTablePda = exports.getTablePda = exports.getDbRootPda = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const profile_1 = require("./profile");
|
|
7
|
+
const SEED_CONFIG_BYTES = Buffer.from(constants_1.SEED_CONFIG);
|
|
8
|
+
const SEED_DB_ROOT_BYTES = Buffer.from(constants_1.SEED_DB_ROOT);
|
|
9
|
+
const SEED_TABLE_BYTES = Buffer.from(constants_1.SEED_TABLE);
|
|
10
|
+
const SEED_TABLE_REF_BYTES = Buffer.from(constants_1.SEED_TABLE_REF);
|
|
11
|
+
const SEED_INSTRUCTION_BYTES = Buffer.from(constants_1.SEED_INSTRUCTION);
|
|
12
|
+
const SEED_TARGET_BYTES = Buffer.from(constants_1.SEED_TARGET);
|
|
13
|
+
const SEED_USER_BYTES = Buffer.from(constants_1.SEED_USER);
|
|
14
|
+
const SEED_BUNDLE_BYTES = Buffer.from(constants_1.SEED_BUNDLE);
|
|
15
|
+
const SEED_CONNECTION_BYTES = Buffer.from(constants_1.SEED_CONNECTION);
|
|
16
|
+
const SEED_CODE_ACCOUNT_BYTES = Buffer.from(constants_1.SEED_CODE_ACCOUNT);
|
|
17
|
+
const SEED_USER_INVENTORY_BYTES = Buffer.from(constants_1.SEED_USER_INVENTORY);
|
|
18
|
+
const encodeBytesSeed = (value) => Buffer.from(value);
|
|
19
|
+
const encodeU64Seed = (value) => {
|
|
20
|
+
const data = Buffer.alloc(8);
|
|
21
|
+
const numberValue = typeof value === "bigint" ? value : BigInt(value);
|
|
22
|
+
data.writeBigUInt64LE(numberValue, 0);
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
const findPda = (seeds, programId) => web3_js_1.PublicKey.findProgramAddressSync(seeds, programId)[0];
|
|
26
|
+
const getProgramIdSeed = (programId) => programId.toBuffer();
|
|
27
|
+
const getDbRootPda = (dbRootId, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
28
|
+
SEED_DB_ROOT_BYTES,
|
|
29
|
+
getProgramIdSeed(programId),
|
|
30
|
+
encodeBytesSeed(dbRootId),
|
|
31
|
+
], programId);
|
|
32
|
+
exports.getDbRootPda = getDbRootPda;
|
|
33
|
+
const getTablePda = (dbRoot, tableSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
34
|
+
SEED_TABLE_BYTES,
|
|
35
|
+
getProgramIdSeed(programId),
|
|
36
|
+
dbRoot.toBuffer(),
|
|
37
|
+
encodeBytesSeed(tableSeed),
|
|
38
|
+
], programId);
|
|
39
|
+
exports.getTablePda = getTablePda;
|
|
40
|
+
const getInstructionTablePda = (dbRoot, tableSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
41
|
+
SEED_TABLE_BYTES,
|
|
42
|
+
getProgramIdSeed(programId),
|
|
43
|
+
dbRoot.toBuffer(),
|
|
44
|
+
encodeBytesSeed(tableSeed),
|
|
45
|
+
SEED_INSTRUCTION_BYTES,
|
|
46
|
+
], programId);
|
|
47
|
+
exports.getInstructionTablePda = getInstructionTablePda;
|
|
48
|
+
const getConnectionTablePda = (dbRoot, connectionSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
49
|
+
SEED_CONNECTION_BYTES,
|
|
50
|
+
getProgramIdSeed(programId),
|
|
51
|
+
dbRoot.toBuffer(),
|
|
52
|
+
encodeBytesSeed(connectionSeed),
|
|
53
|
+
], programId);
|
|
54
|
+
exports.getConnectionTablePda = getConnectionTablePda;
|
|
55
|
+
const getConnectionInstructionTablePda = (dbRoot, connectionSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
56
|
+
SEED_CONNECTION_BYTES,
|
|
57
|
+
getProgramIdSeed(programId),
|
|
58
|
+
dbRoot.toBuffer(),
|
|
59
|
+
encodeBytesSeed(connectionSeed),
|
|
60
|
+
SEED_INSTRUCTION_BYTES,
|
|
61
|
+
], programId);
|
|
62
|
+
exports.getConnectionInstructionTablePda = getConnectionInstructionTablePda;
|
|
63
|
+
const getConnectionTableRefPda = (dbRoot, connectionSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
64
|
+
SEED_TABLE_REF_BYTES,
|
|
65
|
+
getProgramIdSeed(programId),
|
|
66
|
+
dbRoot.toBuffer(),
|
|
67
|
+
encodeBytesSeed(connectionSeed),
|
|
68
|
+
], programId);
|
|
69
|
+
exports.getConnectionTableRefPda = getConnectionTableRefPda;
|
|
70
|
+
const getTargetTableRefPda = (dbRoot, tableSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
71
|
+
SEED_TABLE_REF_BYTES,
|
|
72
|
+
getProgramIdSeed(programId),
|
|
73
|
+
dbRoot.toBuffer(),
|
|
74
|
+
encodeBytesSeed(tableSeed),
|
|
75
|
+
SEED_TARGET_BYTES,
|
|
76
|
+
], programId);
|
|
77
|
+
exports.getTargetTableRefPda = getTargetTableRefPda;
|
|
78
|
+
const getTargetConnectionTableRefPda = (dbRoot, connectionSeed, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
79
|
+
SEED_TABLE_REF_BYTES,
|
|
80
|
+
getProgramIdSeed(programId),
|
|
81
|
+
dbRoot.toBuffer(),
|
|
82
|
+
encodeBytesSeed(connectionSeed),
|
|
83
|
+
SEED_TARGET_BYTES,
|
|
84
|
+
], programId);
|
|
85
|
+
exports.getTargetConnectionTableRefPda = getTargetConnectionTableRefPda;
|
|
86
|
+
const getUserPda = (user, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
87
|
+
SEED_USER_BYTES,
|
|
88
|
+
getProgramIdSeed(programId),
|
|
89
|
+
user.toBuffer(),
|
|
90
|
+
], programId);
|
|
91
|
+
exports.getUserPda = getUserPda;
|
|
92
|
+
const getSessionPda = (user, seq, programId = (0, profile_1.getProgramId)()) => findPda([
|
|
93
|
+
SEED_BUNDLE_BYTES,
|
|
94
|
+
getProgramIdSeed(programId),
|
|
95
|
+
user.toBuffer(),
|
|
96
|
+
encodeU64Seed(seq),
|
|
97
|
+
], programId);
|
|
98
|
+
exports.getSessionPda = getSessionPda;
|
|
99
|
+
const getCodeAccountPda = (user, programId = (0, profile_1.getProgramId)()) => findPda([SEED_CODE_ACCOUNT_BYTES, user.toBuffer()], programId);
|
|
100
|
+
exports.getCodeAccountPda = getCodeAccountPda;
|
|
101
|
+
const getUserInventoryPda = (user, programId = (0, profile_1.getProgramId)()) => findPda([SEED_USER_INVENTORY_BYTES, user.toBuffer()], programId);
|
|
102
|
+
exports.getUserInventoryPda = getUserInventoryPda;
|
|
103
|
+
const getServerAccountPda = (user, serverId, programId = (0, profile_1.getProgramId)()) => findPda([Buffer.from(serverId), user.toBuffer()], programId);
|
|
104
|
+
exports.getServerAccountPda = getServerAccountPda;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProgramId = exports.resolveContractRuntime = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const constants_2 = require("./constants");
|
|
7
|
+
const DEFAULT_PROGRAM_IDS = {
|
|
8
|
+
anchor: new web3_js_1.PublicKey(constants_2.DEFAULT_ANCHOR_PROGRAM_ID),
|
|
9
|
+
pinocchio: new web3_js_1.PublicKey(constants_2.DEFAULT_PINOCCHIO_PROGRAM_ID),
|
|
10
|
+
};
|
|
11
|
+
const resolveContractRuntime = (mode = constants_1.DEFAULT_CONTRACT_MODE) => mode === "pinocchio" ? "pinocchio" : "anchor";
|
|
12
|
+
exports.resolveContractRuntime = resolveContractRuntime;
|
|
13
|
+
const getProgramId = (mode = constants_1.DEFAULT_CONTRACT_MODE) => DEFAULT_PROGRAM_IDS[(0, exports.resolveContractRuntime)(mode)];
|
|
14
|
+
exports.getProgramId = getProgramId;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as contract from "./contract";
|
|
2
|
+
import * as reader from "./sdk/reader";
|
|
3
|
+
import * as writer from "./sdk/writer";
|
|
4
|
+
import * as wallet from "./sdk/utils/wallet";
|
|
5
|
+
import * as constants from "./sdk/constants";
|
|
6
|
+
import * as utils from "./sdk/utils";
|
|
7
|
+
import { setRpcUrl } from "./sdk/utils/connection_helper";
|
|
8
|
+
export { contract, reader, writer, constants, wallet, utils, setRpcUrl };
|
|
9
|
+
import { getRpcUrl } from "./sdk/utils/connection_helper";
|
|
10
|
+
declare const iqlabs: {
|
|
11
|
+
contract: typeof contract;
|
|
12
|
+
reader: typeof reader;
|
|
13
|
+
writer: typeof writer;
|
|
14
|
+
utils: typeof utils;
|
|
15
|
+
wallet: typeof wallet;
|
|
16
|
+
constants: typeof constants;
|
|
17
|
+
setRpcUrl: typeof setRpcUrl;
|
|
18
|
+
getRpcUrl: typeof getRpcUrl;
|
|
19
|
+
};
|
|
20
|
+
export { iqlabs };
|
|
21
|
+
export default iqlabs;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.iqlabs = exports.setRpcUrl = exports.utils = exports.wallet = exports.constants = exports.writer = exports.reader = exports.contract = void 0;
|
|
37
|
+
const contract = __importStar(require("./contract"));
|
|
38
|
+
exports.contract = contract;
|
|
39
|
+
const reader = __importStar(require("./sdk/reader"));
|
|
40
|
+
exports.reader = reader;
|
|
41
|
+
const writer = __importStar(require("./sdk/writer"));
|
|
42
|
+
exports.writer = writer;
|
|
43
|
+
const wallet = __importStar(require("./sdk/utils/wallet"));
|
|
44
|
+
exports.wallet = wallet;
|
|
45
|
+
const constants = __importStar(require("./sdk/constants"));
|
|
46
|
+
exports.constants = constants;
|
|
47
|
+
const utils = __importStar(require("./sdk/utils"));
|
|
48
|
+
exports.utils = utils;
|
|
49
|
+
const connection_helper_1 = require("./sdk/utils/connection_helper");
|
|
50
|
+
Object.defineProperty(exports, "setRpcUrl", { enumerable: true, get: function () { return connection_helper_1.setRpcUrl; } });
|
|
51
|
+
const connection_helper_2 = require("./sdk/utils/connection_helper");
|
|
52
|
+
const iqlabs = {
|
|
53
|
+
contract,
|
|
54
|
+
reader,
|
|
55
|
+
writer,
|
|
56
|
+
utils,
|
|
57
|
+
wallet,
|
|
58
|
+
constants,
|
|
59
|
+
setRpcUrl: connection_helper_1.setRpcUrl,
|
|
60
|
+
getRpcUrl: connection_helper_2.getRpcUrl,
|
|
61
|
+
};
|
|
62
|
+
exports.iqlabs = iqlabs;
|
|
63
|
+
exports.default = iqlabs;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DEFAULT_LINKED_LIST_THRESHOLD = 10;
|
|
2
|
+
export declare const CHUNK_SIZE = 800;
|
|
3
|
+
export declare const DIRECT_METADATA_MAX_BYTES = 900;
|
|
4
|
+
export declare const DEFAULT_WRITE_FEE_RECEIVER = "EWNSTD8tikwqHMcRNuuNbZrnYJUiJdKq9UXLXSEU4wZ1";
|
|
5
|
+
export declare const DEFAULT_IQ_MINT = "3uXACfojUrya7VH51jVC1DCHq3uzK4A7g469Q954LABS";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_IQ_MINT = exports.DEFAULT_WRITE_FEE_RECEIVER = exports.DIRECT_METADATA_MAX_BYTES = exports.CHUNK_SIZE = exports.DEFAULT_LINKED_LIST_THRESHOLD = void 0;
|
|
4
|
+
exports.DEFAULT_LINKED_LIST_THRESHOLD = 10;
|
|
5
|
+
exports.CHUNK_SIZE = 800;
|
|
6
|
+
exports.DIRECT_METADATA_MAX_BYTES = 900;
|
|
7
|
+
exports.DEFAULT_WRITE_FEE_RECEIVER = "EWNSTD8tikwqHMcRNuuNbZrnYJUiJdKq9UXLXSEU4wZ1";
|
|
8
|
+
exports.DEFAULT_IQ_MINT = "3uXACfojUrya7VH51jVC1DCHq3uzK4A7g469Q954LABS";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { deriveDmSeed } from "../utils/seed";
|
|
2
|
+
export { readCodeIn } from "./read_code_in";
|
|
3
|
+
export { readConnection, readTableRows, collectSignatures, getTablelistFromRoot, } from "./iqdb";
|
|
4
|
+
export { readUserState, readInventoryMetadata, fetchInventoryTransactions, } from "./reading_flow";
|
|
5
|
+
export { getSessionPdaList, fetchUserConnections, } from "./reader_utils";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchUserConnections = exports.getSessionPdaList = exports.fetchInventoryTransactions = exports.readInventoryMetadata = exports.readUserState = exports.getTablelistFromRoot = exports.collectSignatures = exports.readTableRows = exports.readConnection = exports.readCodeIn = exports.deriveDmSeed = void 0;
|
|
4
|
+
var seed_1 = require("../utils/seed");
|
|
5
|
+
Object.defineProperty(exports, "deriveDmSeed", { enumerable: true, get: function () { return seed_1.deriveDmSeed; } });
|
|
6
|
+
var read_code_in_1 = require("./read_code_in");
|
|
7
|
+
Object.defineProperty(exports, "readCodeIn", { enumerable: true, get: function () { return read_code_in_1.readCodeIn; } });
|
|
8
|
+
var iqdb_1 = require("./iqdb");
|
|
9
|
+
Object.defineProperty(exports, "readConnection", { enumerable: true, get: function () { return iqdb_1.readConnection; } });
|
|
10
|
+
Object.defineProperty(exports, "readTableRows", { enumerable: true, get: function () { return iqdb_1.readTableRows; } });
|
|
11
|
+
Object.defineProperty(exports, "collectSignatures", { enumerable: true, get: function () { return iqdb_1.collectSignatures; } });
|
|
12
|
+
Object.defineProperty(exports, "getTablelistFromRoot", { enumerable: true, get: function () { return iqdb_1.getTablelistFromRoot; } });
|
|
13
|
+
var reading_flow_1 = require("./reading_flow");
|
|
14
|
+
Object.defineProperty(exports, "readUserState", { enumerable: true, get: function () { return reading_flow_1.readUserState; } });
|
|
15
|
+
Object.defineProperty(exports, "readInventoryMetadata", { enumerable: true, get: function () { return reading_flow_1.readInventoryMetadata; } });
|
|
16
|
+
Object.defineProperty(exports, "fetchInventoryTransactions", { enumerable: true, get: function () { return reading_flow_1.fetchInventoryTransactions; } });
|
|
17
|
+
var reader_utils_1 = require("./reader_utils");
|
|
18
|
+
Object.defineProperty(exports, "getSessionPdaList", { enumerable: true, get: function () { return reader_utils_1.getSessionPdaList; } });
|
|
19
|
+
Object.defineProperty(exports, "fetchUserConnections", { enumerable: true, get: function () { return reader_utils_1.fetchUserConnections; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
+
export declare function readConnection(dbRootId: Uint8Array<any> | string, partyA: string, partyB: string, mode?: string): Promise<{
|
|
3
|
+
status: "pending" | "approved" | "blocked" | "unknown";
|
|
4
|
+
requester: "a" | "b";
|
|
5
|
+
blocker: "a" | "b" | "none";
|
|
6
|
+
}>;
|
|
7
|
+
export declare function getTablelistFromRoot(connection: Connection, dbRootId: Uint8Array | string, mode?: string): Promise<{
|
|
8
|
+
rootPda: PublicKey;
|
|
9
|
+
creator: string;
|
|
10
|
+
tableSeeds: any;
|
|
11
|
+
globalTableSeeds: any;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function readTableRows(account: PublicKey | string, options?: {
|
|
14
|
+
before?: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
signatures?: string[];
|
|
17
|
+
speed?: string;
|
|
18
|
+
}): Promise<Array<Record<string, unknown>>>;
|
|
19
|
+
export declare function collectSignatures(account: PublicKey | string, maxSignatures?: number): Promise<string[]>;
|