diff --git a/examples/nodejs/src/experimental-features/applicable-inputs.ts b/examples/nodejs/src/experimental-features/applicable-inputs.ts index a6a1dd18..a31fd952 100644 --- a/examples/nodejs/src/experimental-features/applicable-inputs.ts +++ b/examples/nodejs/src/experimental-features/applicable-inputs.ts @@ -122,7 +122,7 @@ export async function getApplicableActions( contractId: ContractId, environment?: Environment ): Promise { - const contractDetails = await restClient.getContractById(contractId); + const contractDetails = await restClient.getContractById({ contractId }); const currentContract = contractDetails.currentContract ? contractDetails.currentContract : contractDetails.initialContract; diff --git a/examples/nodejs/src/marlowe-object-flow.ts b/examples/nodejs/src/marlowe-object-flow.ts index 1d7cd273..554bbdce 100644 --- a/examples/nodejs/src/marlowe-object-flow.ts +++ b/examples/nodejs/src/marlowe-object-flow.ts @@ -588,8 +588,9 @@ async function validateExistingContract( contractId: ContractId ): Promise { // First we try to fetch the contract details and the required tags - const contractDetails = - await lifecycle.restClient.getContractById(contractId); + const contractDetails = await lifecycle.restClient.getContractById({ + contractId, + }); const scheme = extractSchemeFromTags(contractDetails.tags); @@ -609,8 +610,9 @@ async function validateExistingContract( // Or this option which doesn't require runtime to runtime communication, and just requires // the dapp to be able to recreate the same sources. const contractBundle = mkDelayPayment(scheme); - const { contractSourceId } = - await lifecycle.restClient.createContractSources(contractBundle); + const { contractSourceId } = await lifecycle.restClient.createContractSources( + { bundle: contractBundle } + ); const initialContract = await lifecycle.restClient.getContractSourceById({ contractSourceId, }); diff --git a/examples/survey-workshop/custodian/index.js b/examples/survey-workshop/custodian/index.js index 46f7cd50..00759c5d 100644 --- a/examples/survey-workshop/custodian/index.js +++ b/examples/survey-workshop/custodian/index.js @@ -22,7 +22,9 @@ async function loadContract() { log("Loading contract"); const contractId = document.getElementById("contract-id").value; const restClient = await H.getRestClient(); - const paginatedTxs = await restClient.getTransactionsForContract(contractId); + const paginatedTxs = await restClient.getTransactionsForContract({ + contractId, + }); if (paginatedTxs.transactions.length !== 1) { log( "Expected 1 transaction for contract, got " + @@ -33,10 +35,10 @@ async function loadContract() { } logJSON("txId", paginatedTxs.transactions[0].transactionId); const txId = paginatedTxs.transactions[0].transactionId; - const answerTx = await restClient.getContractTransactionById( + const answerTx = await restClient.getContractTransactionById({ contractId, - txId - ); + txId, + }); const answers = await getAnswers(answerTx); logJSON("answers", answers); diff --git a/examples/vesting-flow/index.html b/examples/vesting-flow/index.html index 5fbddf70..378d42a7 100644 --- a/examples/vesting-flow/index.html +++ b/examples/vesting-flow/index.html @@ -140,21 +140,21 @@

Console

const contractIdsAndDetails = await Promise.all( contractIds.map((contractId) => restClient - .getContractById(contractId) + .getContractById({ contractId }) .then((details) => [contractId, details]) ) ); const contractIdsAndDetailsAndInputHistory = await Promise.all( contractIdsAndDetails.map(([contractId, details]) => restClient - .getTransactionsForContract(contractId) + .getTransactionsForContract({ contractId }) .then((result) => Promise.all( result.transactions.map((transaction) => - restClient.getContractTransactionById( + restClient.getContractTransactionById({ contractId, - transaction.transactionId - ) + txId: transaction.transactionId, + }) ) ) ) diff --git a/packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts b/packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts index 01745f75..8a7ae6af 100644 --- a/packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts +++ b/packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts @@ -249,7 +249,7 @@ const shouldBeAClosedContract = async ( contractId: ContractId ): Promise => { const state = await restClient - .getContractById(contractId) + .getContractById({ contractId }) .then((contractDetails) => contractDetails.state); if (state) { throw new Error("Contract retrieved is not Closed"); @@ -268,5 +268,5 @@ const getMarloweStatefromAnActiveContract = ( contractId: ContractId ): Promise => restClient - .getContractById(contractId) + .getContractById({ contractId }) .then((contractDetails) => shouldBeAnActiveContract(contractDetails.state));