@zkp2p/sdk 0.11.2 → 0.12.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 +101 -7
- package/dist/{chunk-LPKFXAKY.mjs → chunk-RYBXFY6X.mjs} +44235 -478
- package/dist/chunk-RYBXFY6X.mjs.map +1 -0
- package/dist/index.cjs +44752 -451
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.mjs +536 -12
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-LCSRVC7F.mjs +5 -0
- package/dist/{protocolViewerParsers-M7C2ICV3.mjs.map → protocolViewerParsers-LCSRVC7F.mjs.map} +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{vaultUtils-CbfjrxgD.d.mts → vaultUtils-xNLHO5lY.d.mts} +330 -4
- package/dist/{vaultUtils-CbfjrxgD.d.ts → vaultUtils-xNLHO5lY.d.ts} +330 -4
- package/package.json +1 -1
- package/dist/chunk-LPKFXAKY.mjs.map +0 -1
- package/dist/protocolViewerParsers-M7C2ICV3.mjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-RYBXFY6X.mjs';
|
|
2
|
+
import './chunk-ZFBH4HD7.mjs';
|
|
3
|
+
import './chunk-J5LGTIGS.mjs';
|
|
4
|
+
//# sourceMappingURL=protocolViewerParsers-LCSRVC7F.mjs.map
|
|
5
|
+
//# sourceMappingURL=protocolViewerParsers-LCSRVC7F.mjs.map
|
package/dist/{protocolViewerParsers-M7C2ICV3.mjs.map → protocolViewerParsers-LCSRVC7F.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-LCSRVC7F.mjs"}
|
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a1 as SignalIntentMethodParams,
|
|
2
|
-
export {
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a1 as SignalIntentMethodParams, bM as PreparedTransaction, a2 as FulfillIntentMethodParams, dk as SendTransactionFn, dl as SendBatchFn, di as DelegationDepositTarget, dj as BatchResult, ad as IntentGuardianErrorCode, a9 as IntentGuardianPolicy, aa as IntentGuardianQuote } from './vaultUtils-xNLHO5lY.mjs';
|
|
2
|
+
export { dg as DelegationRoute, dh as DelegationState, dB as VAULT_ZERO_ADDRESS, da as ZERO_RATE_MANAGER_ID, dC as asErrorMessage, dD as assertDelegationMethodSupport, df as classifyDelegationState, de as getDelegationRoute, db as isZeroRateManagerId, dc as normalizeRateManagerId, dd as normalizeRegistry } from './vaultUtils-xNLHO5lY.mjs';
|
|
3
3
|
import { Hash, Address, Hex } from 'viem';
|
|
4
4
|
import '@zkp2p/indexer-schema';
|
|
5
5
|
import 'abitype';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a1 as SignalIntentMethodParams,
|
|
2
|
-
export {
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a1 as SignalIntentMethodParams, bM as PreparedTransaction, a2 as FulfillIntentMethodParams, dk as SendTransactionFn, dl as SendBatchFn, di as DelegationDepositTarget, dj as BatchResult, ad as IntentGuardianErrorCode, a9 as IntentGuardianPolicy, aa as IntentGuardianQuote } from './vaultUtils-xNLHO5lY.js';
|
|
2
|
+
export { dg as DelegationRoute, dh as DelegationState, dB as VAULT_ZERO_ADDRESS, da as ZERO_RATE_MANAGER_ID, dC as asErrorMessage, dD as assertDelegationMethodSupport, df as classifyDelegationState, de as getDelegationRoute, db as isZeroRateManagerId, dc as normalizeRateManagerId, dd as normalizeRegistry } from './vaultUtils-xNLHO5lY.js';
|
|
3
3
|
import { Hash, Address, Hex } from 'viem';
|
|
4
4
|
import '@zkp2p/indexer-schema';
|
|
5
5
|
import 'abitype';
|
|
@@ -13,6 +13,16 @@ import { IdentityPlatform, IdentityAttestationOutputFor as IdentityAttestationOu
|
|
|
13
13
|
* @module contracts
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
/** Reviewed OrchestratorV3 intent-lifecycle ABI. */
|
|
17
|
+
declare const ORCHESTRATOR_V3_ABI: Abi;
|
|
18
|
+
/** Reviewed StakeVault ledger ABI (stake/lock/claim/delegation). */
|
|
19
|
+
declare const STAKE_VAULT_ABI: Abi;
|
|
20
|
+
/**
|
|
21
|
+
* Reviewed ChargebackPolicy ABI — the deployed StakeVault controller. Owns
|
|
22
|
+
* per-payment-method risk windows, per-deposit chargeback enablement, the
|
|
23
|
+
* admissions pause, and chargeback intents.
|
|
24
|
+
*/
|
|
25
|
+
declare const CHARGEBACK_POLICY_ABI: Abi;
|
|
16
26
|
/**
|
|
17
27
|
* Contract addresses for a specific deployment.
|
|
18
28
|
*/
|
|
@@ -66,6 +76,10 @@ type V2ContractAddresses = {
|
|
|
66
76
|
addressGroupRegistry?: `0x${string}`;
|
|
67
77
|
/** WhitelistPolicy contract for deposit access policies */
|
|
68
78
|
whitelistPolicy?: `0x${string}`;
|
|
79
|
+
/** StakeVault contract for taker stake and delegation */
|
|
80
|
+
stakeVault?: `0x${string}`;
|
|
81
|
+
/** ChargebackPolicy contract — the StakeVault controller for dispute-risk admission */
|
|
82
|
+
chargebackPolicy?: `0x${string}`;
|
|
69
83
|
};
|
|
70
84
|
/**
|
|
71
85
|
* Contract ABIs for a specific deployment.
|
|
@@ -86,6 +100,8 @@ type V2ContractAbis = {
|
|
|
86
100
|
intentGuardian?: Abi;
|
|
87
101
|
addressGroupRegistry?: Abi;
|
|
88
102
|
whitelistPolicy?: Abi;
|
|
103
|
+
stakeVault?: Abi;
|
|
104
|
+
chargebackPolicy?: Abi;
|
|
89
105
|
};
|
|
90
106
|
/**
|
|
91
107
|
* Runtime environment: 'production' for mainnet, 'preproduction' for preprod
|
|
@@ -176,6 +192,30 @@ declare function getIntentGuardianContract(chainId: number, env?: RuntimeEnv): {
|
|
|
176
192
|
};
|
|
177
193
|
/** True when the deployment has a usable guardian. Use to gate UI affordances. */
|
|
178
194
|
declare function hasIntentGuardian(chainId: number, env?: RuntimeEnv): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve the user-facing StakeVault contract for a deployment.
|
|
197
|
+
*
|
|
198
|
+
* Throws when the environment has no StakeVault deployment so callers fail
|
|
199
|
+
* closed instead of accidentally targeting another environment.
|
|
200
|
+
*/
|
|
201
|
+
declare function getStakeVaultContract(chainId: number, env?: RuntimeEnv): {
|
|
202
|
+
address: `0x${string}`;
|
|
203
|
+
abi: Abi;
|
|
204
|
+
stakeToken: `0x${string}`;
|
|
205
|
+
};
|
|
206
|
+
/** Resolve OrchestratorV3 for a deployment, failing closed when unavailable. */
|
|
207
|
+
declare function getOrchestratorV3Contract(chainId: number, env?: RuntimeEnv): {
|
|
208
|
+
address: `0x${string}`;
|
|
209
|
+
abi: Abi;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Resolve the ChargebackPolicy contract — the deployed StakeVault controller —
|
|
213
|
+
* failing closed when unavailable.
|
|
214
|
+
*/
|
|
215
|
+
declare function getChargebackPolicyContract(chainId: number, env?: RuntimeEnv): {
|
|
216
|
+
address: `0x${string}`;
|
|
217
|
+
abi: Abi;
|
|
218
|
+
};
|
|
179
219
|
|
|
180
220
|
/**
|
|
181
221
|
* Minimal fetch-based GraphQL client for the ZKP2P indexer.
|
|
@@ -1640,6 +1680,21 @@ type OrderStats = {
|
|
|
1640
1680
|
};
|
|
1641
1681
|
/** @deprecated No corresponding SDK method; will be removed in 0.8. */
|
|
1642
1682
|
type DepositIntentStatistics = OrderStats;
|
|
1683
|
+
type UsdcAmount = {
|
|
1684
|
+
/** USDC base units (6 decimals), stringified integer. */
|
|
1685
|
+
raw: string;
|
|
1686
|
+
/** Display decimal (e.g. "1250" or "0.059792"). */
|
|
1687
|
+
formatted: string;
|
|
1688
|
+
};
|
|
1689
|
+
type StakeEnvironment = 'base' | 'base_staging';
|
|
1690
|
+
type TakerStakeBalances = {
|
|
1691
|
+
/** All principal owned by the stake owner, including locked principal. */
|
|
1692
|
+
totalUsdc: string;
|
|
1693
|
+
/** Principal committed to active StakeVault locks. */
|
|
1694
|
+
lockedUsdc: string;
|
|
1695
|
+
/** Principal withdrawable or lockable immediately. */
|
|
1696
|
+
freeUsdc: string;
|
|
1697
|
+
};
|
|
1643
1698
|
type GetDepositBundleParams = DepositBundleRequest;
|
|
1644
1699
|
type GetDepositBundleResponse = DepositBundleResponse;
|
|
1645
1700
|
type GetOrderbookParams = {
|
|
@@ -2049,6 +2104,50 @@ type IntentGuardianErrorCode = 'EXTENSIONS_DISABLED' | 'COST_EXCEEDS_MAX' | 'FEE
|
|
|
2049
2104
|
*/
|
|
2050
2105
|
declare function classifyIntentGuardianError(error: unknown): IntentGuardianErrorCode;
|
|
2051
2106
|
|
|
2107
|
+
type StakeVaultWriteFunction = 'depositStake' | 'withdrawStake' | 'claim' | 'setTakerAuthorization' | 'selectStakeOwner' | 'clearStakeOwner';
|
|
2108
|
+
type StakeWriteBase = {
|
|
2109
|
+
txOverrides?: TxOverrides;
|
|
2110
|
+
};
|
|
2111
|
+
type StakeVaultWriteParams = {
|
|
2112
|
+
depositStake: StakeWriteBase & {
|
|
2113
|
+
amount: bigint;
|
|
2114
|
+
};
|
|
2115
|
+
withdrawStake: StakeWriteBase & {
|
|
2116
|
+
amount: bigint;
|
|
2117
|
+
};
|
|
2118
|
+
claim: StakeWriteBase;
|
|
2119
|
+
setTakerAuthorization: StakeWriteBase & {
|
|
2120
|
+
taker: Address;
|
|
2121
|
+
authorized: boolean;
|
|
2122
|
+
};
|
|
2123
|
+
selectStakeOwner: StakeWriteBase & {
|
|
2124
|
+
stakeOwner: Address;
|
|
2125
|
+
};
|
|
2126
|
+
clearStakeOwner: StakeWriteBase;
|
|
2127
|
+
};
|
|
2128
|
+
/**
|
|
2129
|
+
* Vault accounting for one staker plus the delegation view for one taker.
|
|
2130
|
+
* `stakeOwner` is the EFFECTIVE owner from `stakeOwnerOf(taker)`;
|
|
2131
|
+
* `selectedStakeOwner` is the raw selection, which is only meaningful while
|
|
2132
|
+
* `selectionAuthorized` remains true. The two must never be conflated: a
|
|
2133
|
+
* stale selection falls back to self-stake on the contract side.
|
|
2134
|
+
* `admissionsPaused` comes from the vault's ChargebackPolicy controller and
|
|
2135
|
+
* blocks new chargebackable admissions while true.
|
|
2136
|
+
*/
|
|
2137
|
+
type StakeVaultState = {
|
|
2138
|
+
staker: Address;
|
|
2139
|
+
taker: Address;
|
|
2140
|
+
stakeToken: Address;
|
|
2141
|
+
stakeOwner: Address;
|
|
2142
|
+
selectedStakeOwner: Address | null;
|
|
2143
|
+
selectionAuthorized: boolean;
|
|
2144
|
+
staked: bigint;
|
|
2145
|
+
locked: bigint;
|
|
2146
|
+
free: bigint;
|
|
2147
|
+
claimable: bigint;
|
|
2148
|
+
admissionsPaused: boolean;
|
|
2149
|
+
};
|
|
2150
|
+
|
|
2052
2151
|
type PV_ReferralFee = {
|
|
2053
2152
|
recipient: `0x${string}`;
|
|
2054
2153
|
fee: bigint;
|
|
@@ -2402,6 +2501,91 @@ declare class IndexerRateManagerService {
|
|
|
2402
2501
|
}): Promise<OracleConfigUpdateEntity[]>;
|
|
2403
2502
|
}
|
|
2404
2503
|
|
|
2504
|
+
type IndexedStakingStateParams = {
|
|
2505
|
+
chainId: number;
|
|
2506
|
+
environment: StakeEnvironment;
|
|
2507
|
+
vaultAddress: Address;
|
|
2508
|
+
chargebackPolicyAddress: Address;
|
|
2509
|
+
taker: Address;
|
|
2510
|
+
/** Effective owner from the caller's fresh stakeOwnerOf(taker) read. */
|
|
2511
|
+
stakeOwner: Address;
|
|
2512
|
+
};
|
|
2513
|
+
type IndexedStakingRowFreshness = {
|
|
2514
|
+
updatedAtBlockNumber: string;
|
|
2515
|
+
updatedAt: string;
|
|
2516
|
+
};
|
|
2517
|
+
type IndexedTakerAuthorization = {
|
|
2518
|
+
stakeOwner: Address;
|
|
2519
|
+
authorized: boolean;
|
|
2520
|
+
freshness: IndexedStakingRowFreshness;
|
|
2521
|
+
};
|
|
2522
|
+
type IndexedRiskWindow = {
|
|
2523
|
+
/** Payment method hash the window applies to. */
|
|
2524
|
+
paymentMethod: string;
|
|
2525
|
+
/**
|
|
2526
|
+
* Minimum collateral lock window in seconds. The policy locks the full
|
|
2527
|
+
* intent amount for at least this long after settlement; a method with no
|
|
2528
|
+
* row (or a zero window) admits unbonded.
|
|
2529
|
+
*/
|
|
2530
|
+
riskWindowSeconds: string;
|
|
2531
|
+
updatedAt: string;
|
|
2532
|
+
};
|
|
2533
|
+
type IndexedStakingState = {
|
|
2534
|
+
chainId: number;
|
|
2535
|
+
environment: StakeEnvironment;
|
|
2536
|
+
taker: Address;
|
|
2537
|
+
/** Effective owner from the indexed TakerStakeState, or the taker when absent. */
|
|
2538
|
+
stakeOwner: Address;
|
|
2539
|
+
selectedStakeOwner: Address | null;
|
|
2540
|
+
selectionAuthorized: boolean;
|
|
2541
|
+
stake: TakerStakeBalances;
|
|
2542
|
+
claimableUsdc: string;
|
|
2543
|
+
authorizations: IndexedTakerAuthorization[];
|
|
2544
|
+
/**
|
|
2545
|
+
* Per-payment-method minimum lock windows from the ChargebackPolicy. The
|
|
2546
|
+
* global admissions pause is intentionally absent from the indexed model —
|
|
2547
|
+
* read it on-chain (`admissionsPaused()`), where it is authoritative.
|
|
2548
|
+
*/
|
|
2549
|
+
riskWindows: IndexedRiskWindow[];
|
|
2550
|
+
vault: {
|
|
2551
|
+
controller: Address | null;
|
|
2552
|
+
pendingController: Address | null;
|
|
2553
|
+
pendingControllerValidAt: string | null;
|
|
2554
|
+
} | null;
|
|
2555
|
+
/**
|
|
2556
|
+
* False when the indexer's effective owner has not caught up with the
|
|
2557
|
+
* caller's onchain owner. In that case stake defaults to zero rather than
|
|
2558
|
+
* attributing another owner's account to this taker.
|
|
2559
|
+
*/
|
|
2560
|
+
stakeAccountMatchesEffectiveOwner: boolean;
|
|
2561
|
+
freshness: {
|
|
2562
|
+
takerStakeState: IndexedStakingRowFreshness | null;
|
|
2563
|
+
stakeAccountState: IndexedStakingRowFreshness | null;
|
|
2564
|
+
claimAccountState: IndexedStakingRowFreshness | null;
|
|
2565
|
+
stakeVaultConfig: IndexedStakingRowFreshness | null;
|
|
2566
|
+
authorizations: IndexedStakingRowFreshness[];
|
|
2567
|
+
/**
|
|
2568
|
+
* Conservative minimum across the block-stamped rows present in this
|
|
2569
|
+
* response. Risk-window rows carry timestamps only and are excluded.
|
|
2570
|
+
*/
|
|
2571
|
+
indexedBlockNumber: string | null;
|
|
2572
|
+
};
|
|
2573
|
+
};
|
|
2574
|
+
type StakingEntityIds = {
|
|
2575
|
+
takerStateId: string;
|
|
2576
|
+
stakeAccountId: string;
|
|
2577
|
+
claimAccountId: string;
|
|
2578
|
+
vaultConfigId: string;
|
|
2579
|
+
/** Lowercased policy address used to filter risk-window rows. */
|
|
2580
|
+
policy: string;
|
|
2581
|
+
};
|
|
2582
|
+
declare function buildStakingEntityIds(params: IndexedStakingStateParams): StakingEntityIds;
|
|
2583
|
+
declare class IndexerStakingService {
|
|
2584
|
+
private readonly client;
|
|
2585
|
+
constructor(client: IndexerClient);
|
|
2586
|
+
fetchStakingState(params: IndexedStakingStateParams, init?: RequestInit): Promise<IndexedStakingState>;
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2405
2589
|
type FulfillmentRecord = {
|
|
2406
2590
|
id: string;
|
|
2407
2591
|
intentHash: string;
|
|
@@ -2523,7 +2707,10 @@ type SignalIntentMethodParams = {
|
|
|
2523
2707
|
data?: `0x${string}`;
|
|
2524
2708
|
/** Optional escrow override (auto-routes orchestrator when provided) */
|
|
2525
2709
|
escrowAddress?: Address;
|
|
2526
|
-
/**
|
|
2710
|
+
/**
|
|
2711
|
+
* Optional caller-pinned orchestrator target. Must resolve to an orchestrator
|
|
2712
|
+
* in the configured deployment; an unrecognized address throws.
|
|
2713
|
+
*/
|
|
2527
2714
|
orchestratorAddress?: Address;
|
|
2528
2715
|
/** Pre-obtained signature (if not auto-fetching) */
|
|
2529
2716
|
gatingServiceSignature?: `0x${string}`;
|
|
@@ -2539,7 +2726,10 @@ type SignalIntentMethodParams = {
|
|
|
2539
2726
|
type CancelIntentMethodParams = {
|
|
2540
2727
|
/** The intent hash to cancel (0x-prefixed, 32 bytes) */
|
|
2541
2728
|
intentHash: `0x${string}`;
|
|
2542
|
-
/**
|
|
2729
|
+
/**
|
|
2730
|
+
* Optional caller-pinned orchestrator target. Must resolve to an orchestrator
|
|
2731
|
+
* in the configured deployment; an unrecognized address throws.
|
|
2732
|
+
*/
|
|
2543
2733
|
orchestratorAddress?: Address;
|
|
2544
2734
|
/** Optional viem transaction overrides */
|
|
2545
2735
|
txOverrides?: TxOverrides;
|
|
@@ -2562,7 +2752,10 @@ type FulfillIntentMethodParams = {
|
|
|
2562
2752
|
attestationServiceFallbackUrls?: string[];
|
|
2563
2753
|
/** Override attestation service URL */
|
|
2564
2754
|
attestationServiceUrl?: string;
|
|
2565
|
-
/**
|
|
2755
|
+
/**
|
|
2756
|
+
* Optional caller-pinned orchestrator target. Must resolve to an orchestrator
|
|
2757
|
+
* in the configured deployment; an unrecognized address throws.
|
|
2758
|
+
*/
|
|
2566
2759
|
orchestratorAddress?: Address;
|
|
2567
2760
|
/** Data to pass to post-intent hook */
|
|
2568
2761
|
postIntentHookData?: `0x${string}`;
|
|
@@ -2739,6 +2932,14 @@ declare class Zkp2pClient {
|
|
|
2739
2932
|
readonly orchestratorRegistryAddress?: Address;
|
|
2740
2933
|
/** OrchestratorRegistry ABI */
|
|
2741
2934
|
readonly orchestratorRegistryAbi?: Abi;
|
|
2935
|
+
/** StakeVault address (undefined when staking is not deployed) */
|
|
2936
|
+
readonly stakeVaultAddress?: Address;
|
|
2937
|
+
/** StakeVault ABI */
|
|
2938
|
+
readonly stakeVaultAbi?: Abi;
|
|
2939
|
+
/** ChargebackPolicy address (undefined when the staking stack is not deployed) */
|
|
2940
|
+
readonly chargebackPolicyAddress?: Address;
|
|
2941
|
+
/** ChargebackPolicy ABI */
|
|
2942
|
+
readonly chargebackPolicyAbi?: Abi;
|
|
2742
2943
|
/** Base API URL for ZKP2P services */
|
|
2743
2944
|
readonly baseApiUrl?: string;
|
|
2744
2945
|
/** Optional internal curator API key (`x-api-key`) for internal seller verification */
|
|
@@ -2755,9 +2956,11 @@ declare class Zkp2pClient {
|
|
|
2755
2956
|
private readonly _indexerClient;
|
|
2756
2957
|
private readonly _indexerService;
|
|
2757
2958
|
private readonly _indexerRateManagerService;
|
|
2959
|
+
private readonly _indexerStakingService;
|
|
2758
2960
|
private readonly _router;
|
|
2759
2961
|
private readonly _pvReader;
|
|
2760
2962
|
private readonly _vaultOps;
|
|
2963
|
+
private readonly _stakeOps;
|
|
2761
2964
|
private readonly _intentGuardianOps;
|
|
2762
2965
|
private readonly _intentOps;
|
|
2763
2966
|
private readonly _referralOps;
|
|
@@ -2827,6 +3030,8 @@ declare class Zkp2pClient {
|
|
|
2827
3030
|
private prepareResolvedOrchestratorTransaction;
|
|
2828
3031
|
private prepareContractTransaction;
|
|
2829
3032
|
private buildContractMethod;
|
|
3033
|
+
private buildStakeVaultMethod;
|
|
3034
|
+
private buildChargebackPolicyMethod;
|
|
2830
3035
|
private buildIntentGuardianMethod;
|
|
2831
3036
|
private buildEscrowMethod;
|
|
2832
3037
|
private buildOrchestratorMethod;
|
|
@@ -3070,6 +3275,14 @@ declare class Zkp2pClient {
|
|
|
3070
3275
|
limit?: number;
|
|
3071
3276
|
rateManagerAddress?: string | null;
|
|
3072
3277
|
}) => Promise<OracleConfigUpdateEntity[]>;
|
|
3278
|
+
/**
|
|
3279
|
+
* Composes the hard-cut 0.14.0-rc.0 staking current-state rows. Pass the
|
|
3280
|
+
* caller's fresh stakeOwnerOf(taker) result so the account rows can be
|
|
3281
|
+
* fetched together and checked against indexed ownership.
|
|
3282
|
+
*/
|
|
3283
|
+
getStakingState: (params: IndexedStakingStateParams, options?: {
|
|
3284
|
+
signal?: AbortSignal;
|
|
3285
|
+
}) => Promise<IndexedStakingState>;
|
|
3073
3286
|
/**
|
|
3074
3287
|
* Fetches chronological fund activities for a specific deposit.
|
|
3075
3288
|
*/
|
|
@@ -3130,6 +3343,117 @@ declare class Zkp2pClient {
|
|
|
3130
3343
|
hadAllowance: boolean;
|
|
3131
3344
|
hash?: Hash;
|
|
3132
3345
|
}>;
|
|
3346
|
+
/**
|
|
3347
|
+
* Return the resolved StakeVault coordinates for advanced wallet, relayer,
|
|
3348
|
+
* or reactive read integrations.
|
|
3349
|
+
*/
|
|
3350
|
+
getStakeVaultContract(): {
|
|
3351
|
+
address: Address;
|
|
3352
|
+
abi: Abi;
|
|
3353
|
+
stakeToken: Address;
|
|
3354
|
+
};
|
|
3355
|
+
/** Return the resolved OrchestratorV3 coordinates for advanced integrations. */
|
|
3356
|
+
getOrchestratorV3Contract(): {
|
|
3357
|
+
address: Address;
|
|
3358
|
+
abi: Abi;
|
|
3359
|
+
};
|
|
3360
|
+
/** Return the resolved ChargebackPolicy coordinates for keeper integrations. */
|
|
3361
|
+
getChargebackPolicyContract(): {
|
|
3362
|
+
address: Address;
|
|
3363
|
+
abi: Abi;
|
|
3364
|
+
};
|
|
3365
|
+
/**
|
|
3366
|
+
* Ensure the connected wallet has approved enough USDC for StakeVault.
|
|
3367
|
+
* If an approval is submitted, wait for it to confirm before depositing.
|
|
3368
|
+
*/
|
|
3369
|
+
ensureStakeAllowance(params: {
|
|
3370
|
+
amount: bigint;
|
|
3371
|
+
maxApprove?: boolean;
|
|
3372
|
+
txOverrides?: TxOverrides;
|
|
3373
|
+
}): Promise<{
|
|
3374
|
+
hadAllowance: boolean;
|
|
3375
|
+
hash?: Hash;
|
|
3376
|
+
}>;
|
|
3377
|
+
/** Deposit USDC stake owned by the transaction sender. */
|
|
3378
|
+
readonly depositStake: PrepareableMethod<{
|
|
3379
|
+
txOverrides?: TxOverrides;
|
|
3380
|
+
} & {
|
|
3381
|
+
amount: bigint;
|
|
3382
|
+
}, `0x${string}`>;
|
|
3383
|
+
/** Withdraw the sender's free stake immediately; locked stake cannot move. */
|
|
3384
|
+
readonly withdrawStake: PrepareableMethod<{
|
|
3385
|
+
txOverrides?: TxOverrides;
|
|
3386
|
+
} & {
|
|
3387
|
+
amount: bigint;
|
|
3388
|
+
}, `0x${string}`>;
|
|
3389
|
+
/** Withdraw the sender's complete claimable USDC balance. */
|
|
3390
|
+
readonly claim: PrepareableMethod<{
|
|
3391
|
+
txOverrides?: TxOverrides;
|
|
3392
|
+
}, `0x${string}`>;
|
|
3393
|
+
/** Grant or revoke a taker's access to the sender's stake. */
|
|
3394
|
+
readonly setTakerAuthorization: PrepareableMethod<{
|
|
3395
|
+
txOverrides?: TxOverrides;
|
|
3396
|
+
} & {
|
|
3397
|
+
taker: Address;
|
|
3398
|
+
authorized: boolean;
|
|
3399
|
+
}, `0x${string}`>;
|
|
3400
|
+
/** Select the authorizing stake owner that backs the connected taker. */
|
|
3401
|
+
readonly selectStakeOwner: PrepareableMethod<{
|
|
3402
|
+
txOverrides?: TxOverrides;
|
|
3403
|
+
} & {
|
|
3404
|
+
stakeOwner: Address;
|
|
3405
|
+
}, `0x${string}`>;
|
|
3406
|
+
/** Clear the connected taker's selection and return to self-stake. */
|
|
3407
|
+
readonly clearStakeOwner: PrepareableMethod<{
|
|
3408
|
+
txOverrides?: TxOverrides;
|
|
3409
|
+
}, `0x${string}`>;
|
|
3410
|
+
/** Read total stake owned by an address directly from StakeVault. */
|
|
3411
|
+
getStakeBalance(stakeOwner: Address): Promise<bigint>;
|
|
3412
|
+
/** Read stake committed to active StakeVault locks. */
|
|
3413
|
+
getLockedStake(stakeOwner: Address): Promise<bigint>;
|
|
3414
|
+
/** Read stake available for immediate withdrawal or a new lock. */
|
|
3415
|
+
getFreeStake(stakeOwner: Address): Promise<bigint>;
|
|
3416
|
+
/** Read the non-stake USDC withdrawable by a beneficiary with `claim()`. */
|
|
3417
|
+
getClaimable(beneficiary: Address): Promise<bigint>;
|
|
3418
|
+
/** Resolve the effective stake owner backing a taker. */
|
|
3419
|
+
getStakeOwner(taker: Address): Promise<Address>;
|
|
3420
|
+
/** Read a taker's raw selection, which is stale once authorization is revoked. */
|
|
3421
|
+
getSelectedStakeOwner(taker: Address): Promise<Address>;
|
|
3422
|
+
/** Read whether a stake owner currently authorizes a taker. */
|
|
3423
|
+
getTakerAuthorization(stakeOwner: Address, taker: Address): Promise<boolean>;
|
|
3424
|
+
/** Read the complete authoritative StakeVault state needed by a staking UI. */
|
|
3425
|
+
getStakeVaultState(params: {
|
|
3426
|
+
staker: Address;
|
|
3427
|
+
taker?: Address;
|
|
3428
|
+
}): Promise<StakeVaultState>;
|
|
3429
|
+
/** Read whether the ChargebackPolicy is refusing new chargebackable admissions. */
|
|
3430
|
+
getAdmissionsPaused(): Promise<boolean>;
|
|
3431
|
+
/**
|
|
3432
|
+
* Read a payment method's minimum collateral lock window in seconds. Zero
|
|
3433
|
+
* means the method admits unbonded — no stake is locked at admission.
|
|
3434
|
+
*/
|
|
3435
|
+
getRiskWindow(paymentMethodHash: `0x${string}`): Promise<bigint>;
|
|
3436
|
+
/** Read whether an escrow deposit has opted into chargeback coverage. */
|
|
3437
|
+
isChargebackEnabled(escrow: Address, depositId: bigint): Promise<boolean>;
|
|
3438
|
+
/**
|
|
3439
|
+
* Release one chargeback intent whose risk window matured, unlocking its
|
|
3440
|
+
* stake cover. Permissionless once mature. Pass `chargebackPolicyAddress` to
|
|
3441
|
+
* pin the transaction to a snapshotted deployment.
|
|
3442
|
+
*/
|
|
3443
|
+
readonly releaseMaturedChargebackIntent: PrepareableMethod<{
|
|
3444
|
+
intentHash: `0x${string}`;
|
|
3445
|
+
chargebackPolicyAddress?: Address;
|
|
3446
|
+
txOverrides?: TxOverrides;
|
|
3447
|
+
}, `0x${string}`>;
|
|
3448
|
+
/**
|
|
3449
|
+
* Release multiple matured chargeback intents in one transaction.
|
|
3450
|
+
* Pass `chargebackPolicyAddress` to pin the transaction to a snapshotted deployment.
|
|
3451
|
+
*/
|
|
3452
|
+
readonly releaseMaturedChargebackIntents: PrepareableMethod<{
|
|
3453
|
+
intentHashes: readonly `0x${string}`[];
|
|
3454
|
+
chargebackPolicyAddress?: Address;
|
|
3455
|
+
txOverrides?: TxOverrides;
|
|
3456
|
+
}, `0x${string}`>;
|
|
3133
3457
|
/**
|
|
3134
3458
|
* Registers payee details with the curator API and returns hashed on-chain IDs.
|
|
3135
3459
|
*
|
|
@@ -4192,6 +4516,8 @@ declare class Zkp2pClient {
|
|
|
4192
4516
|
unifiedPaymentVerifier?: Address;
|
|
4193
4517
|
rateManagerV1?: Address;
|
|
4194
4518
|
orchestratorRegistry?: Address;
|
|
4519
|
+
stakeVault?: Address;
|
|
4520
|
+
chargebackPolicy?: Address;
|
|
4195
4521
|
usdc?: Address;
|
|
4196
4522
|
};
|
|
4197
4523
|
/**
|
|
@@ -4275,4 +4601,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
4275
4601
|
value?: bigint;
|
|
4276
4602
|
}>) => Promise<string>;
|
|
4277
4603
|
|
|
4278
|
-
export { type RedeemReferralCodeSignatureOptions as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetDepositBundleParams as E, type GetDepositBundleResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type GetOrderbookParams as H, type IntentEntity as I, type GetOrderbookResponse as J, type GetOrderbookTableResponse as K, type QuoteRequest as L, type QuoteResponse as M, type CuratorMetadata as N, type CurrencyType as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type PaymentMethodCatalog as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type TxOverrides as W, type ReferralBearerWriteOptions as X, type ReferralReadOptions as Y, Zkp2pClient as Z, type ReferralSignatureOptions as _, type IdentityAttestationRequestBody as a, type
|
|
4604
|
+
export { type RedeemReferralCodeSignatureOptions as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetDepositBundleParams as E, type GetDepositBundleResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type GetOrderbookParams as H, type IntentEntity as I, type GetOrderbookResponse as J, type GetOrderbookTableResponse as K, type QuoteRequest as L, type QuoteResponse as M, type CuratorMetadata as N, type CurrencyType as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type PaymentMethodCatalog as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type TxOverrides as W, type ReferralBearerWriteOptions as X, type ReferralReadOptions as Y, Zkp2pClient as Z, type ReferralSignatureOptions as _, type IdentityAttestationRequestBody as a, type SellerPlatform as a$, type SignalIntentReferralFee as a0, type SignalIntentMethodParams as a1, type FulfillIntentMethodParams as a2, type CancelIntentMethodParams as a3, type UpdateReferralCodeSignatureOptions as a4, type Zkp2pNextOptions as a5, type StakeVaultState as a6, type StakeVaultWriteFunction as a7, type StakeVaultWriteParams as a8, type IntentGuardianPolicy as a9, type GetQuoteResponse as aA, type GetQuoteResponseObject as aB, type GetQuoteSingleResponse as aC, type QuoteResponseObject as aD, type QuoteSingleResponse as aE, type QuoteIntentResponse as aF, type QuoteFeesResponse as aG, type FiatResponse as aH, type TokenResponse as aI, type NearbyQuote as aJ, type NearbySuggestions as aK, type ApiDeposit as aL, type DepositVerifier as aM, type DepositVerifierCurrency as aN, type DepositStatus$1 as aO, type GetDepositByIdRequest as aP, type GetDepositByIdResponse as aQ, type Intent as aR, type ApiIntentStatus as aS, type GetOwnerIntentsRequest as aT, type GetOwnerIntentsResponse as aU, type GetIntentsByDepositRequest as aV, type GetIntentsByDepositResponse as aW, type GetIntentByHashRequest as aX, type GetIntentByHashResponse as aY, type RegisterPayeeDetailsRequest as aZ, type RegisterPayeeDetailsResponse as a_, type IntentGuardianQuote as aa, type IntentGuardianWriteFunction as ab, type IntentGuardianWriteParams as ac, type IntentGuardianErrorCode as ad, classifyIntentGuardianError as ae, type AuthorizationTokenProvider as af, type TimeoutConfig as ag, type ActionCallback as ah, type ReferralRedemption as ai, type ReferralSignatureBody as aj, type CreateDepositParams as ak, type CreateDepositConversionRate as al, type Range as am, type WithdrawDepositParams as an, type SignalIntentParams as ao, type FulfillIntentParams as ap, type ReleaseFundsToPayerParams as aq, type CancelIntentParams as ar, type BestByPlatformResponseObject as as, type GetBestByPlatformResponse as at, type GetBestByPlatformResponseObject as au, type GetPlatformQuote as av, type PlatformQuote as aw, type QuotePreference as ax, type GetNearbyQuote as ay, type GetNearbySuggestions as az, type AttestationServiceSellerVerifyResponse as b, fetchFulfillmentAndPayment as b$, type VenmoSessionMaterial as b0, type CashAppSessionMaterial as b1, type WiseSessionMaterial as b2, type WiseProfileInfo as b3, type WiseProfileSelectionRequired as b4, type WiseProfileNotFound as b5, type PayPalGoogleOAuthSellerCredentialUploadBody as b6, type VenmoCredentialUploadInput as b7, type CashAppCredentialUploadInput as b8, type WiseCredentialUploadInput as b9, type GetSellerCredentialStatusParams as bA, type UploadPayPalGoogleOAuthSellerCredentialParams as bB, type UploadGoogleOAuthSellerCredentialParams as bC, type VerifySellerPaymentParams as bD, type IdentityAttestationActionType as bE, type IdentityAttestationOutput as bF, type IdentityAttestationOutputFor as bG, type IdentityAttestationParams as bH, type MakerIdentityAttestationRequestBody as bI, type MakerIdentityPlatform as bJ, type OnchainCurrency as bK, type DepositVerifierData as bL, type PreparedTransaction as bM, type OrderStats as bN, type DepositIntentStatistics as bO, type UsdcAmount as bP, type StakeEnvironment as bQ, type TakerStakeBalances as bR, type OrderbookEntry as bS, type OrderbookTableRow as bT, IndexerClient as bU, defaultIndexerEndpoint as bV, IndexerDepositService as bW, IndexerRateManagerService as bX, compareEventCursorIdsByRecency as bY, buildStakingEntityIds as bZ, IndexerStakingService as b_, type SellerCredentialUploadInputByPlatform as ba, type SellerCiphertextBundle as bb, type SellerSignedCiphertextBundle as bc, type SellerVerifyIntentDetails as bd, type SellerVerifyInput as be, type SellerProbeInput as bf, type SellerCredentialBundleUpload as bg, type SellerCredentialStatusValue as bh, type SellerCredentialStatus as bi, type SellerVerifyProxyBody as bj, type SellerTypedDataField as bk, type SellerTypedDataSpec as bl, type SellerPaymentTypedDataValue as bm, type SellerAttestationOutput as bn, type SellerCredentialProbeResponse as bo, type FulfillIntentAttestationResponse as bp, type AttestationServiceSellerCredentialProbeResponse as bq, type BuyerTeePaymentParams as br, type BuyerTeePaymentProofInput as bs, type BuyerTeeSessionMaterial as bt, type CuratorSellerCredentialStatusResponse as bu, type CuratorSellerVerifyResponse as bv, type RegisteredSellerCredentialPlatform as bw, type UploadSellerCredentialParams as bx, type RegisteredUploadSellerCredentialParams as by, type UploadSellerCredentialOptions as bz, type SellerCredentialUploadInput as c, parseDepositView as c$, type DepositEntity as c0, type IntentFulfilledEntity as c1, type IntentFulfillmentAmountsEntity as c2, type DepositPaymentMethodEntity as c3, type MethodCurrencyEntity as c4, type IntentStatus as c5, type RateManagerEntity as c6, type RateManagerRateEntity as c7, type RateManagerDelegationEntity as c8, type ManagerAggregateStatsEntity as c9, type PaymentVerifiedRecord as cA, type FulfillmentAndPaymentResponse as cB, PAYMENT_PLATFORMS as cC, type PaymentPlatformType as cD, Currency as cE, currencyInfo as cF, getCurrencyInfoFromHash as cG, getCurrencyInfoFromCountryCode as cH, getCurrencyCodeFromHash as cI, isSupportedCurrencyHash as cJ, mapConversionRatesToOnchainMinRate as cK, type CurrencyData as cL, getContracts as cM, getIntentGuardianContract as cN, hasIntentGuardian as cO, getRateManagerContracts as cP, getStakeVaultContract as cQ, getOrchestratorV3Contract as cR, getChargebackPolicyContract as cS, getPaymentMethodsCatalog as cT, getGatingServiceAddress as cU, ORCHESTRATOR_V3_ABI as cV, CHARGEBACK_POLICY_ABI as cW, STAKE_VAULT_ABI as cX, type RuntimeEnv as cY, type V2ContractAddresses as cZ, type V2ContractAbis as c_, type ManagerStatsEntity as ca, type ManagerDailySnapshotEntity as cb, type RateManagerListItem as cc, type RateManagerDetail as cd, type ManualRateUpdateEntity as ce, type OracleConfigUpdateEntity as cf, type DepositFundActivityEntity as cg, type DepositDailySnapshotEntity as ch, type DepositFundActivityType as ci, type IndexedRiskWindow as cj, type IndexedStakingRowFreshness as ck, type IndexedStakingState as cl, type IndexedStakingStateParams as cm, type IndexedTakerAuthorization as cn, type StakingEntityIds as co, type DepositFilter as cp, type PaginationOptions as cq, type DepositOrderField as cr, type OrderDirection$1 as cs, type RateManagerFilter as ct, type RateManagerPaginationOptions as cu, type RateManagerDelegationPaginationOptions as cv, type RateManagerOrderField as cw, type OrderDirection as cx, type DeploymentEnv as cy, type FulfillmentRecord as cz, type SellerCredentialUploadPlatform as d, parseIntentView as d0, enrichPvDepositView as d1, enrichPvIntentView as d2, type PV_DepositView as d3, type PV_Deposit as d4, type PV_PaymentMethodData as d5, type PV_Currency as d6, type PV_ReferralFee as d7, type PV_IntentView as d8, type PV_Intent as d9, type AccessPolicyViolation as dA, ZERO_ADDRESS as dB, asErrorMessage as dC, assertDelegationMethodSupport as dD, ZERO_RATE_MANAGER_ID as da, isZeroRateManagerId as db, normalizeRateManagerId as dc, normalizeRegistry as dd, getDelegationRoute as de, classifyDelegationState as df, type DelegationRoute as dg, type DelegationState as dh, type DelegationDepositTarget as di, type BatchResult as dj, type SendTransactionFn as dk, type SendBatchFn as dl, AccessPolicyOperations as dm, AccessPolicyUnsupportedError as dn, MAX_GROUPS_PER_DEPOSIT as dp, MAX_ADDRESSES_PER_CALL as dq, MAX_WHITELISTED_ADDRESSES as dr, diffAccessPolicy as ds, normalizeAccessPolicyState as dt, planAccessPolicyUpdate as du, type AccessPolicyDiff as dv, type AccessPolicyOrdering as dw, type AccessPolicyPlan as dx, type AccessPolicyPlanStep as dy, type AccessPolicyState as dz, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type CreateReferralCodeRequest as h, type ApiAdapterOptions as i, type CreateReferralCodeResponse as j, type ReferralReadRequest as k, type ReferralDashboardResponse as l, type ReferralEarningsResponse as m, type ReferralCodeLookupResponse as n, type RedeemReferralCodeRequest as o, type RedeemReferralCodeResponse as p, type UpdateReferralCodeRequest as q, type UpdateReferralCodeResponse as r, type GoogleOAuthSellerCredentialUploadBodyByPlatform as s, type BestByPlatformResponse as t, type ValidatePayeeDetailsResponse as u, type PostDepositDetailsResponse as v, type GetPayeeDetailsRequest as w, type GetPayeeDetailsResponse as x, type GetOwnerDepositsRequest as y, type GetOwnerDepositsResponse as z };
|