@zkp2p/sdk 0.1.0 → 0.2.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 +382 -120
- package/dist/{chunk-JH74HXTS.mjs → chunk-J33LUXNA.mjs} +7 -24
- package/dist/chunk-J33LUXNA.mjs.map +1 -0
- package/dist/{chunk-YLITJ7SI.mjs → chunk-LPJE2MN7.mjs} +11 -48
- package/dist/chunk-LPJE2MN7.mjs.map +1 -0
- package/dist/index.cjs +274 -300
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -16
- package/dist/index.d.ts +5 -16
- package/dist/index.mjs +276 -270
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-VVASNOXW.mjs +4 -0
- package/dist/{protocolViewerParsers-QVG4JP23.mjs.map → protocolViewerParsers-VVASNOXW.mjs.map} +1 -1
- package/dist/react.cjs +9 -54
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +2 -2
- package/dist/{vaultUtils-J1WboG1T.d.mts → vaultUtils-zw4Xgu-G.d.mts} +27 -38
- package/dist/{vaultUtils-J1WboG1T.d.ts → vaultUtils-zw4Xgu-G.d.ts} +27 -38
- package/package.json +18 -18
- package/dist/chunk-JH74HXTS.mjs.map +0 -1
- package/dist/chunk-YLITJ7SI.mjs.map +0 -1
- package/dist/protocolViewerParsers-QVG4JP23.mjs +0 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-
|
|
2
|
-
export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider,
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-zw4Xgu-G.mjs';
|
|
2
|
+
export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bu as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bt as DelegationDepositTarget, br as DelegationRoute, bs as DelegationState, bf as Deposit, bh as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, be as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, b8 as HISTORICAL_ESCROW_ADDRESSES, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bj as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bk as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bg as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bi as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b9 as RuntimeEnv, bw as SendBatchFn, bv as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bl as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bq as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bc as enrichPvDepositView, bd as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bp as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bm as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bn as normalizeRateManagerId, bo as normalizeRegistry, ba as parseDepositView, bb as parseIntentView } from './vaultUtils-zw4Xgu-G.mjs';
|
|
3
3
|
import { Address, Hex, WalletClient, Hash } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
|
@@ -73,48 +73,38 @@ interface EscrowContractContext {
|
|
|
73
73
|
abi: Abi;
|
|
74
74
|
orchestratorAddress?: Address;
|
|
75
75
|
orchestratorAbi?: Abi;
|
|
76
|
-
version: '
|
|
76
|
+
version: 'v2';
|
|
77
77
|
}
|
|
78
78
|
interface OrchestratorContractContext {
|
|
79
79
|
address: Address;
|
|
80
80
|
abi: Abi;
|
|
81
|
-
version: '
|
|
81
|
+
version: 'v2';
|
|
82
82
|
}
|
|
83
83
|
interface ContractRouterConfig {
|
|
84
84
|
escrowAddress: Address;
|
|
85
85
|
escrowAbi: Abi;
|
|
86
|
-
legacyEscrowAddress?: Address;
|
|
87
|
-
legacyEscrowAbi?: Abi;
|
|
88
86
|
escrowV2Address?: Address;
|
|
89
87
|
escrowV2Abi?: Abi;
|
|
90
88
|
escrowAddresses: Address[];
|
|
91
89
|
orchestratorAddress?: Address;
|
|
92
90
|
orchestratorAbi?: Abi;
|
|
93
|
-
legacyOrchestratorAddress?: Address;
|
|
94
|
-
legacyOrchestratorAbi?: Abi;
|
|
95
91
|
orchestratorV2Address?: Address;
|
|
96
92
|
orchestratorV2Abi?: Abi;
|
|
97
93
|
orchestratorAddresses: Address[];
|
|
98
|
-
defaultPreferV2: boolean;
|
|
99
94
|
}
|
|
100
95
|
declare class ContractRouter {
|
|
101
96
|
private readonly _escrowContextsByAddress;
|
|
102
97
|
private readonly _orchestratorContextsByAddress;
|
|
103
98
|
readonly escrowAddress: Address;
|
|
104
99
|
readonly escrowAbi: Abi;
|
|
105
|
-
readonly legacyEscrowAddress?: Address;
|
|
106
|
-
readonly legacyEscrowAbi?: Abi;
|
|
107
100
|
readonly escrowV2Address?: Address;
|
|
108
101
|
readonly escrowV2Abi?: Abi;
|
|
109
102
|
readonly escrowAddresses: Address[];
|
|
110
103
|
readonly orchestratorAddress?: Address;
|
|
111
104
|
readonly orchestratorAbi?: Abi;
|
|
112
|
-
readonly legacyOrchestratorAddress?: Address;
|
|
113
|
-
readonly legacyOrchestratorAbi?: Abi;
|
|
114
105
|
readonly orchestratorV2Address?: Address;
|
|
115
106
|
readonly orchestratorV2Abi?: Abi;
|
|
116
107
|
readonly orchestratorAddresses: Address[];
|
|
117
|
-
private readonly _defaultPreferV2;
|
|
118
108
|
constructor(config: ContractRouterConfig);
|
|
119
109
|
private _registerContexts;
|
|
120
110
|
getEscrowContextByAddress(address?: Address): EscrowContractContext | undefined;
|
|
@@ -122,10 +112,9 @@ declare class ContractRouter {
|
|
|
122
112
|
resolveEscrowContext(options?: {
|
|
123
113
|
escrowAddress?: Address;
|
|
124
114
|
depositId?: bigint | number | string;
|
|
125
|
-
preferV2?: boolean;
|
|
126
115
|
}): EscrowContractContext;
|
|
127
116
|
getEscrowContexts(): EscrowContractContext[];
|
|
128
|
-
resolveOrchestratorForEscrow(escrowAddress?: Address,
|
|
117
|
+
resolveOrchestratorForEscrow(escrowAddress?: Address, _preferV2?: boolean): OrchestratorContractContext | undefined;
|
|
129
118
|
buildProtocolViewerContexts(options?: {
|
|
130
119
|
escrowAddress?: Address;
|
|
131
120
|
orchestratorAddress?: Address;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-
|
|
2
|
-
export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider,
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-zw4Xgu-G.js';
|
|
2
|
+
export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bu as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bt as DelegationDepositTarget, br as DelegationRoute, bs as DelegationState, bf as Deposit, bh as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, be as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, b8 as HISTORICAL_ESCROW_ADDRESSES, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bj as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bk as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bg as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bi as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b9 as RuntimeEnv, bw as SendBatchFn, bv as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bl as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bq as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bc as enrichPvDepositView, bd as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bp as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bm as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bn as normalizeRateManagerId, bo as normalizeRegistry, ba as parseDepositView, bb as parseIntentView } from './vaultUtils-zw4Xgu-G.js';
|
|
3
3
|
import { Address, Hex, WalletClient, Hash } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
|
@@ -73,48 +73,38 @@ interface EscrowContractContext {
|
|
|
73
73
|
abi: Abi;
|
|
74
74
|
orchestratorAddress?: Address;
|
|
75
75
|
orchestratorAbi?: Abi;
|
|
76
|
-
version: '
|
|
76
|
+
version: 'v2';
|
|
77
77
|
}
|
|
78
78
|
interface OrchestratorContractContext {
|
|
79
79
|
address: Address;
|
|
80
80
|
abi: Abi;
|
|
81
|
-
version: '
|
|
81
|
+
version: 'v2';
|
|
82
82
|
}
|
|
83
83
|
interface ContractRouterConfig {
|
|
84
84
|
escrowAddress: Address;
|
|
85
85
|
escrowAbi: Abi;
|
|
86
|
-
legacyEscrowAddress?: Address;
|
|
87
|
-
legacyEscrowAbi?: Abi;
|
|
88
86
|
escrowV2Address?: Address;
|
|
89
87
|
escrowV2Abi?: Abi;
|
|
90
88
|
escrowAddresses: Address[];
|
|
91
89
|
orchestratorAddress?: Address;
|
|
92
90
|
orchestratorAbi?: Abi;
|
|
93
|
-
legacyOrchestratorAddress?: Address;
|
|
94
|
-
legacyOrchestratorAbi?: Abi;
|
|
95
91
|
orchestratorV2Address?: Address;
|
|
96
92
|
orchestratorV2Abi?: Abi;
|
|
97
93
|
orchestratorAddresses: Address[];
|
|
98
|
-
defaultPreferV2: boolean;
|
|
99
94
|
}
|
|
100
95
|
declare class ContractRouter {
|
|
101
96
|
private readonly _escrowContextsByAddress;
|
|
102
97
|
private readonly _orchestratorContextsByAddress;
|
|
103
98
|
readonly escrowAddress: Address;
|
|
104
99
|
readonly escrowAbi: Abi;
|
|
105
|
-
readonly legacyEscrowAddress?: Address;
|
|
106
|
-
readonly legacyEscrowAbi?: Abi;
|
|
107
100
|
readonly escrowV2Address?: Address;
|
|
108
101
|
readonly escrowV2Abi?: Abi;
|
|
109
102
|
readonly escrowAddresses: Address[];
|
|
110
103
|
readonly orchestratorAddress?: Address;
|
|
111
104
|
readonly orchestratorAbi?: Abi;
|
|
112
|
-
readonly legacyOrchestratorAddress?: Address;
|
|
113
|
-
readonly legacyOrchestratorAbi?: Abi;
|
|
114
105
|
readonly orchestratorV2Address?: Address;
|
|
115
106
|
readonly orchestratorV2Abi?: Abi;
|
|
116
107
|
readonly orchestratorAddresses: Address[];
|
|
117
|
-
private readonly _defaultPreferV2;
|
|
118
108
|
constructor(config: ContractRouterConfig);
|
|
119
109
|
private _registerContexts;
|
|
120
110
|
getEscrowContextByAddress(address?: Address): EscrowContractContext | undefined;
|
|
@@ -122,10 +112,9 @@ declare class ContractRouter {
|
|
|
122
112
|
resolveEscrowContext(options?: {
|
|
123
113
|
escrowAddress?: Address;
|
|
124
114
|
depositId?: bigint | number | string;
|
|
125
|
-
preferV2?: boolean;
|
|
126
115
|
}): EscrowContractContext;
|
|
127
116
|
getEscrowContexts(): EscrowContractContext[];
|
|
128
|
-
resolveOrchestratorForEscrow(escrowAddress?: Address,
|
|
117
|
+
resolveOrchestratorForEscrow(escrowAddress?: Address, _preferV2?: boolean): OrchestratorContractContext | undefined;
|
|
129
118
|
buildProtocolViewerContexts(options?: {
|
|
130
119
|
escrowAddress?: Address;
|
|
131
120
|
orchestratorAddress?: Address;
|