-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: upgrade viem to support heterogeneous calls #1527
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
package.json
Outdated
@@ -70,7 +70,7 @@ | |||
"graphql-request": "^6.1.0", | |||
"jsdom": "^24.1.0", | |||
"packemon": "3.3.1", | |||
"permissionless": "^0.1.29", | |||
"permissionless": "^0.2.10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we still using this dependency after these changes (and under dependencies)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
f296883
to
38c7640
Compare
f44d315
to
f5bc044
Compare
@@ -93,75 +84,45 @@ export function TransactionProvider({ | |||
|
|||
const { switchChainAsync } = useSwitchChain(); | |||
|
|||
// Validate `calls` and `contracts` props | |||
if (!contracts && !calls) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is the same conditional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted
// For batched, use statusSendCalls or statusWriteContracts | ||
// For single, use statusSendCall or statusWriteContract | ||
// For batched, use statusSendCalls | ||
// For single, use statusSendCall | ||
const transactionStatus = useMemo(() => { | ||
const transactionStatuses = walletCapabilities[Capabilities.AtomicBatch] | ||
?.supported | ||
? { | ||
[TRANSACTION_TYPE_CALLS]: statusSendCalls, | ||
[TRANSACTION_TYPE_CONTRACTS]: statusWriteContracts, | ||
} | ||
: { | ||
[TRANSACTION_TYPE_CALLS]: statusSendCall, | ||
[TRANSACTION_TYPE_CONTRACTS]: statusWriteContract, | ||
}; | ||
return transactionStatuses[transactionType]; | ||
}, [ | ||
statusSendCalls, | ||
statusWriteContracts, | ||
statusSendCall, | ||
statusWriteContract, | ||
transactionType, | ||
walletCapabilities[Capabilities.AtomicBatch], | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
god bless
src/transaction/types.ts
Outdated
transactions: | ||
| Call[] | ||
| ContractFunctionParameters[] | ||
| (Call | ContractFunctionParameters)[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the same type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transactions: | |
| Call[] | |
| ContractFunctionParameters[] | |
| (Call | ContractFunctionParameters)[]; | |
transactions: (Call | ContractFunctionParameters)[]; |
What changed? Why?
Notes to reviewers
How has it been tested?