@@ -213,14 +213,37 @@ export const ContractOrSourceIdGuard: t.Type<ContractOrSourceId> = t.union([
213
213
SourceIdGuard ,
214
214
] ) ;
215
215
216
+ /**
217
+ * Request for the {@link index.RestClient#buildCreateContractTx | Build Create Contract Tx } endpoint using a source Id (merkleized contract)
218
+ * @category Endpoint : Build Create Contract Tx
219
+ */
220
+ export type BuildCreateContractTxRequestWithContract = {
221
+ /**
222
+ * A Marlowe Contract to create over Cardano
223
+ */
224
+ contract : Contract ;
225
+ } & BuildCreateContractTxRequestOptions ;
226
+
227
+ /**
228
+ * Request for the {@link index.RestClient#buildCreateContractTx | Build Create Contract Tx } endpoint using a contract
229
+ * @category Endpoint : Build Create Contract Tx
230
+ */
231
+ export type BuildCreateContractTxRequestWithSourceId = {
232
+ /**
233
+ * A merkleized Contract (referred by its source Id) to create over Cardano
234
+ * @see Large/Deep Contracts Support (Contract Merkleization) and `@marlowe.io/language-core`
235
+ */
236
+ sourceId : SourceId ;
237
+ } & BuildCreateContractTxRequestOptions ;
238
+
216
239
/**
217
240
* Request options for the {@link index.RestClient#buildCreateContractTx | Build Create Contract Tx } endpoint
218
241
* @category Endpoint : Build Create Contract Tx
219
242
* @example
220
243
* - Minimal Simple Contract Close
221
244
* ```json
222
245
* { "changeAddress" : "addr_test1qqe342swyfn75mp2anj45f8ythjyxg6m7pu0pznptl6f2d84kwuzrh8c83gzhrq5zcw7ytmqc863z5rhhwst3w4x87eq0td9ja",
223
- * "contractOrSourceId " : "close",
246
+ * "contract " : "close",
224
247
* "tags" : {"ts-sdk.documentation.example" : {"infoA" : 5} },
225
248
* "version" : "v1"
226
249
* }
@@ -230,7 +253,7 @@ export const ContractOrSourceIdGuard: t.Type<ContractOrSourceId> = t.union([
230
253
* { "changeAddress" : "addr_test1qqe342swyfn75mp2anj45f8ythjyxg6m7pu0pznptl6f2d84kwuzrh8c83gzhrq5zcw7ytmqc863z5rhhwst3w4x87eq0td9ja",
231
254
* "usedAddresses": ["addr_test1qqe342swyfn75mp2anj45f8ythjyxg6m7pu0pznptl6f2d84kwuzrh8c83gzhrq5zcw7ytmqc863z5rhhwst3w4x87eq0td9ja"],
232
255
* "collateralUTxOs": [],
233
- * "contractOrSourceId " : "close",
256
+ * "contract " : "close",
234
257
* "tags" : {"ts-sdk.documentation.example" : {"infoA" : 5} },
235
258
* "minimumLovelaceUTxODeposit" : 3000000,
236
259
* "threadRoleName" : "ThreadRoleToken",
@@ -242,7 +265,7 @@ export const ContractOrSourceIdGuard: t.Type<ContractOrSourceId> = t.union([
242
265
* { "changeAddress" : "addr_test1qqe342swyfn75mp2anj45f8ythjyxg6m7pu0pznptl6f2d84kwuzrh8c83gzhrq5zcw7ytmqc863z5rhhwst3w4x87eq0td9ja",
243
266
* "usedAddresses": ["addr_test1qqe342swyfn75mp2anj45f8ythjyxg6m7pu0pznptl6f2d84kwuzrh8c83gzhrq5zcw7ytmqc863z5rhhwst3w4x87eq0td9ja"],
244
267
* "collateralUTxOs": [],
245
- * "contractOrSourceId " : {"when":[{"then":{"when":[{"then":{"token":{"token_name":"","currency_symbol":""},"to":{"party":{"role_token":"Dollar provider"}},"then":{"token":{"token_name":"dollar","currency_symbol":"85bb65"},"to":{"party":{"role_token":"Ada provider"}},"then":"close","pay":0,"from_account":{"role_token":"Dollar provider"}},"pay":{"times":0,"multiply":1000000},"from_account":{"role_token":"Ada provider"} },"case":{"party":{"role_token":"Dollar provider"},"of_token":{"token_name":"dollar","currency_symbol":"85bb65"},"into_account":{"role_token":"Dollar provider"},"deposits":0} }],"timeout_continuation":"close","timeout":1701773934770 },"case":{"party":{"role_token":"Ada provider"},"of_token":{"token_name":"","currency_symbol":""},"into_account":{"role_token":"Ada provider"},"deposits":{"times":0,"multiply":1000000}} }],"timeout_continuation":"close","timeout":1701772134770 },
268
+ * "contract " : {"when":[{"then":{"when":[{"then":{"token":{"token_name":"","currency_symbol":""},"to":{"party":{"role_token":"Dollar provider"}},"then":{"token":{"token_name":"dollar","currency_symbol":"85bb65"},"to":{"party":{"role_token":"Ada provider"}},"then":"close","pay":0,"from_account":{"role_token":"Dollar provider"}},"pay":{"times":0,"multiply":1000000},"from_account":{"role_token":"Ada provider"} },"case":{"party":{"role_token":"Dollar provider"},"of_token":{"token_name":"dollar","currency_symbol":"85bb65"},"into_account":{"role_token":"Dollar provider"},"deposits":0} }],"timeout_continuation":"close","timeout":1701773934770 },"case":{"party":{"role_token":"Ada provider"},"of_token":{"token_name":"","currency_symbol":""},"into_account":{"role_token":"Ada provider"},"deposits":{"times":0,"multiply":1000000}} }],"timeout_continuation":"close","timeout":1701772134770 },
246
269
* "tags" : {"ts-sdk.documentation.example" : {"infoA" : 5} },
247
270
* "roles" : {"Ada provider" : {"recipients": {"OpenRole" : 1} }
248
271
* ,"Dollar provider" : {"recipients": {"OpenRole" : 1} } },
@@ -252,7 +275,15 @@ export const ContractOrSourceIdGuard: t.Type<ContractOrSourceId> = t.union([
252
275
* }
253
276
* ```
254
277
*/
255
- export interface BuildCreateContractTxRequest {
278
+ export type BuildCreateContractTxRequest =
279
+ | BuildCreateContractTxRequestWithContract
280
+ | BuildCreateContractTxRequestWithSourceId ;
281
+
282
+ /**
283
+ * Request options for the {@link index.RestClient#buildCreateContractTx | Build Create Contract Tx } endpoint
284
+ * @category Endpoint : Build Create Contract Tx
285
+ */
286
+ export interface BuildCreateContractTxRequestOptions {
256
287
/**
257
288
* Marlowe contracts can have staking rewards for the ADA locked in the contract.
258
289
* Use this field to set the recipient address of those rewards
@@ -306,11 +337,6 @@ export interface BuildCreateContractTxRequest {
306
337
*/
307
338
collateralUTxOs ?: TxOutRef [ ] ;
308
339
309
- /**
310
- * A Marlowe Contract or a Merkleized One (referred by its source Id) to create over Cardano
311
- * @see Large/Deep Contracts Support (Contract Merkleization) and `@marlowe.io/language-core`
312
- */
313
- contractOrSourceId : ContractOrSourceId ;
314
340
/**
315
341
* Marlowe Tags are stored as Metadata within the Transaction Metadata under the top-level Marlowe Reserved Key (`1564`).
316
342
* Tags allows to Query created Marlowe Contracts via {@link index.RestClient#getContracts | Get contracts }
0 commit comments