Skip to content

Commit 0b41538

Browse files
committed
add changelog
1 parent 03214f0 commit 0b41538

File tree

5 files changed

+87
-36
lines changed

5 files changed

+87
-36
lines changed

.github/workflows/unit_tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242

4343
test-agentkit-typescript:
4444
runs-on: ubuntu-latest
45-
timeout-minutes: 15
4645
strategy:
4746
matrix:
4847
node-version: ["18", "20"]
@@ -57,4 +56,4 @@ jobs:
5756
working-directory: ./typescript
5857
run: |
5958
npm ci
60-
npm run test -- -- --testTimeout=300000
59+
npm run test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@coinbase/agentkit": minor
3+
---
4+
5+
Added a new wallet provider and action providers to interact with the Safe Protocol
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
# Safe Action Provider
1+
# Safe Action Provider
2+
3+
This directory contains the **SafeActionProvider** implementation, which provides actions to interact with [Safe](https://safe.global/) multi-signature wallets on EVM-compatible blockchains.
4+
5+
## Directory Structure
6+
7+
```
8+
safe/
9+
├── safeApiActionProvider.ts # Provider for Safe API interactions
10+
├── safeWalletActionProvider.ts # Provider for Safe Wallet operations
11+
├── schemas.ts # Action schemas for Safe operations
12+
├── index.ts # Main exports
13+
└── README.md # This file
14+
```
15+
16+
## Actions
17+
18+
### Safe API Actions
19+
20+
- `safeInfo`: Retrieve detailed information about a Safe wallet
21+
- `getAllowanceInfo`: Get current allowance configurations
22+
- `withdrawAllowance`: Withdraw funds from an allowance
23+
24+
### Safe Wallet Actions
25+
26+
- `addSigner`: Add a new signer to a Safe wallet
27+
- `removeSigner`: Remove an existing signer from a Safe wallet
28+
- `changeThreshold`: Modify the number of required signatures
29+
- `approvePending`: Approve a pending transaction
30+
- `enableAllowanceModule`: Activate the allowance module for a Safe
31+
- `setAllowance`: Configure spending allowances for specific addresses
32+
33+
## Adding New Actions
34+
35+
To add new Safe actions:
36+
37+
1. Define your action schema in `schemas.ts`
38+
2. Implement the action in the appropriate provider file:
39+
- Safe API actions in `safeApiActionProvider.ts`
40+
- Safe Wallet actions in `safeWalletActionProvider.ts`
41+
3. Add corresponding tests
42+
43+
## Network Support
44+
45+
The Safe providers support all EVM-compatible networks, including:
46+
47+
- Ethereum (Mainnet & Testnets)
48+
- Base (Mainnet & Testnets)
49+
- Optimism
50+
- Arbitrum
51+
- Optimism
52+
- And other EVM-compatible networks
53+
54+
## Notes
55+
56+
- safeWalletActionProvider requires a safeWalletProvider
57+
- safeWalletProvider connects to an existing Safe account or automatically creates a new one with the provided private key as single signer
58+
- Safe API actions can be used with other evmWalletProvider
59+
60+
For more information on Safe multi-signature wallets visit [Safe Documentation](https://docs.safe.global/).

typescript/agentkit/src/wallet-providers/smartWalletProvider.ts

+21
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ export class SmartWalletProvider extends EvmWalletProvider {
147147
return smartWalletProvider;
148148
}
149149

150+
/**
151+
* Stub for hash signing
152+
*
153+
* @throws as signing hashes is not implemented for SmartWallets.
154+
*
155+
* @param _ - The hash to sign.
156+
* @returns The signed hash.
157+
*/
158+
async signHash(_: Hex): Promise<Hex> {
159+
throw new Error("Not implemented");
160+
}
161+
150162
/**
151163
* Stub for message signing
152164
*
@@ -359,4 +371,13 @@ export class SmartWalletProvider extends EvmWalletProvider {
359371
throw new Error(`Transfer failed with status ${result.status}`);
360372
}
361373
}
374+
375+
/**
376+
* Gets the public client instance.
377+
*
378+
* @returns The Viem PublicClient instance.
379+
*/
380+
getPublicClient(): ViemPublicClient {
381+
return this.#publicClient;
382+
}
362383
}

typescript/package-lock.json

-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)