@meshsdk/contract 1.5.28

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,739 @@
1
+ import * as _meshsdk_common from '@meshsdk/common';
2
+ import { ConStr0, PubKeyAddress, Integer, CurrencySymbol, TokenName, BuiltinByteString, Value, ConStr1, Asset as Asset$1, UTxO as UTxO$1 } from '@meshsdk/common';
3
+ import { MeshTxBuilder, IFetcher, BrowserWallet, MeshWallet, UTxO, Asset } from '@meshsdk/core';
4
+
5
+ type MeshTxInitiatorInput = {
6
+ mesh: MeshTxBuilder;
7
+ fetcher?: IFetcher;
8
+ wallet?: BrowserWallet | MeshWallet;
9
+ networkId?: number;
10
+ stakeCredential?: string;
11
+ };
12
+ declare class MeshTxInitiator {
13
+ mesh: MeshTxBuilder;
14
+ fetcher?: IFetcher;
15
+ wallet?: BrowserWallet | MeshWallet;
16
+ stakeCredential?: string;
17
+ networkId: number;
18
+ constructor({ mesh, fetcher, wallet, networkId, stakeCredential, }: MeshTxInitiatorInput);
19
+ protected signSubmitReset: () => Promise<string | undefined>;
20
+ protected queryUtxos: (walletAddress: string) => Promise<UTxO[]>;
21
+ protected getWalletDappAddress: () => Promise<string | undefined>;
22
+ protected getWalletCollateral: () => Promise<UTxO | undefined>;
23
+ protected getWalletUtxosWithMinLovelace: (lovelace: number, providedUtxos?: UTxO[]) => Promise<UTxO[]>;
24
+ protected getWalletUtxosWithToken: (assetHex: string, userUtxos?: UTxO[]) => Promise<UTxO[]>;
25
+ protected getAddressUtxosWithMinLovelace: (walletAddress: string, lovelace: number, providedUtxos?: UTxO[]) => Promise<UTxO[]>;
26
+ protected getAddressUtxosWithToken: (walletAddress: string, assetHex: string, userUtxos?: UTxO[]) => Promise<UTxO[]>;
27
+ protected getWalletInfoForTx: () => Promise<{
28
+ utxos: UTxO[];
29
+ collateral: UTxO;
30
+ walletAddress: string;
31
+ }>;
32
+ protected _getUtxoByTxHash: (scriptCbor: string, txHash: string) => Promise<UTxO | undefined>;
33
+ }
34
+
35
+ declare const MeshMarketplaceBlueprint: {
36
+ preamble: {
37
+ title: string;
38
+ description: string;
39
+ version: string;
40
+ plutusVersion: string;
41
+ compiler: {
42
+ name: string;
43
+ version: string;
44
+ };
45
+ license: string;
46
+ };
47
+ validators: {
48
+ title: string;
49
+ datum: {
50
+ title: string;
51
+ schema: {
52
+ $ref: string;
53
+ };
54
+ };
55
+ redeemer: {
56
+ title: string;
57
+ schema: {
58
+ $ref: string;
59
+ };
60
+ };
61
+ parameters: {
62
+ title: string;
63
+ schema: {
64
+ $ref: string;
65
+ };
66
+ }[];
67
+ compiledCode: string;
68
+ hash: string;
69
+ }[];
70
+ definitions: {
71
+ ByteArray: {
72
+ dataType: string;
73
+ };
74
+ Int: {
75
+ dataType: string;
76
+ };
77
+ "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
78
+ title: string;
79
+ anyOf: {
80
+ title: string;
81
+ description: string;
82
+ dataType: string;
83
+ index: number;
84
+ fields: {
85
+ $ref: string;
86
+ }[];
87
+ }[];
88
+ };
89
+ "aiken/transaction/credential/Address": {
90
+ title: string;
91
+ description: string;
92
+ anyOf: {
93
+ title: string;
94
+ dataType: string;
95
+ index: number;
96
+ fields: {
97
+ title: string;
98
+ $ref: string;
99
+ }[];
100
+ }[];
101
+ };
102
+ "aiken/transaction/credential/Credential": {
103
+ title: string;
104
+ description: string;
105
+ anyOf: {
106
+ title: string;
107
+ dataType: string;
108
+ index: number;
109
+ fields: {
110
+ $ref: string;
111
+ }[];
112
+ }[];
113
+ };
114
+ "aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
115
+ title: string;
116
+ description: string;
117
+ anyOf: ({
118
+ title: string;
119
+ dataType: string;
120
+ index: number;
121
+ fields: {
122
+ $ref: string;
123
+ }[];
124
+ } | {
125
+ title: string;
126
+ dataType: string;
127
+ index: number;
128
+ fields: {
129
+ title: string;
130
+ $ref: string;
131
+ }[];
132
+ })[];
133
+ };
134
+ "marketplace/types/MarketplaceDatum": {
135
+ title: string;
136
+ anyOf: {
137
+ title: string;
138
+ dataType: string;
139
+ index: number;
140
+ fields: {
141
+ title: string;
142
+ $ref: string;
143
+ }[];
144
+ }[];
145
+ };
146
+ "marketplace/types/MarketplaceRedeemer": {
147
+ title: string;
148
+ anyOf: {
149
+ title: string;
150
+ dataType: string;
151
+ index: number;
152
+ fields: never[];
153
+ }[];
154
+ };
155
+ };
156
+ };
157
+ type MarketplaceDatum = ConStr0<[
158
+ PubKeyAddress,
159
+ Integer,
160
+ CurrencySymbol,
161
+ TokenName
162
+ ]>;
163
+ declare const marketplaceDatum: (sellerAddress: string, lovelaceFee: number, assetHex: string) => MarketplaceDatum;
164
+ declare class MeshMarketplaceContract extends MeshTxInitiator {
165
+ ownerAddress: string;
166
+ feePercentageBasisPoint: number;
167
+ scriptCbor: string;
168
+ constructor(inputs: MeshTxInitiatorInput, ownerAddress: string, feePercentageBasisPoint: number);
169
+ listAsset: (asset: string, price: number) => Promise<string>;
170
+ delistAsset: (marketplaceUtxo: UTxO) => Promise<string>;
171
+ purchaseAsset: (marketplaceUtxo: UTxO) => Promise<string>;
172
+ relistAsset: (marketplaceUtxo: UTxO, newPrice: number) => Promise<string>;
173
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
174
+ }
175
+
176
+ declare const MeshVestingBlueprint: {
177
+ preamble: {
178
+ title: string;
179
+ description: string;
180
+ version: string;
181
+ plutusVersion: string;
182
+ compiler: {
183
+ name: string;
184
+ version: string;
185
+ };
186
+ license: string;
187
+ };
188
+ validators: {
189
+ title: string;
190
+ datum: {
191
+ title: string;
192
+ schema: {
193
+ $ref: string;
194
+ };
195
+ };
196
+ redeemer: {
197
+ title: string;
198
+ schema: {
199
+ $ref: string;
200
+ };
201
+ };
202
+ compiledCode: string;
203
+ hash: string;
204
+ }[];
205
+ definitions: {
206
+ ByteArray: {
207
+ dataType: string;
208
+ };
209
+ Int: {
210
+ dataType: string;
211
+ };
212
+ "vesting/types/VestingDatum": {
213
+ title: string;
214
+ anyOf: {
215
+ title: string;
216
+ dataType: string;
217
+ index: number;
218
+ fields: {
219
+ title: string;
220
+ description: string;
221
+ $ref: string;
222
+ }[];
223
+ }[];
224
+ };
225
+ };
226
+ };
227
+ type VestingDatum = ConStr0<[
228
+ Integer,
229
+ BuiltinByteString,
230
+ BuiltinByteString
231
+ ]>;
232
+ declare class MeshVestingContract extends MeshTxInitiator {
233
+ scriptCbor: string;
234
+ constructor(inputs: MeshTxInitiatorInput);
235
+ depositFund: (amount: Asset[], lockUntilTimeStampMs: number, beneficiary: string) => Promise<string>;
236
+ withdrawFund: (vestingUtxo: UTxO) => Promise<string>;
237
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
238
+ }
239
+
240
+ declare const MeshEscrowBlueprint: {
241
+ preamble: {
242
+ title: string;
243
+ description: string;
244
+ version: string;
245
+ plutusVersion: string;
246
+ compiler: {
247
+ name: string;
248
+ version: string;
249
+ };
250
+ license: string;
251
+ };
252
+ validators: {
253
+ title: string;
254
+ datum: {
255
+ title: string;
256
+ schema: {
257
+ $ref: string;
258
+ };
259
+ };
260
+ redeemer: {
261
+ title: string;
262
+ schema: {
263
+ $ref: string;
264
+ };
265
+ };
266
+ compiledCode: string;
267
+ hash: string;
268
+ }[];
269
+ definitions: {
270
+ ByteArray: {
271
+ dataType: string;
272
+ };
273
+ Int: {
274
+ dataType: string;
275
+ };
276
+ List$Pair$ByteArray_Int: {
277
+ dataType: string;
278
+ keys: {
279
+ $ref: string;
280
+ };
281
+ values: {
282
+ $ref: string;
283
+ };
284
+ };
285
+ List$Pair$ByteArray_List$Pair$ByteArray_Int: {
286
+ dataType: string;
287
+ keys: {
288
+ $ref: string;
289
+ };
290
+ values: {
291
+ $ref: string;
292
+ };
293
+ };
294
+ "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
295
+ title: string;
296
+ anyOf: {
297
+ title: string;
298
+ description: string;
299
+ dataType: string;
300
+ index: number;
301
+ fields: {
302
+ $ref: string;
303
+ }[];
304
+ }[];
305
+ };
306
+ "aiken/transaction/credential/Address": {
307
+ title: string;
308
+ description: string;
309
+ anyOf: {
310
+ title: string;
311
+ dataType: string;
312
+ index: number;
313
+ fields: {
314
+ title: string;
315
+ $ref: string;
316
+ }[];
317
+ }[];
318
+ };
319
+ "aiken/transaction/credential/Credential": {
320
+ title: string;
321
+ description: string;
322
+ anyOf: {
323
+ title: string;
324
+ dataType: string;
325
+ index: number;
326
+ fields: {
327
+ $ref: string;
328
+ }[];
329
+ }[];
330
+ };
331
+ "aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
332
+ title: string;
333
+ description: string;
334
+ anyOf: ({
335
+ title: string;
336
+ dataType: string;
337
+ index: number;
338
+ fields: {
339
+ $ref: string;
340
+ }[];
341
+ } | {
342
+ title: string;
343
+ dataType: string;
344
+ index: number;
345
+ fields: {
346
+ title: string;
347
+ $ref: string;
348
+ }[];
349
+ })[];
350
+ };
351
+ "escrow/types/EscrowDatum": {
352
+ title: string;
353
+ anyOf: {
354
+ title: string;
355
+ dataType: string;
356
+ index: number;
357
+ fields: {
358
+ title: string;
359
+ $ref: string;
360
+ }[];
361
+ }[];
362
+ };
363
+ "escrow/types/EscrowRedeemer": {
364
+ title: string;
365
+ anyOf: {
366
+ title: string;
367
+ dataType: string;
368
+ index: number;
369
+ fields: {
370
+ title: string;
371
+ $ref: string;
372
+ }[];
373
+ }[];
374
+ };
375
+ };
376
+ };
377
+ type InitiationDatum = ConStr0<[PubKeyAddress, Value]>;
378
+ declare const initiateEscrowDatum: (walletAddress: string, amount: Asset[]) => InitiationDatum;
379
+ type ActiveEscrowDatum = ConStr1<[
380
+ PubKeyAddress,
381
+ Value,
382
+ PubKeyAddress,
383
+ Value
384
+ ]>;
385
+ declare const activeEscrowDatum: (initiationDatum: InitiationDatum, walletAddress: string, amount: Asset[]) => ActiveEscrowDatum;
386
+ type RecipientDepositRedeemer = ConStr0<[PubKeyAddress, Value]>;
387
+ declare const recipientDepositRedeemer: (recipient: string, depositAmount: Asset[]) => InitiationDatum;
388
+ declare class MeshEscrowContract extends MeshTxInitiator {
389
+ scriptCbor: string;
390
+ constructor(inputs: MeshTxInitiatorInput);
391
+ initiateEscrow: (escrowAmount: Asset[]) => Promise<string>;
392
+ cancelEscrow: (escrowUtxo: UTxO) => Promise<string>;
393
+ recipientDeposit: (escrowUtxo: UTxO, depositAmount: Asset[]) => Promise<string>;
394
+ completeEscrow: (escrowUtxo: UTxO) => Promise<string>;
395
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
396
+ }
397
+
398
+ declare const MeshGiftCardBlueprint: {
399
+ preamble: {
400
+ title: string;
401
+ description: string;
402
+ version: string;
403
+ plutusVersion: string;
404
+ compiler: {
405
+ name: string;
406
+ version: string;
407
+ };
408
+ license: string;
409
+ };
410
+ validators: ({
411
+ title: string;
412
+ redeemer: {
413
+ title: string;
414
+ schema: {
415
+ $ref: string;
416
+ };
417
+ };
418
+ parameters: {
419
+ title: string;
420
+ schema: {
421
+ $ref: string;
422
+ };
423
+ }[];
424
+ compiledCode: string;
425
+ hash: string;
426
+ datum?: undefined;
427
+ } | {
428
+ title: string;
429
+ datum: {
430
+ title: string;
431
+ schema: {
432
+ $ref: string;
433
+ };
434
+ };
435
+ redeemer: {
436
+ title: string;
437
+ schema: {
438
+ $ref: string;
439
+ };
440
+ };
441
+ parameters: {
442
+ title: string;
443
+ schema: {
444
+ $ref: string;
445
+ };
446
+ }[];
447
+ compiledCode: string;
448
+ hash: string;
449
+ })[];
450
+ definitions: {
451
+ ByteArray: {
452
+ dataType: string;
453
+ };
454
+ Data: {
455
+ title: string;
456
+ description: string;
457
+ };
458
+ Int: {
459
+ dataType: string;
460
+ };
461
+ "aiken/transaction/OutputReference": {
462
+ title: string;
463
+ description: string;
464
+ anyOf: {
465
+ title: string;
466
+ dataType: string;
467
+ index: number;
468
+ fields: {
469
+ title: string;
470
+ $ref: string;
471
+ }[];
472
+ }[];
473
+ };
474
+ "aiken/transaction/TransactionId": {
475
+ title: string;
476
+ description: string;
477
+ anyOf: {
478
+ title: string;
479
+ dataType: string;
480
+ index: number;
481
+ fields: {
482
+ title: string;
483
+ $ref: string;
484
+ }[];
485
+ }[];
486
+ };
487
+ "oneshot/Action": {
488
+ title: string;
489
+ anyOf: {
490
+ title: string;
491
+ dataType: string;
492
+ index: number;
493
+ fields: never[];
494
+ }[];
495
+ };
496
+ };
497
+ };
498
+ declare class MeshGiftCardContract extends MeshTxInitiator {
499
+ tokenNameHex: string;
500
+ paramUtxo: UTxO["input"];
501
+ giftCardCbor: (tokenNameHex: string, utxoTxHash: string, utxoTxId: number) => string;
502
+ redeemCbor: (tokenNameHex: string, policyId: string) => string;
503
+ constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO["input"]);
504
+ createGiftCard: (tokenName: string, giftValue: Asset[]) => Promise<string>;
505
+ redeemGiftCard: (giftCardUtxo: UTxO) => Promise<string>;
506
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
507
+ private getScripts;
508
+ }
509
+
510
+ declare const MeshPaymentSplitterBlueprint: {
511
+ preamble: {
512
+ title: string;
513
+ description: string;
514
+ version: string;
515
+ plutusVersion: string;
516
+ compiler: {
517
+ name: string;
518
+ version: string;
519
+ };
520
+ license: string;
521
+ };
522
+ validators: {
523
+ title: string;
524
+ datum: {
525
+ title: string;
526
+ schema: {
527
+ $ref: string;
528
+ };
529
+ };
530
+ redeemer: {
531
+ title: string;
532
+ schema: {
533
+ $ref: string;
534
+ };
535
+ };
536
+ parameters: {
537
+ title: string;
538
+ schema: {
539
+ $ref: string;
540
+ };
541
+ }[];
542
+ compiledCode: string;
543
+ hash: string;
544
+ }[];
545
+ definitions: {
546
+ ByteArray: {
547
+ dataType: string;
548
+ };
549
+ List$ByteArray: {
550
+ dataType: string;
551
+ items: {
552
+ $ref: string;
553
+ };
554
+ };
555
+ "payment_splitter/Datum": {
556
+ title: string;
557
+ anyOf: {
558
+ title: string;
559
+ dataType: string;
560
+ index: number;
561
+ fields: {
562
+ title: string;
563
+ $ref: string;
564
+ }[];
565
+ }[];
566
+ };
567
+ "payment_splitter/Redeemer": {
568
+ title: string;
569
+ anyOf: {
570
+ title: string;
571
+ dataType: string;
572
+ index: number;
573
+ fields: {
574
+ title: string;
575
+ $ref: string;
576
+ }[];
577
+ }[];
578
+ };
579
+ };
580
+ };
581
+ declare class MeshPaymentSplitterContract extends MeshTxInitiator {
582
+ wrapPayees: (payees: string[]) => _meshsdk_common.List<_meshsdk_common.BuiltinByteString>;
583
+ scriptCbor: () => string;
584
+ payees: string[];
585
+ constructor(inputs: MeshTxInitiatorInput, payees: string[]);
586
+ sendLovelaceToSplitter: (lovelaceAmount: number) => Promise<string>;
587
+ triggerPayout: () => Promise<string>;
588
+ }
589
+
590
+ declare const MeshSwapBlueprint: {
591
+ preamble: {
592
+ title: string;
593
+ description: string;
594
+ version: string;
595
+ plutusVersion: string;
596
+ compiler: {
597
+ name: string;
598
+ version: string;
599
+ };
600
+ license: string;
601
+ };
602
+ validators: {
603
+ title: string;
604
+ datum: {
605
+ title: string;
606
+ schema: {
607
+ $ref: string;
608
+ };
609
+ };
610
+ redeemer: {
611
+ title: string;
612
+ schema: {
613
+ $ref: string;
614
+ };
615
+ };
616
+ compiledCode: string;
617
+ hash: string;
618
+ }[];
619
+ definitions: {
620
+ ByteArray: {
621
+ dataType: string;
622
+ };
623
+ Int: {
624
+ dataType: string;
625
+ };
626
+ "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
627
+ title: string;
628
+ anyOf: {
629
+ title: string;
630
+ description: string;
631
+ dataType: string;
632
+ index: number;
633
+ fields: {
634
+ $ref: string;
635
+ }[];
636
+ }[];
637
+ };
638
+ "aiken/dict/Dict$ByteArray_Int": {
639
+ title: string;
640
+ description: string;
641
+ dataType: string;
642
+ keys: {
643
+ $ref: string;
644
+ };
645
+ values: {
646
+ $ref: string;
647
+ };
648
+ };
649
+ "aiken/transaction/credential/Address": {
650
+ title: string;
651
+ description: string;
652
+ anyOf: {
653
+ title: string;
654
+ dataType: string;
655
+ index: number;
656
+ fields: {
657
+ title: string;
658
+ $ref: string;
659
+ }[];
660
+ }[];
661
+ };
662
+ "aiken/transaction/credential/Credential": {
663
+ title: string;
664
+ description: string;
665
+ anyOf: {
666
+ title: string;
667
+ dataType: string;
668
+ index: number;
669
+ fields: {
670
+ $ref: string;
671
+ }[];
672
+ }[];
673
+ };
674
+ "aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
675
+ title: string;
676
+ description: string;
677
+ anyOf: ({
678
+ title: string;
679
+ dataType: string;
680
+ index: number;
681
+ fields: {
682
+ $ref: string;
683
+ }[];
684
+ } | {
685
+ title: string;
686
+ dataType: string;
687
+ index: number;
688
+ fields: {
689
+ title: string;
690
+ $ref: string;
691
+ }[];
692
+ })[];
693
+ };
694
+ "aiken/transaction/value/Value": {
695
+ title: string;
696
+ description: string;
697
+ dataType: string;
698
+ keys: {
699
+ $ref: string;
700
+ };
701
+ values: {
702
+ $ref: string;
703
+ };
704
+ };
705
+ "swap/SwapDatum": {
706
+ title: string;
707
+ anyOf: {
708
+ title: string;
709
+ dataType: string;
710
+ index: number;
711
+ fields: {
712
+ title: string;
713
+ $ref: string;
714
+ }[];
715
+ }[];
716
+ };
717
+ "swap/SwapRedeemer": {
718
+ title: string;
719
+ anyOf: {
720
+ title: string;
721
+ dataType: string;
722
+ index: number;
723
+ fields: never[];
724
+ }[];
725
+ };
726
+ };
727
+ };
728
+ type SwapDatum = ConStr0<[PubKeyAddress, Value, Value]>;
729
+ declare class MeshSwapContract extends MeshTxInitiator {
730
+ scriptCbor: string;
731
+ scriptAddress: string;
732
+ constructor(inputs: MeshTxInitiatorInput);
733
+ initiateSwap: (toProvide: Asset$1[], toReceive: Asset$1[]) => Promise<string>;
734
+ acceptSwap: (swapUtxo: UTxO$1) => Promise<string>;
735
+ cancelSwap: (swapUtxo: UTxO$1) => Promise<string>;
736
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO$1 | undefined>;
737
+ }
738
+
739
+ export { type ActiveEscrowDatum, type InitiationDatum, type MarketplaceDatum, MeshEscrowBlueprint, MeshEscrowContract, MeshGiftCardBlueprint, MeshGiftCardContract, MeshMarketplaceBlueprint, MeshMarketplaceContract, MeshPaymentSplitterBlueprint, MeshPaymentSplitterContract, MeshSwapBlueprint, MeshSwapContract, MeshVestingBlueprint, MeshVestingContract, type RecipientDepositRedeemer, type SwapDatum, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };