@silvana-one/token 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 +1 -0
- package/dist/node/BondingCurveAdmin.d.ts +690 -0
- package/dist/node/BondingCurveAdmin.js +504 -0
- package/dist/node/BondingCurveAdmin.js.map +1 -0
- package/dist/node/FungibleToken.d.ts +414 -0
- package/dist/node/FungibleToken.js +7 -0
- package/dist/node/FungibleToken.js.map +1 -0
- package/dist/node/FungibleTokenAdvancedAdmin.d.ts +124 -0
- package/dist/node/FungibleTokenAdvancedAdmin.js +226 -0
- package/dist/node/FungibleTokenAdvancedAdmin.js.map +1 -0
- package/dist/node/FungibleTokenContract.d.ts +526 -0
- package/dist/node/FungibleTokenContract.js +295 -0
- package/dist/node/FungibleTokenContract.js.map +1 -0
- package/dist/node/FungibleTokenStandardAdmin.d.ts +27 -0
- package/dist/node/FungibleTokenStandardAdmin.js +101 -0
- package/dist/node/FungibleTokenStandardAdmin.js.map +1 -0
- package/dist/node/bid.d.ts +86 -0
- package/dist/node/bid.js +168 -0
- package/dist/node/bid.js.map +1 -0
- package/dist/node/claim.d.ts +89 -0
- package/dist/node/claim.js +156 -0
- package/dist/node/claim.js.map +1 -0
- package/dist/node/index.cjs +1576 -0
- package/dist/node/index.d.ts +8 -0
- package/dist/node/index.js +9 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/offer.d.ts +87 -0
- package/dist/node/offer.js +169 -0
- package/dist/node/offer.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/tsconfig.web.tsbuildinfo +1 -0
- package/dist/web/BondingCurveAdmin.d.ts +690 -0
- package/dist/web/BondingCurveAdmin.js +504 -0
- package/dist/web/BondingCurveAdmin.js.map +1 -0
- package/dist/web/FungibleToken.d.ts +414 -0
- package/dist/web/FungibleToken.js +7 -0
- package/dist/web/FungibleToken.js.map +1 -0
- package/dist/web/FungibleTokenAdvancedAdmin.d.ts +124 -0
- package/dist/web/FungibleTokenAdvancedAdmin.js +226 -0
- package/dist/web/FungibleTokenAdvancedAdmin.js.map +1 -0
- package/dist/web/FungibleTokenContract.d.ts +526 -0
- package/dist/web/FungibleTokenContract.js +295 -0
- package/dist/web/FungibleTokenContract.js.map +1 -0
- package/dist/web/FungibleTokenStandardAdmin.d.ts +27 -0
- package/dist/web/FungibleTokenStandardAdmin.js +101 -0
- package/dist/web/FungibleTokenStandardAdmin.js.map +1 -0
- package/dist/web/bid.d.ts +86 -0
- package/dist/web/bid.js +168 -0
- package/dist/web/bid.js.map +1 -0
- package/dist/web/claim.d.ts +89 -0
- package/dist/web/claim.js +156 -0
- package/dist/web/claim.js.map +1 -0
- package/dist/web/index.d.ts +8 -0
- package/dist/web/index.js +9 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/offer.d.ts +87 -0
- package/dist/web/offer.js +169 -0
- package/dist/web/offer.js.map +1 -0
- package/package.json +64 -0
- package/src/BondingCurveAdmin.ts +590 -0
- package/src/FungibleToken.ts +11 -0
- package/src/FungibleTokenAdvancedAdmin.ts +260 -0
- package/src/FungibleTokenContract.ts +337 -0
- package/src/FungibleTokenStandardAdmin.ts +95 -0
- package/src/bid.ts +170 -0
- package/src/claim.ts +151 -0
- package/src/index.ts +8 -0
- package/src/offer.ts +164 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Silvana Fungible Token Library
|
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { AccountUpdate, Bool, DeployArgs, PublicKey, TokenContract, State, UInt64, VerificationKey, Field, AccountUpdateForest, Int64, UInt32 } from "o1js";
|
|
2
|
+
import { FungibleTokenAdminBase } from "@silvana-one/token";
|
|
3
|
+
declare const BondingCurveParams_base: (new (value: {
|
|
4
|
+
startPrice: UInt64;
|
|
5
|
+
curveK: UInt64;
|
|
6
|
+
fee: UInt32;
|
|
7
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
8
|
+
}) => {
|
|
9
|
+
startPrice: UInt64;
|
|
10
|
+
curveK: UInt64;
|
|
11
|
+
fee: UInt32;
|
|
12
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
13
|
+
}) & {
|
|
14
|
+
_isStruct: true;
|
|
15
|
+
} & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
|
|
16
|
+
startPrice: UInt64;
|
|
17
|
+
curveK: UInt64;
|
|
18
|
+
fee: UInt32;
|
|
19
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
20
|
+
}, {
|
|
21
|
+
startPrice: bigint;
|
|
22
|
+
curveK: bigint;
|
|
23
|
+
fee: bigint;
|
|
24
|
+
mintingIsAllowed: boolean;
|
|
25
|
+
}>, "fromFields"> & {
|
|
26
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
|
|
27
|
+
startPrice: UInt64;
|
|
28
|
+
curveK: UInt64;
|
|
29
|
+
fee: UInt32;
|
|
30
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
31
|
+
};
|
|
32
|
+
} & {
|
|
33
|
+
fromValue: (value: {
|
|
34
|
+
startPrice: bigint | UInt64;
|
|
35
|
+
curveK: bigint | UInt64;
|
|
36
|
+
fee: bigint | UInt32;
|
|
37
|
+
mintingIsAllowed: boolean | import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
38
|
+
}) => {
|
|
39
|
+
startPrice: UInt64;
|
|
40
|
+
curveK: UInt64;
|
|
41
|
+
fee: UInt32;
|
|
42
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
43
|
+
};
|
|
44
|
+
toInput: (x: {
|
|
45
|
+
startPrice: UInt64;
|
|
46
|
+
curveK: UInt64;
|
|
47
|
+
fee: UInt32;
|
|
48
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
49
|
+
}) => {
|
|
50
|
+
fields?: Field[] | undefined;
|
|
51
|
+
packed?: [Field, number][] | undefined;
|
|
52
|
+
};
|
|
53
|
+
toJSON: (x: {
|
|
54
|
+
startPrice: UInt64;
|
|
55
|
+
curveK: UInt64;
|
|
56
|
+
fee: UInt32;
|
|
57
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
58
|
+
}) => {
|
|
59
|
+
startPrice: string;
|
|
60
|
+
curveK: string;
|
|
61
|
+
fee: string;
|
|
62
|
+
mintingIsAllowed: boolean;
|
|
63
|
+
};
|
|
64
|
+
fromJSON: (x: {
|
|
65
|
+
startPrice: string;
|
|
66
|
+
curveK: string;
|
|
67
|
+
fee: string;
|
|
68
|
+
mintingIsAllowed: boolean;
|
|
69
|
+
}) => {
|
|
70
|
+
startPrice: UInt64;
|
|
71
|
+
curveK: UInt64;
|
|
72
|
+
fee: UInt32;
|
|
73
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
74
|
+
};
|
|
75
|
+
empty: () => {
|
|
76
|
+
startPrice: UInt64;
|
|
77
|
+
curveK: UInt64;
|
|
78
|
+
fee: UInt32;
|
|
79
|
+
mintingIsAllowed: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Default bonding curve:
|
|
84
|
+
* Initial price: 1 MINA per 100,000 tokens (0.00001 MINA per token), or 10_000 / 10 ** 9
|
|
85
|
+
* Curve K: 1 MINA per 100,000 tokens (0.00001 MINA per token), or 10_000 / 10 ** 9 MINA
|
|
86
|
+
* Owner fee: 10% in 0.001 % units(10 * 1000 = 10_000)
|
|
87
|
+
* Price formula: price = startPrice + curveK * totalSupply
|
|
88
|
+
* Example:
|
|
89
|
+
* If supply is 200,000 tokens, price = 1 MINA + 1 MINA * 200_000 / 100_000 = 3 MINA per 100,000 tokens
|
|
90
|
+
* or per token in MINA/1e9
|
|
91
|
+
* 10000 + 10000 * 200_000 / 100_000 = 30000 per token,
|
|
92
|
+
* or 30_000 * 100_000 = 3_000_000_000, or 3 MINA per 100,000 tokens
|
|
93
|
+
*
|
|
94
|
+
* To calculate the max supply for the given price for 100,000 tokens:
|
|
95
|
+
* price = startPrice + curveK * totalSupply
|
|
96
|
+
* price - startPrice = curveK * totalSupply
|
|
97
|
+
* (price - startPrice) / curveK = totalSupply
|
|
98
|
+
* (3 MINA - 1 MINA) / 1 MINA = 2 * 100_000 = 200_000 tokens
|
|
99
|
+
* (30_000 - 10_000) / 10_000 = 2 * 100_000 = 200_000 tokens
|
|
100
|
+
* or, in 1e9 units:
|
|
101
|
+
* (30_000 - 10_000) * 1e9 * 100_000 / 10_000 = 200_000_000_000_000, or to avoid overflow,
|
|
102
|
+
* (30_000 - 10_000) * 1e9 / 10_000 * 100_000 = 200_000_000_000_000
|
|
103
|
+
*/
|
|
104
|
+
export declare class BondingCurveParams extends BondingCurveParams_base {
|
|
105
|
+
pack(): import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
106
|
+
static unpack(field: Field): BondingCurveParams;
|
|
107
|
+
}
|
|
108
|
+
declare const BondingMintEvent_base: (new (value: {
|
|
109
|
+
to: PublicKey;
|
|
110
|
+
amount: UInt64;
|
|
111
|
+
price: UInt64;
|
|
112
|
+
payment: UInt64;
|
|
113
|
+
fee: UInt64;
|
|
114
|
+
}) => {
|
|
115
|
+
to: PublicKey;
|
|
116
|
+
amount: UInt64;
|
|
117
|
+
price: UInt64;
|
|
118
|
+
payment: UInt64;
|
|
119
|
+
fee: UInt64;
|
|
120
|
+
}) & {
|
|
121
|
+
_isStruct: true;
|
|
122
|
+
} & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
|
|
123
|
+
to: PublicKey;
|
|
124
|
+
amount: UInt64;
|
|
125
|
+
price: UInt64;
|
|
126
|
+
payment: UInt64;
|
|
127
|
+
fee: UInt64;
|
|
128
|
+
}, {
|
|
129
|
+
to: {
|
|
130
|
+
x: bigint;
|
|
131
|
+
isOdd: boolean;
|
|
132
|
+
};
|
|
133
|
+
amount: bigint;
|
|
134
|
+
price: bigint;
|
|
135
|
+
payment: bigint;
|
|
136
|
+
fee: bigint;
|
|
137
|
+
}>, "fromFields"> & {
|
|
138
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
|
|
139
|
+
to: PublicKey;
|
|
140
|
+
amount: UInt64;
|
|
141
|
+
price: UInt64;
|
|
142
|
+
payment: UInt64;
|
|
143
|
+
fee: UInt64;
|
|
144
|
+
};
|
|
145
|
+
} & {
|
|
146
|
+
fromValue: (value: {
|
|
147
|
+
to: PublicKey | {
|
|
148
|
+
x: Field | bigint;
|
|
149
|
+
isOdd: Bool | boolean;
|
|
150
|
+
};
|
|
151
|
+
amount: bigint | UInt64;
|
|
152
|
+
price: bigint | UInt64;
|
|
153
|
+
payment: bigint | UInt64;
|
|
154
|
+
fee: bigint | UInt64;
|
|
155
|
+
}) => {
|
|
156
|
+
to: PublicKey;
|
|
157
|
+
amount: UInt64;
|
|
158
|
+
price: UInt64;
|
|
159
|
+
payment: UInt64;
|
|
160
|
+
fee: UInt64;
|
|
161
|
+
};
|
|
162
|
+
toInput: (x: {
|
|
163
|
+
to: PublicKey;
|
|
164
|
+
amount: UInt64;
|
|
165
|
+
price: UInt64;
|
|
166
|
+
payment: UInt64;
|
|
167
|
+
fee: UInt64;
|
|
168
|
+
}) => {
|
|
169
|
+
fields?: Field[] | undefined;
|
|
170
|
+
packed?: [Field, number][] | undefined;
|
|
171
|
+
};
|
|
172
|
+
toJSON: (x: {
|
|
173
|
+
to: PublicKey;
|
|
174
|
+
amount: UInt64;
|
|
175
|
+
price: UInt64;
|
|
176
|
+
payment: UInt64;
|
|
177
|
+
fee: UInt64;
|
|
178
|
+
}) => {
|
|
179
|
+
to: string;
|
|
180
|
+
amount: string;
|
|
181
|
+
price: string;
|
|
182
|
+
payment: string;
|
|
183
|
+
fee: string;
|
|
184
|
+
};
|
|
185
|
+
fromJSON: (x: {
|
|
186
|
+
to: string;
|
|
187
|
+
amount: string;
|
|
188
|
+
price: string;
|
|
189
|
+
payment: string;
|
|
190
|
+
fee: string;
|
|
191
|
+
}) => {
|
|
192
|
+
to: PublicKey;
|
|
193
|
+
amount: UInt64;
|
|
194
|
+
price: UInt64;
|
|
195
|
+
payment: UInt64;
|
|
196
|
+
fee: UInt64;
|
|
197
|
+
};
|
|
198
|
+
empty: () => {
|
|
199
|
+
to: PublicKey;
|
|
200
|
+
amount: UInt64;
|
|
201
|
+
price: UInt64;
|
|
202
|
+
payment: UInt64;
|
|
203
|
+
fee: UInt64;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
export declare class BondingMintEvent extends BondingMintEvent_base {
|
|
207
|
+
}
|
|
208
|
+
declare const BondingRedeemEvent_base: (new (value: {
|
|
209
|
+
seller: PublicKey;
|
|
210
|
+
amount: UInt64;
|
|
211
|
+
payment: UInt64;
|
|
212
|
+
minBalance: UInt64;
|
|
213
|
+
maxSupply: UInt64;
|
|
214
|
+
fee: UInt64;
|
|
215
|
+
}) => {
|
|
216
|
+
seller: PublicKey;
|
|
217
|
+
amount: UInt64;
|
|
218
|
+
payment: UInt64;
|
|
219
|
+
minBalance: UInt64;
|
|
220
|
+
maxSupply: UInt64;
|
|
221
|
+
fee: UInt64;
|
|
222
|
+
}) & {
|
|
223
|
+
_isStruct: true;
|
|
224
|
+
} & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
|
|
225
|
+
seller: PublicKey;
|
|
226
|
+
amount: UInt64;
|
|
227
|
+
payment: UInt64;
|
|
228
|
+
minBalance: UInt64;
|
|
229
|
+
maxSupply: UInt64;
|
|
230
|
+
fee: UInt64;
|
|
231
|
+
}, {
|
|
232
|
+
seller: {
|
|
233
|
+
x: bigint;
|
|
234
|
+
isOdd: boolean;
|
|
235
|
+
};
|
|
236
|
+
amount: bigint;
|
|
237
|
+
payment: bigint;
|
|
238
|
+
minBalance: bigint;
|
|
239
|
+
maxSupply: bigint;
|
|
240
|
+
fee: bigint;
|
|
241
|
+
}>, "fromFields"> & {
|
|
242
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
|
|
243
|
+
seller: PublicKey;
|
|
244
|
+
amount: UInt64;
|
|
245
|
+
payment: UInt64;
|
|
246
|
+
minBalance: UInt64;
|
|
247
|
+
maxSupply: UInt64;
|
|
248
|
+
fee: UInt64;
|
|
249
|
+
};
|
|
250
|
+
} & {
|
|
251
|
+
fromValue: (value: {
|
|
252
|
+
seller: PublicKey | {
|
|
253
|
+
x: Field | bigint;
|
|
254
|
+
isOdd: Bool | boolean;
|
|
255
|
+
};
|
|
256
|
+
amount: bigint | UInt64;
|
|
257
|
+
payment: bigint | UInt64;
|
|
258
|
+
minBalance: bigint | UInt64;
|
|
259
|
+
maxSupply: bigint | UInt64;
|
|
260
|
+
fee: bigint | UInt64;
|
|
261
|
+
}) => {
|
|
262
|
+
seller: PublicKey;
|
|
263
|
+
amount: UInt64;
|
|
264
|
+
payment: UInt64;
|
|
265
|
+
minBalance: UInt64;
|
|
266
|
+
maxSupply: UInt64;
|
|
267
|
+
fee: UInt64;
|
|
268
|
+
};
|
|
269
|
+
toInput: (x: {
|
|
270
|
+
seller: PublicKey;
|
|
271
|
+
amount: UInt64;
|
|
272
|
+
payment: UInt64;
|
|
273
|
+
minBalance: UInt64;
|
|
274
|
+
maxSupply: UInt64;
|
|
275
|
+
fee: UInt64;
|
|
276
|
+
}) => {
|
|
277
|
+
fields?: Field[] | undefined;
|
|
278
|
+
packed?: [Field, number][] | undefined;
|
|
279
|
+
};
|
|
280
|
+
toJSON: (x: {
|
|
281
|
+
seller: PublicKey;
|
|
282
|
+
amount: UInt64;
|
|
283
|
+
payment: UInt64;
|
|
284
|
+
minBalance: UInt64;
|
|
285
|
+
maxSupply: UInt64;
|
|
286
|
+
fee: UInt64;
|
|
287
|
+
}) => {
|
|
288
|
+
seller: string;
|
|
289
|
+
amount: string;
|
|
290
|
+
payment: string;
|
|
291
|
+
minBalance: string;
|
|
292
|
+
maxSupply: string;
|
|
293
|
+
fee: string;
|
|
294
|
+
};
|
|
295
|
+
fromJSON: (x: {
|
|
296
|
+
seller: string;
|
|
297
|
+
amount: string;
|
|
298
|
+
payment: string;
|
|
299
|
+
minBalance: string;
|
|
300
|
+
maxSupply: string;
|
|
301
|
+
fee: string;
|
|
302
|
+
}) => {
|
|
303
|
+
seller: PublicKey;
|
|
304
|
+
amount: UInt64;
|
|
305
|
+
payment: UInt64;
|
|
306
|
+
minBalance: UInt64;
|
|
307
|
+
maxSupply: UInt64;
|
|
308
|
+
fee: UInt64;
|
|
309
|
+
};
|
|
310
|
+
empty: () => {
|
|
311
|
+
seller: PublicKey;
|
|
312
|
+
amount: UInt64;
|
|
313
|
+
payment: UInt64;
|
|
314
|
+
minBalance: UInt64;
|
|
315
|
+
maxSupply: UInt64;
|
|
316
|
+
fee: UInt64;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
export declare class BondingRedeemEvent extends BondingRedeemEvent_base {
|
|
320
|
+
}
|
|
321
|
+
declare const BondingCurveAdminInitializeProps_base: (new (value: {
|
|
322
|
+
tokenAddress: PublicKey;
|
|
323
|
+
startPrice: UInt64;
|
|
324
|
+
curveK: UInt64;
|
|
325
|
+
feeMaster: PublicKey;
|
|
326
|
+
fee: UInt32;
|
|
327
|
+
launchFee: UInt64;
|
|
328
|
+
numberOfNewAccounts: UInt64;
|
|
329
|
+
}) => {
|
|
330
|
+
tokenAddress: PublicKey;
|
|
331
|
+
startPrice: UInt64;
|
|
332
|
+
curveK: UInt64;
|
|
333
|
+
feeMaster: PublicKey;
|
|
334
|
+
fee: UInt32;
|
|
335
|
+
launchFee: UInt64;
|
|
336
|
+
numberOfNewAccounts: UInt64;
|
|
337
|
+
}) & {
|
|
338
|
+
_isStruct: true;
|
|
339
|
+
} & Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
|
|
340
|
+
tokenAddress: PublicKey;
|
|
341
|
+
startPrice: UInt64;
|
|
342
|
+
curveK: UInt64;
|
|
343
|
+
feeMaster: PublicKey;
|
|
344
|
+
fee: UInt32;
|
|
345
|
+
launchFee: UInt64;
|
|
346
|
+
numberOfNewAccounts: UInt64;
|
|
347
|
+
}, {
|
|
348
|
+
tokenAddress: {
|
|
349
|
+
x: bigint;
|
|
350
|
+
isOdd: boolean;
|
|
351
|
+
};
|
|
352
|
+
startPrice: bigint;
|
|
353
|
+
curveK: bigint;
|
|
354
|
+
feeMaster: {
|
|
355
|
+
x: bigint;
|
|
356
|
+
isOdd: boolean;
|
|
357
|
+
};
|
|
358
|
+
fee: bigint;
|
|
359
|
+
launchFee: bigint;
|
|
360
|
+
numberOfNewAccounts: bigint;
|
|
361
|
+
}>, "fromFields"> & {
|
|
362
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
|
|
363
|
+
tokenAddress: PublicKey;
|
|
364
|
+
startPrice: UInt64;
|
|
365
|
+
curveK: UInt64;
|
|
366
|
+
feeMaster: PublicKey;
|
|
367
|
+
fee: UInt32;
|
|
368
|
+
launchFee: UInt64;
|
|
369
|
+
numberOfNewAccounts: UInt64;
|
|
370
|
+
};
|
|
371
|
+
} & {
|
|
372
|
+
fromValue: (value: {
|
|
373
|
+
tokenAddress: PublicKey | {
|
|
374
|
+
x: Field | bigint;
|
|
375
|
+
isOdd: Bool | boolean;
|
|
376
|
+
};
|
|
377
|
+
startPrice: bigint | UInt64;
|
|
378
|
+
curveK: bigint | UInt64;
|
|
379
|
+
feeMaster: PublicKey | {
|
|
380
|
+
x: Field | bigint;
|
|
381
|
+
isOdd: Bool | boolean;
|
|
382
|
+
};
|
|
383
|
+
fee: bigint | UInt32;
|
|
384
|
+
launchFee: bigint | UInt64;
|
|
385
|
+
numberOfNewAccounts: bigint | UInt64;
|
|
386
|
+
}) => {
|
|
387
|
+
tokenAddress: PublicKey;
|
|
388
|
+
startPrice: UInt64;
|
|
389
|
+
curveK: UInt64;
|
|
390
|
+
feeMaster: PublicKey;
|
|
391
|
+
fee: UInt32;
|
|
392
|
+
launchFee: UInt64;
|
|
393
|
+
numberOfNewAccounts: UInt64;
|
|
394
|
+
};
|
|
395
|
+
toInput: (x: {
|
|
396
|
+
tokenAddress: PublicKey;
|
|
397
|
+
startPrice: UInt64;
|
|
398
|
+
curveK: UInt64;
|
|
399
|
+
feeMaster: PublicKey;
|
|
400
|
+
fee: UInt32;
|
|
401
|
+
launchFee: UInt64;
|
|
402
|
+
numberOfNewAccounts: UInt64;
|
|
403
|
+
}) => {
|
|
404
|
+
fields?: Field[] | undefined;
|
|
405
|
+
packed?: [Field, number][] | undefined;
|
|
406
|
+
};
|
|
407
|
+
toJSON: (x: {
|
|
408
|
+
tokenAddress: PublicKey;
|
|
409
|
+
startPrice: UInt64;
|
|
410
|
+
curveK: UInt64;
|
|
411
|
+
feeMaster: PublicKey;
|
|
412
|
+
fee: UInt32;
|
|
413
|
+
launchFee: UInt64;
|
|
414
|
+
numberOfNewAccounts: UInt64;
|
|
415
|
+
}) => {
|
|
416
|
+
tokenAddress: string;
|
|
417
|
+
startPrice: string;
|
|
418
|
+
curveK: string;
|
|
419
|
+
feeMaster: string;
|
|
420
|
+
fee: string;
|
|
421
|
+
launchFee: string;
|
|
422
|
+
numberOfNewAccounts: string;
|
|
423
|
+
};
|
|
424
|
+
fromJSON: (x: {
|
|
425
|
+
tokenAddress: string;
|
|
426
|
+
startPrice: string;
|
|
427
|
+
curveK: string;
|
|
428
|
+
feeMaster: string;
|
|
429
|
+
fee: string;
|
|
430
|
+
launchFee: string;
|
|
431
|
+
numberOfNewAccounts: string;
|
|
432
|
+
}) => {
|
|
433
|
+
tokenAddress: PublicKey;
|
|
434
|
+
startPrice: UInt64;
|
|
435
|
+
curveK: UInt64;
|
|
436
|
+
feeMaster: PublicKey;
|
|
437
|
+
fee: UInt32;
|
|
438
|
+
launchFee: UInt64;
|
|
439
|
+
numberOfNewAccounts: UInt64;
|
|
440
|
+
};
|
|
441
|
+
empty: () => {
|
|
442
|
+
tokenAddress: PublicKey;
|
|
443
|
+
startPrice: UInt64;
|
|
444
|
+
curveK: UInt64;
|
|
445
|
+
feeMaster: PublicKey;
|
|
446
|
+
fee: UInt32;
|
|
447
|
+
launchFee: UInt64;
|
|
448
|
+
numberOfNewAccounts: UInt64;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
export declare class BondingCurveAdminInitializeProps extends BondingCurveAdminInitializeProps_base {
|
|
452
|
+
}
|
|
453
|
+
export declare class FungibleTokenBondingCurveAdmin extends TokenContract implements FungibleTokenAdminBase {
|
|
454
|
+
owner: State<PublicKey>;
|
|
455
|
+
token: State<PublicKey>;
|
|
456
|
+
feeMaster: State<PublicKey>;
|
|
457
|
+
curve: State<import("node_modules/o1js/dist/node/lib/provable/field.js").Field>;
|
|
458
|
+
insideMint: State<import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool>;
|
|
459
|
+
events: {
|
|
460
|
+
mint: typeof BondingMintEvent;
|
|
461
|
+
redeem: typeof BondingRedeemEvent;
|
|
462
|
+
};
|
|
463
|
+
deploy(props: DeployArgs): Promise<void>;
|
|
464
|
+
approveBase(forest: AccountUpdateForest): Promise<void>;
|
|
465
|
+
initialize(props: BondingCurveAdminInitializeProps): Promise<void>;
|
|
466
|
+
mint(to: PublicKey, amount: UInt64, price: UInt64): Promise<void>;
|
|
467
|
+
redeem(amount: UInt64, minPrice: UInt64, slippage: UInt32): Promise<void>;
|
|
468
|
+
/**
|
|
469
|
+
* In case the user burned tokens without calling the redeem method,
|
|
470
|
+
* we need to sync the supply to the actual circulated supply
|
|
471
|
+
*/
|
|
472
|
+
sync(): Promise<void>;
|
|
473
|
+
/** Update the verification key.
|
|
474
|
+
* Note that because we have set the permissions for setting the verification key to `impossibleDuringCurrentVersion()`, this will only be possible in case of a protocol update that requires an update.
|
|
475
|
+
*/
|
|
476
|
+
updateVerificationKey(vk: VerificationKey): Promise<void>;
|
|
477
|
+
ensureOwnerSignature(): AccountUpdate;
|
|
478
|
+
canMint(_accountUpdate: AccountUpdate): Promise<import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool>;
|
|
479
|
+
canChangeAdmin(_admin: PublicKey): Promise<import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool>;
|
|
480
|
+
canPause(): Promise<Bool>;
|
|
481
|
+
canResume(): Promise<Bool>;
|
|
482
|
+
canChangeVerificationKey(_vk: VerificationKey): Promise<Bool>;
|
|
483
|
+
}
|
|
484
|
+
export declare const BondingCurveFungibleToken: {
|
|
485
|
+
new (address: PublicKey, tokenId?: Field): {
|
|
486
|
+
decimals: State<import("o1js").UInt8>;
|
|
487
|
+
admin: State<PublicKey>;
|
|
488
|
+
paused: State<import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool>;
|
|
489
|
+
readonly events: {
|
|
490
|
+
SetAdmin: typeof import("@silvana-one/token").SetAdminEvent;
|
|
491
|
+
Pause: typeof import("@silvana-one/token").PauseEvent;
|
|
492
|
+
Mint: typeof import("@silvana-one/token").MintEvent;
|
|
493
|
+
Burn: typeof import("@silvana-one/token").BurnEvent;
|
|
494
|
+
BalanceChange: typeof import("@silvana-one/token").BalanceChangeEvent;
|
|
495
|
+
};
|
|
496
|
+
deploy(props: import("@silvana-one/token").FungibleTokenDeployProps): Promise<void>;
|
|
497
|
+
updateVerificationKey(vk: VerificationKey): Promise<void>;
|
|
498
|
+
initialize(admin: PublicKey, decimals: import("o1js").UInt8, startPaused: Bool): Promise<void>;
|
|
499
|
+
getAdminContract(): Promise<FungibleTokenAdminBase>;
|
|
500
|
+
setAdmin(admin: PublicKey): Promise<void>;
|
|
501
|
+
mint(recipient: PublicKey, amount: UInt64): Promise<AccountUpdate>;
|
|
502
|
+
burn(from: PublicKey, amount: UInt64): Promise<AccountUpdate>;
|
|
503
|
+
pause(): Promise<void>;
|
|
504
|
+
resume(): Promise<void>;
|
|
505
|
+
transfer(from: PublicKey, to: PublicKey, amount: UInt64): Promise<void>;
|
|
506
|
+
checkPermissionsUpdate(update: AccountUpdate): void;
|
|
507
|
+
approveBase(updates: AccountUpdateForest): Promise<void>;
|
|
508
|
+
getBalanceOf(address: PublicKey): Promise<UInt64>;
|
|
509
|
+
getCirculating(): Promise<UInt64>;
|
|
510
|
+
getDecimals(): Promise<import("o1js").UInt8>;
|
|
511
|
+
deriveTokenId(): import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
512
|
+
readonly internal: {
|
|
513
|
+
mint({ address, amount, }: {
|
|
514
|
+
address: PublicKey | AccountUpdate | import("o1js").SmartContract;
|
|
515
|
+
amount: number | bigint | UInt64;
|
|
516
|
+
}): AccountUpdate;
|
|
517
|
+
burn({ address, amount, }: {
|
|
518
|
+
address: PublicKey | AccountUpdate | import("o1js").SmartContract;
|
|
519
|
+
amount: number | bigint | UInt64;
|
|
520
|
+
}): AccountUpdate;
|
|
521
|
+
send({ from, to, amount, }: {
|
|
522
|
+
from: PublicKey | AccountUpdate | import("o1js").SmartContract;
|
|
523
|
+
to: PublicKey | AccountUpdate | import("o1js").SmartContract;
|
|
524
|
+
amount: number | bigint | UInt64;
|
|
525
|
+
}): AccountUpdate;
|
|
526
|
+
};
|
|
527
|
+
forEachUpdate(updates: AccountUpdateForest, callback: (update: AccountUpdate, usesToken: Bool) => void): void;
|
|
528
|
+
checkZeroBalanceChange(updates: AccountUpdateForest): void;
|
|
529
|
+
approveAccountUpdate(accountUpdate: AccountUpdate | import("o1js").AccountUpdateTree): Promise<void>;
|
|
530
|
+
approveAccountUpdates(accountUpdates: (AccountUpdate | import("o1js").AccountUpdateTree)[]): Promise<void>;
|
|
531
|
+
"__#3@#private": any;
|
|
532
|
+
address: PublicKey;
|
|
533
|
+
tokenId: Field;
|
|
534
|
+
init(): void;
|
|
535
|
+
requireSignature(): void;
|
|
536
|
+
skipAuthorization(): void;
|
|
537
|
+
readonly self: AccountUpdate;
|
|
538
|
+
newSelf(methodName?: string): AccountUpdate;
|
|
539
|
+
sender: {
|
|
540
|
+
self: import("o1js").SmartContract;
|
|
541
|
+
getUnconstrained(): PublicKey;
|
|
542
|
+
getAndRequireSignature(): PublicKey;
|
|
543
|
+
};
|
|
544
|
+
readonly account: import("node_modules/o1js/dist/node/lib/mina/precondition.js").Account;
|
|
545
|
+
readonly network: import("node_modules/o1js/dist/node/lib/mina/precondition.js").Network;
|
|
546
|
+
readonly currentSlot: import("node_modules/o1js/dist/node/lib/mina/precondition.js").CurrentSlot;
|
|
547
|
+
approve(update: AccountUpdate | import("o1js").AccountUpdateTree | AccountUpdateForest): void;
|
|
548
|
+
send(args: {
|
|
549
|
+
to: PublicKey | AccountUpdate | import("o1js").SmartContract;
|
|
550
|
+
amount: number | bigint | UInt64;
|
|
551
|
+
}): AccountUpdate;
|
|
552
|
+
readonly balance: {
|
|
553
|
+
addInPlace(x: string | number | bigint | UInt64 | UInt32 | import("node_modules/o1js/dist/node/lib/provable/int.js").Int64): void;
|
|
554
|
+
subInPlace(x: string | number | bigint | UInt64 | UInt32 | import("node_modules/o1js/dist/node/lib/provable/int.js").Int64): void;
|
|
555
|
+
};
|
|
556
|
+
emitEventIf<K extends "SetAdmin" | "Pause" | "Mint" | "Burn" | "BalanceChange">(condition: Bool, type: K, event: any): void;
|
|
557
|
+
emitEvent<K extends "SetAdmin" | "Pause" | "Mint" | "Burn" | "BalanceChange">(type: K, event: any): void;
|
|
558
|
+
fetchEvents(start?: UInt32, end?: UInt32): Promise<{
|
|
559
|
+
type: string;
|
|
560
|
+
event: {
|
|
561
|
+
data: import("o1js").ProvablePure<any>;
|
|
562
|
+
transactionInfo: {
|
|
563
|
+
transactionHash: string;
|
|
564
|
+
transactionStatus: string;
|
|
565
|
+
transactionMemo: string;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
blockHeight: UInt32;
|
|
569
|
+
blockHash: string;
|
|
570
|
+
parentBlockHash: string;
|
|
571
|
+
globalSlot: UInt32;
|
|
572
|
+
chainStatus: string;
|
|
573
|
+
}[]>;
|
|
574
|
+
};
|
|
575
|
+
MAX_ACCOUNT_UPDATES: number;
|
|
576
|
+
_methods?: import("node_modules/o1js/dist/node/lib/proof-system/zkprogram.js").MethodInterface[];
|
|
577
|
+
_methodMetadata?: Record<string, {
|
|
578
|
+
actions: number;
|
|
579
|
+
rows: number;
|
|
580
|
+
digest: string;
|
|
581
|
+
gates: import("node_modules/o1js/dist/node/snarky.js").Gate[];
|
|
582
|
+
}>;
|
|
583
|
+
_provers?: import("node_modules/o1js/dist/node/snarky.js").Pickles.Prover[];
|
|
584
|
+
_maxProofsVerified?: 0 | 1 | 2;
|
|
585
|
+
_verificationKey?: {
|
|
586
|
+
data: string;
|
|
587
|
+
hash: Field;
|
|
588
|
+
};
|
|
589
|
+
Proof(): {
|
|
590
|
+
new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
|
|
591
|
+
proof: unknown;
|
|
592
|
+
publicInput: import("o1js").ZkappPublicInput;
|
|
593
|
+
publicOutput: undefined;
|
|
594
|
+
maxProofsVerified: 0 | 2 | 1;
|
|
595
|
+
}): {
|
|
596
|
+
verify(): void;
|
|
597
|
+
verifyIf(condition: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool): void;
|
|
598
|
+
publicInput: import("o1js").ZkappPublicInput;
|
|
599
|
+
publicOutput: undefined;
|
|
600
|
+
proof: unknown;
|
|
601
|
+
maxProofsVerified: 0 | 2 | 1;
|
|
602
|
+
shouldVerify: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
|
|
603
|
+
toJSON(): import("o1js").JsonProof;
|
|
604
|
+
publicFields(): {
|
|
605
|
+
input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
|
|
606
|
+
output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
publicInputType: Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
|
|
610
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
611
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
612
|
+
}, {
|
|
613
|
+
accountUpdate: bigint;
|
|
614
|
+
calls: bigint;
|
|
615
|
+
}>, "fromFields"> & {
|
|
616
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
|
|
617
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
618
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
619
|
+
};
|
|
620
|
+
} & {
|
|
621
|
+
toInput: (x: {
|
|
622
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
623
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
624
|
+
}) => {
|
|
625
|
+
fields?: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[] | undefined;
|
|
626
|
+
packed?: [import("node_modules/o1js/dist/node/lib/provable/field.js").Field, number][] | undefined;
|
|
627
|
+
};
|
|
628
|
+
toJSON: (x: {
|
|
629
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
630
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
631
|
+
}) => {
|
|
632
|
+
accountUpdate: string;
|
|
633
|
+
calls: string;
|
|
634
|
+
};
|
|
635
|
+
fromJSON: (x: {
|
|
636
|
+
accountUpdate: string;
|
|
637
|
+
calls: string;
|
|
638
|
+
}) => {
|
|
639
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
640
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
641
|
+
};
|
|
642
|
+
empty: () => {
|
|
643
|
+
accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
644
|
+
calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
publicOutputType: import("node_modules/o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<undefined, undefined, null>;
|
|
648
|
+
tag: () => typeof import("o1js").SmartContract;
|
|
649
|
+
fromJSON<S extends import("node_modules/o1js/dist/node/lib/util/types.js").Subclass<typeof import("o1js").Proof>>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
|
|
650
|
+
dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
|
|
651
|
+
readonly provable: {
|
|
652
|
+
toFields: (value: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
|
|
653
|
+
toAuxiliary: (value?: import("o1js").Proof<any, any> | undefined) => any[];
|
|
654
|
+
fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], aux: any[]) => import("o1js").Proof<any, any>;
|
|
655
|
+
sizeInFields(): number;
|
|
656
|
+
check: (value: import("o1js").Proof<any, any>) => void;
|
|
657
|
+
toValue: (x: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>;
|
|
658
|
+
fromValue: (x: import("o1js").Proof<any, any> | import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>) => import("o1js").Proof<any, any>;
|
|
659
|
+
toCanonical?: ((x: import("o1js").Proof<any, any>) => import("o1js").Proof<any, any>) | undefined;
|
|
660
|
+
};
|
|
661
|
+
publicFields(value: import("o1js").ProofBase<any, any>): {
|
|
662
|
+
input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
|
|
663
|
+
output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
|
|
664
|
+
};
|
|
665
|
+
_proofFromBase64(proofString: string, maxProofsVerified: 0 | 2 | 1): unknown;
|
|
666
|
+
_proofToBase64(proof: unknown, maxProofsVerified: 0 | 2 | 1): string;
|
|
667
|
+
};
|
|
668
|
+
compile({ cache, forceRecompile, }?: {
|
|
669
|
+
cache?: import("o1js").Cache | undefined;
|
|
670
|
+
forceRecompile?: boolean | undefined;
|
|
671
|
+
}): Promise<{
|
|
672
|
+
verificationKey: {
|
|
673
|
+
data: string;
|
|
674
|
+
hash: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
|
|
675
|
+
};
|
|
676
|
+
provers: import("node_modules/o1js/dist/node/snarky.js").Pickles.Prover[];
|
|
677
|
+
verify: (statement: import("node_modules/o1js/dist/node/snarky.js").Pickles.Statement<import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst>, proof: unknown) => Promise<boolean>;
|
|
678
|
+
}>;
|
|
679
|
+
digest(): Promise<string>;
|
|
680
|
+
runOutsideCircuit(run: () => void): void;
|
|
681
|
+
analyzeMethods({ printSummary }?: {
|
|
682
|
+
printSummary?: boolean | undefined;
|
|
683
|
+
}): Promise<Record<string, {
|
|
684
|
+
actions: number;
|
|
685
|
+
rows: number;
|
|
686
|
+
digest: string;
|
|
687
|
+
gates: import("node_modules/o1js/dist/node/snarky.js").Gate[];
|
|
688
|
+
}>>;
|
|
689
|
+
};
|
|
690
|
+
export {};
|