@meshsdk/contract 1.6.13 → 1.7.1

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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
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';
2
+ import { ConStr0, PubKeyAddress, Value, ConStr1, Integer as Integer$1, CurrencySymbol, TokenName, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1 } from '@meshsdk/common';
3
+ import { MeshTxBuilder, IFetcher, BrowserWallet, MeshWallet, UTxO, Asset, ConStr0 as ConStr0$1, Integer, BuiltinByteString } from '@meshsdk/core';
4
4
 
5
5
  type MeshTxInitiatorInput = {
6
6
  mesh: MeshTxBuilder;
@@ -32,7 +32,7 @@ declare class MeshTxInitiator {
32
32
  protected _getUtxoByTxHash: (txHash: string, scriptCbor?: string) => Promise<UTxO | undefined>;
33
33
  }
34
34
 
35
- declare const MeshMarketplaceBlueprint: {
35
+ declare const MeshEscrowBlueprint: {
36
36
  preamble: {
37
37
  title: string;
38
38
  description: string;
@@ -58,12 +58,6 @@ declare const MeshMarketplaceBlueprint: {
58
58
  $ref: string;
59
59
  };
60
60
  };
61
- parameters: {
62
- title: string;
63
- schema: {
64
- $ref: string;
65
- };
66
- }[];
67
61
  compiledCode: string;
68
62
  hash: string;
69
63
  }[];
@@ -74,6 +68,24 @@ declare const MeshMarketplaceBlueprint: {
74
68
  Int: {
75
69
  dataType: string;
76
70
  };
71
+ List$Pair$ByteArray_Int: {
72
+ dataType: string;
73
+ keys: {
74
+ $ref: string;
75
+ };
76
+ values: {
77
+ $ref: string;
78
+ };
79
+ };
80
+ List$Pair$ByteArray_List$Pair$ByteArray_Int: {
81
+ dataType: string;
82
+ keys: {
83
+ $ref: string;
84
+ };
85
+ values: {
86
+ $ref: string;
87
+ };
88
+ };
77
89
  "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
78
90
  title: string;
79
91
  anyOf: {
@@ -131,7 +143,7 @@ declare const MeshMarketplaceBlueprint: {
131
143
  }[];
132
144
  })[];
133
145
  };
134
- "marketplace/types/MarketplaceDatum": {
146
+ "escrow/types/EscrowDatum": {
135
147
  title: string;
136
148
  anyOf: {
137
149
  title: string;
@@ -143,37 +155,42 @@ declare const MeshMarketplaceBlueprint: {
143
155
  }[];
144
156
  }[];
145
157
  };
146
- "marketplace/types/MarketplaceRedeemer": {
158
+ "escrow/types/EscrowRedeemer": {
147
159
  title: string;
148
160
  anyOf: {
149
161
  title: string;
150
162
  dataType: string;
151
163
  index: number;
152
- fields: never[];
164
+ fields: {
165
+ title: string;
166
+ $ref: string;
167
+ }[];
153
168
  }[];
154
169
  };
155
170
  };
156
171
  };
157
- type MarketplaceDatum = ConStr0<[
172
+ type InitiationDatum = ConStr0<[PubKeyAddress, Value]>;
173
+ declare const initiateEscrowDatum: (walletAddress: string, amount: Asset[]) => InitiationDatum;
174
+ type ActiveEscrowDatum = ConStr1<[
158
175
  PubKeyAddress,
159
- Integer,
160
- CurrencySymbol,
161
- TokenName
176
+ Value,
177
+ PubKeyAddress,
178
+ Value
162
179
  ]>;
163
- declare const marketplaceDatum: (sellerAddress: string, lovelaceFee: number, assetHex: string) => MarketplaceDatum;
164
- declare class MeshMarketplaceContract extends MeshTxInitiator {
165
- ownerAddress: string;
166
- feePercentageBasisPoint: number;
180
+ declare const activeEscrowDatum: (initiationDatum: InitiationDatum, walletAddress: string, amount: Asset[]) => ActiveEscrowDatum;
181
+ type RecipientDepositRedeemer = ConStr0<[PubKeyAddress, Value]>;
182
+ declare const recipientDepositRedeemer: (recipient: string, depositAmount: Asset[]) => InitiationDatum;
183
+ declare class MeshEscrowContract extends MeshTxInitiator {
167
184
  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>;
185
+ constructor(inputs: MeshTxInitiatorInput);
186
+ initiateEscrow: (escrowAmount: Asset[]) => Promise<string>;
187
+ cancelEscrow: (escrowUtxo: UTxO) => Promise<string>;
188
+ recipientDeposit: (escrowUtxo: UTxO, depositAmount: Asset[]) => Promise<string>;
189
+ completeEscrow: (escrowUtxo: UTxO) => Promise<string>;
173
190
  getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
174
191
  }
175
192
 
176
- declare const MeshVestingBlueprint: {
193
+ declare const MeshGiftCardBlueprint: {
177
194
  preamble: {
178
195
  title: string;
179
196
  description: string;
@@ -185,7 +202,24 @@ declare const MeshVestingBlueprint: {
185
202
  };
186
203
  license: string;
187
204
  };
188
- validators: {
205
+ validators: ({
206
+ title: string;
207
+ redeemer: {
208
+ title: string;
209
+ schema: {
210
+ $ref: string;
211
+ };
212
+ };
213
+ parameters: {
214
+ title: string;
215
+ schema: {
216
+ $ref: string;
217
+ };
218
+ }[];
219
+ compiledCode: string;
220
+ hash: string;
221
+ datum?: undefined;
222
+ } | {
189
223
  title: string;
190
224
  datum: {
191
225
  title: string;
@@ -199,9 +233,15 @@ declare const MeshVestingBlueprint: {
199
233
  $ref: string;
200
234
  };
201
235
  };
236
+ parameters: {
237
+ title: string;
238
+ schema: {
239
+ $ref: string;
240
+ };
241
+ }[];
202
242
  compiledCode: string;
203
243
  hash: string;
204
- }[];
244
+ })[];
205
245
  definitions: {
206
246
  ByteArray: {
207
247
  dataType: string;
@@ -213,35 +253,60 @@ declare const MeshVestingBlueprint: {
213
253
  Int: {
214
254
  dataType: string;
215
255
  };
216
- "vesting/types/VestingDatum": {
256
+ "aiken/transaction/OutputReference": {
217
257
  title: string;
258
+ description: string;
259
+ anyOf: {
260
+ title: string;
261
+ dataType: string;
262
+ index: number;
263
+ fields: {
264
+ title: string;
265
+ $ref: string;
266
+ }[];
267
+ }[];
268
+ };
269
+ "aiken/transaction/TransactionId": {
270
+ title: string;
271
+ description: string;
218
272
  anyOf: {
219
273
  title: string;
220
274
  dataType: string;
221
275
  index: number;
222
276
  fields: {
223
277
  title: string;
224
- description: string;
225
278
  $ref: string;
226
279
  }[];
227
280
  }[];
228
281
  };
282
+ "oneshot/Action": {
283
+ title: string;
284
+ anyOf: {
285
+ title: string;
286
+ dataType: string;
287
+ index: number;
288
+ fields: never[];
289
+ }[];
290
+ };
229
291
  };
230
292
  };
231
- type VestingDatum = ConStr0<[
293
+ declare class MeshGiftCardContract extends MeshTxInitiator {
294
+ tokenNameHex: string;
295
+ paramUtxo: UTxO["input"];
296
+ giftCardCbor: (tokenNameHex: string, utxoTxHash: string, utxoTxId: number) => string;
297
+ redeemCbor: (tokenNameHex: string, policyId: string) => string;
298
+ constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO["input"]);
299
+ createGiftCard: (tokenName: string, giftValue: Asset[]) => Promise<string>;
300
+ redeemGiftCard: (giftCardUtxo: UTxO) => Promise<string>;
301
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
302
+ }
303
+
304
+ type HelloWorldDatum = ConStr0$1<[
232
305
  Integer,
233
306
  BuiltinByteString,
234
307
  BuiltinByteString
235
308
  ]>;
236
- declare class MeshVestingContract extends MeshTxInitiator {
237
- scriptCbor: string;
238
- constructor(inputs: MeshTxInitiatorInput);
239
- depositFund: (amount: Asset[], lockUntilTimeStampMs: number, beneficiary: string) => Promise<string>;
240
- withdrawFund: (vestingUtxo: UTxO) => Promise<string>;
241
- getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
242
- }
243
-
244
- declare const MeshEscrowBlueprint: {
309
+ declare const MeshHelloWorldBlueprint: {
245
310
  preamble: {
246
311
  title: string;
247
312
  description: string;
@@ -274,85 +339,7 @@ declare const MeshEscrowBlueprint: {
274
339
  ByteArray: {
275
340
  dataType: string;
276
341
  };
277
- Int: {
278
- dataType: string;
279
- };
280
- List$Pair$ByteArray_Int: {
281
- dataType: string;
282
- keys: {
283
- $ref: string;
284
- };
285
- values: {
286
- $ref: string;
287
- };
288
- };
289
- List$Pair$ByteArray_List$Pair$ByteArray_Int: {
290
- dataType: string;
291
- keys: {
292
- $ref: string;
293
- };
294
- values: {
295
- $ref: string;
296
- };
297
- };
298
- "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
299
- title: string;
300
- anyOf: {
301
- title: string;
302
- description: string;
303
- dataType: string;
304
- index: number;
305
- fields: {
306
- $ref: string;
307
- }[];
308
- }[];
309
- };
310
- "aiken/transaction/credential/Address": {
311
- title: string;
312
- description: string;
313
- anyOf: {
314
- title: string;
315
- dataType: string;
316
- index: number;
317
- fields: {
318
- title: string;
319
- $ref: string;
320
- }[];
321
- }[];
322
- };
323
- "aiken/transaction/credential/Credential": {
324
- title: string;
325
- description: string;
326
- anyOf: {
327
- title: string;
328
- dataType: string;
329
- index: number;
330
- fields: {
331
- $ref: string;
332
- }[];
333
- }[];
334
- };
335
- "aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
336
- title: string;
337
- description: string;
338
- anyOf: ({
339
- title: string;
340
- dataType: string;
341
- index: number;
342
- fields: {
343
- $ref: string;
344
- }[];
345
- } | {
346
- title: string;
347
- dataType: string;
348
- index: number;
349
- fields: {
350
- title: string;
351
- $ref: string;
352
- }[];
353
- })[];
354
- };
355
- "escrow/types/EscrowDatum": {
342
+ "hello_world/Datum": {
356
343
  title: string;
357
344
  anyOf: {
358
345
  title: string;
@@ -364,7 +351,7 @@ declare const MeshEscrowBlueprint: {
364
351
  }[];
365
352
  }[];
366
353
  };
367
- "escrow/types/EscrowRedeemer": {
354
+ "hello_world/Redeemer": {
368
355
  title: string;
369
356
  anyOf: {
370
357
  title: string;
@@ -378,28 +365,18 @@ declare const MeshEscrowBlueprint: {
378
365
  };
379
366
  };
380
367
  };
381
- type InitiationDatum = ConStr0<[PubKeyAddress, Value]>;
382
- declare const initiateEscrowDatum: (walletAddress: string, amount: Asset[]) => InitiationDatum;
383
- type ActiveEscrowDatum = ConStr1<[
384
- PubKeyAddress,
385
- Value,
386
- PubKeyAddress,
387
- Value
388
- ]>;
389
- declare const activeEscrowDatum: (initiationDatum: InitiationDatum, walletAddress: string, amount: Asset[]) => ActiveEscrowDatum;
390
- type RecipientDepositRedeemer = ConStr0<[PubKeyAddress, Value]>;
391
- declare const recipientDepositRedeemer: (recipient: string, depositAmount: Asset[]) => InitiationDatum;
392
- declare class MeshEscrowContract extends MeshTxInitiator {
368
+ declare class MeshHelloWorldContract extends MeshTxInitiator {
393
369
  scriptCbor: string;
394
370
  constructor(inputs: MeshTxInitiatorInput);
395
- initiateEscrow: (escrowAmount: Asset[]) => Promise<string>;
396
- cancelEscrow: (escrowUtxo: UTxO) => Promise<string>;
397
- recipientDeposit: (escrowUtxo: UTxO, depositAmount: Asset[]) => Promise<string>;
398
- completeEscrow: (escrowUtxo: UTxO) => Promise<string>;
371
+ getScript: () => {
372
+ scriptAddr: string;
373
+ };
374
+ lockAsset: (assets: Asset[]) => Promise<string>;
375
+ unlockAsset: (scriptUtxo: UTxO, message: string) => Promise<string>;
399
376
  getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
400
377
  }
401
378
 
402
- declare const MeshGiftCardBlueprint: {
379
+ declare const MeshMarketplaceBlueprint: {
403
380
  preamble: {
404
381
  title: string;
405
382
  description: string;
@@ -411,24 +388,7 @@ declare const MeshGiftCardBlueprint: {
411
388
  };
412
389
  license: string;
413
390
  };
414
- validators: ({
415
- title: string;
416
- redeemer: {
417
- title: string;
418
- schema: {
419
- $ref: string;
420
- };
421
- };
422
- parameters: {
423
- title: string;
424
- schema: {
425
- $ref: string;
426
- };
427
- }[];
428
- compiledCode: string;
429
- hash: string;
430
- datum?: undefined;
431
- } | {
391
+ validators: {
432
392
  title: string;
433
393
  datum: {
434
394
  title: string;
@@ -450,19 +410,27 @@ declare const MeshGiftCardBlueprint: {
450
410
  }[];
451
411
  compiledCode: string;
452
412
  hash: string;
453
- })[];
413
+ }[];
454
414
  definitions: {
455
415
  ByteArray: {
456
416
  dataType: string;
457
417
  };
458
- Data: {
459
- title: string;
460
- description: string;
461
- };
462
418
  Int: {
463
419
  dataType: string;
464
420
  };
465
- "aiken/transaction/OutputReference": {
421
+ "Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
422
+ title: string;
423
+ anyOf: {
424
+ title: string;
425
+ description: string;
426
+ dataType: string;
427
+ index: number;
428
+ fields: {
429
+ $ref: string;
430
+ }[];
431
+ }[];
432
+ };
433
+ "aiken/transaction/credential/Address": {
466
434
  title: string;
467
435
  description: string;
468
436
  anyOf: {
@@ -475,9 +443,40 @@ declare const MeshGiftCardBlueprint: {
475
443
  }[];
476
444
  }[];
477
445
  };
478
- "aiken/transaction/TransactionId": {
446
+ "aiken/transaction/credential/Credential": {
479
447
  title: string;
480
448
  description: string;
449
+ anyOf: {
450
+ title: string;
451
+ dataType: string;
452
+ index: number;
453
+ fields: {
454
+ $ref: string;
455
+ }[];
456
+ }[];
457
+ };
458
+ "aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
459
+ title: string;
460
+ description: string;
461
+ anyOf: ({
462
+ title: string;
463
+ dataType: string;
464
+ index: number;
465
+ fields: {
466
+ $ref: string;
467
+ }[];
468
+ } | {
469
+ title: string;
470
+ dataType: string;
471
+ index: number;
472
+ fields: {
473
+ title: string;
474
+ $ref: string;
475
+ }[];
476
+ })[];
477
+ };
478
+ "marketplace/types/MarketplaceDatum": {
479
+ title: string;
481
480
  anyOf: {
482
481
  title: string;
483
482
  dataType: string;
@@ -488,7 +487,7 @@ declare const MeshGiftCardBlueprint: {
488
487
  }[];
489
488
  }[];
490
489
  };
491
- "oneshot/Action": {
490
+ "marketplace/types/MarketplaceRedeemer": {
492
491
  title: string;
493
492
  anyOf: {
494
493
  title: string;
@@ -499,14 +498,22 @@ declare const MeshGiftCardBlueprint: {
499
498
  };
500
499
  };
501
500
  };
502
- declare class MeshGiftCardContract extends MeshTxInitiator {
503
- tokenNameHex: string;
504
- paramUtxo: UTxO["input"];
505
- giftCardCbor: (tokenNameHex: string, utxoTxHash: string, utxoTxId: number) => string;
506
- redeemCbor: (tokenNameHex: string, policyId: string) => string;
507
- constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO["input"]);
508
- createGiftCard: (tokenName: string, giftValue: Asset[]) => Promise<string>;
509
- redeemGiftCard: (giftCardUtxo: UTxO) => Promise<string>;
501
+ type MarketplaceDatum = ConStr0<[
502
+ PubKeyAddress,
503
+ Integer$1,
504
+ CurrencySymbol,
505
+ TokenName
506
+ ]>;
507
+ declare const marketplaceDatum: (sellerAddress: string, lovelaceFee: number, assetHex: string) => MarketplaceDatum;
508
+ declare class MeshMarketplaceContract extends MeshTxInitiator {
509
+ ownerAddress: string;
510
+ feePercentageBasisPoint: number;
511
+ scriptCbor: string;
512
+ constructor(inputs: MeshTxInitiatorInput, ownerAddress: string, feePercentageBasisPoint: number);
513
+ listAsset: (asset: string, price: number) => Promise<string>;
514
+ delistAsset: (marketplaceUtxo: UTxO) => Promise<string>;
515
+ purchaseAsset: (marketplaceUtxo: UTxO) => Promise<string>;
516
+ relistAsset: (marketplaceUtxo: UTxO, newPrice: number) => Promise<string>;
510
517
  getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
511
518
  }
512
519
 
@@ -735,4 +742,72 @@ declare class MeshSwapContract extends MeshTxInitiator {
735
742
  getUtxoByTxHash: (txHash: string) => Promise<UTxO$1 | undefined>;
736
743
  }
737
744
 
738
- 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 };
745
+ declare const MeshVestingBlueprint: {
746
+ preamble: {
747
+ title: string;
748
+ description: string;
749
+ version: string;
750
+ plutusVersion: string;
751
+ compiler: {
752
+ name: string;
753
+ version: string;
754
+ };
755
+ license: string;
756
+ };
757
+ validators: {
758
+ title: string;
759
+ datum: {
760
+ title: string;
761
+ schema: {
762
+ $ref: string;
763
+ };
764
+ };
765
+ redeemer: {
766
+ title: string;
767
+ schema: {
768
+ $ref: string;
769
+ };
770
+ };
771
+ compiledCode: string;
772
+ hash: string;
773
+ }[];
774
+ definitions: {
775
+ ByteArray: {
776
+ dataType: string;
777
+ };
778
+ Data: {
779
+ title: string;
780
+ description: string;
781
+ };
782
+ Int: {
783
+ dataType: string;
784
+ };
785
+ "vesting/types/VestingDatum": {
786
+ title: string;
787
+ anyOf: {
788
+ title: string;
789
+ dataType: string;
790
+ index: number;
791
+ fields: {
792
+ title: string;
793
+ description: string;
794
+ $ref: string;
795
+ }[];
796
+ }[];
797
+ };
798
+ };
799
+ };
800
+ type VestingDatum = ConStr0<[
801
+ Integer$1,
802
+ BuiltinByteString$1,
803
+ BuiltinByteString$1
804
+ ]>;
805
+ declare class MeshVestingContract extends MeshTxInitiator {
806
+ scriptCbor: string;
807
+ constructor(inputs: MeshTxInitiatorInput);
808
+ depositFund: (amount: Asset[], lockUntilTimeStampMs: number, beneficiary: string) => Promise<string>;
809
+ withdrawFund: (vestingUtxo: UTxO) => Promise<string>;
810
+ getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
811
+ }
812
+
813
+ export { type ActiveEscrowDatum, type HelloWorldDatum, type InitiationDatum, type MarketplaceDatum, MeshEscrowBlueprint, MeshEscrowContract, MeshGiftCardBlueprint, MeshGiftCardContract, MeshHelloWorldBlueprint, MeshHelloWorldContract, MeshMarketplaceBlueprint, MeshMarketplaceContract, MeshPaymentSplitterBlueprint, MeshPaymentSplitterContract, MeshSwapBlueprint, MeshSwapContract, MeshVestingBlueprint, MeshVestingContract, type RecipientDepositRedeemer, type SwapDatum, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };