Skip to content

Commit

Permalink
chore: submit transactions through the wallet by default (#177)
Browse files Browse the repository at this point in the history
* chore: submit transactions through the wallet by default

* chore: changeset

* chore: fmt
  • Loading branch information
cjkoepke authored Sep 17, 2024
1 parent c951eec commit 471d47d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/olive-comics-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@blaze-cardano/sdk": minor
"@blaze-cardano/tx": minor
---

Submit built transactions through the wallet by default, while allowing a provider option.
11 changes: 8 additions & 3 deletions packages/blaze-sdk/src/blaze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,14 @@ export class Blaze<ProviderType extends Provider, WalletType extends Wallet> {
* @returns {Promise<TransactionId>} - 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<TransactionId> {
return this.provider.postTransactionToChain(tx);
async submitTransaction(
tx: Transaction,
useProvider?: boolean,
): Promise<TransactionId> {
return useProvider
? this.provider.postTransactionToChain(tx)
: this.wallet.postTransaction(tx);
}
}

0 comments on commit 471d47d

Please sign in to comment.