@scallop-io/sui-scallop-sdk 2.1.6 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -152,8 +152,12 @@ type ScallopAddressParams = {
152
152
  auth?: string;
153
153
  network?: NetworkType;
154
154
  forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
155
+ defaultValues?: {
156
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
157
+ };
155
158
  } & ScallopAxiosParams;
156
159
  declare class ScallopAddress {
160
+ readonly params: ScallopAddressParams;
157
161
  private currentAddresses?;
158
162
  private addressId?;
159
163
  private network;
@@ -165,6 +169,9 @@ declare class ScallopAddress {
165
169
  private initializeForcedAddresses;
166
170
  get axiosClient(): ScallopAxios;
167
171
  get queryClient(): _tanstack_query_core.QueryClient;
172
+ get defaultValues(): {
173
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
174
+ } | undefined;
168
175
  getId(): string | undefined;
169
176
  /**
170
177
  * Get the address at the provided path.
@@ -240,6 +247,10 @@ declare class ScallopAddress {
240
247
  }): Promise<{
241
248
  [k: string]: AddressesInterface;
242
249
  }>;
250
+ protected readApi<T>({ url, queryKey, }: {
251
+ url: string;
252
+ queryKey: QueryKey;
253
+ }): Promise<T>;
243
254
  /**
244
255
  * Read and synchronizes all addresses from the API into instance.
245
256
  *
@@ -305,6 +316,10 @@ type ScallopConstantsParams = {
305
316
  whitelistApiUrl?: string;
306
317
  forcePoolAddressInterface?: Record<string, PoolAddress>;
307
318
  forceWhitelistInterface?: Whitelist | Record<string, any>;
319
+ defaultValues?: {
320
+ poolAddresses?: Record<string, PoolAddress>;
321
+ whitelist?: Whitelist | Record<string, any>;
322
+ };
308
323
  } & ScallopAddressParams;
309
324
  declare class ScallopConstants extends ScallopAddress {
310
325
  readonly params: ScallopConstantsParams;
@@ -333,12 +348,17 @@ declare class ScallopConstants extends ScallopAddress {
333
348
  * @description Supported borrow incentive reward coin names
334
349
  */
335
350
  supportedBorrowIncentiveRewards: Set<CoinName>;
336
- private scallopConstantAxios;
337
351
  constructor(params?: ScallopConstantsParams);
338
352
  get protocolObjectId(): string;
339
353
  get isInitialized(): boolean;
340
354
  get whitelist(): Whitelist;
341
355
  get poolAddresses(): Record<string, PoolAddress | undefined>;
356
+ get defaultValues(): ({
357
+ poolAddresses?: Record<string, PoolAddress>;
358
+ whitelist?: Whitelist | Record<string, any>;
359
+ } & {
360
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
361
+ }) | undefined;
342
362
  private isAddressInitialized;
343
363
  parseToOldMarketCoin(coinType: string): string;
344
364
  init({ networkType, force, addressId, constantsParams, }?: {
@@ -348,7 +368,6 @@ declare class ScallopConstants extends ScallopAddress {
348
368
  constantsParams?: Partial<ScallopConstantsParams>;
349
369
  }): Promise<void>;
350
370
  private initConstants;
351
- private readApi;
352
371
  readWhiteList(): Promise<Whitelist>;
353
372
  readPoolAddresses(): Promise<Record<string, PoolAddress>>;
354
373
  }
@@ -2886,6 +2905,7 @@ type VeScaTreasuryInfo = {
2886
2905
  };
2887
2906
 
2888
2907
  interface AddressesInterface {
2908
+ id?: string;
2889
2909
  core: {
2890
2910
  version: string;
2891
2911
  versionCap: string;
package/dist/index.d.ts CHANGED
@@ -152,8 +152,12 @@ type ScallopAddressParams = {
152
152
  auth?: string;
153
153
  network?: NetworkType;
154
154
  forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
155
+ defaultValues?: {
156
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
157
+ };
155
158
  } & ScallopAxiosParams;
156
159
  declare class ScallopAddress {
160
+ readonly params: ScallopAddressParams;
157
161
  private currentAddresses?;
158
162
  private addressId?;
159
163
  private network;
@@ -165,6 +169,9 @@ declare class ScallopAddress {
165
169
  private initializeForcedAddresses;
166
170
  get axiosClient(): ScallopAxios;
167
171
  get queryClient(): _tanstack_query_core.QueryClient;
172
+ get defaultValues(): {
173
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
174
+ } | undefined;
168
175
  getId(): string | undefined;
169
176
  /**
170
177
  * Get the address at the provided path.
@@ -240,6 +247,10 @@ declare class ScallopAddress {
240
247
  }): Promise<{
241
248
  [k: string]: AddressesInterface;
242
249
  }>;
250
+ protected readApi<T>({ url, queryKey, }: {
251
+ url: string;
252
+ queryKey: QueryKey;
253
+ }): Promise<T>;
243
254
  /**
244
255
  * Read and synchronizes all addresses from the API into instance.
245
256
  *
@@ -305,6 +316,10 @@ type ScallopConstantsParams = {
305
316
  whitelistApiUrl?: string;
306
317
  forcePoolAddressInterface?: Record<string, PoolAddress>;
307
318
  forceWhitelistInterface?: Whitelist | Record<string, any>;
319
+ defaultValues?: {
320
+ poolAddresses?: Record<string, PoolAddress>;
321
+ whitelist?: Whitelist | Record<string, any>;
322
+ };
308
323
  } & ScallopAddressParams;
309
324
  declare class ScallopConstants extends ScallopAddress {
310
325
  readonly params: ScallopConstantsParams;
@@ -333,12 +348,17 @@ declare class ScallopConstants extends ScallopAddress {
333
348
  * @description Supported borrow incentive reward coin names
334
349
  */
335
350
  supportedBorrowIncentiveRewards: Set<CoinName>;
336
- private scallopConstantAxios;
337
351
  constructor(params?: ScallopConstantsParams);
338
352
  get protocolObjectId(): string;
339
353
  get isInitialized(): boolean;
340
354
  get whitelist(): Whitelist;
341
355
  get poolAddresses(): Record<string, PoolAddress | undefined>;
356
+ get defaultValues(): ({
357
+ poolAddresses?: Record<string, PoolAddress>;
358
+ whitelist?: Whitelist | Record<string, any>;
359
+ } & {
360
+ addresses?: Partial<Record<NetworkType, AddressesInterface>>;
361
+ }) | undefined;
342
362
  private isAddressInitialized;
343
363
  parseToOldMarketCoin(coinType: string): string;
344
364
  init({ networkType, force, addressId, constantsParams, }?: {
@@ -348,7 +368,6 @@ declare class ScallopConstants extends ScallopAddress {
348
368
  constantsParams?: Partial<ScallopConstantsParams>;
349
369
  }): Promise<void>;
350
370
  private initConstants;
351
- private readApi;
352
371
  readWhiteList(): Promise<Whitelist>;
353
372
  readPoolAddresses(): Promise<Record<string, PoolAddress>>;
354
373
  }
@@ -2886,6 +2905,7 @@ type VeScaTreasuryInfo = {
2886
2905
  };
2887
2906
 
2888
2907
  interface AddressesInterface {
2908
+ id?: string;
2889
2909
  core: {
2890
2910
  version: string;
2891
2911
  versionCap: string;