From 09dfb0dcd4a46b23bcf3003a85df8a67b98252ac Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Wed, 20 Nov 2024 08:33:04 -0800 Subject: [PATCH] address pr comments --- package.json | 1 - src/transaction/components/TransactionProvider.tsx | 4 ++-- src/transaction/types.ts | 10 ++-------- yarn.lock | 10 ---------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 2b9579365b..1a4a9db160 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "graphql-request": "^6.1.0", "jsdom": "^24.1.0", "packemon": "3.3.1", - "permissionless": "^0.2.10", "react": "^18", "react-dom": "^18", "rimraf": "^5.0.5", diff --git a/src/transaction/components/TransactionProvider.tsx b/src/transaction/components/TransactionProvider.tsx index 148cc5cc48..bc5e744e0b 100644 --- a/src/transaction/components/TransactionProvider.tsx +++ b/src/transaction/components/TransactionProvider.tsx @@ -84,8 +84,8 @@ export function TransactionProvider({ const { switchChainAsync } = useSwitchChain(); - // Validate `calls` props - if (!calls && !contracts) { + // Validate `calls` and `contracts` props + if (!contracts && !calls) { throw new Error( 'Transaction: calls or contracts must be provided as a prop to the Transaction component.', ); diff --git a/src/transaction/types.ts b/src/transaction/types.ts index 1196271479..2539a01846 100644 --- a/src/transaction/types.ts +++ b/src/transaction/types.ts @@ -104,18 +104,12 @@ export type SendBatchedTransactionsParams = { capabilities?: WalletCapabilities; // biome-ignore lint: cannot find module 'wagmi/experimental/query' sendCallsAsync: any; - transactions?: - | Call[] - | ContractFunctionParameters[] - | (Call | ContractFunctionParameters)[]; + transactions?: (Call | ContractFunctionParameters)[]; }; export type SendSingleTransactionParams = { sendCallAsync: SendTransactionMutateAsync | (() => void); - transactions: - | Call[] - | ContractFunctionParameters[] - | (Call | ContractFunctionParameters)[]; + transactions: (Call | ContractFunctionParameters)[]; }; /** diff --git a/yarn.lock b/yarn.lock index 8e5910a01c..fcc68d0df0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2208,7 +2208,6 @@ __metadata: graphql-request: "npm:^6.1.0" jsdom: "npm:^24.1.0" packemon: "npm:3.3.1" - permissionless: "npm:^0.2.10" react: "npm:^18" react-dom: "npm:^18" rimraf: "npm:^5.0.5" @@ -12910,15 +12909,6 @@ __metadata: languageName: node linkType: hard -"permissionless@npm:^0.2.10": - version: 0.2.13 - resolution: "permissionless@npm:0.2.13" - peerDependencies: - viem: ^2.21.22 - checksum: f941956c5f8723c5490843ee2c794ae992f8f6211e8773dd602774955a8d12aee36a262a034344646b27bcdca8d6d3dc91a0a94fb6b0fd3c7929cf5ca4ea2a91 - languageName: node - linkType: hard - "picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": version: 1.0.1 resolution: "picocolors@npm:1.0.1"