@owney/sdk 0.7.10-beta.0 → 0.7.11
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.cjs +238 -891
- package/dist/index.d.cts +11 -30
- package/dist/index.d.ts +11 -30
- package/dist/index.js +214 -210
- package/package.json +2 -4
- package/dist/chunk-PWIKIQOX.js +0 -140
- package/dist/surfliquid.agent-VNGQUSXN.js +0 -473
package/dist/index.d.cts
CHANGED
|
@@ -21,16 +21,6 @@ interface OwneySDKConfig {
|
|
|
21
21
|
* `createOwneySIWX` for apps that don't use the AppKit SIWX modal.
|
|
22
22
|
*/
|
|
23
23
|
referralSource?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Optional override for the SurfLiquid API base URL (defaults to the
|
|
26
|
-
* SurfLiquid SDK's production URL). SurfLiquid auth is an httpOnly
|
|
27
|
-
* SameSite=None cookie set by api.surfliquid.com — a THIRD-PARTY cookie from
|
|
28
|
-
* the embedding app's origin, which WebKit (all iOS browsers) discards, so
|
|
29
|
-
* every authenticated SurfLiquid call 401s on iOS. Point this at a
|
|
30
|
-
* same-origin reverse proxy (e.g. "/api/surf") so the session cookie becomes
|
|
31
|
-
* first-party. Relative paths resolve against the page origin.
|
|
32
|
-
*/
|
|
33
|
-
surfliquidApiBaseUrl?: string;
|
|
34
24
|
/**
|
|
35
25
|
* Turn on the SDK's debug logging (default false). Traces the decisions that
|
|
36
26
|
* are otherwise invisible — notably how the organization's agent policy is
|
|
@@ -64,7 +54,7 @@ type OwneySupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];
|
|
|
64
54
|
type OwneySupportedChains = (typeof SUPPORTED_CHAINS)[number];
|
|
65
55
|
type OwneySupportedTokens = (typeof SUPPORTED_TOKENS)[number];
|
|
66
56
|
|
|
67
|
-
type AgentId = "zyfai" | "sail"
|
|
57
|
+
type AgentId = "zyfai" | "sail";
|
|
68
58
|
type Asset = string;
|
|
69
59
|
type AgentSupportedAsset = {
|
|
70
60
|
readonly symbol: string;
|
|
@@ -83,6 +73,15 @@ type HistoryFilters = {
|
|
|
83
73
|
limit?: number;
|
|
84
74
|
/** Opaque cursor returned by a previous getHistory call. */
|
|
85
75
|
cursor?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional asset symbol (e.g. "USDC", "WETH") to scope the history to a
|
|
78
|
+
* single asset. Without it the page blends every asset on the chain, so a
|
|
79
|
+
* consumer showing one asset at a time has to filter client-side — and a
|
|
80
|
+
* page whose entries all belong to the *other* asset then renders empty
|
|
81
|
+
* even though matching entries exist further back. Agents whose backends
|
|
82
|
+
* cannot filter by asset ignore this and return the whole chain's history.
|
|
83
|
+
*/
|
|
84
|
+
tokenSymbol?: string;
|
|
86
85
|
};
|
|
87
86
|
type HistoryOptions = {
|
|
88
87
|
agentId?: AgentId;
|
|
@@ -171,12 +170,6 @@ interface OwneyDepositResult {
|
|
|
171
170
|
}
|
|
172
171
|
interface OwneyMultiDepositResult {
|
|
173
172
|
agentResults: Record<string, OwneyDepositResult>;
|
|
174
|
-
/**
|
|
175
|
-
* Per-agent failure messages for agents that errored during a diversified
|
|
176
|
-
* deposit. Present only when at least one (but not all) agents failed —
|
|
177
|
-
* the deposit is partial, not total. Omitted when every agent succeeded.
|
|
178
|
-
*/
|
|
179
|
-
agentErrors?: Record<string, string>;
|
|
180
173
|
}
|
|
181
174
|
interface AgentWithdrawResult {
|
|
182
175
|
txHash?: string;
|
|
@@ -448,7 +441,6 @@ declare class OwneySDK {
|
|
|
448
441
|
private zyfaiRpcUrls?;
|
|
449
442
|
private routingApiBaseUrl?;
|
|
450
443
|
private referralSource?;
|
|
451
|
-
private surfliquidApiBaseUrl?;
|
|
452
444
|
private cachedSponsoredCallback;
|
|
453
445
|
private cachedWethSponsoredCallback;
|
|
454
446
|
private paymasterServiceUrl?;
|
|
@@ -581,17 +573,6 @@ declare class OwneySDK {
|
|
|
581
573
|
private hasExistingBalance;
|
|
582
574
|
private validateAssetSupport;
|
|
583
575
|
private getEligibleAgents;
|
|
584
|
-
/**
|
|
585
|
-
* Agent ids the routing API provisioned for this org that support the given
|
|
586
|
-
* chain + asset, ordered by preference ({@link AGENT_ELIGIBILITY_ORDER},
|
|
587
|
-
* surfliquid first). Returns `[]` when the org has no compatible agent — never
|
|
588
|
-
* throws on an empty org. Loads agent keys on first call (apiKey only, no
|
|
589
|
-
* wallet), so the UI can resolve which agent to use before the user connects.
|
|
590
|
-
*
|
|
591
|
-
* This is the source of truth for agent availability: an agent appears here
|
|
592
|
-
* iff the routing API returned its key. No per-app feature flags.
|
|
593
|
-
*/
|
|
594
|
-
getEligibleAgentIds(chainId: number, asset: string): Promise<AgentId[]>;
|
|
595
576
|
/**
|
|
596
577
|
* Withdraw funds from a specific agent, or all agents that support the active chain+asset if agentId is omitted.
|
|
597
578
|
* Validates that the asset is supported by the target agent(s) on the active chain.
|
|
@@ -692,7 +673,7 @@ declare class OwneySDK {
|
|
|
692
673
|
getAllocationApy({ agentId, }?: AllocationApyOptions): Promise<OwneyAllocationApy>;
|
|
693
674
|
}
|
|
694
675
|
|
|
695
|
-
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "
|
|
676
|
+
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_SAIL_ERROR" | "API_SAIL_TIMEOUT" | "API_NO_AGENTS" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
696
677
|
declare class OwneyError extends Error {
|
|
697
678
|
readonly code: OwneyErrorCode;
|
|
698
679
|
readonly details?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,16 +21,6 @@ interface OwneySDKConfig {
|
|
|
21
21
|
* `createOwneySIWX` for apps that don't use the AppKit SIWX modal.
|
|
22
22
|
*/
|
|
23
23
|
referralSource?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Optional override for the SurfLiquid API base URL (defaults to the
|
|
26
|
-
* SurfLiquid SDK's production URL). SurfLiquid auth is an httpOnly
|
|
27
|
-
* SameSite=None cookie set by api.surfliquid.com — a THIRD-PARTY cookie from
|
|
28
|
-
* the embedding app's origin, which WebKit (all iOS browsers) discards, so
|
|
29
|
-
* every authenticated SurfLiquid call 401s on iOS. Point this at a
|
|
30
|
-
* same-origin reverse proxy (e.g. "/api/surf") so the session cookie becomes
|
|
31
|
-
* first-party. Relative paths resolve against the page origin.
|
|
32
|
-
*/
|
|
33
|
-
surfliquidApiBaseUrl?: string;
|
|
34
24
|
/**
|
|
35
25
|
* Turn on the SDK's debug logging (default false). Traces the decisions that
|
|
36
26
|
* are otherwise invisible — notably how the organization's agent policy is
|
|
@@ -64,7 +54,7 @@ type OwneySupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];
|
|
|
64
54
|
type OwneySupportedChains = (typeof SUPPORTED_CHAINS)[number];
|
|
65
55
|
type OwneySupportedTokens = (typeof SUPPORTED_TOKENS)[number];
|
|
66
56
|
|
|
67
|
-
type AgentId = "zyfai" | "sail"
|
|
57
|
+
type AgentId = "zyfai" | "sail";
|
|
68
58
|
type Asset = string;
|
|
69
59
|
type AgentSupportedAsset = {
|
|
70
60
|
readonly symbol: string;
|
|
@@ -83,6 +73,15 @@ type HistoryFilters = {
|
|
|
83
73
|
limit?: number;
|
|
84
74
|
/** Opaque cursor returned by a previous getHistory call. */
|
|
85
75
|
cursor?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional asset symbol (e.g. "USDC", "WETH") to scope the history to a
|
|
78
|
+
* single asset. Without it the page blends every asset on the chain, so a
|
|
79
|
+
* consumer showing one asset at a time has to filter client-side — and a
|
|
80
|
+
* page whose entries all belong to the *other* asset then renders empty
|
|
81
|
+
* even though matching entries exist further back. Agents whose backends
|
|
82
|
+
* cannot filter by asset ignore this and return the whole chain's history.
|
|
83
|
+
*/
|
|
84
|
+
tokenSymbol?: string;
|
|
86
85
|
};
|
|
87
86
|
type HistoryOptions = {
|
|
88
87
|
agentId?: AgentId;
|
|
@@ -171,12 +170,6 @@ interface OwneyDepositResult {
|
|
|
171
170
|
}
|
|
172
171
|
interface OwneyMultiDepositResult {
|
|
173
172
|
agentResults: Record<string, OwneyDepositResult>;
|
|
174
|
-
/**
|
|
175
|
-
* Per-agent failure messages for agents that errored during a diversified
|
|
176
|
-
* deposit. Present only when at least one (but not all) agents failed —
|
|
177
|
-
* the deposit is partial, not total. Omitted when every agent succeeded.
|
|
178
|
-
*/
|
|
179
|
-
agentErrors?: Record<string, string>;
|
|
180
173
|
}
|
|
181
174
|
interface AgentWithdrawResult {
|
|
182
175
|
txHash?: string;
|
|
@@ -448,7 +441,6 @@ declare class OwneySDK {
|
|
|
448
441
|
private zyfaiRpcUrls?;
|
|
449
442
|
private routingApiBaseUrl?;
|
|
450
443
|
private referralSource?;
|
|
451
|
-
private surfliquidApiBaseUrl?;
|
|
452
444
|
private cachedSponsoredCallback;
|
|
453
445
|
private cachedWethSponsoredCallback;
|
|
454
446
|
private paymasterServiceUrl?;
|
|
@@ -581,17 +573,6 @@ declare class OwneySDK {
|
|
|
581
573
|
private hasExistingBalance;
|
|
582
574
|
private validateAssetSupport;
|
|
583
575
|
private getEligibleAgents;
|
|
584
|
-
/**
|
|
585
|
-
* Agent ids the routing API provisioned for this org that support the given
|
|
586
|
-
* chain + asset, ordered by preference ({@link AGENT_ELIGIBILITY_ORDER},
|
|
587
|
-
* surfliquid first). Returns `[]` when the org has no compatible agent — never
|
|
588
|
-
* throws on an empty org. Loads agent keys on first call (apiKey only, no
|
|
589
|
-
* wallet), so the UI can resolve which agent to use before the user connects.
|
|
590
|
-
*
|
|
591
|
-
* This is the source of truth for agent availability: an agent appears here
|
|
592
|
-
* iff the routing API returned its key. No per-app feature flags.
|
|
593
|
-
*/
|
|
594
|
-
getEligibleAgentIds(chainId: number, asset: string): Promise<AgentId[]>;
|
|
595
576
|
/**
|
|
596
577
|
* Withdraw funds from a specific agent, or all agents that support the active chain+asset if agentId is omitted.
|
|
597
578
|
* Validates that the asset is supported by the target agent(s) on the active chain.
|
|
@@ -692,7 +673,7 @@ declare class OwneySDK {
|
|
|
692
673
|
getAllocationApy({ agentId, }?: AllocationApyOptions): Promise<OwneyAllocationApy>;
|
|
693
674
|
}
|
|
694
675
|
|
|
695
|
-
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "
|
|
676
|
+
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_SAIL_ERROR" | "API_SAIL_TIMEOUT" | "API_NO_AGENTS" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
696
677
|
declare class OwneyError extends Error {
|
|
697
678
|
readonly code: OwneyErrorCode;
|
|
698
679
|
readonly details?: Record<string, unknown>;
|