diff --git a/packages/blaze-core/src/params.ts b/packages/blaze-core/src/params.ts index 200c73be..f305af3c 100644 --- a/packages/blaze-core/src/params.ts +++ b/packages/blaze-core/src/params.ts @@ -75,7 +75,7 @@ export const hardCodedProtocolParams: ProtocolParameters = { minPoolCost: 170000000, // The minimum pool cost. protocolVersion: { major: 9, minor: 0 }, // The protocol version. maxValueSize: 5000, // The maximum value size. - collateralPercentage: 150 / 100, // The collateral percentage. + collateralPercentage: 150, // The collateral percentage. maxCollateralInputs: 3, // The maximum collateral inputs. costModels: new Map() // The cost models. .set( diff --git a/packages/blaze-emulator/CHANGELOG.md b/packages/blaze-emulator/CHANGELOG.md index c2e5e3a7..ab72f871 100644 --- a/packages/blaze-emulator/CHANGELOG.md +++ b/packages/blaze-emulator/CHANGELOG.md @@ -1,5 +1,23 @@ # @blaze-cardano/emulator +## 0.1.76 + +### Patch Changes + +- Updated dependencies [88ee831] + - @blaze-cardano/tx@0.6.1 + - @blaze-cardano/wallet@0.1.56 + +## 0.1.75 + +### Patch Changes + +- Updated dependencies [c924f95] +- Updated dependencies [471d47d] +- Updated dependencies [c951eec] + - @blaze-cardano/tx@0.6.0 + - @blaze-cardano/wallet@0.1.55 + ## 0.1.74 ### Patch Changes diff --git a/packages/blaze-emulator/package.json b/packages/blaze-emulator/package.json index c1973b1d..98526cdb 100644 --- a/packages/blaze-emulator/package.json +++ b/packages/blaze-emulator/package.json @@ -1,6 +1,6 @@ { "name": "@blaze-cardano/emulator", - "version": "0.1.74", + "version": "0.1.76", "description": "Blaze cardano emulator library", "exports": { ".": { diff --git a/packages/blaze-emulator/src/emulator.ts b/packages/blaze-emulator/src/emulator.ts index b75c190b..da93c726 100644 --- a/packages/blaze-emulator/src/emulator.ts +++ b/packages/blaze-emulator/src/emulator.ts @@ -504,7 +504,7 @@ export class Emulator { // Minimum collateral amount included const minCollateral = BigInt( - Math.ceil(this.params.collateralPercentage * Number(body.fee())), + Math.ceil((this.params.collateralPercentage * Number(body.fee())) / 100), ); // If any scripts have been invoked, minimum collateral must be included diff --git a/packages/blaze-query/src/blockfrost.ts b/packages/blaze-query/src/blockfrost.ts index 14c0051d..2991ea3f 100644 --- a/packages/blaze-query/src/blockfrost.ts +++ b/packages/blaze-query/src/blockfrost.ts @@ -112,7 +112,7 @@ export class Blockfrost implements Provider { minor: response.protocol_minor_ver, }, maxValueSize: response.max_val_size, - collateralPercentage: response.collateral_percent / 100, + collateralPercentage: response.collateral_percent, maxCollateralInputs: response.max_collateral_inputs, costModels: costModels, prices: { diff --git a/packages/blaze-query/src/maestro.ts b/packages/blaze-query/src/maestro.ts index e1c8af06..85aea232 100644 --- a/packages/blaze-query/src/maestro.ts +++ b/packages/blaze-query/src/maestro.ts @@ -94,7 +94,7 @@ export class Maestro implements Provider { minPoolCost: params.min_stake_pool_cost.ada.lovelace, protocolVersion: params.version, maxValueSize: params.max_value_size.bytes, - collateralPercentage: params.collateral_percentage / 100, + collateralPercentage: params.collateral_percentage, maxCollateralInputs: params.max_collateral_inputs, costModels: costModels, prices: { diff --git a/packages/blaze-sdk/CHANGELOG.md b/packages/blaze-sdk/CHANGELOG.md index 89878c3b..1165778e 100644 --- a/packages/blaze-sdk/CHANGELOG.md +++ b/packages/blaze-sdk/CHANGELOG.md @@ -1,5 +1,30 @@ # @blaze-cardano/sdk +## 0.2.1 + +### Patch Changes + +- Updated dependencies [88ee831] + - @blaze-cardano/tx@0.6.1 + - @blaze-cardano/uplc@0.1.30 + - @blaze-cardano/wallet@0.1.56 + +## 0.2.0 + +### Minor Changes + +- 471d47d: Submit built transactions through the wallet by default, while allowing a provider option. + +### Patch Changes + +- c951eec: avoid preCompleteHook overriding user selections +- Updated dependencies [c924f95] +- Updated dependencies [471d47d] +- Updated dependencies [c951eec] + - @blaze-cardano/tx@0.6.0 + - @blaze-cardano/uplc@0.1.29 + - @blaze-cardano/wallet@0.1.55 + ## 0.1.35 ### Patch Changes diff --git a/packages/blaze-sdk/package.json b/packages/blaze-sdk/package.json index dfe66196..1214dcb7 100644 --- a/packages/blaze-sdk/package.json +++ b/packages/blaze-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@blaze-cardano/sdk", - "version": "0.1.35", + "version": "0.2.1", "description": "Blaze cardano sdk library", "exports": { ".": { diff --git a/packages/blaze-sdk/src/blaze.ts b/packages/blaze-sdk/src/blaze.ts index f301f6d9..3a5c110a 100644 --- a/packages/blaze-sdk/src/blaze.ts +++ b/packages/blaze-sdk/src/blaze.ts @@ -51,8 +51,9 @@ export class Blaze { const changeAddress = await this.wallet.getChangeAddress(); tx.setNetworkId(await this.wallet.getNetworkId()) .addUnspentOutputs(myUtxos) - .setChangeAddress(changeAddress) - .useEvaluator((x, y) => this.provider.evaluateTransaction(x, y)); + // We do not want to override the change address if it was already set + .setChangeAddress(changeAddress, false) + .useEvaluator((x, y) => this.provider.evaluateTransaction(x, y), false); }); } @@ -95,9 +96,14 @@ export class Blaze { * @returns {Promise} - The transaction ID. * @throws {Error} If the transaction submission fails. * @description This method sends the provided transaction to the blockchain network - * using the configured provider. + * using the configured wallet, or the configured provider if set. */ - async submitTransaction(tx: Transaction): Promise { - return this.provider.postTransactionToChain(tx); + async submitTransaction( + tx: Transaction, + useProvider?: boolean, + ): Promise { + return useProvider + ? this.provider.postTransactionToChain(tx) + : this.wallet.postTransaction(tx); } } diff --git a/packages/blaze-tx/CHANGELOG.md b/packages/blaze-tx/CHANGELOG.md index 809b4ee2..ab8bfe9c 100644 --- a/packages/blaze-tx/CHANGELOG.md +++ b/packages/blaze-tx/CHANGELOG.md @@ -1,5 +1,22 @@ # @blaze-cardano/tx +## 0.6.1 + +### Patch Changes + +- 88ee831: Small fee calculation fix + +## 0.6.0 + +### Minor Changes + +- 471d47d: Submit built transactions through the wallet by default, while allowing a provider option. + +### Patch Changes + +- c924f95: Fix fee calculation before evaluation +- c951eec: avoid preCompleteHook overriding user selections + ## 0.5.17 ### Patch Changes diff --git a/packages/blaze-tx/package.json b/packages/blaze-tx/package.json index 69bb7574..cbc21a4e 100644 --- a/packages/blaze-tx/package.json +++ b/packages/blaze-tx/package.json @@ -1,6 +1,6 @@ { "name": "@blaze-cardano/tx", - "version": "0.5.17", + "version": "0.6.1", "description": "Blaze cardano transaction building library", "exports": { ".": { diff --git a/packages/blaze-tx/src/tx.ts b/packages/blaze-tx/src/tx.ts index c39faf3e..2c49ea2d 100644 --- a/packages/blaze-tx/src/tx.ts +++ b/packages/blaze-tx/src/tx.ts @@ -109,6 +109,7 @@ export class TxBuilder { private scriptScope: Set