-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: inverted submission flow (#3689)
* feat: interface change for prepareForSend * chore: pr release * feat: further support for the prepareForSend flow * feat: disable pr release * chore: remove redundant file * test: connector account tests * chore: docs * chore: changeset * chore: changeset * feat: pass connector params to prepareForSend --------- Co-authored-by: Peter Smith <[email protected]>
- Loading branch information
1 parent
5c6c659
commit dcec508
Showing
9 changed files
with
269 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@fuel-ts/account": patch | ||
--- | ||
|
||
feat: inverted submission flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { transactionRequestify, type TransactionRequestLike } from '../../src'; | ||
|
||
import { MockConnector } from './mocked-connector'; | ||
|
||
export class MockedPrepConnector extends MockConnector { | ||
override usePrepareForSend = true; | ||
|
||
override async prepareForSend( | ||
address: string, | ||
transaction: TransactionRequestLike | ||
): Promise<TransactionRequestLike> { | ||
const wallet = this._wallets.find((w) => w.address.toString() === address); | ||
if (!wallet) { | ||
throw new Error('Wallet is not found!'); | ||
} | ||
|
||
const request = transactionRequestify(transaction); | ||
const signature = await wallet.signTransaction(request); | ||
request.updateWitnessByOwner(wallet.address, signature); | ||
|
||
return request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters