@provablehq/veil-aleo-react-hooks 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare function VeilProvider({ children, network, autoConnect, decryptPermissio
|
|
|
46
46
|
*
|
|
47
47
|
* @property rpcUrl Node endpoint both clients read through (and the wallet
|
|
48
48
|
* client falls back to). Defaults to the Provable API,
|
|
49
|
-
* `https://
|
|
49
|
+
* `https://edge.provable.com/api/v2`.
|
|
50
50
|
* @property network Network for the HTTP transport. Defaults to the connected
|
|
51
51
|
* wallet's network, or `'mainnet'` before a wallet connects. Set it to pin
|
|
52
52
|
* the transport to one network regardless of the wallet.
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
fallback
|
|
59
59
|
} from "@provablehq/veil-core";
|
|
60
60
|
import { fromWalletAdapter } from "@provablehq/veil-aleo-wallet-adapter";
|
|
61
|
-
var DEFAULT_API_URL = "https://
|
|
61
|
+
var DEFAULT_API_URL = "https://edge.provable.com/api/v2";
|
|
62
62
|
function useVeilWallet(config) {
|
|
63
63
|
const { rpcUrl = DEFAULT_API_URL } = config ?? {};
|
|
64
64
|
const wallet = useWallet();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/provider.tsx","../src/useVeilWallet.ts"],"sourcesContent":["import { useMemo, type ComponentProps, type ReactNode } from 'react'\nimport { AleoWalletProvider } from '@provablehq/aleo-wallet-adaptor-react'\nimport { ShieldWalletAdapter } from '@provablehq/aleo-wallet-adaptor-shield'\nimport { LeoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-leo'\nimport { PuzzleWalletAdapter } from '@provablehq/aleo-wallet-adaptor-puzzle'\nimport { FoxWalletAdapter } from '@provablehq/aleo-wallet-adaptor-fox'\nimport { Network } from '@provablehq/aleo-types'\nimport { WalletDecryptPermission } from '@provablehq/aleo-wallet-standard'\nimport type { RecordAccessGrant, AlgorithmGrant } from '@provablehq/veil-core'\n\nexport interface VeilProviderProps {\n children: ReactNode\n /** Network to connect to. Defaults to 'mainnet'. */\n network?: 'mainnet' | 'testnet'\n /** Auto-connect to previously used wallet. Defaults to true. */\n autoConnect?: boolean\n /** Decrypt permission level. Defaults to UponRequest. */\n decryptPermission?: WalletDecryptPermission\n /** Programs to register with the wallet for decrypt permissions. */\n programs?: string[]\n /** Override the default wallet list. If omitted, all known wallets are included. */\n wallets?: ComponentProps<typeof AleoWalletProvider>['wallets']\n /** Connect-time record/field access grant for privacy-preserving wallets. */\n recordAccess?: RecordAccessGrant\n /** If false, transact without the dapp ever learning the address. Defaults to true. */\n readAddress?: boolean\n /** Allowlist authorizing `derived` transaction inputs (e.g. blinding algorithms). */\n algorithmsAllowed?: AlgorithmGrant[]\n}\n\nconst networkMap = {\n mainnet: Network.MAINNET,\n testnet: Network.TESTNET,\n} as const\n\n/**\n * Batteries-included provider for veil + Aleo wallets.\n *\n * Wraps the app with wallet connection support. All known Aleo wallets\n * (Shield, Leo, Puzzle, Fox) are auto-configured.\n *\n * ```tsx\n * import { VeilProvider } from '@provablehq/veil-aleo-react-hooks'\n *\n * <VeilProvider network=\"mainnet\">\n * <App />\n * </VeilProvider>\n * ```\n */\nexport function VeilProvider({\n children,\n network = 'mainnet',\n autoConnect = true,\n decryptPermission = WalletDecryptPermission.UponRequest,\n programs,\n wallets: walletsOverride,\n recordAccess,\n readAddress,\n algorithmsAllowed,\n}: VeilProviderProps) {\n const wallets = useMemo(\n () =>\n walletsOverride ?? [\n new ShieldWalletAdapter(),\n new LeoWalletAdapter(),\n new PuzzleWalletAdapter(),\n new FoxWalletAdapter(),\n ],\n [walletsOverride],\n )\n\n return (\n <AleoWalletProvider\n wallets={wallets}\n network={networkMap[network]}\n autoConnect={autoConnect}\n decryptPermission={decryptPermission}\n programs={programs}\n recordAccess={recordAccess}\n readAddress={readAddress}\n algorithmsAllowed={algorithmsAllowed}\n >\n {children}\n </AleoWalletProvider>\n )\n}\n","import { useMemo } from 'react'\nimport { useWallet } from '@provablehq/aleo-wallet-adaptor-react'\nimport {\n createPublicClient,\n createWalletClient,\n http,\n fallback,\n type Network,\n type PublicClient,\n type TxHistoryResult,\n type WalletClient,\n} from '@provablehq/veil-core'\nimport { fromWalletAdapter, type AleoWalletAdapter } from '@provablehq/veil-aleo-wallet-adapter'\n\nconst DEFAULT_API_URL = 'https://api.provable.com/v2'\n\n/**\n * Options for {@link useVeilWallet}.\n *\n * @property rpcUrl Node endpoint both clients read through (and the wallet\n * client falls back to). Defaults to the Provable API,\n * `https://api.provable.com/v2`.\n * @property network Network for the HTTP transport. Defaults to the connected\n * wallet's network, or `'mainnet'` before a wallet connects. Set it to pin\n * the transport to one network regardless of the wallet.\n */\nexport interface UseVeilWalletConfig {\n rpcUrl?: string\n network?: 'mainnet' | 'testnet'\n}\n\n/**\n * Clients, connection state, and connection controls from {@link useVeilWallet}.\n *\n * @property publicClient Read-only client for chain queries. Usable with or\n * without a connected wallet.\n * @property walletClient Write client that signs and submits through the\n * connected wallet. `undefined` until a wallet connects — gate writes on it.\n * @property address The connected account's address, or `null` when disconnected.\n * @property connected True once a wallet session is established and\n * `walletClient` is available.\n * @property connecting True while a connect is in flight — use it to disable\n * the connect button.\n * @property connect Opens the wallet's approval flow on its current network.\n * Pass a wallet name to select and connect in one step; otherwise the wallet\n * chosen via `selectWallet` is connected.\n * @property disconnect Ends the wallet session; `walletClient` becomes\n * `undefined` and `address` becomes `null`.\n * @property wallets Detected wallets with their install status, for building a\n * wallet picker.\n * @property selectWallet Chooses which wallet a later `connect()` opens, by name.\n */\nexport interface UseVeilWalletReturn {\n publicClient: PublicClient\n walletClient: WalletClient | undefined\n address: string | null\n connected: boolean\n connecting: boolean\n connect: (walletName?: string) => Promise<void>\n disconnect: () => Promise<void>\n wallets: ReturnType<typeof useWallet>['wallets']\n selectWallet: (name: string) => void\n}\n\n/**\n * All-in-one hook for veil + Aleo wallet interaction.\n *\n * Returns a publicClient (always available) and a walletClient\n * (available after wallet connection). No manual adapter bridging needed.\n *\n * ```tsx\n * import { useVeilWallet } from '@provablehq/veil-aleo-react-hooks'\n *\n * function App() {\n * const { publicClient, walletClient, address, connect } = useVeilWallet()\n *\n * // Read — always works\n * const balance = await publicClient.getBalance({ address: 'aleo1...' })\n *\n * // Write — after connect\n * const txId = await walletClient.writeContract({\n * program: 'my_program.aleo',\n * function: 'transfer',\n * inputs: ['aleo1...', '100u64'],\n * fee: 500_000n,\n * })\n * }\n * ```\n */\nexport function useVeilWallet(config?: UseVeilWalletConfig): UseVeilWalletReturn {\n const { rpcUrl = DEFAULT_API_URL } = config ?? {}\n\n const wallet = useWallet()\n\n // Derive network from the wallet provider context, with config override\n const network = config?.network ?? (wallet.network === 'testnet' ? 'testnet' : 'mainnet')\n\n const publicClient = useMemo(\n () => createPublicClient({ transport: http(rpcUrl, { network }) }),\n [rpcUrl, network],\n )\n\n const walletClient = useMemo(() => {\n if (!wallet.connected || !wallet.address || !wallet.network) return undefined\n\n const walletNetwork: Network = wallet.network === 'testnet' ? 'testnet' : 'mainnet'\n\n const adapter: AleoWalletAdapter = {\n account: { address: wallet.address },\n connected: wallet.connected,\n network: walletNetwork,\n signMessage: (message: Uint8Array) =>\n wallet.signMessage(message).then((r) => r ?? new Uint8Array()),\n executeTransaction: (options) =>\n wallet.executeTransaction(options).then((r) => r ?? { transactionId: '' }),\n executeDeployment: (deployment) => wallet.executeDeployment(deployment),\n transactionStatus: (txId) => wallet.transactionStatus(txId),\n decrypt: (cipherText) => wallet.decrypt(cipherText),\n requestRecords: (program, includePlaintext) =>\n wallet.requestRecords(program, includePlaintext),\n transitionViewKeys: (txId) => wallet.transitionViewKeys(txId),\n switchNetwork: async (network) => {\n await wallet.switchNetwork(network as any)\n },\n requestTransactionHistory: (program) =>\n wallet.requestTransactionHistory(program) as Promise<TxHistoryResult>,\n algorithmsSupported: () => wallet.algorithmsSupported(),\n }\n\n const { account, transport: walletTransport } = fromWalletAdapter(adapter)\n\n return createWalletClient({\n account,\n transport: fallback([walletTransport, http(rpcUrl, { network })]),\n })\n }, [wallet.connected, wallet.address, wallet.network, rpcUrl, network])\n\n const connect = async (walletName?: string) => {\n if (walletName) {\n wallet.selectWallet(walletName as Parameters<typeof wallet.selectWallet>[0])\n // Allow React to process the selection before connecting\n await new Promise((r) => setTimeout(r, 0))\n }\n await wallet.connect(wallet.network!)\n }\n\n return {\n publicClient,\n walletClient,\n address: wallet.address,\n connected: wallet.connected,\n connecting: wallet.connecting,\n connect,\n disconnect: () => wallet.disconnect(),\n wallets: wallet.wallets,\n selectWallet: wallet.selectWallet as unknown as (name: string) => void,\n }\n}\n"],"mappings":";AAAA,SAAS,eAAoD;AAC7D,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,+BAA+B;AAiEpC;AA1CJ,IAAM,aAAa;AAAA,EACjB,SAAS,QAAQ;AAAA,EACjB,SAAS,QAAQ;AACnB;AAgBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,cAAc;AAAA,EACd,oBAAoB,wBAAwB;AAAA,EAC5C;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAsB;AACpB,QAAM,UAAU;AAAA,IACd,MACE,mBAAmB;AAAA,MACjB,IAAI,oBAAoB;AAAA,MACxB,IAAI,iBAAiB;AAAA,MACrB,IAAI,oBAAoB;AAAA,MACxB,IAAI,iBAAiB;AAAA,IACvB;AAAA,IACF,CAAC,eAAe;AAAA,EAClB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW,OAAO;AAAA,MAC3B;AAAA,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AA,MACjD,oBAAoB,CAAC,SAAS,OAAO,mBAAmB,IAAI;AAAA,MAC5D,eAAe,OAAOC,aAAY;AAChC,cAAM,OAAO,cAAcA,QAAc;AAAA,MAC3C;AAAA,MACA,2BAA2B,CAAC,YAC1B,OAAO,0BAA0B,OAAO;AAAA,MAC1C,qBAAqB,MAAM,OAAO,oBAAoB;AAAA,IACxD;AAEA,UAAM,EAAE,SAAS,WAAW,gBAAgB,IAAI,kBAAkB,OAAO;AAEzE,WAAO,mBAAmB;AAAA,MACxB;AAAA,MACA,WAAW,SAAS,CAAC,iBAAiB,KAAK,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAAA,IAClE,CAAC;AAAA,EACH,GAAG,CAAC,OAAO,WAAW,OAAO,SAAS,OAAO,SAAS,QAAQ,OAAO,CAAC;AAEtE,QAAM,UAAU,OAAO,eAAwB;AAC7C,QAAI,YAAY;AACd,aAAO,aAAa,UAAuD;AAE3E,YAAM,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAAA,IAC3C;AACA,UAAM,OAAO,QAAQ,OAAO,OAAQ;AAAA,EACtC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,WAAW,OAAO;AAAA,IAClB,YAAY,OAAO;AAAA,IACnB;AAAA,IACA,YAAY,MAAM,OAAO,WAAW;AAAA,IACpC,SAAS,OAAO;AAAA,IAChB,cAAc,OAAO;AAAA,EACvB;AACF;","names":["useMemo","network"]}
|
|
1
|
+
{"version":3,"sources":["../src/provider.tsx","../src/useVeilWallet.ts"],"sourcesContent":["import { useMemo, type ComponentProps, type ReactNode } from 'react'\nimport { AleoWalletProvider } from '@provablehq/aleo-wallet-adaptor-react'\nimport { ShieldWalletAdapter } from '@provablehq/aleo-wallet-adaptor-shield'\nimport { LeoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-leo'\nimport { PuzzleWalletAdapter } from '@provablehq/aleo-wallet-adaptor-puzzle'\nimport { FoxWalletAdapter } from '@provablehq/aleo-wallet-adaptor-fox'\nimport { Network } from '@provablehq/aleo-types'\nimport { WalletDecryptPermission } from '@provablehq/aleo-wallet-standard'\nimport type { RecordAccessGrant, AlgorithmGrant } from '@provablehq/veil-core'\n\nexport interface VeilProviderProps {\n children: ReactNode\n /** Network to connect to. Defaults to 'mainnet'. */\n network?: 'mainnet' | 'testnet'\n /** Auto-connect to previously used wallet. Defaults to true. */\n autoConnect?: boolean\n /** Decrypt permission level. Defaults to UponRequest. */\n decryptPermission?: WalletDecryptPermission\n /** Programs to register with the wallet for decrypt permissions. */\n programs?: string[]\n /** Override the default wallet list. If omitted, all known wallets are included. */\n wallets?: ComponentProps<typeof AleoWalletProvider>['wallets']\n /** Connect-time record/field access grant for privacy-preserving wallets. */\n recordAccess?: RecordAccessGrant\n /** If false, transact without the dapp ever learning the address. Defaults to true. */\n readAddress?: boolean\n /** Allowlist authorizing `derived` transaction inputs (e.g. blinding algorithms). */\n algorithmsAllowed?: AlgorithmGrant[]\n}\n\nconst networkMap = {\n mainnet: Network.MAINNET,\n testnet: Network.TESTNET,\n} as const\n\n/**\n * Batteries-included provider for veil + Aleo wallets.\n *\n * Wraps the app with wallet connection support. All known Aleo wallets\n * (Shield, Leo, Puzzle, Fox) are auto-configured.\n *\n * ```tsx\n * import { VeilProvider } from '@provablehq/veil-aleo-react-hooks'\n *\n * <VeilProvider network=\"mainnet\">\n * <App />\n * </VeilProvider>\n * ```\n */\nexport function VeilProvider({\n children,\n network = 'mainnet',\n autoConnect = true,\n decryptPermission = WalletDecryptPermission.UponRequest,\n programs,\n wallets: walletsOverride,\n recordAccess,\n readAddress,\n algorithmsAllowed,\n}: VeilProviderProps) {\n const wallets = useMemo(\n () =>\n walletsOverride ?? [\n new ShieldWalletAdapter(),\n new LeoWalletAdapter(),\n new PuzzleWalletAdapter(),\n new FoxWalletAdapter(),\n ],\n [walletsOverride],\n )\n\n return (\n <AleoWalletProvider\n wallets={wallets}\n network={networkMap[network]}\n autoConnect={autoConnect}\n decryptPermission={decryptPermission}\n programs={programs}\n recordAccess={recordAccess}\n readAddress={readAddress}\n algorithmsAllowed={algorithmsAllowed}\n >\n {children}\n </AleoWalletProvider>\n )\n}\n","import { useMemo } from 'react'\nimport { useWallet } from '@provablehq/aleo-wallet-adaptor-react'\nimport {\n createPublicClient,\n createWalletClient,\n http,\n fallback,\n type Network,\n type PublicClient,\n type TxHistoryResult,\n type WalletClient,\n} from '@provablehq/veil-core'\nimport { fromWalletAdapter, type AleoWalletAdapter } from '@provablehq/veil-aleo-wallet-adapter'\n\nconst DEFAULT_API_URL = 'https://edge.provable.com/api/v2'\n\n/**\n * Options for {@link useVeilWallet}.\n *\n * @property rpcUrl Node endpoint both clients read through (and the wallet\n * client falls back to). Defaults to the Provable API,\n * `https://edge.provable.com/api/v2`.\n * @property network Network for the HTTP transport. Defaults to the connected\n * wallet's network, or `'mainnet'` before a wallet connects. Set it to pin\n * the transport to one network regardless of the wallet.\n */\nexport interface UseVeilWalletConfig {\n rpcUrl?: string\n network?: 'mainnet' | 'testnet'\n}\n\n/**\n * Clients, connection state, and connection controls from {@link useVeilWallet}.\n *\n * @property publicClient Read-only client for chain queries. Usable with or\n * without a connected wallet.\n * @property walletClient Write client that signs and submits through the\n * connected wallet. `undefined` until a wallet connects — gate writes on it.\n * @property address The connected account's address, or `null` when disconnected.\n * @property connected True once a wallet session is established and\n * `walletClient` is available.\n * @property connecting True while a connect is in flight — use it to disable\n * the connect button.\n * @property connect Opens the wallet's approval flow on its current network.\n * Pass a wallet name to select and connect in one step; otherwise the wallet\n * chosen via `selectWallet` is connected.\n * @property disconnect Ends the wallet session; `walletClient` becomes\n * `undefined` and `address` becomes `null`.\n * @property wallets Detected wallets with their install status, for building a\n * wallet picker.\n * @property selectWallet Chooses which wallet a later `connect()` opens, by name.\n */\nexport interface UseVeilWalletReturn {\n publicClient: PublicClient\n walletClient: WalletClient | undefined\n address: string | null\n connected: boolean\n connecting: boolean\n connect: (walletName?: string) => Promise<void>\n disconnect: () => Promise<void>\n wallets: ReturnType<typeof useWallet>['wallets']\n selectWallet: (name: string) => void\n}\n\n/**\n * All-in-one hook for veil + Aleo wallet interaction.\n *\n * Returns a publicClient (always available) and a walletClient\n * (available after wallet connection). No manual adapter bridging needed.\n *\n * ```tsx\n * import { useVeilWallet } from '@provablehq/veil-aleo-react-hooks'\n *\n * function App() {\n * const { publicClient, walletClient, address, connect } = useVeilWallet()\n *\n * // Read — always works\n * const balance = await publicClient.getBalance({ address: 'aleo1...' })\n *\n * // Write — after connect\n * const txId = await walletClient.writeContract({\n * program: 'my_program.aleo',\n * function: 'transfer',\n * inputs: ['aleo1...', '100u64'],\n * fee: 500_000n,\n * })\n * }\n * ```\n */\nexport function useVeilWallet(config?: UseVeilWalletConfig): UseVeilWalletReturn {\n const { rpcUrl = DEFAULT_API_URL } = config ?? {}\n\n const wallet = useWallet()\n\n // Derive network from the wallet provider context, with config override\n const network = config?.network ?? (wallet.network === 'testnet' ? 'testnet' : 'mainnet')\n\n const publicClient = useMemo(\n () => createPublicClient({ transport: http(rpcUrl, { network }) }),\n [rpcUrl, network],\n )\n\n const walletClient = useMemo(() => {\n if (!wallet.connected || !wallet.address || !wallet.network) return undefined\n\n const walletNetwork: Network = wallet.network === 'testnet' ? 'testnet' : 'mainnet'\n\n const adapter: AleoWalletAdapter = {\n account: { address: wallet.address },\n connected: wallet.connected,\n network: walletNetwork,\n signMessage: (message: Uint8Array) =>\n wallet.signMessage(message).then((r) => r ?? new Uint8Array()),\n executeTransaction: (options) =>\n wallet.executeTransaction(options).then((r) => r ?? { transactionId: '' }),\n executeDeployment: (deployment) => wallet.executeDeployment(deployment),\n transactionStatus: (txId) => wallet.transactionStatus(txId),\n decrypt: (cipherText) => wallet.decrypt(cipherText),\n requestRecords: (program, includePlaintext) =>\n wallet.requestRecords(program, includePlaintext),\n transitionViewKeys: (txId) => wallet.transitionViewKeys(txId),\n switchNetwork: async (network) => {\n await wallet.switchNetwork(network as any)\n },\n requestTransactionHistory: (program) =>\n wallet.requestTransactionHistory(program) as Promise<TxHistoryResult>,\n algorithmsSupported: () => wallet.algorithmsSupported(),\n }\n\n const { account, transport: walletTransport } = fromWalletAdapter(adapter)\n\n return createWalletClient({\n account,\n transport: fallback([walletTransport, http(rpcUrl, { network })]),\n })\n }, [wallet.connected, wallet.address, wallet.network, rpcUrl, network])\n\n const connect = async (walletName?: string) => {\n if (walletName) {\n wallet.selectWallet(walletName as Parameters<typeof wallet.selectWallet>[0])\n // Allow React to process the selection before connecting\n await new Promise((r) => setTimeout(r, 0))\n }\n await wallet.connect(wallet.network!)\n }\n\n return {\n publicClient,\n walletClient,\n address: wallet.address,\n connected: wallet.connected,\n connecting: wallet.connecting,\n connect,\n disconnect: () => wallet.disconnect(),\n wallets: wallet.wallets,\n selectWallet: wallet.selectWallet as unknown as (name: string) => void,\n }\n}\n"],"mappings":";AAAA,SAAS,eAAoD;AAC7D,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,+BAA+B;AAiEpC;AA1CJ,IAAM,aAAa;AAAA,EACjB,SAAS,QAAQ;AAAA,EACjB,SAAS,QAAQ;AACnB;AAgBO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,cAAc;AAAA,EACd,oBAAoB,wBAAwB;AAAA,EAC5C;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAsB;AACpB,QAAM,UAAU;AAAA,IACd,MACE,mBAAmB;AAAA,MACjB,IAAI,oBAAoB;AAAA,MACxB,IAAI,iBAAiB;AAAA,MACrB,IAAI,oBAAoB;AAAA,MACxB,IAAI,iBAAiB;AAAA,IACvB;AAAA,IACF,CAAC,eAAe;AAAA,EAClB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS,WAAW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AO,eAAe,SAAS,gBAAgB;AAAA,MACjD,oBAAoB,CAAC,SAAS,OAAO,mBAAmB,IAAI;AAAA,MAC5D,eAAe,OAAOC,aAAY;AAChC,cAAM,OAAO,cAAcA,QAAc;AAAA,MAC3C;AAAA,MACA,2BAA2B,CAAC,YAC1B,OAAO,0BAA0B,OAAO;AAAA,MAC1C,qBAAqB,MAAM,OAAO,oBAAoB;AAAA,IACxD;AAEA,UAAM,EAAE,SAAS,WAAW,gBAAgB,IAAI,kBAAkB,OAAO;AAEzE,WAAO,mBAAmB;AAAA,MACxB;AAAA,MACA,WAAW,SAAS,CAAC,iBAAiB,KAAK,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAAA,IAClE,CAAC;AAAA,EACH,GAAG,CAAC,OAAO,WAAW,OAAO,SAAS,OAAO,SAAS,QAAQ,OAAO,CAAC;AAEtE,QAAM,UAAU,OAAO,eAAwB;AAC7C,QAAI,YAAY;AACd,aAAO,aAAa,UAAuD;AAE3E,YAAM,IAAI,QAAQ,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAAA,IAC3C;AACA,UAAM,OAAO,QAAQ,OAAO,OAAQ;AAAA,EACtC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,WAAW,OAAO;AAAA,IAClB,YAAY,OAAO;AAAA,IACnB;AAAA,IACA,YAAY,MAAM,OAAO,WAAW;AAAA,IACpC,SAAS,OAAO;AAAA,IAChB,cAAc,OAAO;AAAA,EACvB;AACF;","names":["useMemo","network"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provablehq/veil-aleo-react-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "React hooks and providers for the building web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@provablehq/aleo-wallet-adaptor-fox": "1.0.0",
|
|
40
40
|
"@provablehq/aleo-types": "1.0.0",
|
|
41
41
|
"@provablehq/aleo-wallet-standard": "1.0.0",
|
|
42
|
-
"@provablehq/veil-
|
|
43
|
-
"@provablehq/veil-
|
|
42
|
+
"@provablehq/veil-core": "0.11.0",
|
|
43
|
+
"@provablehq/veil-aleo-wallet-adapter": "0.11.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/react": "^19.0.0",
|