@near-kit-tool-box/fun 0.0.1 → 0.0.2

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.
@@ -0,0 +1,535 @@
1
+ import { Near } from "near-kit";
2
+ export declare function pool_get_number_of_accounts_fun(near: Near, pool_contractId: string): Promise<number>;
3
+ export declare function pool_ping_fun(near: Near, pool_contractId: string): Promise<{
4
+ final_execution_status: "NONE";
5
+ transaction?: {
6
+ hash: string;
7
+ signer_id: string;
8
+ receiver_id: string;
9
+ nonce: number;
10
+ } | undefined;
11
+ } | {
12
+ final_execution_status: "INCLUDED";
13
+ transaction?: {
14
+ hash: string;
15
+ signer_id: string;
16
+ receiver_id: string;
17
+ nonce: number;
18
+ } | undefined;
19
+ } | {
20
+ final_execution_status: "INCLUDED_FINAL";
21
+ transaction?: {
22
+ hash: string;
23
+ signer_id: string;
24
+ receiver_id: string;
25
+ nonce: number;
26
+ } | undefined;
27
+ } | {
28
+ final_execution_status: "EXECUTED_OPTIMISTIC";
29
+ status: "Unknown" | "Pending" | {
30
+ SuccessValue: string;
31
+ } | {
32
+ SuccessReceiptId: string;
33
+ } | {
34
+ Failure: {
35
+ [x: string]: any;
36
+ error_message?: string | undefined;
37
+ error_type?: string | undefined;
38
+ };
39
+ };
40
+ transaction: {
41
+ signer_id: string;
42
+ public_key: string;
43
+ nonce: number;
44
+ receiver_id: string;
45
+ actions: ("CreateAccount" | {
46
+ CreateAccount: Record<string, never>;
47
+ } | {
48
+ Transfer: {
49
+ deposit: string;
50
+ };
51
+ } | {
52
+ FunctionCall: {
53
+ method_name: string;
54
+ args: string;
55
+ gas: number;
56
+ deposit: string;
57
+ };
58
+ } | {
59
+ DeployContract: {
60
+ code: string;
61
+ };
62
+ } | {
63
+ DeployGlobalContract: {
64
+ code: string;
65
+ };
66
+ } | {
67
+ DeployGlobalContractByAccountId: {
68
+ code: string;
69
+ };
70
+ } | {
71
+ Stake: {
72
+ stake: string;
73
+ public_key: string;
74
+ };
75
+ } | {
76
+ AddKey: {
77
+ public_key: string;
78
+ access_key: {
79
+ nonce: number;
80
+ permission: "FullAccess" | {
81
+ FunctionCall: {
82
+ receiver_id: string;
83
+ method_names: string[];
84
+ allowance?: string | null | undefined;
85
+ };
86
+ };
87
+ };
88
+ };
89
+ } | {
90
+ DeleteKey: {
91
+ public_key: string;
92
+ };
93
+ } | {
94
+ DeleteAccount: {
95
+ beneficiary_id: string;
96
+ };
97
+ } | {
98
+ UseGlobalContract: {
99
+ code_hash: string;
100
+ };
101
+ } | {
102
+ UseGlobalContractByAccountId: {
103
+ account_id: string;
104
+ };
105
+ } | {
106
+ Delegate: {
107
+ delegate_action: {
108
+ sender_id: string;
109
+ receiver_id: string;
110
+ actions: any[];
111
+ nonce: number;
112
+ max_block_height: number;
113
+ public_key: string;
114
+ };
115
+ signature: string;
116
+ };
117
+ } | {
118
+ DeterministicStateInit: {
119
+ deposit: string;
120
+ };
121
+ })[];
122
+ signature: string;
123
+ hash: string;
124
+ priority_fee?: number | undefined;
125
+ };
126
+ transaction_outcome: {
127
+ id: string;
128
+ outcome: {
129
+ logs: string[];
130
+ receipt_ids: string[];
131
+ gas_burnt: number;
132
+ tokens_burnt: string;
133
+ executor_id: string;
134
+ status: "Unknown" | "Pending" | {
135
+ SuccessValue: string;
136
+ } | {
137
+ SuccessReceiptId: string;
138
+ } | {
139
+ Failure: {
140
+ [x: string]: any;
141
+ error_message?: string | undefined;
142
+ error_type?: string | undefined;
143
+ };
144
+ };
145
+ metadata?: {
146
+ version: number;
147
+ gas_profile?: {
148
+ [x: string]: any;
149
+ cost?: string | undefined;
150
+ cost_category?: string | undefined;
151
+ gas_used?: string | undefined;
152
+ }[] | null | undefined;
153
+ } | undefined;
154
+ };
155
+ block_hash: string;
156
+ proof: {
157
+ hash: string;
158
+ direction: "Left" | "Right";
159
+ }[];
160
+ };
161
+ receipts_outcome: {
162
+ id: string;
163
+ outcome: {
164
+ logs: string[];
165
+ receipt_ids: string[];
166
+ gas_burnt: number;
167
+ tokens_burnt: string;
168
+ executor_id: string;
169
+ status: "Unknown" | "Pending" | {
170
+ SuccessValue: string;
171
+ } | {
172
+ SuccessReceiptId: string;
173
+ } | {
174
+ Failure: {
175
+ [x: string]: any;
176
+ error_message?: string | undefined;
177
+ error_type?: string | undefined;
178
+ };
179
+ };
180
+ metadata?: {
181
+ version: number;
182
+ gas_profile?: {
183
+ [x: string]: any;
184
+ cost?: string | undefined;
185
+ cost_category?: string | undefined;
186
+ gas_used?: string | undefined;
187
+ }[] | null | undefined;
188
+ } | undefined;
189
+ };
190
+ block_hash: string;
191
+ proof: {
192
+ hash: string;
193
+ direction: "Left" | "Right";
194
+ }[];
195
+ }[];
196
+ } | {
197
+ final_execution_status: "EXECUTED";
198
+ status: "Unknown" | "Pending" | {
199
+ SuccessValue: string;
200
+ } | {
201
+ SuccessReceiptId: string;
202
+ } | {
203
+ Failure: {
204
+ [x: string]: any;
205
+ error_message?: string | undefined;
206
+ error_type?: string | undefined;
207
+ };
208
+ };
209
+ transaction: {
210
+ signer_id: string;
211
+ public_key: string;
212
+ nonce: number;
213
+ receiver_id: string;
214
+ actions: ("CreateAccount" | {
215
+ CreateAccount: Record<string, never>;
216
+ } | {
217
+ Transfer: {
218
+ deposit: string;
219
+ };
220
+ } | {
221
+ FunctionCall: {
222
+ method_name: string;
223
+ args: string;
224
+ gas: number;
225
+ deposit: string;
226
+ };
227
+ } | {
228
+ DeployContract: {
229
+ code: string;
230
+ };
231
+ } | {
232
+ DeployGlobalContract: {
233
+ code: string;
234
+ };
235
+ } | {
236
+ DeployGlobalContractByAccountId: {
237
+ code: string;
238
+ };
239
+ } | {
240
+ Stake: {
241
+ stake: string;
242
+ public_key: string;
243
+ };
244
+ } | {
245
+ AddKey: {
246
+ public_key: string;
247
+ access_key: {
248
+ nonce: number;
249
+ permission: "FullAccess" | {
250
+ FunctionCall: {
251
+ receiver_id: string;
252
+ method_names: string[];
253
+ allowance?: string | null | undefined;
254
+ };
255
+ };
256
+ };
257
+ };
258
+ } | {
259
+ DeleteKey: {
260
+ public_key: string;
261
+ };
262
+ } | {
263
+ DeleteAccount: {
264
+ beneficiary_id: string;
265
+ };
266
+ } | {
267
+ UseGlobalContract: {
268
+ code_hash: string;
269
+ };
270
+ } | {
271
+ UseGlobalContractByAccountId: {
272
+ account_id: string;
273
+ };
274
+ } | {
275
+ Delegate: {
276
+ delegate_action: {
277
+ sender_id: string;
278
+ receiver_id: string;
279
+ actions: any[];
280
+ nonce: number;
281
+ max_block_height: number;
282
+ public_key: string;
283
+ };
284
+ signature: string;
285
+ };
286
+ } | {
287
+ DeterministicStateInit: {
288
+ deposit: string;
289
+ };
290
+ })[];
291
+ signature: string;
292
+ hash: string;
293
+ priority_fee?: number | undefined;
294
+ };
295
+ transaction_outcome: {
296
+ id: string;
297
+ outcome: {
298
+ logs: string[];
299
+ receipt_ids: string[];
300
+ gas_burnt: number;
301
+ tokens_burnt: string;
302
+ executor_id: string;
303
+ status: "Unknown" | "Pending" | {
304
+ SuccessValue: string;
305
+ } | {
306
+ SuccessReceiptId: string;
307
+ } | {
308
+ Failure: {
309
+ [x: string]: any;
310
+ error_message?: string | undefined;
311
+ error_type?: string | undefined;
312
+ };
313
+ };
314
+ metadata?: {
315
+ version: number;
316
+ gas_profile?: {
317
+ [x: string]: any;
318
+ cost?: string | undefined;
319
+ cost_category?: string | undefined;
320
+ gas_used?: string | undefined;
321
+ }[] | null | undefined;
322
+ } | undefined;
323
+ };
324
+ block_hash: string;
325
+ proof: {
326
+ hash: string;
327
+ direction: "Left" | "Right";
328
+ }[];
329
+ };
330
+ receipts_outcome: {
331
+ id: string;
332
+ outcome: {
333
+ logs: string[];
334
+ receipt_ids: string[];
335
+ gas_burnt: number;
336
+ tokens_burnt: string;
337
+ executor_id: string;
338
+ status: "Unknown" | "Pending" | {
339
+ SuccessValue: string;
340
+ } | {
341
+ SuccessReceiptId: string;
342
+ } | {
343
+ Failure: {
344
+ [x: string]: any;
345
+ error_message?: string | undefined;
346
+ error_type?: string | undefined;
347
+ };
348
+ };
349
+ metadata?: {
350
+ version: number;
351
+ gas_profile?: {
352
+ [x: string]: any;
353
+ cost?: string | undefined;
354
+ cost_category?: string | undefined;
355
+ gas_used?: string | undefined;
356
+ }[] | null | undefined;
357
+ } | undefined;
358
+ };
359
+ block_hash: string;
360
+ proof: {
361
+ hash: string;
362
+ direction: "Left" | "Right";
363
+ }[];
364
+ }[];
365
+ } | {
366
+ final_execution_status: "FINAL";
367
+ status: "Unknown" | "Pending" | {
368
+ SuccessValue: string;
369
+ } | {
370
+ SuccessReceiptId: string;
371
+ } | {
372
+ Failure: {
373
+ [x: string]: any;
374
+ error_message?: string | undefined;
375
+ error_type?: string | undefined;
376
+ };
377
+ };
378
+ transaction: {
379
+ signer_id: string;
380
+ public_key: string;
381
+ nonce: number;
382
+ receiver_id: string;
383
+ actions: ("CreateAccount" | {
384
+ CreateAccount: Record<string, never>;
385
+ } | {
386
+ Transfer: {
387
+ deposit: string;
388
+ };
389
+ } | {
390
+ FunctionCall: {
391
+ method_name: string;
392
+ args: string;
393
+ gas: number;
394
+ deposit: string;
395
+ };
396
+ } | {
397
+ DeployContract: {
398
+ code: string;
399
+ };
400
+ } | {
401
+ DeployGlobalContract: {
402
+ code: string;
403
+ };
404
+ } | {
405
+ DeployGlobalContractByAccountId: {
406
+ code: string;
407
+ };
408
+ } | {
409
+ Stake: {
410
+ stake: string;
411
+ public_key: string;
412
+ };
413
+ } | {
414
+ AddKey: {
415
+ public_key: string;
416
+ access_key: {
417
+ nonce: number;
418
+ permission: "FullAccess" | {
419
+ FunctionCall: {
420
+ receiver_id: string;
421
+ method_names: string[];
422
+ allowance?: string | null | undefined;
423
+ };
424
+ };
425
+ };
426
+ };
427
+ } | {
428
+ DeleteKey: {
429
+ public_key: string;
430
+ };
431
+ } | {
432
+ DeleteAccount: {
433
+ beneficiary_id: string;
434
+ };
435
+ } | {
436
+ UseGlobalContract: {
437
+ code_hash: string;
438
+ };
439
+ } | {
440
+ UseGlobalContractByAccountId: {
441
+ account_id: string;
442
+ };
443
+ } | {
444
+ Delegate: {
445
+ delegate_action: {
446
+ sender_id: string;
447
+ receiver_id: string;
448
+ actions: any[];
449
+ nonce: number;
450
+ max_block_height: number;
451
+ public_key: string;
452
+ };
453
+ signature: string;
454
+ };
455
+ } | {
456
+ DeterministicStateInit: {
457
+ deposit: string;
458
+ };
459
+ })[];
460
+ signature: string;
461
+ hash: string;
462
+ priority_fee?: number | undefined;
463
+ };
464
+ transaction_outcome: {
465
+ id: string;
466
+ outcome: {
467
+ logs: string[];
468
+ receipt_ids: string[];
469
+ gas_burnt: number;
470
+ tokens_burnt: string;
471
+ executor_id: string;
472
+ status: "Unknown" | "Pending" | {
473
+ SuccessValue: string;
474
+ } | {
475
+ SuccessReceiptId: string;
476
+ } | {
477
+ Failure: {
478
+ [x: string]: any;
479
+ error_message?: string | undefined;
480
+ error_type?: string | undefined;
481
+ };
482
+ };
483
+ metadata?: {
484
+ version: number;
485
+ gas_profile?: {
486
+ [x: string]: any;
487
+ cost?: string | undefined;
488
+ cost_category?: string | undefined;
489
+ gas_used?: string | undefined;
490
+ }[] | null | undefined;
491
+ } | undefined;
492
+ };
493
+ block_hash: string;
494
+ proof: {
495
+ hash: string;
496
+ direction: "Left" | "Right";
497
+ }[];
498
+ };
499
+ receipts_outcome: {
500
+ id: string;
501
+ outcome: {
502
+ logs: string[];
503
+ receipt_ids: string[];
504
+ gas_burnt: number;
505
+ tokens_burnt: string;
506
+ executor_id: string;
507
+ status: "Unknown" | "Pending" | {
508
+ SuccessValue: string;
509
+ } | {
510
+ SuccessReceiptId: string;
511
+ } | {
512
+ Failure: {
513
+ [x: string]: any;
514
+ error_message?: string | undefined;
515
+ error_type?: string | undefined;
516
+ };
517
+ };
518
+ metadata?: {
519
+ version: number;
520
+ gas_profile?: {
521
+ [x: string]: any;
522
+ cost?: string | undefined;
523
+ cost_category?: string | undefined;
524
+ gas_used?: string | undefined;
525
+ }[] | null | undefined;
526
+ } | undefined;
527
+ };
528
+ block_hash: string;
529
+ proof: {
530
+ hash: string;
531
+ direction: "Left" | "Right";
532
+ }[];
533
+ }[];
534
+ }>;
535
+ //# sourceMappingURL=pool_fun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool_fun.d.ts","sourceRoot":"","sources":["../../../src/fun/pool/pool_fun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAShC,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,mBAOxB;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQxB"}
@@ -0,0 +1,19 @@
1
+ import { Near } from "near-kit";
2
+ import { pool_methods_const } from "@sleet-js/staking-pool-contract-methods-const";
3
+ // ===========================================
4
+ // view
5
+ // get_number_of_accounts
6
+ // call
7
+ // ping
8
+ // ===========================================
9
+ export async function pool_get_number_of_accounts_fun(near, pool_contractId) {
10
+ const result = await near.view(pool_contractId, pool_methods_const.get_number_of_accounts);
11
+ return result;
12
+ }
13
+ // ===========================================
14
+ export async function pool_ping_fun(near, pool_contractId) {
15
+ const result = await near.call(pool_contractId, pool_methods_const.ping, { gas: "30 Tgas" });
16
+ return result;
17
+ }
18
+ // ===========================================
19
+ //# sourceMappingURL=pool_fun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool_fun.js","sourceRoot":"","sources":["../../../src/fun/pool/pool_fun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,8CAA8C;AAC9C,OAAO;AACP,yBAAyB;AACzB,OAAO;AACP,OAAO;AACP,8CAA8C;AAC9C,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,IAAU,EACV,eAAuB;IAEvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAC5B,eAAe,EACf,kBAAkB,CAAC,sBAAsB,CAC1C,CAAC;IACF,OAAO,MAAgB,CAAC;AAC1B,CAAC;AACD,8CAA8C;AAC9C,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAU,EACV,eAAuB;IAEvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAC5B,eAAe,EACf,kBAAkB,CAAC,IAAI,EACvB,EAAE,GAAG,EAAE,SAAS,EAAE,CACnB,CAAC;IACF,OAAO,MAA+B,CAAC;AACzC,CAAC;AACD,8CAA8C"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@near-kit-tool-box/fun",
3
3
  "description": "Reusable contract functions for common NEAR contracts",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "homepage": "https://sleet-js.near.page",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -35,9 +35,10 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@hot-labs/near-connect": "0.11.1",
38
- "@sleet-js/ft-methods-const": "^0.0.5",
39
- "@sleet-js/ref-exchange-methods-const": "^0.0.3",
40
- "@sleet-js/wrap-near-contract-methods-const": "^0.0.1",
38
+ "@sleet-js/ft-methods-const": "^0.0.7",
39
+ "@sleet-js/ref-exchange-methods-const": "^0.0.7",
40
+ "@sleet-js/staking-pool-contract-methods-const": "^0.0.7",
41
+ "@sleet-js/wrap-near-contract-methods-const": "^0.0.7",
41
42
  "near-kit": "^0.12.0",
42
43
  "prettier": "^3.8.1",
43
44
  "zod": "^4.3.6"