@arcanetech/privacy-sdk-stellar 0.2.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 +69 -0
- package/dist/index.js +7057 -0
- package/dist/index.js.map +1 -0
- package/dist/node.js +6726 -0
- package/dist/node.js.map +1 -0
- package/dist/state/index.js +2478 -0
- package/dist/state/index.js.map +1 -0
- package/dist/transact/index.js +4163 -0
- package/dist/transact/index.js.map +1 -0
- package/generated/contract/README.md +54 -0
- package/generated/contract/dist/index.d.ts +369 -0
- package/generated/contract/dist/index.js +125 -0
- package/generated/contract/package.json +17 -0
- package/generated/contract/src/index.ts +399 -0
- package/generated/contract/tsconfig.json +98 -0
- package/generated/registry/README.md +54 -0
- package/generated/registry/dist/index.d.ts +198 -0
- package/generated/registry/dist/index.js +70 -0
- package/generated/registry/package.json +17 -0
- package/generated/registry/src/index.ts +238 -0
- package/generated/registry/tsconfig.json +98 -0
- package/package.json +69 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { Address } from "@stellar/stellar-sdk";
|
|
3
|
+
import {
|
|
4
|
+
AssembledTransaction,
|
|
5
|
+
Client as ContractClient,
|
|
6
|
+
ClientOptions as ContractClientOptions,
|
|
7
|
+
MethodOptions,
|
|
8
|
+
Result,
|
|
9
|
+
Spec as ContractSpec,
|
|
10
|
+
} from "@stellar/stellar-sdk/contract";
|
|
11
|
+
import type {
|
|
12
|
+
u32,
|
|
13
|
+
i32,
|
|
14
|
+
u64,
|
|
15
|
+
i64,
|
|
16
|
+
u128,
|
|
17
|
+
i128,
|
|
18
|
+
u256,
|
|
19
|
+
i256,
|
|
20
|
+
Option,
|
|
21
|
+
Timepoint,
|
|
22
|
+
Duration,
|
|
23
|
+
} from "@stellar/stellar-sdk/contract";
|
|
24
|
+
export * from "@stellar/stellar-sdk";
|
|
25
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
26
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
27
|
+
|
|
28
|
+
if (typeof window !== "undefined") {
|
|
29
|
+
//@ts-ignore Buffer exists
|
|
30
|
+
window.Buffer = window.Buffer || Buffer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export const networks = {
|
|
35
|
+
testnet: {
|
|
36
|
+
networkPassphrase: "Test SDF Network ; September 2015",
|
|
37
|
+
contractId: "CBVQTSTSIJ4UZMN5FQBFHPUIYSW3ATGSP57BZDJNKTOBNQODQTRGE4K5",
|
|
38
|
+
}
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Per-application audit public key allowlist entry (runtime/config state).
|
|
44
|
+
*/
|
|
45
|
+
export interface AppAuditState {
|
|
46
|
+
audit_public_key_x: Buffer;
|
|
47
|
+
audit_public_key_y: Buffer;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Ephemeral BabyJubJub / ECDH point (not hashed into the Merkle tree).
|
|
54
|
+
*/
|
|
55
|
+
export interface EphemeralKeyCoords {
|
|
56
|
+
x: Buffer;
|
|
57
|
+
y: Buffer;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Storage key for tree leaves — each leaf stored by index for O(1) write on deposit.
|
|
62
|
+
*/
|
|
63
|
+
export type TreeDataKey = {tag: "Leaf", values: readonly [u32]} | {tag: "LeafCount", values: void} | {tag: "LeafEphemeral", values: readonly [u32]} | {tag: "PairwiseFrontier", values: void};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Storage key for nullifiers — each nullifier hash maps to bool (consumed or not).
|
|
67
|
+
*/
|
|
68
|
+
export type NulifierDataKey = {tag: "Nulifier", values: readonly [Buffer]};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Ring buffer of historical Merkle roots (for proofs generated against recent states).
|
|
72
|
+
*/
|
|
73
|
+
export type RootHistoryKey = {tag: "CurrentRootIndex", values: void} | {tag: "Root", values: readonly [u32]};
|
|
74
|
+
|
|
75
|
+
export const Errors = {
|
|
76
|
+
1: {message:"NullifierUsed"},
|
|
77
|
+
2: {message:"InsufficientBalance"},
|
|
78
|
+
3: {message:"ProofVerificationFailed"},
|
|
79
|
+
4: {message:"OnlyAdmin"},
|
|
80
|
+
5: {message:"TreeAtCapacity"},
|
|
81
|
+
6: {message:"AssociationRootMismatch"},
|
|
82
|
+
7: {message:"InvalidPublicSignals"},
|
|
83
|
+
8: {message:"InvalidTokenAmount"},
|
|
84
|
+
/**
|
|
85
|
+
* Proof `state_root` is not in the recent root history window.
|
|
86
|
+
*/
|
|
87
|
+
9: {message:"UnknownRoot"},
|
|
88
|
+
/**
|
|
89
|
+
* Exactly one output commitment is non-zero; only zero/zero or two non-zero outputs are allowed.
|
|
90
|
+
*/
|
|
91
|
+
10: {message:"InvalidCommitmentPair"},
|
|
92
|
+
/**
|
|
93
|
+
* Stored Merkle frontier length does not match tree depth (corrupt or outdated storage layout).
|
|
94
|
+
*/
|
|
95
|
+
11: {message:"InvalidMerkleFrontier"},
|
|
96
|
+
/**
|
|
97
|
+
* KYT passage registry is not configured (required for the current layout).
|
|
98
|
+
*/
|
|
99
|
+
12: {message:"KytRegistryMissing"},
|
|
100
|
+
/**
|
|
101
|
+
* Public note audit key is not registered for any enabled application.
|
|
102
|
+
*/
|
|
103
|
+
13: {message:"UnknownAuditPublicKey"},
|
|
104
|
+
/**
|
|
105
|
+
* Public note audit key coordinates are not a valid BabyJubJub point.
|
|
106
|
+
*/
|
|
107
|
+
14: {message:"InvalidAuditPublicKey"}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
export interface OutputNoteEventPayload {
|
|
113
|
+
ciphertext: Buffer;
|
|
114
|
+
ephemeral_x: Buffer;
|
|
115
|
+
ephemeral_y: Buffer;
|
|
116
|
+
output_index: u32;
|
|
117
|
+
tag: Buffer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
export const Groth16Error = {
|
|
122
|
+
0: {message:"MalformedVerifyingKey"}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Plaintext note fields stored in registry for onboarding claim.
|
|
128
|
+
*/
|
|
129
|
+
export interface PlaintextNote {
|
|
130
|
+
asset_hi: Buffer;
|
|
131
|
+
asset_lo: Buffer;
|
|
132
|
+
/**
|
|
133
|
+
* Must remain `None`; registry rejects payloads that expose the sender ephemeral scalar.
|
|
134
|
+
*/
|
|
135
|
+
deposited_ephemeral_scalar: Option<Buffer>;
|
|
136
|
+
nullifier: Buffer;
|
|
137
|
+
secret: Buffer;
|
|
138
|
+
value: i128;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
export interface PendingNotePayload {
|
|
143
|
+
notes: Array<PlaintextNote>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
export interface PrivateAddressRegistration {
|
|
148
|
+
owner: string;
|
|
149
|
+
public_key_x: Buffer;
|
|
150
|
+
public_key_y: Buffer;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export type OptionalPrivateAddressRegistration = {tag: "None", values: void} | {tag: "Some", values: readonly [PrivateAddressRegistration]};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
export interface OnboardingPayload {
|
|
157
|
+
encrypted_private_key: Buffer;
|
|
158
|
+
notes: PendingNotePayload;
|
|
159
|
+
owner: string;
|
|
160
|
+
private_address_registration: OptionalPrivateAddressRegistration;
|
|
161
|
+
temp_public_key_x: Buffer;
|
|
162
|
+
temp_public_key_y: Buffer;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
export interface PrivateAddressRecord {
|
|
167
|
+
owner: string;
|
|
168
|
+
public_key_x: Buffer;
|
|
169
|
+
public_key_y: Buffer;
|
|
170
|
+
updated_at_ledger: u32;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
export interface PendingNullifierRecord {
|
|
175
|
+
created_at_ledger: u32;
|
|
176
|
+
created_by: string;
|
|
177
|
+
encrypted_private_key: Buffer;
|
|
178
|
+
note: PlaintextNote;
|
|
179
|
+
owner: string;
|
|
180
|
+
temp_public_key_x: Buffer;
|
|
181
|
+
temp_public_key_y: Buffer;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
export interface KytPassageRecord {
|
|
186
|
+
expires_at_ledger: u32;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
export interface KytPassageAuthorization {
|
|
191
|
+
expiration_ledger: u32;
|
|
192
|
+
signature: Buffer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface Client {
|
|
196
|
+
/**
|
|
197
|
+
* Construct and simulate a transact transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
198
|
+
* Single entrypoint: verifies `circuits/main.circom` Groth16 proof and public signals, checks
|
|
199
|
+
* tree root and nullifiers, appends new output commitments (with ephemeral keys, not in Merkle),
|
|
200
|
+
* optionally forwards onboarding payload to the registry, then applies public token deposits /
|
|
201
|
+
* withdrawals: `publicDepositedAssets` + `publicDeposits` pull from `from`, and
|
|
202
|
+
* `publicWithdrawnAssets` + `publicWithdrawals` send to the Stellar account from
|
|
203
|
+
* `withdrawAddressHi` / `withdrawAddressLo`.
|
|
204
|
+
*
|
|
205
|
+
* Asset ids: Stellar **contract** token `C...` addresses encoded as two field elements (same 32-byte
|
|
206
|
+
* split as account keys — see `circuits/main.circom`).
|
|
207
|
+
*
|
|
208
|
+
* Withdraw destination account: Stellar **account** Ed25519 key (G-address strkey payload) split into two
|
|
209
|
+
* public field elements `withdrawAddressHi` / `withdrawAddressLo` — big-endian `u128` chunks
|
|
210
|
+
* `bytes[0..16]` and `bytes[16..32]` (see `circuits/main.circom`). Avoids mod-`r` loss from a single `Fr`.
|
|
211
|
+
*/
|
|
212
|
+
transact: ({from, proof_bytes, pub_signals_bytes, onboarding, kyt_authorization}: {from: string, proof_bytes: Buffer, pub_signals_bytes: Buffer, onboarding: Option<OnboardingPayload>, kyt_authorization: Option<KytPassageAuthorization>}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Construct and simulate a set_kyt_registry transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
216
|
+
*/
|
|
217
|
+
set_kyt_registry: ({admin, kyt_registry}: {admin: string, kyt_registry: string}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Construct and simulate a get_kyt_registry transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
221
|
+
*/
|
|
222
|
+
get_kyt_registry: (options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Construct and simulate a require_kyt_passage transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
226
|
+
*/
|
|
227
|
+
require_kyt_passage: ({passage_id}: {passage_id: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Construct and simulate a set_app_audit_key transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
231
|
+
*/
|
|
232
|
+
set_app_audit_key: ({admin, application_id, audit_public_key_x, audit_public_key_y, enabled}: {admin: string, application_id: Buffer, audit_public_key_x: Buffer, audit_public_key_y: Buffer, enabled: boolean}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Construct and simulate a get_app_audit_state transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
236
|
+
*/
|
|
237
|
+
get_app_audit_state: ({application_id}: {application_id: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<Option<AppAuditState>>>
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Construct and simulate a set_registry transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
241
|
+
*/
|
|
242
|
+
set_registry: ({admin, registry}: {admin: string, registry: string}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Construct and simulate a get_registry transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
246
|
+
*/
|
|
247
|
+
get_registry: (options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Construct and simulate a get_merkle_root transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
251
|
+
* Gets the current merkle root of the commitment tree.
|
|
252
|
+
*/
|
|
253
|
+
get_merkle_root: (options?: MethodOptions) => Promise<AssembledTransaction<Buffer>>
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Construct and simulate a get_merkle_depth transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
257
|
+
* Gets the current depth of the merkle tree
|
|
258
|
+
*/
|
|
259
|
+
get_merkle_depth: (options?: MethodOptions) => Promise<AssembledTransaction<u32>>
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Construct and simulate a get_commitment_count transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
263
|
+
* Gets the number of commitments (leaves) in the merkle tree
|
|
264
|
+
*/
|
|
265
|
+
get_commitment_count: (options?: MethodOptions) => Promise<AssembledTransaction<u32>>
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Construct and simulate a get_leaf_ephemeral transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
269
|
+
* Ephemeral key (x, y) for a leaf index, if present.
|
|
270
|
+
*/
|
|
271
|
+
get_leaf_ephemeral: ({leaf_index}: {leaf_index: u32}, options?: MethodOptions) => Promise<AssembledTransaction<Option<EphemeralKeyCoords>>>
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Construct and simulate a get_pairwise_frontier transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
275
|
+
* Filled-subtree frontier after the last pairwise insert (reload on the next deposit).
|
|
276
|
+
*/
|
|
277
|
+
get_pairwise_frontier: (options?: MethodOptions) => Promise<AssembledTransaction<Array<Buffer>>>
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Construct and simulate a get_commitments transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
281
|
+
* Gets all commitments (leaves) in the merkle tree
|
|
282
|
+
*/
|
|
283
|
+
get_commitments: (options?: MethodOptions) => Promise<AssembledTransaction<Array<Buffer>>>
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Construct and simulate a is_nulifier_hash_consumed transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
287
|
+
* Returns true if the given nullifier hash has already been consumed (used in a withdrawal).
|
|
288
|
+
*/
|
|
289
|
+
is_nulifier_hash_consumed: ({hash}: {hash: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<boolean>>
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Construct and simulate a is_known_root transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
293
|
+
* Returns true if `root` appears in the recent root history (ring buffer).
|
|
294
|
+
* All-zero bytes are never accepted.
|
|
295
|
+
*/
|
|
296
|
+
is_known_root: ({root}: {root: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<boolean>>
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Construct and simulate a get_token_balance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
300
|
+
* Token balance held by this contract for a Stellar asset contract (`C...`).
|
|
301
|
+
*/
|
|
302
|
+
get_token_balance: ({token}: {token: string}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Construct and simulate a get_public_slot_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
306
|
+
* `publicNInputs` / `publicNOutputs` configured at deploy (must match the verification key circuit).
|
|
307
|
+
*/
|
|
308
|
+
get_public_slot_config: (options?: MethodOptions) => Promise<AssembledTransaction<readonly [u32, u32]>>
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Construct and simulate a get_admin transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
312
|
+
* Gets the admin address (the contract deployer)
|
|
313
|
+
*/
|
|
314
|
+
get_admin: (options?: MethodOptions) => Promise<AssembledTransaction<string>>
|
|
315
|
+
|
|
316
|
+
}
|
|
317
|
+
export class Client extends ContractClient {
|
|
318
|
+
static async deploy<T = Client>(
|
|
319
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
320
|
+
{tree_depth, vk_bytes, public_n_inputs, public_n_outputs, admin}: {tree_depth: u32, vk_bytes: Buffer, public_n_inputs: u32, public_n_outputs: u32, admin: string},
|
|
321
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
322
|
+
options: MethodOptions &
|
|
323
|
+
Omit<ContractClientOptions, "contractId"> & {
|
|
324
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
325
|
+
wasmHash: Buffer | string;
|
|
326
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
327
|
+
salt?: Buffer | Uint8Array;
|
|
328
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
329
|
+
format?: "hex" | "base64";
|
|
330
|
+
}
|
|
331
|
+
): Promise<AssembledTransaction<T>> {
|
|
332
|
+
return ContractClient.deploy({tree_depth, vk_bytes, public_n_inputs, public_n_outputs, admin}, options)
|
|
333
|
+
}
|
|
334
|
+
constructor(public readonly options: ContractClientOptions) {
|
|
335
|
+
super(
|
|
336
|
+
new ContractSpec([ "AAAAAQAAAEhQZXItYXBwbGljYXRpb24gYXVkaXQgcHVibGljIGtleSBhbGxvd2xpc3QgZW50cnkgKHJ1bnRpbWUvY29uZmlnIHN0YXRlKS4AAAAAAAAADUFwcEF1ZGl0U3RhdGUAAAAAAAADAAAAAAAAABJhdWRpdF9wdWJsaWNfa2V5X3gAAAAAA+4AAAAgAAAAAAAAABJhdWRpdF9wdWJsaWNfa2V5X3kAAAAAA+4AAAAgAAAAAAAAAAdlbmFibGVkAAAAAAE=",
|
|
337
|
+
"AAAAAQAAAERFcGhlbWVyYWwgQmFieUp1Ykp1YiAvIEVDREggcG9pbnQgKG5vdCBoYXNoZWQgaW50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AEXVwZGF0ZWRfYXRfbGVkZ2VyAAAAAAAABA==",
|
|
372
|
+
"AAAAAQAAAAAAAAAAAAAAFlBlbmRpbmdOdWxsaWZpZXJSZWNvcmQAAAAAAAcAAAAAAAAAEWNyZWF0ZWRfYXRfbGVkZ2VyAAAAAAAABAAAAAAAAAAKY3JlYXRlZF9ieQAAAAAAEwAAAAAAAAAVZW5jcnlwdGVkX3ByaXZhdGVfa2V5AAAAAAAADgAAAAAAAAAEbm90ZQAAB9AAAAANUGxhaW50ZXh0Tm90ZQAAAAAAAAAAAAAFb3duZXIAAAAAAAATAAAAAAAAABF0ZW1wX3B1YmxpY19rZXlfeAAAAAAAA+4AAAAgAAAAAAAAABF0ZW1wX3B1YmxpY19rZXlfeQAAAAAAA+4AAAAg",
|
|
373
|
+
"AAAAAQAAAAAAAAAAAAAAEEt5dFBhc3NhZ2VSZWNvcmQAAAABAAAAAAAAABFleHBpcmVzX2F0X2xlZGdlcgAAAAAAAAQ=",
|
|
374
|
+
"AAAAAQAAAAAAAAAAAAAAF0t5dFBhc3NhZ2VBdXRob3JpemF0aW9uAAAAAAIAAAAAAAAAEWV4cGlyYXRpb25fbGVkZ2VyAAAAAAAABAAAAAAAAAAJc2lnbmF0dXJlAAAAAAAD7gAAAEA=" ]),
|
|
375
|
+
options
|
|
376
|
+
)
|
|
377
|
+
}
|
|
378
|
+
public readonly fromJSON = {
|
|
379
|
+
transact: this.txFromJSON<Result<void>>,
|
|
380
|
+
set_kyt_registry: this.txFromJSON<null>,
|
|
381
|
+
get_kyt_registry: this.txFromJSON<Option<string>>,
|
|
382
|
+
require_kyt_passage: this.txFromJSON<Result<void>>,
|
|
383
|
+
set_app_audit_key: this.txFromJSON<null>,
|
|
384
|
+
get_app_audit_state: this.txFromJSON<Option<AppAuditState>>,
|
|
385
|
+
set_registry: this.txFromJSON<null>,
|
|
386
|
+
get_registry: this.txFromJSON<Option<string>>,
|
|
387
|
+
get_merkle_root: this.txFromJSON<Buffer>,
|
|
388
|
+
get_merkle_depth: this.txFromJSON<u32>,
|
|
389
|
+
get_commitment_count: this.txFromJSON<u32>,
|
|
390
|
+
get_leaf_ephemeral: this.txFromJSON<Option<EphemeralKeyCoords>>,
|
|
391
|
+
get_pairwise_frontier: this.txFromJSON<Array<Buffer>>,
|
|
392
|
+
get_commitments: this.txFromJSON<Array<Buffer>>,
|
|
393
|
+
is_nulifier_hash_consumed: this.txFromJSON<boolean>,
|
|
394
|
+
is_known_root: this.txFromJSON<boolean>,
|
|
395
|
+
get_token_balance: this.txFromJSON<i128>,
|
|
396
|
+
get_public_slot_config: this.txFromJSON<readonly [u32, u32]>,
|
|
397
|
+
get_admin: this.txFromJSON<string>
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
/* Projects */
|
|
5
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
6
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
7
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
8
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
9
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
10
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
11
|
+
/* Language and Environment */
|
|
12
|
+
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
13
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
14
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
15
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
16
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
17
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
18
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
19
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
20
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
21
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
22
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
23
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
24
|
+
/* Modules */
|
|
25
|
+
"module": "NodeNext", /* Specify what module code is generated. */
|
|
26
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
27
|
+
"moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
28
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
29
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
30
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
31
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
32
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
33
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
34
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
35
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
36
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
37
|
+
/* JavaScript Support */
|
|
38
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
39
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
40
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
41
|
+
/* Emit */
|
|
42
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
43
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
44
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
45
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
46
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
47
|
+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
48
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
49
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
50
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
51
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
52
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
53
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
54
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
55
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
56
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
57
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
58
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
59
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
60
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
61
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
62
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
63
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
64
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
65
|
+
/* Interop Constraints */
|
|
66
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
67
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
68
|
+
// "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
69
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
70
|
+
// "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
71
|
+
/* Type Checking */
|
|
72
|
+
// "strict": true, /* Enable all strict type-checking options. */
|
|
73
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
74
|
+
"strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
75
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
76
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
77
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
78
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
79
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
80
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
81
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
82
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
83
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
84
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
85
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
86
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
87
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
88
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
89
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
90
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
91
|
+
/* Completeness */
|
|
92
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
93
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
94
|
+
},
|
|
95
|
+
"include": [
|
|
96
|
+
"src/*"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# registry JS
|
|
2
|
+
|
|
3
|
+
JS library for interacting with [Soroban](https://soroban.stellar.org/) smart contract `registry` via Soroban RPC.
|
|
4
|
+
|
|
5
|
+
This library was automatically generated by Soroban CLI using a command similar to:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
soroban contract bindings ts \
|
|
9
|
+
--rpc-url https://soroban-testnet.stellar.org \
|
|
10
|
+
--network-passphrase "Test SDF Network ; September 2015" \
|
|
11
|
+
--contract-id CCO5QRTS5HFVPR356FFC4NI62IMBQNDGMOAXR4K5UVTV3YMRWDZGKXGC \
|
|
12
|
+
--output-dir ./path/to/registry
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The network passphrase and contract ID are exported from [index.ts](./src/index.ts) in the `networks` constant. If you are the one who generated this library and you know that this contract is also deployed to other networks, feel free to update `networks` with other valid options. This will help your contract consumers use this library more easily.
|
|
16
|
+
|
|
17
|
+
# To publish or not to publish
|
|
18
|
+
|
|
19
|
+
This library is suitable for publishing to NPM. You can publish it to NPM using the `npm publish` command.
|
|
20
|
+
|
|
21
|
+
But you don't need to publish this library to NPM to use it. You can add it to your project's `package.json` using a file path:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"registry": "./path/to/this/folder"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
However, we've actually encountered [frustration](https://github.com/stellar/soroban-example-dapp/pull/117#discussion_r1232873560) using local libraries with NPM in this way. Though it seems a bit messy, we suggest generating the library directly to your `node_modules` folder automatically after each install by using a `postinstall` script. We've had the least trouble with this approach. NPM will automatically remove what it sees as erroneous directories during the `install` step, and then regenerate them when it gets to your `postinstall` step, which will keep the library up-to-date with your contract.
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
"scripts": {
|
|
33
|
+
"postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org --network-passphrase \"Test SDF Network ; September 2015\" --id CCO5QRTS5HFVPR356FFC4NI62IMBQNDGMOAXR4K5UVTV3YMRWDZGKXGC --name registry"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Obviously you need to adjust the above command based on the actual command you used to generate the library.
|
|
38
|
+
|
|
39
|
+
# Use it
|
|
40
|
+
|
|
41
|
+
Now that you have your library up-to-date and added to your project, you can import it in a file and see inline documentation for all of its exported methods:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { Contract, networks } from "registry"
|
|
45
|
+
|
|
46
|
+
const contract = new Contract({
|
|
47
|
+
...networks.futurenet, // for example; check which networks this library exports
|
|
48
|
+
rpcUrl: '...', // use your own, or find one for testing at https://soroban.stellar.org/docs/reference/rpc#public-rpc-providers
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
contract.|
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
As long as your editor is configured to show JavaScript/TypeScript documentation, you can pause your typing at that `|` to get a list of all exports and inline-documentation for each. It exports a separate [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function for each method in the smart contract, with documentation for each generated from the comments the contract's author included in the original source code.
|