@meshsdk/contract 1.7.9 → 1.7.10
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.cjs +3904 -1091
- package/dist/index.d.cts +224 -529
- package/dist/index.d.ts +224 -529
- package/dist/index.js +3983 -1140
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _meshsdk_common from '@meshsdk/common';
|
|
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, LanguageVersion, UTxO,
|
|
2
|
+
import { ConStr0 as ConStr0$1, PubKeyAddress, Value, ConStr1, Integer as Integer$1, CurrencySymbol, TokenName, AssetMetadata, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1 } from '@meshsdk/common';
|
|
3
|
+
import { MeshTxBuilder, IFetcher, BrowserWallet, MeshWallet, LanguageVersion, UTxO, ConStr0, BuiltinByteString, ScriptAddress, Integer, NativeScript, Data, Asset } from '@meshsdk/core';
|
|
4
4
|
|
|
5
5
|
type MeshTxInitiatorInput = {
|
|
6
6
|
mesh: MeshTxBuilder;
|
|
@@ -19,6 +19,7 @@ declare class MeshTxInitiator {
|
|
|
19
19
|
version: number;
|
|
20
20
|
languageVersion: LanguageVersion;
|
|
21
21
|
constructor({ mesh, fetcher, wallet, networkId, stakeCredential, version, }: MeshTxInitiatorInput);
|
|
22
|
+
getScriptAddress: (scriptCbor: string) => string;
|
|
22
23
|
protected signSubmitReset: () => Promise<string | undefined>;
|
|
23
24
|
protected queryUtxos: (walletAddress: string) => Promise<UTxO[]>;
|
|
24
25
|
protected getWalletDappAddress: () => Promise<string | undefined>;
|
|
@@ -35,144 +36,141 @@ declare class MeshTxInitiator {
|
|
|
35
36
|
protected _getUtxoByTxHash: (txHash: string, scriptCbor?: string) => Promise<UTxO | undefined>;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
type ScriptIndex = "OracleNFT" | "OracleValidator" | "ContentRegistry" | "ContentRefToken" | "OwnershipRegistry" | "OwnershipRefToken";
|
|
40
|
+
|
|
41
|
+
type OracleDatum = ConStr0<[
|
|
42
|
+
BuiltinByteString,
|
|
43
|
+
ScriptAddress,
|
|
44
|
+
BuiltinByteString,
|
|
45
|
+
ScriptAddress,
|
|
46
|
+
Integer,
|
|
47
|
+
BuiltinByteString,
|
|
48
|
+
ScriptAddress,
|
|
49
|
+
Integer,
|
|
50
|
+
BuiltinByteString,
|
|
51
|
+
BuiltinByteString
|
|
52
|
+
]>;
|
|
53
|
+
type UpdateContent = {
|
|
54
|
+
ownerTokenUtxo: UTxO;
|
|
55
|
+
registryNumber: number;
|
|
56
|
+
newContentHashHex: string;
|
|
57
|
+
contentNumber: number;
|
|
58
|
+
};
|
|
59
|
+
type TransferContent = {
|
|
60
|
+
ownerTokenUtxo: UTxO;
|
|
61
|
+
registryNumber: number;
|
|
62
|
+
newOwnerAssetHex: string;
|
|
63
|
+
contentNumber: number;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare class MeshContentOwnershipContract extends MeshTxInitiator {
|
|
67
|
+
paramUtxo: {
|
|
68
|
+
txHash: string;
|
|
69
|
+
outputIndex: number;
|
|
49
70
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
scriptInfo: {
|
|
72
|
+
oracleNFT: {
|
|
73
|
+
hash: string;
|
|
74
|
+
cbor: string;
|
|
75
|
+
};
|
|
76
|
+
oracleValidator: {
|
|
77
|
+
hash: string;
|
|
78
|
+
cbor: string;
|
|
79
|
+
address: string;
|
|
80
|
+
};
|
|
81
|
+
contentRegistry: {
|
|
82
|
+
hash: string;
|
|
83
|
+
cbor: string;
|
|
84
|
+
address: string;
|
|
85
|
+
};
|
|
86
|
+
contentRefToken: {
|
|
87
|
+
hash: string;
|
|
88
|
+
cbor: string;
|
|
89
|
+
};
|
|
90
|
+
ownershipRegistry: {
|
|
91
|
+
hash: string;
|
|
92
|
+
cbor: string;
|
|
93
|
+
address: string;
|
|
94
|
+
};
|
|
95
|
+
ownershipRefToken: {
|
|
96
|
+
hash: string;
|
|
97
|
+
cbor: string;
|
|
57
98
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
compiledCode: string;
|
|
65
|
-
hash: string;
|
|
66
|
-
}[];
|
|
67
|
-
definitions: {
|
|
68
|
-
ByteArray: {
|
|
69
|
-
dataType: string;
|
|
70
|
-
};
|
|
71
|
-
Int: {
|
|
72
|
-
dataType: string;
|
|
73
|
-
};
|
|
74
|
-
List$Pair$ByteArray_Int: {
|
|
75
|
-
dataType: string;
|
|
76
|
-
keys: {
|
|
77
|
-
$ref: string;
|
|
78
|
-
};
|
|
79
|
-
values: {
|
|
80
|
-
$ref: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
List$Pair$ByteArray_List$Pair$ByteArray_Int: {
|
|
84
|
-
dataType: string;
|
|
85
|
-
keys: {
|
|
86
|
-
$ref: string;
|
|
87
|
-
};
|
|
88
|
-
values: {
|
|
89
|
-
$ref: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
"Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
|
|
93
|
-
title: string;
|
|
94
|
-
anyOf: {
|
|
95
|
-
title: string;
|
|
96
|
-
description: string;
|
|
97
|
-
dataType: string;
|
|
98
|
-
index: number;
|
|
99
|
-
fields: {
|
|
100
|
-
$ref: string;
|
|
101
|
-
}[];
|
|
102
|
-
}[];
|
|
99
|
+
};
|
|
100
|
+
refScriptUtxos: {
|
|
101
|
+
contentRefToken: {
|
|
102
|
+
txHash: string;
|
|
103
|
+
outputIndex: number;
|
|
103
104
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
anyOf: {
|
|
108
|
-
title: string;
|
|
109
|
-
dataType: string;
|
|
110
|
-
index: number;
|
|
111
|
-
fields: {
|
|
112
|
-
title: string;
|
|
113
|
-
$ref: string;
|
|
114
|
-
}[];
|
|
115
|
-
}[];
|
|
105
|
+
ownershipRefToken: {
|
|
106
|
+
txHash: string;
|
|
107
|
+
outputIndex: number;
|
|
116
108
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
anyOf: {
|
|
121
|
-
title: string;
|
|
122
|
-
dataType: string;
|
|
123
|
-
index: number;
|
|
124
|
-
fields: {
|
|
125
|
-
$ref: string;
|
|
126
|
-
}[];
|
|
127
|
-
}[];
|
|
109
|
+
contentRegistry: {
|
|
110
|
+
txHash: string;
|
|
111
|
+
outputIndex: number;
|
|
128
112
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
anyOf: ({
|
|
133
|
-
title: string;
|
|
134
|
-
dataType: string;
|
|
135
|
-
index: number;
|
|
136
|
-
fields: {
|
|
137
|
-
$ref: string;
|
|
138
|
-
}[];
|
|
139
|
-
} | {
|
|
140
|
-
title: string;
|
|
141
|
-
dataType: string;
|
|
142
|
-
index: number;
|
|
143
|
-
fields: {
|
|
144
|
-
title: string;
|
|
145
|
-
$ref: string;
|
|
146
|
-
}[];
|
|
147
|
-
})[];
|
|
113
|
+
ownershipRegistry: {
|
|
114
|
+
txHash: string;
|
|
115
|
+
outputIndex: number;
|
|
148
116
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
117
|
+
};
|
|
118
|
+
operationAddress: string;
|
|
119
|
+
opsKey: string;
|
|
120
|
+
constructor(inputs: MeshTxInitiatorInput, contract: {
|
|
121
|
+
operationAddress: string;
|
|
122
|
+
paramUtxo?: UTxO["input"];
|
|
123
|
+
refScriptUtxos?: {
|
|
124
|
+
contentRegistry: UTxO["input"];
|
|
125
|
+
contentRefToken: UTxO["input"];
|
|
126
|
+
ownershipRegistry: UTxO["input"];
|
|
127
|
+
ownershipRefToken: UTxO["input"];
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
getOwnerNativeScript: () => {
|
|
131
|
+
nativeScript: {
|
|
132
|
+
type: "all" | "any";
|
|
133
|
+
scripts: NativeScript[];
|
|
134
|
+
};
|
|
135
|
+
scriptAddress: string;
|
|
136
|
+
};
|
|
137
|
+
mintOneTimeMintingPolicy: () => Promise<{
|
|
138
|
+
tx: string;
|
|
139
|
+
paramUtxo: {
|
|
140
|
+
outputIndex: number;
|
|
141
|
+
txHash: string;
|
|
160
142
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}[];
|
|
171
|
-
}[];
|
|
143
|
+
}>;
|
|
144
|
+
sendRefScriptOnchain: (scriptIndex: ScriptIndex) => Promise<string>;
|
|
145
|
+
setupOracleUtxo: () => Promise<string>;
|
|
146
|
+
handleSetup: () => Promise<{
|
|
147
|
+
txHexMintOneTimeMintingPolicy: string;
|
|
148
|
+
txHexSetupOracleUtxo: string;
|
|
149
|
+
paramUtxo: {
|
|
150
|
+
outputIndex: number;
|
|
151
|
+
txHash: string;
|
|
172
152
|
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
153
|
+
}>;
|
|
154
|
+
createContentRegistry: () => Promise<string>;
|
|
155
|
+
createOwnershipRegistry: () => Promise<string>;
|
|
156
|
+
createContent: (ownerAssetHex: string, contentHashHex: string, registryNumber?: number) => Promise<string>;
|
|
157
|
+
updateContent: ({ ownerTokenUtxo, registryNumber, newContentHashHex, contentNumber, }: UpdateContent) => Promise<string>;
|
|
158
|
+
transferContent: ({ ownerTokenUtxo, registryNumber, newOwnerAssetHex, contentNumber, }: TransferContent) => Promise<string>;
|
|
159
|
+
stopContentRegistry: (registryNumber: number) => Promise<string>;
|
|
160
|
+
stopOwnershipRegistry: (registryNumber: number) => Promise<string>;
|
|
161
|
+
stopOracle: (txInHash: string, txInId: number) => Promise<string>;
|
|
162
|
+
protected getCurrentOracleDatum: (utxos?: UTxO[]) => Promise<OracleDatum>;
|
|
163
|
+
protected getOracleDatum: (contentRegistryCount: number, ownershipRegistryCount: number) => _meshsdk_common.MConStr0<Data[]>;
|
|
164
|
+
protected getContentDatum: (contentArray: string[]) => _meshsdk_common.MConStr0<(number | string[])[]>;
|
|
165
|
+
protected getOwnershipDatum: (ownershipArray: [string, string][]) => _meshsdk_common.MConStr0<(number | [string, string][])[]>;
|
|
166
|
+
getScriptUtxos: (registryNumber: number, toFetch?: ("oracle" | "content" | "ownership")[]) => Promise<(UTxO | undefined)[]>;
|
|
167
|
+
private insertContentRegistry;
|
|
168
|
+
private insertOwnershipRegistry;
|
|
169
|
+
private updateContentRegistry;
|
|
170
|
+
private updateOwnershipRegistry;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type InitiationDatum = ConStr0$1<[PubKeyAddress, Value]>;
|
|
176
174
|
declare const initiateEscrowDatum: (walletAddress: string, amount: Asset[]) => InitiationDatum;
|
|
177
175
|
type ActiveEscrowDatum = ConStr1<[
|
|
178
176
|
PubKeyAddress,
|
|
@@ -181,11 +179,13 @@ type ActiveEscrowDatum = ConStr1<[
|
|
|
181
179
|
Value
|
|
182
180
|
]>;
|
|
183
181
|
declare const activeEscrowDatum: (initiationDatum: InitiationDatum, walletAddress: string, amount: Asset[]) => ActiveEscrowDatum;
|
|
184
|
-
type RecipientDepositRedeemer = ConStr0<[PubKeyAddress, Value]>;
|
|
182
|
+
type RecipientDepositRedeemer = ConStr0$1<[PubKeyAddress, Value]>;
|
|
185
183
|
declare const recipientDepositRedeemer: (recipient: string, depositAmount: Asset[]) => InitiationDatum;
|
|
186
184
|
declare class MeshEscrowContract extends MeshTxInitiator {
|
|
187
185
|
scriptCbor: string;
|
|
186
|
+
scriptAddress: string;
|
|
188
187
|
constructor(inputs: MeshTxInitiatorInput);
|
|
188
|
+
getScriptCbor: () => string;
|
|
189
189
|
initiateEscrow: (escrowAmount: Asset[]) => Promise<string>;
|
|
190
190
|
cancelEscrow: (escrowUtxo: UTxO) => Promise<string>;
|
|
191
191
|
recipientDeposit: (escrowUtxo: UTxO, depositAmount: Asset[]) => Promise<string>;
|
|
@@ -196,212 +196,30 @@ declare class MeshEscrowContract extends MeshTxInitiator {
|
|
|
196
196
|
declare class MeshGiftCardContract extends MeshTxInitiator {
|
|
197
197
|
tokenNameHex: string;
|
|
198
198
|
paramUtxo: UTxO["input"];
|
|
199
|
+
constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO["input"]);
|
|
199
200
|
giftCardCbor: (tokenNameHex: string, utxoTxHash: string, utxoTxId: number) => string;
|
|
200
201
|
redeemCbor: (tokenNameHex: string, policyId: string) => string;
|
|
201
|
-
constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO["input"]);
|
|
202
202
|
createGiftCard: (tokenName: string, giftValue: Asset[]) => Promise<string>;
|
|
203
203
|
redeemGiftCard: (giftCardUtxo: UTxO) => Promise<string>;
|
|
204
204
|
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
type HelloWorldDatum = ConStr0
|
|
207
|
+
type HelloWorldDatum = ConStr0<[
|
|
208
208
|
Integer,
|
|
209
209
|
BuiltinByteString,
|
|
210
210
|
BuiltinByteString
|
|
211
211
|
]>;
|
|
212
|
-
declare const MeshHelloWorldBlueprint: {
|
|
213
|
-
preamble: {
|
|
214
|
-
title: string;
|
|
215
|
-
description: string;
|
|
216
|
-
version: string;
|
|
217
|
-
plutusVersion: string;
|
|
218
|
-
compiler: {
|
|
219
|
-
name: string;
|
|
220
|
-
version: string;
|
|
221
|
-
};
|
|
222
|
-
license: string;
|
|
223
|
-
};
|
|
224
|
-
validators: {
|
|
225
|
-
title: string;
|
|
226
|
-
datum: {
|
|
227
|
-
title: string;
|
|
228
|
-
schema: {
|
|
229
|
-
$ref: string;
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
redeemer: {
|
|
233
|
-
title: string;
|
|
234
|
-
schema: {
|
|
235
|
-
$ref: string;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
compiledCode: string;
|
|
239
|
-
hash: string;
|
|
240
|
-
}[];
|
|
241
|
-
definitions: {
|
|
242
|
-
ByteArray: {
|
|
243
|
-
dataType: string;
|
|
244
|
-
};
|
|
245
|
-
"hello_world/Datum": {
|
|
246
|
-
title: string;
|
|
247
|
-
anyOf: {
|
|
248
|
-
title: string;
|
|
249
|
-
dataType: string;
|
|
250
|
-
index: number;
|
|
251
|
-
fields: {
|
|
252
|
-
title: string;
|
|
253
|
-
$ref: string;
|
|
254
|
-
}[];
|
|
255
|
-
}[];
|
|
256
|
-
};
|
|
257
|
-
"hello_world/Redeemer": {
|
|
258
|
-
title: string;
|
|
259
|
-
anyOf: {
|
|
260
|
-
title: string;
|
|
261
|
-
dataType: string;
|
|
262
|
-
index: number;
|
|
263
|
-
fields: {
|
|
264
|
-
title: string;
|
|
265
|
-
$ref: string;
|
|
266
|
-
}[];
|
|
267
|
-
}[];
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
212
|
declare class MeshHelloWorldContract extends MeshTxInitiator {
|
|
272
213
|
scriptCbor: string;
|
|
214
|
+
scriptAddress: string;
|
|
273
215
|
constructor(inputs: MeshTxInitiatorInput);
|
|
274
|
-
|
|
275
|
-
scriptAddr: string;
|
|
276
|
-
};
|
|
216
|
+
getScriptCbor: () => string;
|
|
277
217
|
lockAsset: (assets: Asset[]) => Promise<string>;
|
|
278
218
|
unlockAsset: (scriptUtxo: UTxO, message: string) => Promise<string>;
|
|
279
219
|
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
|
|
280
220
|
}
|
|
281
221
|
|
|
282
|
-
|
|
283
|
-
preamble: {
|
|
284
|
-
title: string;
|
|
285
|
-
description: string;
|
|
286
|
-
version: string;
|
|
287
|
-
plutusVersion: string;
|
|
288
|
-
compiler: {
|
|
289
|
-
name: string;
|
|
290
|
-
version: string;
|
|
291
|
-
};
|
|
292
|
-
license: string;
|
|
293
|
-
};
|
|
294
|
-
validators: {
|
|
295
|
-
title: string;
|
|
296
|
-
datum: {
|
|
297
|
-
title: string;
|
|
298
|
-
schema: {
|
|
299
|
-
$ref: string;
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
redeemer: {
|
|
303
|
-
title: string;
|
|
304
|
-
schema: {
|
|
305
|
-
$ref: string;
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
parameters: {
|
|
309
|
-
title: string;
|
|
310
|
-
schema: {
|
|
311
|
-
$ref: string;
|
|
312
|
-
};
|
|
313
|
-
}[];
|
|
314
|
-
compiledCode: string;
|
|
315
|
-
hash: string;
|
|
316
|
-
}[];
|
|
317
|
-
definitions: {
|
|
318
|
-
ByteArray: {
|
|
319
|
-
dataType: string;
|
|
320
|
-
};
|
|
321
|
-
Int: {
|
|
322
|
-
dataType: string;
|
|
323
|
-
};
|
|
324
|
-
"Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
|
|
325
|
-
title: string;
|
|
326
|
-
anyOf: {
|
|
327
|
-
title: string;
|
|
328
|
-
description: string;
|
|
329
|
-
dataType: string;
|
|
330
|
-
index: number;
|
|
331
|
-
fields: {
|
|
332
|
-
$ref: string;
|
|
333
|
-
}[];
|
|
334
|
-
}[];
|
|
335
|
-
};
|
|
336
|
-
"aiken/transaction/credential/Address": {
|
|
337
|
-
title: string;
|
|
338
|
-
description: string;
|
|
339
|
-
anyOf: {
|
|
340
|
-
title: string;
|
|
341
|
-
dataType: string;
|
|
342
|
-
index: number;
|
|
343
|
-
fields: {
|
|
344
|
-
title: string;
|
|
345
|
-
$ref: string;
|
|
346
|
-
}[];
|
|
347
|
-
}[];
|
|
348
|
-
};
|
|
349
|
-
"aiken/transaction/credential/Credential": {
|
|
350
|
-
title: string;
|
|
351
|
-
description: string;
|
|
352
|
-
anyOf: {
|
|
353
|
-
title: string;
|
|
354
|
-
dataType: string;
|
|
355
|
-
index: number;
|
|
356
|
-
fields: {
|
|
357
|
-
$ref: string;
|
|
358
|
-
}[];
|
|
359
|
-
}[];
|
|
360
|
-
};
|
|
361
|
-
"aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
|
|
362
|
-
title: string;
|
|
363
|
-
description: string;
|
|
364
|
-
anyOf: ({
|
|
365
|
-
title: string;
|
|
366
|
-
dataType: string;
|
|
367
|
-
index: number;
|
|
368
|
-
fields: {
|
|
369
|
-
$ref: string;
|
|
370
|
-
}[];
|
|
371
|
-
} | {
|
|
372
|
-
title: string;
|
|
373
|
-
dataType: string;
|
|
374
|
-
index: number;
|
|
375
|
-
fields: {
|
|
376
|
-
title: string;
|
|
377
|
-
$ref: string;
|
|
378
|
-
}[];
|
|
379
|
-
})[];
|
|
380
|
-
};
|
|
381
|
-
"marketplace/types/MarketplaceDatum": {
|
|
382
|
-
title: string;
|
|
383
|
-
anyOf: {
|
|
384
|
-
title: string;
|
|
385
|
-
dataType: string;
|
|
386
|
-
index: number;
|
|
387
|
-
fields: {
|
|
388
|
-
title: string;
|
|
389
|
-
$ref: string;
|
|
390
|
-
}[];
|
|
391
|
-
}[];
|
|
392
|
-
};
|
|
393
|
-
"marketplace/types/MarketplaceRedeemer": {
|
|
394
|
-
title: string;
|
|
395
|
-
anyOf: {
|
|
396
|
-
title: string;
|
|
397
|
-
dataType: string;
|
|
398
|
-
index: number;
|
|
399
|
-
fields: never[];
|
|
400
|
-
}[];
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
type MarketplaceDatum = ConStr0<[
|
|
222
|
+
type MarketplaceDatum = ConStr0$1<[
|
|
405
223
|
PubKeyAddress,
|
|
406
224
|
Integer$1,
|
|
407
225
|
CurrencySymbol,
|
|
@@ -412,245 +230,122 @@ declare class MeshMarketplaceContract extends MeshTxInitiator {
|
|
|
412
230
|
ownerAddress: string;
|
|
413
231
|
feePercentageBasisPoint: number;
|
|
414
232
|
scriptCbor: string;
|
|
233
|
+
scriptAddress: string;
|
|
415
234
|
constructor(inputs: MeshTxInitiatorInput, ownerAddress: string, feePercentageBasisPoint: number);
|
|
235
|
+
getScriptCbor: (pubKeyHash: string, stakeCredentialHash: string, feePercentageBasisPoint: number) => string;
|
|
416
236
|
listAsset: (asset: string, price: number) => Promise<string>;
|
|
417
237
|
delistAsset: (marketplaceUtxo: UTxO) => Promise<string>;
|
|
418
238
|
purchaseAsset: (marketplaceUtxo: UTxO) => Promise<string>;
|
|
419
239
|
relistAsset: (marketplaceUtxo: UTxO, newPrice: number) => Promise<string>;
|
|
420
240
|
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
|
|
241
|
+
static getCompiledCode: (version?: number) => string;
|
|
421
242
|
}
|
|
422
243
|
|
|
423
|
-
declare const MeshPaymentSplitterBlueprint: {
|
|
424
|
-
preamble: {
|
|
425
|
-
title: string;
|
|
426
|
-
description: string;
|
|
427
|
-
version: string;
|
|
428
|
-
plutusVersion: string;
|
|
429
|
-
compiler: {
|
|
430
|
-
name: string;
|
|
431
|
-
version: string;
|
|
432
|
-
};
|
|
433
|
-
license: string;
|
|
434
|
-
};
|
|
435
|
-
validators: {
|
|
436
|
-
title: string;
|
|
437
|
-
datum: {
|
|
438
|
-
title: string;
|
|
439
|
-
schema: {
|
|
440
|
-
$ref: string;
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
redeemer: {
|
|
444
|
-
title: string;
|
|
445
|
-
schema: {
|
|
446
|
-
$ref: string;
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
parameters: {
|
|
450
|
-
title: string;
|
|
451
|
-
schema: {
|
|
452
|
-
$ref: string;
|
|
453
|
-
};
|
|
454
|
-
}[];
|
|
455
|
-
compiledCode: string;
|
|
456
|
-
hash: string;
|
|
457
|
-
}[];
|
|
458
|
-
definitions: {
|
|
459
|
-
ByteArray: {
|
|
460
|
-
dataType: string;
|
|
461
|
-
};
|
|
462
|
-
List$ByteArray: {
|
|
463
|
-
dataType: string;
|
|
464
|
-
items: {
|
|
465
|
-
$ref: string;
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
"payment_splitter/Datum": {
|
|
469
|
-
title: string;
|
|
470
|
-
anyOf: {
|
|
471
|
-
title: string;
|
|
472
|
-
dataType: string;
|
|
473
|
-
index: number;
|
|
474
|
-
fields: {
|
|
475
|
-
title: string;
|
|
476
|
-
$ref: string;
|
|
477
|
-
}[];
|
|
478
|
-
}[];
|
|
479
|
-
};
|
|
480
|
-
"payment_splitter/Redeemer": {
|
|
481
|
-
title: string;
|
|
482
|
-
anyOf: {
|
|
483
|
-
title: string;
|
|
484
|
-
dataType: string;
|
|
485
|
-
index: number;
|
|
486
|
-
fields: {
|
|
487
|
-
title: string;
|
|
488
|
-
$ref: string;
|
|
489
|
-
}[];
|
|
490
|
-
}[];
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
};
|
|
494
244
|
declare class MeshPaymentSplitterContract extends MeshTxInitiator {
|
|
495
|
-
|
|
496
|
-
|
|
245
|
+
scriptCbor: string;
|
|
246
|
+
scriptAddress: string;
|
|
497
247
|
payees: string[];
|
|
248
|
+
wrapPayees: (payees: string[]) => _meshsdk_common.List<_meshsdk_common.BuiltinByteString>;
|
|
498
249
|
constructor(inputs: MeshTxInitiatorInput, payees: string[]);
|
|
250
|
+
getScriptCbor: () => string;
|
|
499
251
|
sendLovelaceToSplitter: (lovelaceAmount: number) => Promise<string>;
|
|
500
252
|
triggerPayout: () => Promise<string>;
|
|
501
253
|
}
|
|
502
254
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
};
|
|
539
|
-
List$Pair$ByteArray_Int: {
|
|
540
|
-
dataType: string;
|
|
541
|
-
keys: {
|
|
542
|
-
$ref: string;
|
|
543
|
-
};
|
|
544
|
-
values: {
|
|
545
|
-
$ref: string;
|
|
546
|
-
};
|
|
547
|
-
};
|
|
548
|
-
List$Pair$ByteArray_List$Pair$ByteArray_Int: {
|
|
549
|
-
dataType: string;
|
|
550
|
-
keys: {
|
|
551
|
-
$ref: string;
|
|
552
|
-
};
|
|
553
|
-
values: {
|
|
554
|
-
$ref: string;
|
|
555
|
-
};
|
|
556
|
-
};
|
|
557
|
-
"Option$aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
|
|
558
|
-
title: string;
|
|
559
|
-
anyOf: {
|
|
560
|
-
title: string;
|
|
561
|
-
description: string;
|
|
562
|
-
dataType: string;
|
|
563
|
-
index: number;
|
|
564
|
-
fields: {
|
|
565
|
-
$ref: string;
|
|
566
|
-
}[];
|
|
567
|
-
}[];
|
|
568
|
-
};
|
|
569
|
-
"aiken/transaction/credential/Address": {
|
|
570
|
-
title: string;
|
|
571
|
-
description: string;
|
|
572
|
-
anyOf: {
|
|
573
|
-
title: string;
|
|
574
|
-
dataType: string;
|
|
575
|
-
index: number;
|
|
576
|
-
fields: {
|
|
577
|
-
title: string;
|
|
578
|
-
$ref: string;
|
|
579
|
-
}[];
|
|
580
|
-
}[];
|
|
581
|
-
};
|
|
582
|
-
"aiken/transaction/credential/Credential": {
|
|
583
|
-
title: string;
|
|
584
|
-
description: string;
|
|
585
|
-
anyOf: {
|
|
586
|
-
title: string;
|
|
587
|
-
dataType: string;
|
|
588
|
-
index: number;
|
|
589
|
-
fields: {
|
|
590
|
-
$ref: string;
|
|
591
|
-
}[];
|
|
592
|
-
}[];
|
|
593
|
-
};
|
|
594
|
-
"aiken/transaction/credential/Referenced$aiken/transaction/credential/Credential": {
|
|
595
|
-
title: string;
|
|
596
|
-
description: string;
|
|
597
|
-
anyOf: ({
|
|
598
|
-
title: string;
|
|
599
|
-
dataType: string;
|
|
600
|
-
index: number;
|
|
601
|
-
fields: {
|
|
602
|
-
$ref: string;
|
|
603
|
-
}[];
|
|
604
|
-
} | {
|
|
605
|
-
title: string;
|
|
606
|
-
dataType: string;
|
|
607
|
-
index: number;
|
|
608
|
-
fields: {
|
|
609
|
-
title: string;
|
|
610
|
-
$ref: string;
|
|
611
|
-
}[];
|
|
612
|
-
})[];
|
|
613
|
-
};
|
|
614
|
-
"swap/SwapDatum": {
|
|
615
|
-
title: string;
|
|
616
|
-
anyOf: {
|
|
617
|
-
title: string;
|
|
618
|
-
dataType: string;
|
|
619
|
-
index: number;
|
|
620
|
-
fields: {
|
|
621
|
-
title: string;
|
|
622
|
-
$ref: string;
|
|
623
|
-
}[];
|
|
624
|
-
}[];
|
|
625
|
-
};
|
|
626
|
-
"swap/SwapRedeemer": {
|
|
627
|
-
title: string;
|
|
628
|
-
anyOf: {
|
|
629
|
-
title: string;
|
|
630
|
-
dataType: string;
|
|
631
|
-
index: number;
|
|
632
|
-
fields: never[];
|
|
633
|
-
}[];
|
|
255
|
+
/**
|
|
256
|
+
* Mesh Plutus NFT contract class
|
|
257
|
+
*
|
|
258
|
+
* This NFT minting script enables users to mint NFTs with an automatically incremented index, which increases by one for each newly minted NFT.
|
|
259
|
+
*
|
|
260
|
+
* To facilitate this process, the first step is to set up a one-time minting policy by minting an oracle token. This oracle token is essential as it holds the current state and index of the NFTs, acting as a reference for the minting sequence.
|
|
261
|
+
*
|
|
262
|
+
* With each new NFT minted, the token index within the oracle is incremented by one, ensuring a consistent and orderly progression in the numbering of the NFTs.
|
|
263
|
+
*/
|
|
264
|
+
declare class MeshPlutusNFTContract extends MeshTxInitiator {
|
|
265
|
+
collectionName: string;
|
|
266
|
+
paramUtxo: UTxO["input"];
|
|
267
|
+
oracleAddress: string;
|
|
268
|
+
getOracleCbor: () => string;
|
|
269
|
+
getOracleNFTCbor: () => string;
|
|
270
|
+
getNFTCbor: () => string;
|
|
271
|
+
constructor(inputs: MeshTxInitiatorInput, contract: {
|
|
272
|
+
collectionName: string;
|
|
273
|
+
paramUtxo?: UTxO["input"];
|
|
274
|
+
});
|
|
275
|
+
/**
|
|
276
|
+
* Set up a one-time minting policy by minting an oracle token. This oracle token is essential as it holds the current state and index of the NFTs, acting as a reference for the minting sequence.
|
|
277
|
+
* @param lovelacePrice - Price of the NFT in lovelace
|
|
278
|
+
* @returns - Transaction hex and paramUtxo
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* const { tx, paramUtxo } = await contract.setupOracle(lovelacePrice);
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
setupOracle: (lovelacePrice: number) => Promise<{
|
|
286
|
+
tx: string;
|
|
287
|
+
paramUtxo: {
|
|
288
|
+
outputIndex: number;
|
|
289
|
+
txHash: string;
|
|
634
290
|
};
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
|
|
291
|
+
}>;
|
|
292
|
+
/**
|
|
293
|
+
* Mint NFT token with an automatically incremented index, which increases by one for each newly minted NFT.
|
|
294
|
+
* @param assetMetadata - Asset metadata
|
|
295
|
+
* @returns - Transaction hex
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* const assetMetadata = {
|
|
300
|
+
* ...demoAssetMetadata,
|
|
301
|
+
* name: `Mesh Token ${oracleData.nftIndex}`,
|
|
302
|
+
* };
|
|
303
|
+
* const tx = await contract.mintPlutusNFT(assetMetadata);
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
mintPlutusNFT: (assetMetadata?: AssetMetadata) => Promise<string>;
|
|
307
|
+
/**
|
|
308
|
+
* Get the current oracle data.
|
|
309
|
+
*
|
|
310
|
+
* @returns - Oracle data
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* ```typescript
|
|
314
|
+
* const oracleData = await contract.getOracleData();
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
getOracleData: () => Promise<{
|
|
318
|
+
nftIndex: number | bigint;
|
|
319
|
+
policyId: string;
|
|
320
|
+
lovelacePrice: number | bigint;
|
|
321
|
+
oracleUtxo: UTxO;
|
|
322
|
+
oracleNftPolicyId: string;
|
|
323
|
+
feeCollectorAddress: string;
|
|
324
|
+
feeCollectorAddressObj: _meshsdk_common.PubKeyAddress;
|
|
325
|
+
}>;
|
|
326
|
+
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
type SwapDatum = ConStr0$1<[PubKeyAddress, Value, Value]>;
|
|
638
330
|
declare class MeshSwapContract extends MeshTxInitiator {
|
|
639
331
|
scriptCbor: string;
|
|
640
332
|
scriptAddress: string;
|
|
641
333
|
constructor(inputs: MeshTxInitiatorInput);
|
|
334
|
+
getScriptCbor: () => string;
|
|
642
335
|
initiateSwap: (toProvide: Asset$1[], toReceive: Asset$1[]) => Promise<string>;
|
|
643
336
|
acceptSwap: (swapUtxo: UTxO$1) => Promise<string>;
|
|
644
337
|
cancelSwap: (swapUtxo: UTxO$1) => Promise<string>;
|
|
645
338
|
getUtxoByTxHash: (txHash: string) => Promise<UTxO$1 | undefined>;
|
|
646
339
|
}
|
|
647
340
|
|
|
648
|
-
type VestingDatum = ConStr0<[
|
|
341
|
+
type VestingDatum = ConStr0$1<[
|
|
649
342
|
Integer$1,
|
|
650
343
|
BuiltinByteString$1,
|
|
651
344
|
BuiltinByteString$1
|
|
652
345
|
]>;
|
|
653
346
|
declare class MeshVestingContract extends MeshTxInitiator {
|
|
347
|
+
scriptCbor: string;
|
|
348
|
+
scriptAddress: string;
|
|
654
349
|
constructor(inputs: MeshTxInitiatorInput);
|
|
655
350
|
getScriptCbor: () => string;
|
|
656
351
|
depositFund: (amount: Asset[], lockUntilTimeStampMs: number, beneficiary: string) => Promise<string>;
|
|
@@ -658,4 +353,4 @@ declare class MeshVestingContract extends MeshTxInitiator {
|
|
|
658
353
|
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
|
|
659
354
|
}
|
|
660
355
|
|
|
661
|
-
export { type ActiveEscrowDatum, type HelloWorldDatum, type InitiationDatum, type MarketplaceDatum,
|
|
356
|
+
export { type ActiveEscrowDatum, type HelloWorldDatum, type InitiationDatum, type MarketplaceDatum, MeshContentOwnershipContract, MeshEscrowContract, MeshGiftCardContract, MeshHelloWorldContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshPlutusNFTContract, MeshSwapContract, MeshVestingContract, type RecipientDepositRedeemer, type SwapDatum, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };
|