Skip to content

Commit

Permalink
refactor(sdk): Remove zksend (#783)
Browse files Browse the repository at this point in the history
* refactor(sdk): Remove zksend

* refactor: remove zksend from pnpm-lock

* refactor: revert previous commit

---------

Co-authored-by: Begoña Alvarez <[email protected]>
  • Loading branch information
marc2332 and begonaalvarezd authored Jun 24, 2024
1 parent 9442651 commit a23410a
Show file tree
Hide file tree
Showing 35 changed files with 4 additions and 3,301 deletions.
39 changes: 0 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sdk/dapp-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"dependencies": {
"@iota/iota.js": "workspace:*",
"@iota/wallet-standard": "workspace:*",
"@iota/zksend": "workspace:*",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.5",
"@radix-ui/react-slot": "^1.0.2",
Expand Down
11 changes: 1 addition & 10 deletions sdk/dapp-kit/src/components/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { useAutoConnectWallet } from '../hooks/wallet/useAutoConnectWallet.js';
import { useUnsafeBurnerWallet } from '../hooks/wallet/useUnsafeBurnerWallet.js';
import { useWalletPropertiesChanged } from '../hooks/wallet/useWalletPropertiesChanged.js';
import { useWalletsChanged } from '../hooks/wallet/useWalletsChanged.js';
import type { ZkSendWalletConfig } from '../hooks/wallet/useZkSendWallet.js';
import { useZkSendWallet } from '../hooks/wallet/useZkSendWallet.js';
import { lightTheme } from '../themes/lightTheme.js';
import type { Theme } from '../themes/themeContract.js';
import { createInMemoryStore } from '../utils/stateStorage.js';
Expand All @@ -40,9 +38,6 @@ export type WalletProviderProps = {
/** Enables automatically reconnecting to the most recently used wallet account upon mounting. */
autoConnect?: boolean;

/** Enables the zkSend wallet */
zkSend?: ZkSendWalletConfig;

/** Configures how the most recently connected to wallet account is stored. Set to `null` to disable persisting state entirely. Defaults to using localStorage if it is available. */
storage?: StateStorage | null;

Expand All @@ -64,7 +59,6 @@ export function WalletProvider({
storageKey = DEFAULT_STORAGE_KEY,
enableUnsafeBurner = false,
autoConnect = false,
zkSend,
theme = lightTheme,
children,
}: WalletProviderProps) {
Expand All @@ -83,7 +77,6 @@ export function WalletProvider({
preferredWallets={preferredWallets}
requiredFeatures={requiredFeatures}
enableUnsafeBurner={enableUnsafeBurner}
zkSend={zkSend}
>
{/* TODO: We ideally don't want to inject styles if people aren't using the UI components */}
{theme ? <InjectedThemeStyles theme={theme} /> : null}
Expand All @@ -95,19 +88,17 @@ export function WalletProvider({

type WalletConnectionManagerProps = Pick<
WalletProviderProps,
'preferredWallets' | 'requiredFeatures' | 'enableUnsafeBurner' | 'zkSend' | 'children'
'preferredWallets' | 'requiredFeatures' | 'enableUnsafeBurner' | 'children'
>;

function WalletConnectionManager({
preferredWallets = DEFAULT_PREFERRED_WALLETS,
requiredFeatures = DEFAULT_REQUIRED_FEATURES,
enableUnsafeBurner = false,
zkSend,
children,
}: WalletConnectionManagerProps) {
useWalletsChanged(preferredWallets, requiredFeatures);
useWalletPropertiesChanged();
useZkSendWallet(zkSend);
useUnsafeBurnerWallet(enableUnsafeBurner);
useAutoConnectWallet();

Expand Down
3 changes: 1 addition & 2 deletions sdk/dapp-kit/src/constants/walletDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

import type { WalletWithRequiredFeatures } from '@iota/wallet-standard';
import { ZKSEND_WALLET_NAME } from '@iota/zksend';

import { createInMemoryStore } from '../utils/stateStorage.js';

Expand All @@ -18,4 +17,4 @@ export const DEFAULT_REQUIRED_FEATURES: (keyof WalletWithRequiredFeatures['featu
'iota:signTransactionBlock',
];

export const DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME, ZKSEND_WALLET_NAME];
export const DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME];
50 changes: 0 additions & 50 deletions sdk/dapp-kit/src/hooks/wallet/useZkSendWallet.ts

This file was deleted.

6 changes: 1 addition & 5 deletions sdk/dapp-kit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@
"jsx": "react-jsx",
"rootDir": "src"
},
"references": [
{ "path": "../typescript" },
{ "path": "../wallet-standard" },
{ "path": "../zksend" }
]
"references": [{ "path": "../typescript" }, { "path": "../wallet-standard" }]
}
1 change: 0 additions & 1 deletion sdk/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@iota/kiosk": "workspace:*",
"@iota/iota.js": "workspace:*",
"@iota/zklogin": "workspace:*",
"@iota/zksend": "workspace:*",
"@tanstack/react-query": "^5.0.0",
"@types/node": "^20.4.2",
"next": "^13.4.15",
Expand Down
4 changes: 0 additions & 4 deletions sdk/docs/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"title": "Kiosk SDK",
"type": "page"
},
"zksend": {
"title": "zkSend SDK",
"type": "page"
},
"bcs": {
"title": "BCS",
"type": "page"
Expand Down
1 change: 0 additions & 1 deletion sdk/docs/pages/dapp-kit/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"wallet-provider": "WalletProvider",
"wallet-components": "Wallet Components",
"wallet-hooks": "Wallet Hooks",
"zksend": "zkSend Integration",
"themes": "Themes"
}
2 changes: 0 additions & 2 deletions sdk/docs/pages/dapp-kit/wallet-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ All props are optional.
- `enableUnsafeBurner` - Enables the development-only unsafe burner wallet, useful for testing.
- `autoConnect` - Enables automatically reconnecting to the most recently used wallet account upon
mounting.
- `zkSend` - Enables and configures the zkSend wallet. Read more about how to
[use the zkSend integration](./zksend.mdx).
- `storage` - Configures how the most recently connected-to wallet account is stored. Set to
`null` to disable persisting state entirely. Defaults to using `localStorage` if it is
available.
Expand Down
24 changes: 0 additions & 24 deletions sdk/docs/pages/dapp-kit/zksend.mdx

This file was deleted.

5 changes: 0 additions & 5 deletions sdk/docs/pages/zksend/_meta.json

This file was deleted.

73 changes: 0 additions & 73 deletions sdk/docs/pages/zksend/dapp.mdx

This file was deleted.

12 changes: 0 additions & 12 deletions sdk/docs/pages/zksend/index.mdx

This file was deleted.

Loading

0 comments on commit a23410a

Please sign in to comment.