@provablehq/veil-aleo-wallet-adapter 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/README.md CHANGED
@@ -46,7 +46,7 @@ const { account, transport } = fromWalletAdapter(wallet)
46
46
 
47
47
  const client = createWalletClient({
48
48
  account,
49
- transport: fallback([transport, http('https://api.provable.com/v2')]),
49
+ transport: fallback([transport, http('https://edge.provable.com/api/v2')]),
50
50
  })
51
51
  ```
52
52
 
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core';
25
25
  *
26
26
  * const walletClient = createWalletClient({
27
27
  * account,
28
- * transport: fallback([transport, http('https://api.provable.com/v2')]),
28
+ * transport: fallback([transport, http('https://edge.provable.com/api/v2')]),
29
29
  * })
30
30
  */
31
31
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @provablehq/veil-aleo-wallet-adapter\n *\n * Wraps @provablehq/aleo-wallet-adaptor-core into veil's\n * Account and Transport interfaces.\n *\n * Usage with any wallet adapter (Leo, Puzzle, Fox, Shield):\n *\n * import { LeoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-leo'\n * import { fromWalletAdapter } from '@provablehq/veil-aleo-wallet-adapter'\n * import { createWalletClient, http, fallback } from '@provablehq/veil-core'\n *\n * const leoWallet = new LeoWalletAdapter()\n * await leoWallet.connect(Network.MAINNET, DecryptPermission.UponRequest)\n *\n * const { account, transport } = fromWalletAdapter(leoWallet)\n *\n * const walletClient = createWalletClient({\n * account,\n * transport: fallback([transport, http('https://api.provable.com/v2')]),\n * })\n */\n\nimport { custom } from '@provablehq/veil-core'\nimport type { Network, RpcAccount, Transport, TransactionStatusResponse, TxHistoryResult } from '@provablehq/veil-core'\n\n// Import the real types from the Provable ecosystem\nimport type { TransactionOptions, TransactionInput } from '@provablehq/aleo-types'\nimport type { AleoDeployment } from '@provablehq/aleo-wallet-standard'\nimport type { RecordStatusFilter } from '@provablehq/veil-core'\nimport type { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core'\n\n// Re-export useful types so consumers don't need extra imports\nexport type { TransactionOptions } from '@provablehq/aleo-types'\nexport type { Network, TransactionStatusResponse, TxHistoryResult } from '@provablehq/veil-core'\nexport type { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core'\n\n// Re-export the privacy-feature types (Veil mirrors) so consumers can import them\n// from the wallet-adapter boundary alongside fromWalletAdapter.\n//\n// The upstream error classes (WalletAddressWithheldError, etc.) are deliberately\n// NOT re-exported here: @provablehq/aleo-wallet-adaptor-core is an OPTIONAL peer\n// dependency, and a value re-export would compile to a static runtime import,\n// breaking consumers who use fromWalletAdapter without installing -core. Consumers\n// that need to catch those classes import them from\n// @provablehq/aleo-wallet-adaptor-core directly.\nexport type {\n TransactionInput,\n InputRequest,\n RecordFilters,\n RecordView,\n ConnectOptions,\n RecordAccessGrant,\n AlgorithmGrant,\n} from '@provablehq/veil-core'\n\n// --------------------------------------------------------------------------\n// Wallet adapter interface — matches BaseAleoWalletAdapter from\n// @provablehq/aleo-wallet-adaptor-core\n// --------------------------------------------------------------------------\n\n/**\n * The post-connect subset of the Provable wallet standard's `WalletAdapter`\n * interface — covers the methods veil invokes after a wallet is already\n * connected. `connect` and `disconnect` are deliberately omitted; consumers\n * call those on the adapter directly before passing it to `fromWalletAdapter`.\n *\n * All standard-conforming adapters (Leo, Puzzle, Fox, Shield) satisfy this\n * shape because their classes implement every method declared here.\n * Implementations that don't support a given feature should throw at runtime\n * (the standard's `WalletFeatureNotAvailableError` contract).\n */\nexport interface AleoWalletAdapter {\n /** The connected account. */\n account?: { address: string; viewKey?: string; privateKey?: string }\n\n /** Whether the wallet is currently connected. */\n connected: boolean\n\n /** The wallet's currently selected network. May be null before connect. */\n network: Network | null\n\n /** Sign an arbitrary message — returns raw signature bytes. */\n signMessage(message: Uint8Array): Promise<Uint8Array>\n\n /** Execute a program function — returns temporary transaction id. */\n executeTransaction(options: TransactionOptions): Promise<{ transactionId: string }>\n\n /** Deploy a program — returns temporary transaction id. */\n executeDeployment(deployment: AleoDeployment): Promise<{ transactionId: string }>\n\n /** Get the status of a submitted transaction. */\n transactionStatus(transactionId: string): Promise<TransactionStatusResponse>\n\n /**\n * Decrypt a record ciphertext using the wallet's view key.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false` — decryption would reveal the address.\n */\n decrypt(\n cipherText: string,\n tpk?: string,\n programId?: string,\n functionName?: string,\n index?: number,\n ): Promise<string>\n\n /**\n * Request records for a program.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n requestRecords(\n program: string,\n includePlaintext: boolean,\n statusFilter?: RecordStatusFilter,\n ): Promise<unknown[]>\n\n /**\n * Get transition view keys for a transaction.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n transitionViewKeys(transactionId: string): Promise<string[]>\n\n /** Switch the connected network. May throw if the wallet doesn't support it. */\n switchNetwork(network: Network): Promise<void>\n\n /**\n * Get transaction history for a program. May throw if the wallet doesn't support it.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n requestTransactionHistory(program: string): Promise<TxHistoryResult>\n\n /**\n * List the derived-input algorithms this wallet supports. Empty if none.\n *\n * Optional: wallets that predate the privacy feature omit it, in which case\n * the transport reports no supported algorithms.\n */\n algorithmsSupported?(): Promise<string[]>\n}\n\n/**\n * Union of Veil's minimal interface and the real BaseAleoWalletAdapter.\n * All public functions accept either shape — duck-typing handles\n * the differences since both expose the same method signatures.\n */\nexport type AnyWalletAdapter = AleoWalletAdapter | BaseAleoWalletAdapter\n\n// --------------------------------------------------------------------------\n// Account adapter\n// --------------------------------------------------------------------------\n\n/**\n * Creates an veil RpcAccount from a connected wallet adapter.\n *\n * The adapter must be connected (adapter.account must exist).\n * Sign operations are delegated to the wallet.\n */\nexport function rpcAccountFromAdapter(adapter: AnyWalletAdapter): RpcAccount {\n if (!adapter.account) {\n throw new Error(\n 'Wallet adapter is not connected. Call adapter.connect() before creating an account.',\n )\n }\n\n const address = adapter.account.address\n\n return {\n type: 'rpc',\n address,\n sign: (message: Uint8Array) => adapter.signMessage(message),\n signMessage: (message: Uint8Array) => adapter.signMessage(message),\n }\n}\n\n// --------------------------------------------------------------------------\n// Transport adapter\n// --------------------------------------------------------------------------\n\n/**\n * Creates an veil custom transport that routes wallet-specific\n * operations through the adapter.\n *\n * This transport handles:\n * - executeTransaction → adapter.executeTransaction()\n * - deployProgram → adapter.executeDeployment()\n * - signMessage → adapter.signMessage()\n * - decrypt → adapter.decrypt()\n * - requestRecords → adapter.requestRecords()\n * - transactionStatus → adapter.transactionStatus()\n * - transitionViewKeys → adapter.transitionViewKeys()\n *\n * Read operations (getBlock, getBalance, etc.) are NOT handled — pair\n * with http() via fallback() for full coverage:\n *\n * fallback([transportFromAdapter(adapter), http(url)])\n */\nexport function transportFromAdapter(adapter: AnyWalletAdapter): Transport<'custom'> {\n return custom({\n key: 'walletAdapter',\n name: 'Wallet Adapter Transport',\n request: async ({ method, params }) => {\n const p = params as Record<string, unknown> | undefined\n\n switch (method) {\n case 'executeTransaction': {\n const options: TransactionOptions = {\n program: p?.programName as string,\n function: p?.functionName as string,\n // Inputs may be Aleo-encoded strings or InputRequest objects the wallet\n // fulfils (address/record/derived); pass them through untouched.\n inputs: p?.inputs as TransactionInput[],\n privateFee: (p?.privateFee as boolean) ?? false,\n }\n if (p?.imports != null) {\n options.imports = p.imports as string[]\n }\n const result = await adapter.executeTransaction(options)\n return result.transactionId\n }\n\n case 'deployProgram': {\n // The wallet-standard `AleoDeployment` shape requires `priorityFee`,\n // but Veil's user-facing API treats fees as auto-estimated; pass 0 so\n // the wallet uses its own default.\n const deployment: AleoDeployment = {\n program: p?.program as string,\n address: adapter.account?.address ?? '',\n priorityFee: 0,\n privateFee: (p?.privateFee as boolean) ?? false,\n }\n const result = await adapter.executeDeployment(deployment)\n return result.transactionId\n }\n\n case 'signMessage': {\n return adapter.signMessage(p?.message as Uint8Array)\n }\n\n case 'decrypt':\n return adapter.decrypt(\n p?.cipherText as string,\n p?.tpk as string | undefined,\n p?.programId as string | undefined,\n p?.functionName as string | undefined,\n p?.index as number | undefined,\n )\n\n case 'requestRecords':\n return adapter.requestRecords(\n p?.program as string,\n (p?.includePlaintext as boolean) ?? true,\n p?.statusFilter as RecordStatusFilter | undefined,\n )\n\n case 'transactionStatus': {\n return adapter.transactionStatus(p?.transactionId as string)\n }\n\n case 'getTransitionViewKeys': {\n return adapter.transitionViewKeys(p?.id as string)\n }\n\n case 'algorithmsSupported': {\n return adapter.algorithmsSupported ? adapter.algorithmsSupported() : []\n }\n\n case 'switchNetwork': {\n // Cast: BaseAleoWalletAdapter expects @provablehq/aleo-types' Network\n // enum, AleoWalletAdapter expects @provablehq/veil-core's string-union Network.\n // Runtime values are identical strings.\n return (adapter.switchNetwork as (n: unknown) => Promise<void>)(p?.network)\n }\n\n case 'requestTransactionHistory': {\n return adapter.requestTransactionHistory(p?.program as string)\n }\n\n case 'getChainId': {\n return adapter.network\n }\n\n default:\n throw new Error(\n `Wallet adapter transport does not handle method \"${method}\". ` +\n 'Use fallback([transportFromAdapter(adapter), http(url)]) for read methods.',\n )\n }\n },\n })\n}\n\n// --------------------------------------------------------------------------\n// Convenience\n// --------------------------------------------------------------------------\n\n/**\n * Creates both an veil account and transport from a connected\n * wallet adapter. This is the primary entry point.\n *\n * const { account, transport } = fromWalletAdapter(leoWallet)\n * const client = createWalletClient({ account, transport })\n */\nexport function fromWalletAdapter(adapter: AnyWalletAdapter): {\n account: RpcAccount\n transport: Transport<'custom'>\n} {\n return {\n account: rpcAccountFromAdapter(adapter),\n transport: transportFromAdapter(adapter),\n }\n}\n"],"mappings":";AAuBA,SAAS,cAAc;AA8IhB,SAAS,sBAAsB,SAAuC;AAC3E,MAAI,CAAC,QAAQ,SAAS;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU,QAAQ,QAAQ;AAEhC,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,MAAM,CAAC,YAAwB,QAAQ,YAAY,OAAO;AAAA,IAC1D,aAAa,CAAC,YAAwB,QAAQ,YAAY,OAAO;AAAA,EACnE;AACF;AAwBO,SAAS,qBAAqB,SAAgD;AACnF,SAAO,OAAO;AAAA,IACZ,KAAK;AAAA,IACL,MAAM;AAAA,IACN,SAAS,OAAO,EAAE,QAAQ,OAAO,MAAM;AACrC,YAAM,IAAI;AAEV,cAAQ,QAAQ;AAAA,QACd,KAAK,sBAAsB;AACzB,gBAAM,UAA8B;AAAA,YAClC,SAAS,GAAG;AAAA,YACZ,UAAU,GAAG;AAAA;AAAA;AAAA,YAGb,QAAQ,GAAG;AAAA,YACX,YAAa,GAAG,cAA0B;AAAA,UAC5C;AACA,cAAI,GAAG,WAAW,MAAM;AACtB,oBAAQ,UAAU,EAAE;AAAA,UACtB;AACA,gBAAM,SAAS,MAAM,QAAQ,mBAAmB,OAAO;AACvD,iBAAO,OAAO;AAAA,QAChB;AAAA,QAEA,KAAK,iBAAiB;AAIpB,gBAAM,aAA6B;AAAA,YACjC,SAAS,GAAG;AAAA,YACZ,SAAS,QAAQ,SAAS,WAAW;AAAA,YACrC,aAAa;AAAA,YACb,YAAa,GAAG,cAA0B;AAAA,UAC5C;AACA,gBAAM,SAAS,MAAM,QAAQ,kBAAkB,UAAU;AACzD,iBAAO,OAAO;AAAA,QAChB;AAAA,QAEA,KAAK,eAAe;AAClB,iBAAO,QAAQ,YAAY,GAAG,OAAqB;AAAA,QACrD;AAAA,QAEA,KAAK;AACH,iBAAO,QAAQ;AAAA,YACb,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,UACL;AAAA,QAEF,KAAK;AACH,iBAAO,QAAQ;AAAA,YACb,GAAG;AAAA,YACF,GAAG,oBAAgC;AAAA,YACpC,GAAG;AAAA,UACL;AAAA,QAEF,KAAK,qBAAqB;AACxB,iBAAO,QAAQ,kBAAkB,GAAG,aAAuB;AAAA,QAC7D;AAAA,QAEA,KAAK,yBAAyB;AAC5B,iBAAO,QAAQ,mBAAmB,GAAG,EAAY;AAAA,QACnD;AAAA,QAEA,KAAK,uBAAuB;AAC1B,iBAAO,QAAQ,sBAAsB,QAAQ,oBAAoB,IAAI,CAAC;AAAA,QACxE;AAAA,QAEA,KAAK,iBAAiB;AAIpB,iBAAQ,QAAQ,cAAgD,GAAG,OAAO;AAAA,QAC5E;AAAA,QAEA,KAAK,6BAA6B;AAChC,iBAAO,QAAQ,0BAA0B,GAAG,OAAiB;AAAA,QAC/D;AAAA,QAEA,KAAK,cAAc;AACjB,iBAAO,QAAQ;AAAA,QACjB;AAAA,QAEA;AACE,gBAAM,IAAI;AAAA,YACR,oDAAoD,MAAM;AAAA,UAE5D;AAAA,MACJ;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAaO,SAAS,kBAAkB,SAGhC;AACA,SAAO;AAAA,IACL,SAAS,sBAAsB,OAAO;AAAA,IACtC,WAAW,qBAAqB,OAAO;AAAA,EACzC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @provablehq/veil-aleo-wallet-adapter\n *\n * Wraps @provablehq/aleo-wallet-adaptor-core into veil's\n * Account and Transport interfaces.\n *\n * Usage with any wallet adapter (Leo, Puzzle, Fox, Shield):\n *\n * import { LeoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-leo'\n * import { fromWalletAdapter } from '@provablehq/veil-aleo-wallet-adapter'\n * import { createWalletClient, http, fallback } from '@provablehq/veil-core'\n *\n * const leoWallet = new LeoWalletAdapter()\n * await leoWallet.connect(Network.MAINNET, DecryptPermission.UponRequest)\n *\n * const { account, transport } = fromWalletAdapter(leoWallet)\n *\n * const walletClient = createWalletClient({\n * account,\n * transport: fallback([transport, http('https://edge.provable.com/api/v2')]),\n * })\n */\n\nimport { custom } from '@provablehq/veil-core'\nimport type { Network, RpcAccount, Transport, TransactionStatusResponse, TxHistoryResult } from '@provablehq/veil-core'\n\n// Import the real types from the Provable ecosystem\nimport type { TransactionOptions, TransactionInput } from '@provablehq/aleo-types'\nimport type { AleoDeployment } from '@provablehq/aleo-wallet-standard'\nimport type { RecordStatusFilter } from '@provablehq/veil-core'\nimport type { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core'\n\n// Re-export useful types so consumers don't need extra imports\nexport type { TransactionOptions } from '@provablehq/aleo-types'\nexport type { Network, TransactionStatusResponse, TxHistoryResult } from '@provablehq/veil-core'\nexport type { BaseAleoWalletAdapter } from '@provablehq/aleo-wallet-adaptor-core'\n\n// Re-export the privacy-feature types (Veil mirrors) so consumers can import them\n// from the wallet-adapter boundary alongside fromWalletAdapter.\n//\n// The upstream error classes (WalletAddressWithheldError, etc.) are deliberately\n// NOT re-exported here: @provablehq/aleo-wallet-adaptor-core is an OPTIONAL peer\n// dependency, and a value re-export would compile to a static runtime import,\n// breaking consumers who use fromWalletAdapter without installing -core. Consumers\n// that need to catch those classes import them from\n// @provablehq/aleo-wallet-adaptor-core directly.\nexport type {\n TransactionInput,\n InputRequest,\n RecordFilters,\n RecordView,\n ConnectOptions,\n RecordAccessGrant,\n AlgorithmGrant,\n} from '@provablehq/veil-core'\n\n// --------------------------------------------------------------------------\n// Wallet adapter interface — matches BaseAleoWalletAdapter from\n// @provablehq/aleo-wallet-adaptor-core\n// --------------------------------------------------------------------------\n\n/**\n * The post-connect subset of the Provable wallet standard's `WalletAdapter`\n * interface — covers the methods veil invokes after a wallet is already\n * connected. `connect` and `disconnect` are deliberately omitted; consumers\n * call those on the adapter directly before passing it to `fromWalletAdapter`.\n *\n * All standard-conforming adapters (Leo, Puzzle, Fox, Shield) satisfy this\n * shape because their classes implement every method declared here.\n * Implementations that don't support a given feature should throw at runtime\n * (the standard's `WalletFeatureNotAvailableError` contract).\n */\nexport interface AleoWalletAdapter {\n /** The connected account. */\n account?: { address: string; viewKey?: string; privateKey?: string }\n\n /** Whether the wallet is currently connected. */\n connected: boolean\n\n /** The wallet's currently selected network. May be null before connect. */\n network: Network | null\n\n /** Sign an arbitrary message — returns raw signature bytes. */\n signMessage(message: Uint8Array): Promise<Uint8Array>\n\n /** Execute a program function — returns temporary transaction id. */\n executeTransaction(options: TransactionOptions): Promise<{ transactionId: string }>\n\n /** Deploy a program — returns temporary transaction id. */\n executeDeployment(deployment: AleoDeployment): Promise<{ transactionId: string }>\n\n /** Get the status of a submitted transaction. */\n transactionStatus(transactionId: string): Promise<TransactionStatusResponse>\n\n /**\n * Decrypt a record ciphertext using the wallet's view key.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false` — decryption would reveal the address.\n */\n decrypt(\n cipherText: string,\n tpk?: string,\n programId?: string,\n functionName?: string,\n index?: number,\n ): Promise<string>\n\n /**\n * Request records for a program.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n requestRecords(\n program: string,\n includePlaintext: boolean,\n statusFilter?: RecordStatusFilter,\n ): Promise<unknown[]>\n\n /**\n * Get transition view keys for a transaction.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n transitionViewKeys(transactionId: string): Promise<string[]>\n\n /** Switch the connected network. May throw if the wallet doesn't support it. */\n switchNetwork(network: Network): Promise<void>\n\n /**\n * Get transaction history for a program. May throw if the wallet doesn't support it.\n *\n * Throws `WalletAddressWithheldError` when the connection was made with\n * `readAddress: false`.\n */\n requestTransactionHistory(program: string): Promise<TxHistoryResult>\n\n /**\n * List the derived-input algorithms this wallet supports. Empty if none.\n *\n * Optional: wallets that predate the privacy feature omit it, in which case\n * the transport reports no supported algorithms.\n */\n algorithmsSupported?(): Promise<string[]>\n}\n\n/**\n * Union of Veil's minimal interface and the real BaseAleoWalletAdapter.\n * All public functions accept either shape — duck-typing handles\n * the differences since both expose the same method signatures.\n */\nexport type AnyWalletAdapter = AleoWalletAdapter | BaseAleoWalletAdapter\n\n// --------------------------------------------------------------------------\n// Account adapter\n// --------------------------------------------------------------------------\n\n/**\n * Creates an veil RpcAccount from a connected wallet adapter.\n *\n * The adapter must be connected (adapter.account must exist).\n * Sign operations are delegated to the wallet.\n */\nexport function rpcAccountFromAdapter(adapter: AnyWalletAdapter): RpcAccount {\n if (!adapter.account) {\n throw new Error(\n 'Wallet adapter is not connected. Call adapter.connect() before creating an account.',\n )\n }\n\n const address = adapter.account.address\n\n return {\n type: 'rpc',\n address,\n sign: (message: Uint8Array) => adapter.signMessage(message),\n signMessage: (message: Uint8Array) => adapter.signMessage(message),\n }\n}\n\n// --------------------------------------------------------------------------\n// Transport adapter\n// --------------------------------------------------------------------------\n\n/**\n * Creates an veil custom transport that routes wallet-specific\n * operations through the adapter.\n *\n * This transport handles:\n * - executeTransaction → adapter.executeTransaction()\n * - deployProgram → adapter.executeDeployment()\n * - signMessage → adapter.signMessage()\n * - decrypt → adapter.decrypt()\n * - requestRecords → adapter.requestRecords()\n * - transactionStatus → adapter.transactionStatus()\n * - transitionViewKeys → adapter.transitionViewKeys()\n *\n * Read operations (getBlock, getBalance, etc.) are NOT handled — pair\n * with http() via fallback() for full coverage:\n *\n * fallback([transportFromAdapter(adapter), http(url)])\n */\nexport function transportFromAdapter(adapter: AnyWalletAdapter): Transport<'custom'> {\n return custom({\n key: 'walletAdapter',\n name: 'Wallet Adapter Transport',\n request: async ({ method, params }) => {\n const p = params as Record<string, unknown> | undefined\n\n switch (method) {\n case 'executeTransaction': {\n const options: TransactionOptions = {\n program: p?.programName as string,\n function: p?.functionName as string,\n // Inputs may be Aleo-encoded strings or InputRequest objects the wallet\n // fulfils (address/record/derived); pass them through untouched.\n inputs: p?.inputs as TransactionInput[],\n privateFee: (p?.privateFee as boolean) ?? false,\n }\n if (p?.imports != null) {\n options.imports = p.imports as string[]\n }\n const result = await adapter.executeTransaction(options)\n return result.transactionId\n }\n\n case 'deployProgram': {\n // The wallet-standard `AleoDeployment` shape requires `priorityFee`,\n // but Veil's user-facing API treats fees as auto-estimated; pass 0 so\n // the wallet uses its own default.\n const deployment: AleoDeployment = {\n program: p?.program as string,\n address: adapter.account?.address ?? '',\n priorityFee: 0,\n privateFee: (p?.privateFee as boolean) ?? false,\n }\n const result = await adapter.executeDeployment(deployment)\n return result.transactionId\n }\n\n case 'signMessage': {\n return adapter.signMessage(p?.message as Uint8Array)\n }\n\n case 'decrypt':\n return adapter.decrypt(\n p?.cipherText as string,\n p?.tpk as string | undefined,\n p?.programId as string | undefined,\n p?.functionName as string | undefined,\n p?.index as number | undefined,\n )\n\n case 'requestRecords':\n return adapter.requestRecords(\n p?.program as string,\n (p?.includePlaintext as boolean) ?? true,\n p?.statusFilter as RecordStatusFilter | undefined,\n )\n\n case 'transactionStatus': {\n return adapter.transactionStatus(p?.transactionId as string)\n }\n\n case 'getTransitionViewKeys': {\n return adapter.transitionViewKeys(p?.id as string)\n }\n\n case 'algorithmsSupported': {\n return adapter.algorithmsSupported ? adapter.algorithmsSupported() : []\n }\n\n case 'switchNetwork': {\n // Cast: BaseAleoWalletAdapter expects @provablehq/aleo-types' Network\n // enum, AleoWalletAdapter expects @provablehq/veil-core's string-union Network.\n // Runtime values are identical strings.\n return (adapter.switchNetwork as (n: unknown) => Promise<void>)(p?.network)\n }\n\n case 'requestTransactionHistory': {\n return adapter.requestTransactionHistory(p?.program as string)\n }\n\n case 'getChainId': {\n return adapter.network\n }\n\n default:\n throw new Error(\n `Wallet adapter transport does not handle method \"${method}\". ` +\n 'Use fallback([transportFromAdapter(adapter), http(url)]) for read methods.',\n )\n }\n },\n })\n}\n\n// --------------------------------------------------------------------------\n// Convenience\n// --------------------------------------------------------------------------\n\n/**\n * Creates both an veil account and transport from a connected\n * wallet adapter. This is the primary entry point.\n *\n * const { account, transport } = fromWalletAdapter(leoWallet)\n * const client = createWalletClient({ account, transport })\n */\nexport function fromWalletAdapter(adapter: AnyWalletAdapter): {\n account: RpcAccount\n transport: Transport<'custom'>\n} {\n return {\n account: rpcAccountFromAdapter(adapter),\n transport: transportFromAdapter(adapter),\n }\n}\n"],"mappings":";AAuBA,SAAS,cAAc;AA8IhB,SAAS,sBAAsB,SAAuC;AAC3E,MAAI,CAAC,QAAQ,SAAS;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU,QAAQ,QAAQ;AAEhC,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,MAAM,CAAC,YAAwB,QAAQ,YAAY,OAAO;AAAA,IAC1D,aAAa,CAAC,YAAwB,QAAQ,YAAY,OAAO;AAAA,EACnE;AACF;AAwBO,SAAS,qBAAqB,SAAgD;AACnF,SAAO,OAAO;AAAA,IACZ,KAAK;AAAA,IACL,MAAM;AAAA,IACN,SAAS,OAAO,EAAE,QAAQ,OAAO,MAAM;AACrC,YAAM,IAAI;AAEV,cAAQ,QAAQ;AAAA,QACd,KAAK,sBAAsB;AACzB,gBAAM,UAA8B;AAAA,YAClC,SAAS,GAAG;AAAA,YACZ,UAAU,GAAG;AAAA;AAAA;AAAA,YAGb,QAAQ,GAAG;AAAA,YACX,YAAa,GAAG,cAA0B;AAAA,UAC5C;AACA,cAAI,GAAG,WAAW,MAAM;AACtB,oBAAQ,UAAU,EAAE;AAAA,UACtB;AACA,gBAAM,SAAS,MAAM,QAAQ,mBAAmB,OAAO;AACvD,iBAAO,OAAO;AAAA,QAChB;AAAA,QAEA,KAAK,iBAAiB;AAIpB,gBAAM,aAA6B;AAAA,YACjC,SAAS,GAAG;AAAA,YACZ,SAAS,QAAQ,SAAS,WAAW;AAAA,YACrC,aAAa;AAAA,YACb,YAAa,GAAG,cAA0B;AAAA,UAC5C;AACA,gBAAM,SAAS,MAAM,QAAQ,kBAAkB,UAAU;AACzD,iBAAO,OAAO;AAAA,QAChB;AAAA,QAEA,KAAK,eAAe;AAClB,iBAAO,QAAQ,YAAY,GAAG,OAAqB;AAAA,QACrD;AAAA,QAEA,KAAK;AACH,iBAAO,QAAQ;AAAA,YACb,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAG;AAAA,UACL;AAAA,QAEF,KAAK;AACH,iBAAO,QAAQ;AAAA,YACb,GAAG;AAAA,YACF,GAAG,oBAAgC;AAAA,YACpC,GAAG;AAAA,UACL;AAAA,QAEF,KAAK,qBAAqB;AACxB,iBAAO,QAAQ,kBAAkB,GAAG,aAAuB;AAAA,QAC7D;AAAA,QAEA,KAAK,yBAAyB;AAC5B,iBAAO,QAAQ,mBAAmB,GAAG,EAAY;AAAA,QACnD;AAAA,QAEA,KAAK,uBAAuB;AAC1B,iBAAO,QAAQ,sBAAsB,QAAQ,oBAAoB,IAAI,CAAC;AAAA,QACxE;AAAA,QAEA,KAAK,iBAAiB;AAIpB,iBAAQ,QAAQ,cAAgD,GAAG,OAAO;AAAA,QAC5E;AAAA,QAEA,KAAK,6BAA6B;AAChC,iBAAO,QAAQ,0BAA0B,GAAG,OAAiB;AAAA,QAC/D;AAAA,QAEA,KAAK,cAAc;AACjB,iBAAO,QAAQ;AAAA,QACjB;AAAA,QAEA;AACE,gBAAM,IAAI;AAAA,YACR,oDAAoD,MAAM;AAAA,UAE5D;AAAA,MACJ;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAaO,SAAS,kBAAkB,SAGhC;AACA,SAAO;AAAA,IACL,SAAS,sBAAsB,OAAO;AAAA,IACtC,WAAW,qBAAqB,OAAO;AAAA,EACzC;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provablehq/veil-aleo-wallet-adapter",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Aleo wallet adapter bindings for the Veil Aleo SDK.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "peerDependencies": {
32
- "@provablehq/veil-core": ">=0.6.0 <1.0.0",
32
+ "@provablehq/veil-core": ">=0.11.0 <1.0.0",
33
33
  "@provablehq/aleo-wallet-adaptor-core": "*"
34
34
  },
35
35
  "peerDependenciesMeta": {