@owney/sdk 0.7.35 → 0.8.0-beta.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 +25 -4
- package/dist/index.cjs +319 -147
- package/dist/index.d.cts +53 -44
- package/dist/index.d.ts +53 -44
- package/dist/index.js +319 -147
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,27 @@ the funds are already credited or earning yield.
|
|
|
143
143
|
|
|
144
144
|
Returns: `OwneyDepositResult` (single agent) or `OwneyMultiDepositResult` (all agents)
|
|
145
145
|
|
|
146
|
+
When `depositCallback` is omitted, deposits are gas-free by default:
|
|
147
|
+
|
|
148
|
+
| Asset | Chains | Gas-free rail |
|
|
149
|
+
| ------ | ------------------------- | ------------------------------------------------- |
|
|
150
|
+
| `USDC` | Base, Arbitrum, Ethereum | EIP-3009 signature |
|
|
151
|
+
| `EURC` | Ethereum, Base | EIP-3009 signature, like USDC |
|
|
152
|
+
| `WETH` | Base, Arbitrum, Ethereum | Permit2 signature (one-time Permit2 approval) |
|
|
153
|
+
| `USDT` | Ethereum | Permit2 signature, like WETH (one-time approval) |
|
|
154
|
+
|
|
155
|
+
### `approvePermit2(asset?)`
|
|
156
|
+
|
|
157
|
+
One-time, user-paid approval of Permit2 on the active chain for a Permit2 asset
|
|
158
|
+
(`"WETH"`, the default, or `"USDT"`). Needed once per wallet per chain before
|
|
159
|
+
the first gas-free deposit of that asset; afterwards `deposit()` is
|
|
160
|
+
signature-only. Resolves after the approval is mined and returns its tx hash.
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
await sdk.approvePermit2(); // WETH
|
|
164
|
+
await sdk.approvePermit2("USDT");
|
|
165
|
+
```
|
|
166
|
+
|
|
146
167
|
```typescript
|
|
147
168
|
// Deposit to a specific agent
|
|
148
169
|
const result = await sdk.deposit({
|
|
@@ -446,9 +467,9 @@ console.log(usdcBaseApy.agentApy.zyfai.averageApy); // APY scoped to USDC on Bas
|
|
|
446
467
|
type AgentId = "zyfai";
|
|
447
468
|
type Asset = string;
|
|
448
469
|
type DailyApyDays = "7D" | "14D" | "30D";
|
|
449
|
-
type OwneySupportedChainId = 8453 | 42161;
|
|
450
|
-
type OwneySupportedChains = "BASE" | "ARBITRUM";
|
|
451
|
-
type OwneySupportedTokens = "USDC" | "WETH";
|
|
470
|
+
type OwneySupportedChainId = 8453 | 42161 | 1;
|
|
471
|
+
type OwneySupportedChains = "BASE" | "ARBITRUM" | "ETHEREUM";
|
|
472
|
+
type OwneySupportedTokens = "USDC" | "WETH" | "EURC" | "USDT";
|
|
452
473
|
|
|
453
474
|
type AgentSupportedAsset = {
|
|
454
475
|
readonly symbol: string;
|
|
@@ -704,7 +725,7 @@ type OwneyErrorCode =
|
|
|
704
725
|
| "AGENT_CHAIN_INCOMPATIBLE" // Agent(s) don't support the given chain
|
|
705
726
|
| "AGENT_EMPTY_LIST" // Empty agentId array passed to activateAgent()
|
|
706
727
|
// Chain
|
|
707
|
-
| "CHAIN_UNSUPPORTED" // Chain ID not in supported list (8453, 42161)
|
|
728
|
+
| "CHAIN_UNSUPPORTED" // Chain ID not in supported list (8453, 42161, 1)
|
|
708
729
|
| "CHAIN_NO_COMPATIBLE_AGENTS" // No agents support the given chain
|
|
709
730
|
// Asset
|
|
710
731
|
| "ASSET_UNSUPPORTED" // Agent doesn't support the asset on the active chain
|