@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,198 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
import type { u32, i128, Option } from "@stellar/stellar-sdk/contract";
|
|
4
|
+
export * from "@stellar/stellar-sdk";
|
|
5
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
6
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
7
|
+
export declare const networks: {
|
|
8
|
+
readonly testnet: {
|
|
9
|
+
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
10
|
+
readonly contractId: "CCO5QRTS5HFVPR356FFC4NI62IMBQNDGMOAXR4K5UVTV3YMRWDZGKXGC";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const Errors: {
|
|
14
|
+
1: {
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
2: {
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
3: {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
4: {
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
5: {
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Plaintext note fields stored in registry for onboarding claim.
|
|
32
|
+
*/
|
|
33
|
+
export interface PlaintextNote {
|
|
34
|
+
asset_hi: Buffer;
|
|
35
|
+
asset_lo: Buffer;
|
|
36
|
+
/**
|
|
37
|
+
* Must remain `None`; registry rejects payloads that expose the sender ephemeral scalar.
|
|
38
|
+
*/
|
|
39
|
+
deposited_ephemeral_scalar: Option<Buffer>;
|
|
40
|
+
nullifier: Buffer;
|
|
41
|
+
secret: Buffer;
|
|
42
|
+
value: i128;
|
|
43
|
+
}
|
|
44
|
+
export interface PendingNotePayload {
|
|
45
|
+
notes: Array<PlaintextNote>;
|
|
46
|
+
}
|
|
47
|
+
export interface PrivateAddressRegistration {
|
|
48
|
+
owner: string;
|
|
49
|
+
public_key_x: Buffer;
|
|
50
|
+
public_key_y: Buffer;
|
|
51
|
+
}
|
|
52
|
+
export type OptionalPrivateAddressRegistration = {
|
|
53
|
+
tag: "None";
|
|
54
|
+
values: void;
|
|
55
|
+
} | {
|
|
56
|
+
tag: "Some";
|
|
57
|
+
values: readonly [PrivateAddressRegistration];
|
|
58
|
+
};
|
|
59
|
+
export interface OnboardingPayload {
|
|
60
|
+
encrypted_private_key: Buffer;
|
|
61
|
+
notes: PendingNotePayload;
|
|
62
|
+
owner: string;
|
|
63
|
+
private_address_registration: OptionalPrivateAddressRegistration;
|
|
64
|
+
temp_public_key_x: Buffer;
|
|
65
|
+
temp_public_key_y: Buffer;
|
|
66
|
+
}
|
|
67
|
+
export interface PrivateAddressRecord {
|
|
68
|
+
owner: string;
|
|
69
|
+
public_key_x: Buffer;
|
|
70
|
+
public_key_y: Buffer;
|
|
71
|
+
updated_at_ledger: u32;
|
|
72
|
+
}
|
|
73
|
+
export interface PendingNullifierRecord {
|
|
74
|
+
created_at_ledger: u32;
|
|
75
|
+
created_by: string;
|
|
76
|
+
encrypted_private_key: Buffer;
|
|
77
|
+
note: PlaintextNote;
|
|
78
|
+
owner: string;
|
|
79
|
+
temp_public_key_x: Buffer;
|
|
80
|
+
temp_public_key_y: Buffer;
|
|
81
|
+
}
|
|
82
|
+
export interface KytPassageRecord {
|
|
83
|
+
expires_at_ledger: u32;
|
|
84
|
+
}
|
|
85
|
+
export interface KytPassageAuthorization {
|
|
86
|
+
expiration_ledger: u32;
|
|
87
|
+
signature: Buffer;
|
|
88
|
+
}
|
|
89
|
+
export interface Client {
|
|
90
|
+
/**
|
|
91
|
+
* Construct and simulate a set_trusted_pool 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.
|
|
92
|
+
*/
|
|
93
|
+
set_trusted_pool: ({ admin, trusted_pool }: {
|
|
94
|
+
admin: string;
|
|
95
|
+
trusted_pool: string;
|
|
96
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
97
|
+
/**
|
|
98
|
+
* Construct and simulate a get_trusted_pool 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.
|
|
99
|
+
*/
|
|
100
|
+
get_trusted_pool: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
|
|
101
|
+
/**
|
|
102
|
+
* Construct and simulate a register_private_address 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.
|
|
103
|
+
* Owner registers a permanent private address directly.
|
|
104
|
+
*/
|
|
105
|
+
register_private_address: ({ owner, public_key_x, public_key_y }: {
|
|
106
|
+
owner: string;
|
|
107
|
+
public_key_x: Buffer;
|
|
108
|
+
public_key_y: Buffer;
|
|
109
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
110
|
+
/**
|
|
111
|
+
* Construct and simulate a register_address_via_pool 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.
|
|
112
|
+
* Trusted pool forwards registration after owner auth in the same transaction.
|
|
113
|
+
*/
|
|
114
|
+
register_address_via_pool: ({ registration }: {
|
|
115
|
+
registration: PrivateAddressRegistration;
|
|
116
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
117
|
+
/**
|
|
118
|
+
* Construct and simulate a get_private_address 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.
|
|
119
|
+
*/
|
|
120
|
+
get_private_address: ({ owner }: {
|
|
121
|
+
owner: string;
|
|
122
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<Option<PrivateAddressRecord>>>;
|
|
123
|
+
/**
|
|
124
|
+
* Construct and simulate a get_owner_by_public_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.
|
|
125
|
+
* Resolve the Stellar G-address owner from a registered private-address public key.
|
|
126
|
+
*/
|
|
127
|
+
get_owner_by_public_key: ({ public_key_x, public_key_y }: {
|
|
128
|
+
public_key_x: Buffer;
|
|
129
|
+
public_key_y: Buffer;
|
|
130
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>;
|
|
131
|
+
/**
|
|
132
|
+
* Construct and simulate a seed_private_address 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.
|
|
133
|
+
* Admin-only migration helper: seed forward and reverse indexes without owner auth.
|
|
134
|
+
*/
|
|
135
|
+
seed_private_address: ({ admin, registration, updated_at_ledger }: {
|
|
136
|
+
admin: string;
|
|
137
|
+
registration: PrivateAddressRegistration;
|
|
138
|
+
updated_at_ledger: u32;
|
|
139
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
140
|
+
/**
|
|
141
|
+
* Construct and simulate a register_pending_notes 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.
|
|
142
|
+
* Trusted pool registers onboarding pending notes.
|
|
143
|
+
*/
|
|
144
|
+
register_pending_notes: ({ sender, payload }: {
|
|
145
|
+
sender: string;
|
|
146
|
+
payload: OnboardingPayload;
|
|
147
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
148
|
+
/**
|
|
149
|
+
* Construct and simulate a auth_address_for_nullifier 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.
|
|
150
|
+
*/
|
|
151
|
+
auth_address_for_nullifier: ({ nullifier_hash }: {
|
|
152
|
+
nullifier_hash: Buffer;
|
|
153
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>;
|
|
154
|
+
/**
|
|
155
|
+
* Construct and simulate a get_pending_nullifier_record 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.
|
|
156
|
+
*/
|
|
157
|
+
get_pending_nullifier_record: ({ nullifier_hash }: {
|
|
158
|
+
nullifier_hash: Buffer;
|
|
159
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<Option<PendingNullifierRecord>>>;
|
|
160
|
+
/**
|
|
161
|
+
* Construct and simulate a future_nullifier_hash 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.
|
|
162
|
+
*/
|
|
163
|
+
future_nullifier_hash: ({ note }: {
|
|
164
|
+
note: PlaintextNote;
|
|
165
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<Buffer>>;
|
|
166
|
+
}
|
|
167
|
+
export declare class Client extends ContractClient {
|
|
168
|
+
readonly options: ContractClientOptions;
|
|
169
|
+
static deploy<T = Client>(
|
|
170
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
171
|
+
{ admin, trusted_pool }: {
|
|
172
|
+
admin: string;
|
|
173
|
+
trusted_pool: string;
|
|
174
|
+
},
|
|
175
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
176
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
177
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
178
|
+
wasmHash: Buffer | string;
|
|
179
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
180
|
+
salt?: Buffer | Uint8Array;
|
|
181
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
182
|
+
format?: "hex" | "base64";
|
|
183
|
+
}): Promise<AssembledTransaction<T>>;
|
|
184
|
+
constructor(options: ContractClientOptions);
|
|
185
|
+
readonly fromJSON: {
|
|
186
|
+
set_trusted_pool: (json: string) => AssembledTransaction<null>;
|
|
187
|
+
get_trusted_pool: (json: string) => AssembledTransaction<string>;
|
|
188
|
+
register_private_address: (json: string) => AssembledTransaction<null>;
|
|
189
|
+
register_address_via_pool: (json: string) => AssembledTransaction<null>;
|
|
190
|
+
get_private_address: (json: string) => AssembledTransaction<Option<PrivateAddressRecord>>;
|
|
191
|
+
get_owner_by_public_key: (json: string) => AssembledTransaction<Option<string>>;
|
|
192
|
+
seed_private_address: (json: string) => AssembledTransaction<null>;
|
|
193
|
+
register_pending_notes: (json: string) => AssembledTransaction<null>;
|
|
194
|
+
auth_address_for_nullifier: (json: string) => AssembledTransaction<Option<string>>;
|
|
195
|
+
get_pending_nullifier_record: (json: string) => AssembledTransaction<Option<PendingNullifierRecord>>;
|
|
196
|
+
future_nullifier_hash: (json: string) => AssembledTransaction<Buffer<ArrayBufferLike>>;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { Client as ContractClient, Spec as ContractSpec, } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
export * from "@stellar/stellar-sdk";
|
|
4
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
5
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
6
|
+
if (typeof window !== "undefined") {
|
|
7
|
+
//@ts-ignore Buffer exists
|
|
8
|
+
window.Buffer = window.Buffer || Buffer;
|
|
9
|
+
}
|
|
10
|
+
export const networks = {
|
|
11
|
+
testnet: {
|
|
12
|
+
networkPassphrase: "Test SDF Network ; September 2015",
|
|
13
|
+
contractId: "CCO5QRTS5HFVPR356FFC4NI62IMBQNDGMOAXR4K5UVTV3YMRWDZGKXGC",
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export const Errors = {
|
|
17
|
+
1: { message: "OnlyAdmin" },
|
|
18
|
+
2: { message: "UntrustedCaller" },
|
|
19
|
+
3: { message: "DuplicatePendingNullifier" },
|
|
20
|
+
4: { message: "ForbiddenEphemeralScalar" },
|
|
21
|
+
5: { message: "EmptyNotes" }
|
|
22
|
+
};
|
|
23
|
+
export class Client extends ContractClient {
|
|
24
|
+
options;
|
|
25
|
+
static async deploy(
|
|
26
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
27
|
+
{ admin, trusted_pool },
|
|
28
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
29
|
+
options) {
|
|
30
|
+
return ContractClient.deploy({ admin, trusted_pool }, options);
|
|
31
|
+
}
|
|
32
|
+
constructor(options) {
|
|
33
|
+
super(new ContractSpec(["AAAABAAAAAAAAAAAAAAABUVycm9yAAAAAAAABQAAAAAAAAAJT25seUFkbWluAAAAAAAAAQAAAAAAAAAPVW50cnVzdGVkQ2FsbGVyAAAAAAIAAAAAAAAAGUR1cGxpY2F0ZVBlbmRpbmdOdWxsaWZpZXIAAAAAAAADAAAAAA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1wX3B1YmxpY19rZXlfeQAAAAAAA+4AAAAg",
|
|
53
|
+
"AAAAAQAAAAAAAAAAAAAAEEt5dFBhc3NhZ2VSZWNvcmQAAAABAAAAAAAAABFleHBpcmVzX2F0X2xlZGdlcgAAAAAAAAQ=",
|
|
54
|
+
"AAAAAQAAAAAAAAAAAAAAF0t5dFBhc3NhZ2VBdXRob3JpemF0aW9uAAAAAAIAAAAAAAAAEWV4cGlyYXRpb25fbGVkZ2VyAAAAAAAABAAAAAAAAAAJc2lnbmF0dXJlAAAAAAAD7gAAAEA="]), options);
|
|
55
|
+
this.options = options;
|
|
56
|
+
}
|
|
57
|
+
fromJSON = {
|
|
58
|
+
set_trusted_pool: (this.txFromJSON),
|
|
59
|
+
get_trusted_pool: (this.txFromJSON),
|
|
60
|
+
register_private_address: (this.txFromJSON),
|
|
61
|
+
register_address_via_pool: (this.txFromJSON),
|
|
62
|
+
get_private_address: (this.txFromJSON),
|
|
63
|
+
get_owner_by_public_key: (this.txFromJSON),
|
|
64
|
+
seed_private_address: (this.txFromJSON),
|
|
65
|
+
register_pending_notes: (this.txFromJSON),
|
|
66
|
+
auth_address_for_nullifier: (this.txFromJSON),
|
|
67
|
+
get_pending_nullifier_record: (this.txFromJSON),
|
|
68
|
+
future_nullifier_hash: (this.txFromJSON)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.0.0",
|
|
3
|
+
"name": "registry",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": "./dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@stellar/stellar-sdk": "^14.1.1",
|
|
12
|
+
"buffer": "6.0.3"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"typescript": "^5.6.2"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
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: "CCO5QRTS5HFVPR356FFC4NI62IMBQNDGMOAXR4K5UVTV3YMRWDZGKXGC",
|
|
38
|
+
}
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
export const Errors = {
|
|
42
|
+
1: {message:"OnlyAdmin"},
|
|
43
|
+
2: {message:"UntrustedCaller"},
|
|
44
|
+
3: {message:"DuplicatePendingNullifier"},
|
|
45
|
+
4: {message:"ForbiddenEphemeralScalar"},
|
|
46
|
+
5: {message:"EmptyNotes"}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Plaintext note fields stored in registry for onboarding claim.
|
|
52
|
+
*/
|
|
53
|
+
export interface PlaintextNote {
|
|
54
|
+
asset_hi: Buffer;
|
|
55
|
+
asset_lo: Buffer;
|
|
56
|
+
/**
|
|
57
|
+
* Must remain `None`; registry rejects payloads that expose the sender ephemeral scalar.
|
|
58
|
+
*/
|
|
59
|
+
deposited_ephemeral_scalar: Option<Buffer>;
|
|
60
|
+
nullifier: Buffer;
|
|
61
|
+
secret: Buffer;
|
|
62
|
+
value: i128;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
export interface PendingNotePayload {
|
|
67
|
+
notes: Array<PlaintextNote>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
export interface PrivateAddressRegistration {
|
|
72
|
+
owner: string;
|
|
73
|
+
public_key_x: Buffer;
|
|
74
|
+
public_key_y: Buffer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type OptionalPrivateAddressRegistration = {tag: "None", values: void} | {tag: "Some", values: readonly [PrivateAddressRegistration]};
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export interface OnboardingPayload {
|
|
81
|
+
encrypted_private_key: Buffer;
|
|
82
|
+
notes: PendingNotePayload;
|
|
83
|
+
owner: string;
|
|
84
|
+
private_address_registration: OptionalPrivateAddressRegistration;
|
|
85
|
+
temp_public_key_x: Buffer;
|
|
86
|
+
temp_public_key_y: Buffer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export interface PrivateAddressRecord {
|
|
91
|
+
owner: string;
|
|
92
|
+
public_key_x: Buffer;
|
|
93
|
+
public_key_y: Buffer;
|
|
94
|
+
updated_at_ledger: u32;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
export interface PendingNullifierRecord {
|
|
99
|
+
created_at_ledger: u32;
|
|
100
|
+
created_by: string;
|
|
101
|
+
encrypted_private_key: Buffer;
|
|
102
|
+
note: PlaintextNote;
|
|
103
|
+
owner: string;
|
|
104
|
+
temp_public_key_x: Buffer;
|
|
105
|
+
temp_public_key_y: Buffer;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export interface KytPassageRecord {
|
|
110
|
+
expires_at_ledger: u32;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
export interface KytPassageAuthorization {
|
|
115
|
+
expiration_ledger: u32;
|
|
116
|
+
signature: Buffer;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface Client {
|
|
120
|
+
/**
|
|
121
|
+
* Construct and simulate a set_trusted_pool 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.
|
|
122
|
+
*/
|
|
123
|
+
set_trusted_pool: ({admin, trusted_pool}: {admin: string, trusted_pool: string}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Construct and simulate a get_trusted_pool 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.
|
|
127
|
+
*/
|
|
128
|
+
get_trusted_pool: (options?: MethodOptions) => Promise<AssembledTransaction<string>>
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Construct and simulate a register_private_address 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.
|
|
132
|
+
* Owner registers a permanent private address directly.
|
|
133
|
+
*/
|
|
134
|
+
register_private_address: ({owner, public_key_x, public_key_y}: {owner: string, public_key_x: Buffer, public_key_y: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Construct and simulate a register_address_via_pool 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.
|
|
138
|
+
* Trusted pool forwards registration after owner auth in the same transaction.
|
|
139
|
+
*/
|
|
140
|
+
register_address_via_pool: ({registration}: {registration: PrivateAddressRegistration}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Construct and simulate a get_private_address 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.
|
|
144
|
+
*/
|
|
145
|
+
get_private_address: ({owner}: {owner: string}, options?: MethodOptions) => Promise<AssembledTransaction<Option<PrivateAddressRecord>>>
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Construct and simulate a get_owner_by_public_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.
|
|
149
|
+
* Resolve the Stellar G-address owner from a registered private-address public key.
|
|
150
|
+
*/
|
|
151
|
+
get_owner_by_public_key: ({public_key_x, public_key_y}: {public_key_x: Buffer, public_key_y: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Construct and simulate a seed_private_address 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.
|
|
155
|
+
* Admin-only migration helper: seed forward and reverse indexes without owner auth.
|
|
156
|
+
*/
|
|
157
|
+
seed_private_address: ({admin, registration, updated_at_ledger}: {admin: string, registration: PrivateAddressRegistration, updated_at_ledger: u32}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Construct and simulate a register_pending_notes 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.
|
|
161
|
+
* Trusted pool registers onboarding pending notes.
|
|
162
|
+
*/
|
|
163
|
+
register_pending_notes: ({sender, payload}: {sender: string, payload: OnboardingPayload}, options?: MethodOptions) => Promise<AssembledTransaction<null>>
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Construct and simulate a auth_address_for_nullifier 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.
|
|
167
|
+
*/
|
|
168
|
+
auth_address_for_nullifier: ({nullifier_hash}: {nullifier_hash: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<Option<string>>>
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Construct and simulate a get_pending_nullifier_record 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.
|
|
172
|
+
*/
|
|
173
|
+
get_pending_nullifier_record: ({nullifier_hash}: {nullifier_hash: Buffer}, options?: MethodOptions) => Promise<AssembledTransaction<Option<PendingNullifierRecord>>>
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Construct and simulate a future_nullifier_hash 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.
|
|
177
|
+
*/
|
|
178
|
+
future_nullifier_hash: ({note}: {note: PlaintextNote}, options?: MethodOptions) => Promise<AssembledTransaction<Buffer>>
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
export class Client extends ContractClient {
|
|
182
|
+
static async deploy<T = Client>(
|
|
183
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
184
|
+
{admin, trusted_pool}: {admin: string, trusted_pool: string},
|
|
185
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
186
|
+
options: MethodOptions &
|
|
187
|
+
Omit<ContractClientOptions, "contractId"> & {
|
|
188
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
189
|
+
wasmHash: Buffer | string;
|
|
190
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
191
|
+
salt?: Buffer | Uint8Array;
|
|
192
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
193
|
+
format?: "hex" | "base64";
|
|
194
|
+
}
|
|
195
|
+
): Promise<AssembledTransaction<T>> {
|
|
196
|
+
return ContractClient.deploy({admin, trusted_pool}, options)
|
|
197
|
+
}
|
|
198
|
+
constructor(public readonly options: ContractClientOptions) {
|
|
199
|
+
super(
|
|
200
|
+
new ContractSpec([ "AAAABAAAAAAAAAAAAAAABUVycm9yAAAAAAAABQAAAAAAAAAJT25seUFkbWluAAAAAAAAAQAAAAAAAAAPVW50cnVzdGVkQ2FsbGVyAAAAAAIAAAAAAAAAGUR1cGxpY2F0ZVBlbmRpbmdOdWxsaWZpZXIAAAAAAAADAAAAAAAAABhGb3JiaWRkZW5FcGhlbWVyYWxTY2FsYXIAAAAEAAAAAAAAAApFbXB0eU5vdGVzAAAAAAAF",
|
|
201
|
+
"AAAAAAAAAAAAAAANX19jb25zdHJ1Y3RvcgAAAAAAAAIAAAAAAAAABWFkbWluAAAAAAAAEwAAAAAAAAAMdHJ1c3RlZF9wb29sAAAAEwAAAAA=",
|
|
202
|
+
"AAAAAAAAAAAAAAAQc2V0X3RydXN0ZWRfcG9vbAAAAAIAAAAAAAAABWFkbWluAAAAAAAAEwAAAAAAAAAMdHJ1c3RlZF9wb29sAAAAEwAAAAA=",
|
|
203
|
+
"AAAAAAAAAAAAAAAQZ2V0X3RydXN0ZWRfcG9vbAAAAAAAAAABAAAAEw==",
|
|
204
|
+
"AAAAAAAAADVPd25lciByZWdpc3RlcnMgYSBwZXJtYW5lbnQgcHJpdmF0ZSBhZGRyZXNzIGRpcmVjdGx5LgAAAAAAABhyZWdpc3Rlcl9wcml2YXRlX2FkZHJlc3MAAAADAAAAAAAAAAVvd25lcgAAAAAAABMAAAAAAAAADHB1YmxpY19rZXlfeAAAA+4AAAAgAAA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AAAAATAAAAAAAAAAxwdWJsaWNfa2V5X3gAAAPuAAAAIAAAAAAAAAAMcHVibGljX2tleV95AAAD7gAAACAAAAAAAAAAEXVwZGF0ZWRfYXRfbGVkZ2VyAAAAAAAABA==",
|
|
219
|
+
"AAAAAQAAAAAAAAAAAAAAFlBlbmRpbmdOdWxsaWZpZXJSZWNvcmQAAAAAAAcAAAAAAAAAEWNyZWF0ZWRfYXRfbGVkZ2VyAAAAAAAABAAAAAAAAAAKY3JlYXRlZF9ieQAAAAAAEwAAAAAAAAAVZW5jcnlwdGVkX3ByaXZhdGVfa2V5AAAAAAAADgAAAAAAAAAEbm90ZQAAB9AAAAANUGxhaW50ZXh0Tm90ZQAAAAAAAAAAAAAFb3duZXIAAAAAAAATAAAAAAAAABF0ZW1wX3B1YmxpY19rZXlfeAAAAAAAA+4AAAAgAAAAAAAAABF0ZW1wX3B1YmxpY19rZXlfeQAAAAAAA+4AAAAg",
|
|
220
|
+
"AAAAAQAAAAAAAAAAAAAAEEt5dFBhc3NhZ2VSZWNvcmQAAAABAAAAAAAAABFleHBpcmVzX2F0X2xlZGdlcgAAAAAAAAQ=",
|
|
221
|
+
"AAAAAQAAAAAAAAAAAAAAF0t5dFBhc3NhZ2VBdXRob3JpemF0aW9uAAAAAAIAAAAAAAAAEWV4cGlyYXRpb25fbGVkZ2VyAAAAAAAABAAAAAAAAAAJc2lnbmF0dXJlAAAAAAAD7gAAAEA=" ]),
|
|
222
|
+
options
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
public readonly fromJSON = {
|
|
226
|
+
set_trusted_pool: this.txFromJSON<null>,
|
|
227
|
+
get_trusted_pool: this.txFromJSON<string>,
|
|
228
|
+
register_private_address: this.txFromJSON<null>,
|
|
229
|
+
register_address_via_pool: this.txFromJSON<null>,
|
|
230
|
+
get_private_address: this.txFromJSON<Option<PrivateAddressRecord>>,
|
|
231
|
+
get_owner_by_public_key: this.txFromJSON<Option<string>>,
|
|
232
|
+
seed_private_address: this.txFromJSON<null>,
|
|
233
|
+
register_pending_notes: this.txFromJSON<null>,
|
|
234
|
+
auth_address_for_nullifier: this.txFromJSON<Option<string>>,
|
|
235
|
+
get_pending_nullifier_record: this.txFromJSON<Option<PendingNullifierRecord>>,
|
|
236
|
+
future_nullifier_hash: this.txFromJSON<Buffer>
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -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
|
+
}
|