@gearbox-protocol/sdk 13.7.0-kyc.3 → 14.0.0-next.10
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/cjs/dev/AccountOpener.js +5 -45
- package/dist/cjs/dev/RevolverTransport.js +10 -4
- package/dist/cjs/dev/index.js +0 -2
- package/dist/cjs/dev/logSplitterTransport.js +10 -1
- package/dist/cjs/permissionless/utils/create2.js +2 -2
- package/dist/cjs/permissionless/utils/price-update/get-price-feeds.js +11 -5
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +11 -5
- package/dist/cjs/permissionless/utils/price-update/get-prices.js +12 -6
- package/dist/cjs/sdk/MultichainSDK.js +232 -0
- package/dist/cjs/sdk/OnchainSDK.js +478 -0
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +16 -324
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +1 -7
- package/dist/cjs/sdk/base/TokensMeta.js +42 -22
- package/dist/cjs/sdk/base/token-types.js +0 -9
- package/dist/cjs/sdk/chain/chains.js +1 -2
- package/dist/cjs/sdk/constants/address-provider.js +0 -3
- package/dist/cjs/sdk/core/errors.js +77 -0
- package/dist/cjs/sdk/core/index.js +2 -0
- package/dist/cjs/sdk/index.js +4 -2
- package/dist/cjs/sdk/market/MarketRegister.js +116 -70
- package/dist/cjs/sdk/market/MarketSuite.js +0 -3
- package/dist/cjs/sdk/market/index.js +0 -2
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -11
- package/dist/cjs/sdk/market/pool/index.js +0 -2
- package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +10 -3
- package/dist/cjs/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.js +20 -23
- package/dist/cjs/sdk/market/pricefeeds/updates/PythUpdater.js +7 -4
- package/dist/cjs/sdk/market/pricefeeds/updates/RedstoneUpdater.js +4 -4
- package/dist/cjs/sdk/market/pricefeeds/updates/fetchPythPayloads.js +1 -1
- package/dist/cjs/sdk/market/pricefeeds/updates/index.js +3 -0
- package/dist/cjs/sdk/options.js +24 -52
- package/dist/cjs/sdk/plugins/BasePlugin.js +11 -4
- package/dist/cjs/sdk/pools/PoolService.js +12 -104
- package/dist/cjs/sdk/utils/formatter.js +99 -20
- package/dist/cjs/sdk/utils/viem/index.js +3 -3
- package/dist/cjs/sdk/utils/viem/watchBlocksAsync.js +76 -0
- package/dist/esm/dev/AccountOpener.js +6 -47
- package/dist/esm/dev/RevolverTransport.js +10 -4
- package/dist/esm/dev/index.js +0 -1
- package/dist/esm/dev/logSplitterTransport.js +10 -1
- package/dist/esm/permissionless/utils/create2.js +1 -1
- package/dist/esm/permissionless/utils/price-update/get-price-feeds.js +12 -6
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +13 -7
- package/dist/esm/permissionless/utils/price-update/get-prices.js +13 -7
- package/dist/esm/sdk/MultichainSDK.js +217 -0
- package/dist/esm/sdk/OnchainSDK.js +472 -0
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +17 -328
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -7
- package/dist/esm/sdk/base/TokensMeta.js +44 -22
- package/dist/esm/sdk/base/token-types.js +0 -6
- package/dist/esm/sdk/chain/chains.js +1 -2
- package/dist/esm/sdk/constants/address-provider.js +0 -2
- package/dist/esm/sdk/core/errors.js +48 -0
- package/dist/esm/sdk/core/index.js +1 -0
- package/dist/esm/sdk/index.js +2 -1
- package/dist/esm/sdk/market/MarketRegister.js +118 -74
- package/dist/esm/sdk/market/MarketSuite.js +0 -3
- package/dist/esm/sdk/market/index.js +0 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -11
- package/dist/esm/sdk/market/pool/index.js +0 -1
- package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +10 -3
- package/dist/esm/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.js +20 -13
- package/dist/esm/sdk/market/pricefeeds/updates/PythUpdater.js +7 -4
- package/dist/esm/sdk/market/pricefeeds/updates/RedstoneUpdater.js +4 -4
- package/dist/esm/sdk/market/pricefeeds/updates/fetchPythPayloads.js +1 -1
- package/dist/esm/sdk/market/pricefeeds/updates/index.js +2 -0
- package/dist/esm/sdk/options.js +22 -51
- package/dist/esm/sdk/plugins/BasePlugin.js +11 -4
- package/dist/esm/sdk/pools/PoolService.js +13 -109
- package/dist/esm/sdk/utils/formatter.js +99 -10
- package/dist/esm/sdk/utils/viem/index.js +1 -1
- package/dist/esm/sdk/utils/viem/watchBlocksAsync.js +52 -0
- package/dist/types/dev/RevolverTransport.d.ts +2 -1
- package/dist/types/dev/calcLiquidatableLTs.d.ts +2 -2
- package/dist/types/dev/claimFromFaucet.d.ts +2 -2
- package/dist/types/dev/create2.d.ts +3 -4
- package/dist/types/dev/index.d.ts +0 -1
- package/dist/types/dev/logSplitterTransport.d.ts +3 -1
- package/dist/types/dev/migrateFaucet.d.ts +2 -2
- package/dist/types/dev/mint/AbstractMinter.d.ts +2 -2
- package/dist/types/dev/mint/FallbackMinter.d.ts +2 -2
- package/dist/types/dev/mint/factory.d.ts +2 -2
- package/dist/types/dev/replaceStorage.d.ts +1 -1
- package/dist/types/permissionless/utils/price-update/get-updatable-feeds.d.ts +2 -2
- package/dist/types/plugins/accounts/AccountsPlugin.d.ts +2 -2
- package/dist/types/plugins/accounts-counter/AccountsCounterPlugin.d.ts +2 -2
- package/dist/types/plugins/adapters/AdaptersPlugin.d.ts +2 -2
- package/dist/types/plugins/apy/ApyPlugin.d.ts +2 -2
- package/dist/types/plugins/bots/BotsPlugin.d.ts +2 -2
- package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +2 -2
- package/dist/types/plugins/degen-distributors/DegenDistributorsPlugin.d.ts +2 -2
- package/dist/types/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.d.ts +2 -2
- package/dist/types/sdk/MultichainSDK.d.ts +144 -0
- package/dist/types/sdk/OnchainSDK.d.ts +257 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +4 -54
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/createCreditAccountService.d.ts +2 -2
- package/dist/types/sdk/accounts/types.d.ts +15 -95
- package/dist/types/sdk/base/SDKConstruct.d.ts +4 -4
- package/dist/types/sdk/base/TokensMeta.d.ts +3 -14
- package/dist/types/sdk/base/token-types.d.ts +4 -44
- package/dist/types/sdk/base/types.d.ts +2 -116
- package/dist/types/sdk/chain/chains.d.ts +1 -5
- package/dist/types/sdk/constants/address-provider.d.ts +0 -1
- package/dist/types/sdk/core/createAddressProvider.d.ts +3 -3
- package/dist/types/sdk/core/errors.d.ts +51 -0
- package/dist/types/sdk/core/index.d.ts +1 -0
- package/dist/types/sdk/index.d.ts +2 -1
- package/dist/types/sdk/market/MarketRegister.d.ts +11 -8
- package/dist/types/sdk/market/MarketSuite.d.ts +2 -4
- package/dist/types/sdk/market/adapters/createAdapter.d.ts +2 -2
- package/dist/types/sdk/market/credit/CreditConfiguratorV310Contract.d.ts +3 -3
- package/dist/types/sdk/market/credit/CreditManagerV310Contract.d.ts +2 -2
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +2 -2
- package/dist/types/sdk/market/credit/createCreditConfigurator.d.ts +2 -2
- package/dist/types/sdk/market/credit/createCreditFacade.d.ts +2 -2
- package/dist/types/sdk/market/credit/createCreditManager.d.ts +2 -2
- package/dist/types/sdk/market/credit/types.d.ts +1 -1
- package/dist/types/sdk/market/index.d.ts +0 -1
- package/dist/types/sdk/market/loss-policy/AliasLossPolicyV310Contract.d.ts +3 -3
- package/dist/types/sdk/market/loss-policy/createLossPolicy.d.ts +2 -2
- package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +5 -6
- package/dist/types/sdk/market/oracle/PriceOracleV310Contract.d.ts +2 -2
- package/dist/types/sdk/market/oracle/createPriceOracle.d.ts +2 -2
- package/dist/types/sdk/market/oracle/types.d.ts +10 -3
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -4
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
- package/dist/types/sdk/market/pool/createInterestRateModel.d.ts +2 -2
- package/dist/types/sdk/market/pool/createPool.d.ts +2 -2
- package/dist/types/sdk/market/pool/createPoolQuotaKeeper.d.ts +2 -2
- package/dist/types/sdk/market/pool/createRateKeeper.d.ts +2 -2
- package/dist/types/sdk/market/pool/index.d.ts +0 -1
- package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +8 -3
- package/dist/types/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.d.ts +12 -13
- package/dist/types/sdk/market/pricefeeds/updates/PythUpdater.d.ts +8 -3
- package/dist/types/sdk/market/pricefeeds/updates/RedstoneUpdater.d.ts +8 -3
- package/dist/types/sdk/market/pricefeeds/updates/index.d.ts +1 -0
- package/dist/types/sdk/market/pricefeeds/updates/types.d.ts +4 -0
- package/dist/types/sdk/market/types.d.ts +1 -1
- package/dist/types/sdk/options.d.ts +15 -16
- package/dist/types/sdk/plugins/BasePlugin.d.ts +12 -6
- package/dist/types/sdk/plugins/errors.d.ts +2 -2
- package/dist/types/sdk/plugins/types.d.ts +16 -6
- package/dist/types/sdk/pools/PoolService.d.ts +8 -8
- package/dist/types/sdk/pools/types.d.ts +2 -3
- package/dist/types/sdk/router/AbstractRouterContract.d.ts +3 -3
- package/dist/types/sdk/router/RouterV310Contract.d.ts +2 -2
- package/dist/types/sdk/router/createRouter.d.ts +2 -2
- package/dist/types/sdk/router/helpers.d.ts +1 -1
- package/dist/types/sdk/types/state-human.d.ts +10 -2
- package/dist/types/sdk/types/state.d.ts +14 -8
- package/dist/types/sdk/utils/filterDust.d.ts +2 -2
- package/dist/types/sdk/utils/formatter.d.ts +1 -1
- package/dist/types/sdk/utils/isDust.d.ts +2 -2
- package/dist/types/sdk/utils/toAddress.d.ts +1 -1
- package/dist/types/sdk/utils/viem/getLogsPaginated.d.ts +1 -2
- package/dist/types/sdk/utils/viem/getLogsSafe.d.ts +1 -1
- package/dist/types/sdk/utils/viem/index.d.ts +1 -1
- package/dist/types/sdk/utils/viem/simulateWithPriceUpdates.d.ts +1 -2
- package/dist/types/sdk/utils/viem/watchBlocksAsync.d.ts +74 -0
- package/package.json +3 -6
- package/dist/cjs/abi/kyc/iDSRegistryService.js +0 -70
- package/dist/cjs/abi/kyc/iDSToken.js +0 -71
- package/dist/cjs/abi/kyc/iKYCCompressor.js +0 -196
- package/dist/cjs/abi/kyc/iKYCFactory.js +0 -122
- package/dist/cjs/abi/kyc/iKYCUnderlying.js +0 -401
- package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +0 -326
- package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +0 -319
- package/dist/cjs/dev/CachedStateSubscriber.js +0 -78
- package/dist/cjs/sdk/GearboxSDK.js +0 -696
- package/dist/cjs/sdk/market/kyc/KYCRegistry.js +0 -269
- package/dist/cjs/sdk/market/kyc/index.js +0 -26
- package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +0 -244
- package/dist/cjs/sdk/market/kyc/securitize/constants.js +0 -28
- package/dist/cjs/sdk/market/kyc/securitize/index.js +0 -26
- package/dist/cjs/sdk/market/kyc/securitize/types.js +0 -16
- package/dist/cjs/sdk/market/kyc/types.js +0 -34
- package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +0 -38
- package/dist/esm/abi/kyc/iDSRegistryService.js +0 -46
- package/dist/esm/abi/kyc/iDSToken.js +0 -47
- package/dist/esm/abi/kyc/iKYCCompressor.js +0 -172
- package/dist/esm/abi/kyc/iKYCFactory.js +0 -98
- package/dist/esm/abi/kyc/iKYCUnderlying.js +0 -377
- package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +0 -302
- package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +0 -295
- package/dist/esm/dev/CachedStateSubscriber.js +0 -54
- package/dist/esm/sdk/GearboxSDK.js +0 -689
- package/dist/esm/sdk/market/kyc/KYCRegistry.js +0 -253
- package/dist/esm/sdk/market/kyc/index.js +0 -3
- package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +0 -220
- package/dist/esm/sdk/market/kyc/securitize/constants.js +0 -4
- package/dist/esm/sdk/market/kyc/securitize/index.js +0 -3
- package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
- package/dist/esm/sdk/market/kyc/types.js +0 -9
- package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +0 -14
- package/dist/types/abi/kyc/iDSRegistryService.d.ts +0 -71
- package/dist/types/abi/kyc/iDSToken.d.ts +0 -67
- package/dist/types/abi/kyc/iKYCCompressor.d.ts +0 -228
- package/dist/types/abi/kyc/iKYCFactory.d.ts +0 -139
- package/dist/types/abi/kyc/iKYCUnderlying.d.ts +0 -548
- package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +0 -404
- package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +0 -376
- package/dist/types/dev/CachedStateSubscriber.d.ts +0 -21
- package/dist/types/sdk/GearboxSDK.d.ts +0 -324
- package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +0 -52
- package/dist/types/sdk/market/kyc/index.d.ts +0 -3
- package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +0 -428
- package/dist/types/sdk/market/kyc/securitize/constants.d.ts +0 -1
- package/dist/types/sdk/market/kyc/securitize/index.d.ts +0 -3
- package/dist/types/sdk/market/kyc/securitize/types.d.ts +0 -127
- package/dist/types/sdk/market/kyc/types.d.ts +0 -170
- package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +0 -28
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { NetworkType } from "./chain/chains.js";
|
|
2
|
+
import { type PythOptions, type RedstoneOptions } from "./market/pricefeeds/updates/index.js";
|
|
3
|
+
import { type AttachOptions, type ClientOptions, type HydrateOptions, OnchainSDK } from "./OnchainSDK.js";
|
|
4
|
+
import type { PluginFactoriesMap, PluginsMap } from "./plugins/index.js";
|
|
5
|
+
import type { ILogger, MultichainState, MultichainStateHuman } from "./types/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Per-chain configuration for {@link MultichainSDK}.
|
|
8
|
+
**/
|
|
9
|
+
export interface ChainConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Gas limit for read-only `eth_call` requests. `null` disables, `undefined` uses default.
|
|
12
|
+
**/
|
|
13
|
+
gasLimit?: bigint | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options for creating a {@link MultichainSDK} instance.
|
|
17
|
+
*
|
|
18
|
+
* @typeParam Plugins - Map of plugin names to plugin instances.
|
|
19
|
+
**/
|
|
20
|
+
export interface MultichainSDKOptions<Plugins extends PluginsMap> {
|
|
21
|
+
/**
|
|
22
|
+
* Per-chain client and configuration.
|
|
23
|
+
**/
|
|
24
|
+
chains: Partial<Record<NetworkType, ChainConfig & ClientOptions>>;
|
|
25
|
+
/**
|
|
26
|
+
* Plugin factories — called once per chain to produce independent instances.
|
|
27
|
+
**/
|
|
28
|
+
plugins?: PluginFactoriesMap<Plugins>;
|
|
29
|
+
/**
|
|
30
|
+
* Shared default logger
|
|
31
|
+
**/
|
|
32
|
+
logger?: ILogger;
|
|
33
|
+
/**
|
|
34
|
+
* When `true`, throw on unrecognised contract types instead of falling back to a generic contract wrapper.
|
|
35
|
+
**/
|
|
36
|
+
strictContractTypes?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Default gas limit for read-only `eth_call` requests on all chains. `null` disables, `undefined` uses default.
|
|
39
|
+
**/
|
|
40
|
+
gasLimit?: bigint | null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Options for {@link MultichainSDK.attach}.
|
|
44
|
+
**/
|
|
45
|
+
export interface MultichainAttachOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Per-chain attach options.
|
|
48
|
+
**/
|
|
49
|
+
perChain?: Partial<Record<NetworkType, AttachOptions>>;
|
|
50
|
+
/**
|
|
51
|
+
* Options for Redstone price-feed updates (shared cache across chains).
|
|
52
|
+
**/
|
|
53
|
+
redstone?: RedstoneOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Options for Pyth price-feed updates (shared cache across chains).
|
|
56
|
+
**/
|
|
57
|
+
pyth?: PythOptions;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Options for {@link MultichainSDK.hydrate}.
|
|
61
|
+
**/
|
|
62
|
+
export interface MultichainHydrateOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Per-chain hydrate options.
|
|
65
|
+
**/
|
|
66
|
+
perChain?: Partial<Record<NetworkType, HydrateOptions>>;
|
|
67
|
+
/**
|
|
68
|
+
* Options for Redstone price-feed updates (shared cache across chains).
|
|
69
|
+
**/
|
|
70
|
+
redstone?: RedstoneOptions;
|
|
71
|
+
/**
|
|
72
|
+
* Options for Pyth price-feed updates (shared cache across chains).
|
|
73
|
+
**/
|
|
74
|
+
pyth?: PythOptions;
|
|
75
|
+
/**
|
|
76
|
+
* When `true`, chains missing from the serialised state are silently skipped
|
|
77
|
+
* instead of throwing {@link SdkMissingChainStateError}.
|
|
78
|
+
*
|
|
79
|
+
* Useful when a deprecated chain is no longer included in cached state snapshots
|
|
80
|
+
* but users still need it in legacy mode to exit existing positions.
|
|
81
|
+
**/
|
|
82
|
+
allowMissingChains?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Options for {@link MultichainSDK.syncState}.
|
|
86
|
+
**/
|
|
87
|
+
export interface MultichainSyncStateOptions {
|
|
88
|
+
/**
|
|
89
|
+
* When `true`, skip refreshing updatable price feeds.
|
|
90
|
+
**/
|
|
91
|
+
ignoreUpdateablePrices?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Thin wrapper around multiple {@link OnchainSDK} instances, one per chain.
|
|
95
|
+
*
|
|
96
|
+
* @typeParam Plugins - Map of plugin names to plugin instances.
|
|
97
|
+
**/
|
|
98
|
+
export declare class MultichainSDK<const Plugins extends PluginsMap = {}> {
|
|
99
|
+
#private;
|
|
100
|
+
constructor(options: MultichainSDKOptions<Plugins>);
|
|
101
|
+
/**
|
|
102
|
+
* Attach all configured chains in parallel.
|
|
103
|
+
*
|
|
104
|
+
* @param options - Shared and per-chain attach options.
|
|
105
|
+
*/
|
|
106
|
+
attach(options?: MultichainAttachOptions): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Hydrate all configured chains from serialised state.
|
|
109
|
+
*
|
|
110
|
+
* @param state - Multichain serialised state.
|
|
111
|
+
* @param options - Shared and per-chain hydrate options.
|
|
112
|
+
* @throws {@link SdkStateVersionMismatchError} if version doesn't match.
|
|
113
|
+
* @throws {@link SdkMissingChainStateError} if a configured chain has no
|
|
114
|
+
* state and `allowMissingChains` is not set.
|
|
115
|
+
*/
|
|
116
|
+
hydrate(state: MultichainState<Plugins>, options?: MultichainHydrateOptions): void;
|
|
117
|
+
/**
|
|
118
|
+
* Returns the {@link OnchainSDK} for a given network or chain ID.
|
|
119
|
+
*
|
|
120
|
+
* @param networkOrChainId - Network type string or numeric chain ID.
|
|
121
|
+
* @throws If the network/chain is not configured.
|
|
122
|
+
*/
|
|
123
|
+
chain(networkOrChainId: NetworkType | number): OnchainSDK<Plugins>;
|
|
124
|
+
/**
|
|
125
|
+
* Read-only map of all configured chains.
|
|
126
|
+
**/
|
|
127
|
+
get chains(): ReadonlyMap<NetworkType, OnchainSDK<Plugins>>;
|
|
128
|
+
/**
|
|
129
|
+
* Sync state for all chains in parallel.
|
|
130
|
+
*
|
|
131
|
+
* @param opts - Sync options.
|
|
132
|
+
* @throws {@link SdkSyncFailedError} if any chain fails.
|
|
133
|
+
*/
|
|
134
|
+
syncState(opts?: MultichainSyncStateOptions): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Serialisable snapshot of all chains' state.
|
|
137
|
+
**/
|
|
138
|
+
get state(): MultichainState<Plugins>;
|
|
139
|
+
/**
|
|
140
|
+
* Human-readable snapshot of all chains' state.
|
|
141
|
+
* @param raw - When `true`, include raw numeric values.
|
|
142
|
+
*/
|
|
143
|
+
stateHuman(raw?: boolean): MultichainStateHuman;
|
|
144
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { type PublicClient, type Transport } from "viem";
|
|
3
|
+
import type { HttpRpcClientOptions } from "viem/utils";
|
|
4
|
+
import type { BaseState, IBaseContract } from "./base/index.js";
|
|
5
|
+
import { ChainContractsRegister } from "./base/index.js";
|
|
6
|
+
import type { GearboxChain, NetworkType } from "./chain/chains.js";
|
|
7
|
+
import type { VersionRange } from "./constants/index.js";
|
|
8
|
+
import type { IAddressProviderContract } from "./core/index.js";
|
|
9
|
+
import { MarketRegister } from "./market/MarketRegister.js";
|
|
10
|
+
import { PriceFeedRegister } from "./market/pricefeeds/index.js";
|
|
11
|
+
import type { PythOptions, RedstoneOptions } from "./market/pricefeeds/updates/index.js";
|
|
12
|
+
import type { PluginsMap } from "./plugins/index.js";
|
|
13
|
+
import { type IRouterContract } from "./router/index.js";
|
|
14
|
+
import type { GearboxState, GearboxStateHuman, ILogger } from "./types/index.js";
|
|
15
|
+
/**
|
|
16
|
+
* Serialised state format version, checked during hydration to detect
|
|
17
|
+
* incompatible snapshots.
|
|
18
|
+
**/
|
|
19
|
+
export declare const STATE_VERSION = 1;
|
|
20
|
+
/**
|
|
21
|
+
* Connection options for the underlying JSON-RPC provider.
|
|
22
|
+
*
|
|
23
|
+
* Supply **one** of the three variants:
|
|
24
|
+
* - `rpcURLs` — the SDK creates a viem transport internally (with optional
|
|
25
|
+
* fallback when multiple URLs are given).
|
|
26
|
+
* - `transport` — bring your own viem `Transport`.
|
|
27
|
+
* - `client` — bring your own fully-configured viem `PublicClient`.
|
|
28
|
+
**/
|
|
29
|
+
export type ClientOptions = {
|
|
30
|
+
/**
|
|
31
|
+
* One or more JSON-RPC endpoint URLs.
|
|
32
|
+
**/
|
|
33
|
+
rpcURLs: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Per-request timeout in milliseconds.
|
|
36
|
+
**/
|
|
37
|
+
timeout?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Number of automatic retries per RPC call.
|
|
40
|
+
**/
|
|
41
|
+
retryCount?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Low-level options forwarded to the viem HTTP transport.
|
|
44
|
+
**/
|
|
45
|
+
httpTransportOptions?: HttpRpcClientOptions | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
/**
|
|
48
|
+
* Pre-built viem transport.
|
|
49
|
+
**/
|
|
50
|
+
transport: Transport;
|
|
51
|
+
} | {
|
|
52
|
+
/**
|
|
53
|
+
* Pre-built viem public client.
|
|
54
|
+
**/
|
|
55
|
+
client: PublicClient<Transport, GearboxChain>;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Options for creating an {@link OnchainSDK} instance.
|
|
59
|
+
*
|
|
60
|
+
* @typeParam Plugins - Map of plugin names to plugin instances.
|
|
61
|
+
**/
|
|
62
|
+
export interface OnchainSDKOptions<Plugins extends PluginsMap> {
|
|
63
|
+
/**
|
|
64
|
+
* Custom logger implementation.
|
|
65
|
+
**/
|
|
66
|
+
logger?: ILogger;
|
|
67
|
+
/**
|
|
68
|
+
* When `true`, throw on unrecognised contract types instead of falling back to a generic contract wrapper.
|
|
69
|
+
**/
|
|
70
|
+
strictContractTypes?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Explicit gas limit for read-only `eth_call` requests.
|
|
73
|
+
* `null` disables the gas limit entirely; `undefined` uses the SDK default (550M).
|
|
74
|
+
*/
|
|
75
|
+
gasLimit?: bigint | null;
|
|
76
|
+
/**
|
|
77
|
+
* Plugins that extend SDK functionality.
|
|
78
|
+
**/
|
|
79
|
+
plugins?: Plugins;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Options accepted by {@link OnchainSDK.attach}.
|
|
83
|
+
**/
|
|
84
|
+
export interface AttachOptions {
|
|
85
|
+
/**
|
|
86
|
+
* Override address of the Gearbox AddressProvider contract.
|
|
87
|
+
**/
|
|
88
|
+
addressProvider?: Address;
|
|
89
|
+
/**
|
|
90
|
+
* Addresses of market configurator contracts to load.
|
|
91
|
+
**/
|
|
92
|
+
marketConfigurators?: Address[];
|
|
93
|
+
/**
|
|
94
|
+
* Pin SDK to a specific block number during attach.
|
|
95
|
+
**/
|
|
96
|
+
blockNumber?: bigint | number;
|
|
97
|
+
/**
|
|
98
|
+
* Skip fetching updatable price feeds on attach and sync.
|
|
99
|
+
**/
|
|
100
|
+
ignoreUpdateablePrices?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Pool addresses whose markets should be skipped.
|
|
103
|
+
**/
|
|
104
|
+
ignoreMarkets?: Address[];
|
|
105
|
+
/**
|
|
106
|
+
* Options for Redstone price-feed updates.
|
|
107
|
+
**/
|
|
108
|
+
redstone?: RedstoneOptions;
|
|
109
|
+
/**
|
|
110
|
+
* Options for Pyth price-feed updates.
|
|
111
|
+
**/
|
|
112
|
+
pyth?: PythOptions;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Options accepted by {@link OnchainSDK.hydrate}.
|
|
116
|
+
**/
|
|
117
|
+
export interface HydrateOptions {
|
|
118
|
+
/**
|
|
119
|
+
* Pool addresses whose markets should be skipped.
|
|
120
|
+
**/
|
|
121
|
+
ignoreMarkets?: Address[];
|
|
122
|
+
/**
|
|
123
|
+
* Options for Redstone price-feed updates.
|
|
124
|
+
**/
|
|
125
|
+
redstone?: RedstoneOptions;
|
|
126
|
+
/**
|
|
127
|
+
* Options for Pyth price-feed updates.
|
|
128
|
+
**/
|
|
129
|
+
pyth?: PythOptions;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Options for {@link OnchainSDK.syncState}, controlling which block to
|
|
133
|
+
* sync to and whether updatable price feeds should be refreshed.
|
|
134
|
+
**/
|
|
135
|
+
export interface SyncStateOptions {
|
|
136
|
+
/**
|
|
137
|
+
* Target block number to sync to.
|
|
138
|
+
**/
|
|
139
|
+
blockNumber: bigint;
|
|
140
|
+
/**
|
|
141
|
+
* Block timestamp corresponding to `blockNumber`.
|
|
142
|
+
**/
|
|
143
|
+
timestamp: bigint;
|
|
144
|
+
/**
|
|
145
|
+
* When `true`, skip refreshing updatable price feeds during this sync.
|
|
146
|
+
**/
|
|
147
|
+
ignoreUpdateablePrices?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Single-chain entry point for the Gearbox SDK.
|
|
151
|
+
*
|
|
152
|
+
* `OnchainSDK` aggregates on-chain state for the Gearbox protocol — markets,
|
|
153
|
+
* credit managers, pools, price oracles, and price feeds — into a single
|
|
154
|
+
* queryable object that can be kept up-to-date via {@link syncState} or
|
|
155
|
+
* serialised/restored via {@link state}/{@link hydrate}.
|
|
156
|
+
*
|
|
157
|
+
* Create an instance with `new OnchainSDK(network, clientOptions, options)`,
|
|
158
|
+
* then call {@link attach} (live chain data) or {@link hydrate} (saved snapshot).
|
|
159
|
+
*
|
|
160
|
+
* @typeParam Plugins - Map of plugin names to plugin instances that extend
|
|
161
|
+
* the SDK with additional domain-specific functionality.
|
|
162
|
+
**/
|
|
163
|
+
export declare class OnchainSDK<const Plugins extends PluginsMap = {}> extends ChainContractsRegister {
|
|
164
|
+
#private;
|
|
165
|
+
/** Registered plugin instances, keyed by plugin name. */
|
|
166
|
+
readonly plugins: Plugins;
|
|
167
|
+
/**
|
|
168
|
+
* Gas limit applied to read-only `eth_call` requests.
|
|
169
|
+
**/
|
|
170
|
+
readonly gasLimit: bigint | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* When `true`, the SDK throws on unrecognised contract types.
|
|
173
|
+
**/
|
|
174
|
+
readonly strictContractTypes: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* @param network - Gearbox network type (e.g. `"Mainnet"`, `"Monad"`).
|
|
177
|
+
* @param clientOptions - Connection options (RPC URLs, transport, or client).
|
|
178
|
+
* @param options - SDK configuration options.
|
|
179
|
+
*/
|
|
180
|
+
constructor(network: NetworkType, clientOptions: ClientOptions, options?: OnchainSDKOptions<Plugins>);
|
|
181
|
+
/**
|
|
182
|
+
* Initialises the SDK by reading live on-chain state.
|
|
183
|
+
*
|
|
184
|
+
* @param options - Attach configuration.
|
|
185
|
+
* @throws {@link SdkAlreadyAttachedError} if already attached.
|
|
186
|
+
*/
|
|
187
|
+
attach(options?: AttachOptions): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Restores SDK state from a previously serialised {@link GearboxState}
|
|
190
|
+
* snapshot, without making any on-chain calls.
|
|
191
|
+
*
|
|
192
|
+
* @param state - Serialised state obtained from {@link OnchainSDK.state}.
|
|
193
|
+
* @param options - Hydrate configuration.
|
|
194
|
+
* @throws {@link SdkAlreadyAttachedError} if already attached.
|
|
195
|
+
* @throws {@link SdkStateVersionMismatchError} if snapshot version doesn't match.
|
|
196
|
+
* @throws {@link SdkChainMismatchError} if snapshot network doesn't match.
|
|
197
|
+
*/
|
|
198
|
+
hydrate(state: GearboxState<Plugins>, options?: HydrateOptions): void;
|
|
199
|
+
/**
|
|
200
|
+
* Gearbox network type the SDK is connected to (e.g. `"Mainnet"`, `"Arbitrum"`).
|
|
201
|
+
**/
|
|
202
|
+
get networkType(): NetworkType;
|
|
203
|
+
/**
|
|
204
|
+
* Whether the SDK has been initialised via {@link attach} or {@link hydrate}.
|
|
205
|
+
**/
|
|
206
|
+
get attached(): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Returns a human-readable snapshot of the entire SDK state.
|
|
209
|
+
* @param raw - When `true`, include raw numeric values alongside formatted ones.
|
|
210
|
+
*/
|
|
211
|
+
stateHuman(raw?: boolean): GearboxStateHuman;
|
|
212
|
+
/** Serialisable snapshot of the current SDK state. */
|
|
213
|
+
get state(): GearboxState<Plugins>;
|
|
214
|
+
/**
|
|
215
|
+
* Incrementally updates SDK state by replaying on-chain events.
|
|
216
|
+
*
|
|
217
|
+
* @param opts - Target block and sync behaviour.
|
|
218
|
+
* @returns `true` if the sync completed successfully.
|
|
219
|
+
*/
|
|
220
|
+
syncState(opts?: SyncStateOptions): Promise<boolean>;
|
|
221
|
+
/**
|
|
222
|
+
* Block number that the SDK state corresponds to.
|
|
223
|
+
* @throws {@link SdkNotAttachedError} if not attached.
|
|
224
|
+
*/
|
|
225
|
+
get currentBlock(): bigint;
|
|
226
|
+
/**
|
|
227
|
+
* Block timestamp (Unix epoch seconds) corresponding to {@link currentBlock}.
|
|
228
|
+
* @throws {@link SdkNotAttachedError} if not attached.
|
|
229
|
+
*/
|
|
230
|
+
get timestamp(): bigint;
|
|
231
|
+
/**
|
|
232
|
+
* Global registry of all price feeds known to the SDK.
|
|
233
|
+
* @throws {@link SdkNotAttachedError} if not attached.
|
|
234
|
+
*/
|
|
235
|
+
get priceFeeds(): PriceFeedRegister;
|
|
236
|
+
/** GEAR governance token address, or `undefined` if not listed. */
|
|
237
|
+
get gear(): Address | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* The chain's address provider contract.
|
|
240
|
+
* @throws {@link SdkNotAttachedError} if not attached.
|
|
241
|
+
*/
|
|
242
|
+
get addressProvider(): IAddressProviderContract;
|
|
243
|
+
/**
|
|
244
|
+
* Registry of all loaded markets.
|
|
245
|
+
* @throws {@link SdkNotAttachedError} if not attached.
|
|
246
|
+
*/
|
|
247
|
+
get marketRegister(): MarketRegister;
|
|
248
|
+
/**
|
|
249
|
+
* Resolves the appropriate router contract for a given credit manager,
|
|
250
|
+
* credit facade, or explicit version range.
|
|
251
|
+
*/
|
|
252
|
+
routerFor(params: {
|
|
253
|
+
creditManager: Address | BaseState | IBaseContract;
|
|
254
|
+
} | {
|
|
255
|
+
creditFacade: Address | BaseState | IBaseContract;
|
|
256
|
+
} | VersionRange): IRouterContract;
|
|
257
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { CreditAccountData } from "../base/index.js";
|
|
3
3
|
import { SDKConstruct } from "../base/index.js";
|
|
4
|
-
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
5
4
|
import type { CreditSuite } from "../market/index.js";
|
|
6
5
|
import { type PriceUpdate, type UpdatePriceFeedsResult } from "../market/index.js";
|
|
7
|
-
import {
|
|
6
|
+
import type { OnchainSDK } from "../OnchainSDK.js";
|
|
8
7
|
import { type Asset, type RouterCASlice } from "../router/index.js";
|
|
9
8
|
import type { MultiCall, RawTx } from "../types/index.js";
|
|
10
|
-
import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult,
|
|
9
|
+
import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, OpenCAProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewDelayedWithdrawalResult, Rewards, StartDelayedWithdrawalProps, UpdateQuotasProps } from "./types.js";
|
|
11
10
|
/**
|
|
12
11
|
* Options for configuring the credit account service.
|
|
13
12
|
**/
|
|
@@ -29,19 +28,15 @@ export declare function getWithdrawalCompressorAddress(chainId: number): `0x${st
|
|
|
29
28
|
*/
|
|
30
29
|
export declare abstract class AbstractCreditAccountService extends SDKConstruct {
|
|
31
30
|
#private;
|
|
32
|
-
constructor(sdk:
|
|
31
|
+
constructor(sdk: OnchainSDK, options?: CreditAccountServiceOptions);
|
|
33
32
|
/**
|
|
34
33
|
* {@inheritDoc ICreditAccountsService.getCreditAccountData}
|
|
35
34
|
**/
|
|
36
|
-
getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData
|
|
35
|
+
getCreditAccountData(account: Address, blockNumber?: bigint): Promise<CreditAccountData | undefined>;
|
|
37
36
|
/**
|
|
38
37
|
* {@inheritDoc ICreditAccountsService.getCreditAccounts}
|
|
39
38
|
**/
|
|
40
39
|
getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
|
|
41
|
-
/**
|
|
42
|
-
* {@inheritDoc ICreditAccountsService.getBorrowerCreditAccounts}
|
|
43
|
-
**/
|
|
44
|
-
getBorrowerCreditAccounts(borrower: Address, options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData<true>>>;
|
|
45
40
|
/**
|
|
46
41
|
* {@inheritDoc ICreditAccountsService.getRewards}
|
|
47
42
|
**/
|
|
@@ -94,14 +89,6 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
94
89
|
* {@inheritDoc ICreditAccountsService.claimDelayed}
|
|
95
90
|
**/
|
|
96
91
|
claimDelayed({ creditAccount, minQuota, averageQuota, claimableNow, }: ClaimDelayedProps): Promise<CreditAccountOperationResult>;
|
|
97
|
-
/**
|
|
98
|
-
* {@inheritDoc ICreditAccountsService.getApprovalAddress}
|
|
99
|
-
**/
|
|
100
|
-
getApprovalAddress(options: GetApprovalAddressProps): Promise<Address>;
|
|
101
|
-
/**
|
|
102
|
-
* {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
|
|
103
|
-
*/
|
|
104
|
-
getOpenAccountRequirements(borrower: Address, props: Pick<OpenCAProps, "creditManager">): Promise<OpenAccountRequirements | undefined>;
|
|
105
92
|
/**
|
|
106
93
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
107
94
|
**/
|
|
@@ -115,43 +102,6 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
115
102
|
**/
|
|
116
103
|
getOptimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
|
|
117
104
|
/**
|
|
118
|
-
* Returns multicall entries to redeem (unwrap) KYC ERC-4626 vault shares into underlying for the given credit manager.
|
|
119
|
-
* Used when withdrawing debt from a KYC market: redeems adapter vault shares so the underlying can be withdrawn.
|
|
120
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
121
|
-
* @param amount - Number of vault shares (adapter tokens) to redeem
|
|
122
|
-
* @param creditManager - Credit manager address
|
|
123
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
124
|
-
*/
|
|
125
|
-
getKYCUnwrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
126
|
-
/**
|
|
127
|
-
* Returns multicall entries to deposit (wrap) underlying into KYC ERC-4626 vault shares for the given credit manager.
|
|
128
|
-
* Used when adding debt on a KYC market: deposits underlying into the adapter vault so shares are minted on the account.
|
|
129
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
130
|
-
* @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
|
|
131
|
-
* @param creditManager - Credit manager address
|
|
132
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
133
|
-
*/
|
|
134
|
-
getKYCWrapCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
135
|
-
/**
|
|
136
|
-
* Returns multicall entries to call redeemDiff on the KYC ERC-4626 adapter for the given credit manager.
|
|
137
|
-
* Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess KYC vault tokens.
|
|
138
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
139
|
-
* @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
|
|
140
|
-
* @param creditManager - Credit manager address
|
|
141
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
142
|
-
*/
|
|
143
|
-
getRedeemDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
144
|
-
/**
|
|
145
|
-
* Returns multicall entries to call depositDiff on the KYC ERC-4626 adapter for the given credit manager.
|
|
146
|
-
* Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
|
|
147
|
-
* Only applies when the credit manager's underlying is KYC-gated and has an ERC-4626 adapter configured.
|
|
148
|
-
* @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
|
|
149
|
-
* @param creditManager - Credit manager address
|
|
150
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not KYC or no adapter is configured
|
|
151
|
-
*/
|
|
152
|
-
getDepositDiffCalls(amount: bigint, creditManager: Address): Promise<Array<MultiCall> | undefined>;
|
|
153
|
-
/**
|
|
154
|
-
* Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
|
|
155
105
|
* {@inheritDoc ICreditAccountsService.getOnDemandPriceUpdates}
|
|
156
106
|
**/
|
|
157
107
|
getOnDemandPriceUpdates(account: CreditAccountTokensSlice, ignoreReservePrices?: boolean): Promise<PriceUpdate[]>;
|
|
@@ -21,7 +21,7 @@ export declare class CreditAccountServiceV310 extends AbstractCreditAccountServi
|
|
|
21
21
|
/**
|
|
22
22
|
* {@inheritDoc ICreditAccountsService.repayCreditAccount}
|
|
23
23
|
*/
|
|
24
|
-
repayCreditAccount({ operation, collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim,
|
|
24
|
+
repayCreditAccount({ operation, collateralAssets, assetsToWithdraw, creditAccount: ca, permits, to, tokensToClaim, }: RepayCreditAccountProps): Promise<CreditAccountOperationResult>;
|
|
25
25
|
/**
|
|
26
26
|
* {@inheritDoc ICreditAccountsService.repayAndLiquidateCreditAccount}
|
|
27
27
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OnchainSDK } from "../OnchainSDK.js";
|
|
2
2
|
import type { CreditAccountServiceOptions } from "./AbstractCreditAccountsService.js";
|
|
3
3
|
import type { ICreditAccountsService } from "./types.js";
|
|
4
4
|
/**
|
|
@@ -6,4 +6,4 @@ import type { ICreditAccountsService } from "./types.js";
|
|
|
6
6
|
* @version version of desired credit facade
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function createCreditAccountService(sdk:
|
|
9
|
+
export declare function createCreditAccountService(sdk: OnchainSDK, version: number, options?: CreditAccountServiceOptions): ICreditAccountsService;
|