@prb/effect-evm-safe 1.0.0-beta.0 → 1.0.0-beta.2

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 ADDED
@@ -0,0 +1,48 @@
1
+ # effect-evm-safe
2
+
3
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![Effect](https://img.shields.io/badge/Effect-v3-7C3AED)](https://effect.website)
5
+
6
+ > [!WARNING] This is experimental, beta software. It is provided "as is" without warranty of any kind, express or
7
+ > implied.
8
+
9
+ Safe Apps + Safe multisig utilities for Effect, built on top of `@prb/effect-evm`.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ bun add @prb/effect-evm-safe @prb/effect-evm @safe-global/safe-apps-sdk
15
+ ```
16
+
17
+ Peer dependencies
18
+
19
+ - `effect@^3`
20
+ - `@effect/platform@^0.93`
21
+ - `@prb/effect-evm@^1.0.0-beta.5`
22
+ - `@safe-global/safe-apps-sdk@9.1.0`
23
+ - `viem@^2.43`
24
+ - Optional: `@wagmi/core@>=2.0.0` (for hooks using wagmi)
25
+ - Optional: `react@>=18.2.0`, `react-dom@>=18.2.0` (for React hooks)
26
+
27
+ ## Usage
28
+
29
+ ```typescript
30
+ import { Layer } from "effect";
31
+ import { makeEffectEvmLayer } from "@prb/effect-evm";
32
+ import { SafeAppsServiceLive } from "@prb/effect-evm-safe";
33
+
34
+ const baseLayer = makeEffectEvmLayer(/* chain configs */, window.ethereum);
35
+ const layer = Layer.provideMerge(SafeAppsServiceLive(), baseLayer);
36
+ ```
37
+
38
+ ## Exports
39
+
40
+ - Safe Apps service: `SafeAppsService`, `SafeAppsServiceLive`
41
+ - Safe detection: `isSafeMultisig`
42
+ - Safe simulation: `SafeMultisigSimulationService`, `SafeMultisigSimulationServiceLive`
43
+ - Types + errors: `safe/*`
44
+ - React hooks: `@prb/effect-evm-safe/react-hooks`
45
+
46
+ ## License
47
+
48
+ MIT
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/safe/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Address, Hash, Hex, TransactionReceipt } from \"viem\";\n\n/** Safe multisig info returned from SDK */\nexport type SafeMultisigInfo = {\n chainId: number;\n safeAddress: Address;\n};\n\n/** Tx to send via Safe multisig */\nexport type SafeMultisigTx = {\n data: Hex;\n to: Address;\n value?: bigint; // Converted to string at SDK boundary\n};\n\n/** Result from sendTxs */\nexport type SafeMultisigTxSubmission = {\n chainId: number;\n safeAddress: Address;\n safeTxHash: Hash;\n};\n\n/** Result from waitForTxReceipt */\nexport type SafeMultisigTxResult = {\n chainId: number;\n onchainHash: Hash;\n receipt: TransactionReceipt;\n safeAddress: Address;\n safeTxHash: Hash;\n};\n\n/** Discriminated union for signTypedData result */\nexport type SignTypedDataResult =\n | { readonly _tag: \"Offchain\"; readonly messageHash: Hex }\n | { readonly _tag: \"Onchain\"; readonly safeTxHash: Hash };\n\n/** Off-chain signature result */\nexport type OffchainSignatureResult = {\n messageHash: Hex;\n signature: Hex;\n};\n\n/** Policy for Safe tx waiting (aligns with TxPolicy from src/tx/policy.ts) */\nexport type SafeWaitPolicy = {\n /** Timeout for Safe tx execution in ms (default: 300000 = 5 min) */\n executionTimeout?: number;\n /** Poll interval for Safe gateway in ms (default: 3000) */\n pollInterval?: number;\n /** Policy passed to TxManager.waitForReceipt */\n receiptPolicy?: {\n pollingInterval?: number;\n receiptTimeout?: number;\n };\n};\n\n/** Policy for off-chain signature polling */\nexport type OffchainSignaturePolicy = {\n /** Poll interval in ms (default: 2000) */\n pollInterval?: number;\n /** Timeout in ms (default: 120000 = 2 min) */\n timeout?: number;\n};\n\n/** EIP-712 typed data structure (local definition to avoid SDK import) */\nexport type EIP712TypedData = {\n domain: {\n chainId?: number;\n name?: string;\n salt?: string;\n verifyingContract?: string;\n version?: string;\n };\n message: Record<string, unknown>;\n primaryType?: string;\n types: Record<string, Array<{ name: string; type: string }>>;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/safe/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Address, Hash, Hex, TransactionReceipt } from \"viem\";\n\n/** Safe multisig info returned from SDK */\nexport type SafeMultisigInfo = {\n chainId: number;\n safeAddress: Address;\n};\n\n/** Tx to send via Safe multisig */\nexport type SafeMultisigTx = {\n data: Hex;\n to: Address;\n value?: bigint; // Converted to string at SDK boundary\n};\n\n/** Result from sendTxs */\nexport type SafeMultisigTxSubmission = {\n chainId: number;\n safeAddress: Address;\n safeTxHash: Hash;\n};\n\n/** Result from waitForTxReceipt */\nexport type SafeMultisigTxResult = {\n chainId: number;\n onchainHash: Hash;\n receipt: TransactionReceipt;\n safeAddress: Address;\n safeTxHash: Hash;\n};\n\n/** Discriminated union for signTypedData result */\nexport type SignTypedDataResult =\n | { readonly _tag: \"Offchain\"; readonly messageHash: Hex }\n | { readonly _tag: \"Onchain\"; readonly safeTxHash: Hash };\n\n/** Off-chain signature result */\nexport type OffchainSignatureResult = {\n messageHash: Hex;\n signature: Hex;\n};\n\n/** Policy for Safe tx waiting (aligns with TxPolicy from @prb/effect-evm) */\nexport type SafeWaitPolicy = {\n /** Timeout for Safe tx execution in ms (default: 300000 = 5 min) */\n executionTimeout?: number;\n /** Poll interval for Safe gateway in ms (default: 3000) */\n pollInterval?: number;\n /** Policy passed to TxManager.waitForReceipt */\n receiptPolicy?: {\n pollingInterval?: number;\n receiptTimeout?: number;\n };\n};\n\n/** Policy for off-chain signature polling */\nexport type OffchainSignaturePolicy = {\n /** Poll interval in ms (default: 2000) */\n pollInterval?: number;\n /** Timeout in ms (default: 120000 = 2 min) */\n timeout?: number;\n};\n\n/** EIP-712 typed data structure (local definition to avoid SDK import) */\nexport type EIP712TypedData = {\n domain: {\n chainId?: number;\n name?: string;\n salt?: string;\n verifyingContract?: string;\n version?: string;\n };\n message: Record<string, unknown>;\n primaryType?: string;\n types: Record<string, Array<{ name: string; type: string }>>;\n};\n"]}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "type": "module",
8
8
  "types": "./dist/index.d.ts",
9
- "version": "1.0.0-beta.0",
9
+ "version": "1.0.0-beta.2",
10
10
  "scripts": {
11
11
  "build": "just build",
12
12
  "prepack": "bun install --frozen-lockfile && just build"
@@ -76,7 +76,7 @@
76
76
  ],
77
77
  "peerDependencies": {
78
78
  "@effect/platform": "catalog:peers",
79
- "@prb/effect-evm": "^1.0.0-beta.5",
79
+ "@prb/effect-evm": "^1.0.0-beta.7",
80
80
  "@safe-global/safe-apps-sdk": "catalog:peers",
81
81
  "@wagmi/core": "catalog:peers",
82
82
  "effect": "catalog:peers",