-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Section anchors / Refactor batch transactions (#167)
* Add anchors for transactions from web wallet provider * Improve due to feedback * Remove log * Rename prop * Update widgets * Remove useCallback * Update pingpong hook * Update widget * Remove useMemo * Rename getCallbackUrl * Extract function separately * Remove log * Rename type * Update import * Update import * Fix callbackroute * Rename function * Update batch transactions * Remove relative property * Remove log * Update based on feedback * Update interface * Add generic type for WidgetType * Use TokenTransfer instead of formatAmount * Fix interface
- Loading branch information
Showing
44 changed files
with
717 additions
and
403 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './sdkDappHelpers'; | ||
export * from './pingPong'; | ||
export * from './signAndSendTransactions'; |
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,26 @@ | ||
import { Transaction, TransactionsDisplayInfoType } from 'types'; | ||
|
||
import { refreshAccount, sendTransactions } from './sdkDappHelpers'; | ||
|
||
type SignAndSendTransactionsProps = { | ||
transactions: Transaction[]; | ||
callbackRoute: string; | ||
transactionsDisplayInfo: TransactionsDisplayInfoType; | ||
}; | ||
|
||
export const signAndSendTransactions = async ({ | ||
transactions, | ||
callbackRoute, | ||
transactionsDisplayInfo | ||
}: SignAndSendTransactionsProps) => { | ||
await refreshAccount(); | ||
|
||
const { sessionId } = await sendTransactions({ | ||
transactions, | ||
transactionsDisplayInfo, | ||
redirectAfterSign: false, | ||
callbackRoute | ||
}); | ||
|
||
return sessionId; | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './sdkDappHooks'; | ||
export * from './withPageTitle'; | ||
export * from './transactions'; | ||
export * from './useScrollToElement'; |
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
Oops, something went wrong.