@scallop-io/sui-scallop-sdk 2.1.8 → 2.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/dist/index.d.mts CHANGED
@@ -148,7 +148,9 @@ declare class ScallopAxios extends ScallopQueryClient {
148
148
 
149
149
  type ScallopAddressParams = {
150
150
  addressId?: string;
151
- addressApiUrl?: string;
151
+ urls?: {
152
+ addresses?: string[];
153
+ };
152
154
  auth?: string;
153
155
  network?: NetworkType;
154
156
  forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
@@ -247,9 +249,10 @@ declare class ScallopAddress {
247
249
  }): Promise<{
248
250
  [k: string]: AddressesInterface;
249
251
  }>;
250
- protected readApi<T>({ url, queryKey, }: {
252
+ protected readApi<T>({ url, queryKey, config, }: {
251
253
  url: string;
252
254
  queryKey: QueryKey;
255
+ config?: AxiosRequestConfig;
253
256
  }): Promise<T>;
254
257
  /**
255
258
  * Read and synchronizes all addresses from the API into instance.
@@ -312,8 +315,10 @@ type SCoinRawName = string;
312
315
  */
313
316
  type SCoinName = string;
314
317
  type ScallopConstantsParams = {
315
- poolAddressesApiUrl?: string;
316
- whitelistApiUrl?: string;
318
+ urls?: {
319
+ poolAddresses?: string[];
320
+ whitelist?: string[];
321
+ };
317
322
  forcePoolAddressInterface?: Record<string, PoolAddress>;
318
323
  forceWhitelistInterface?: Whitelist | Record<string, any>;
319
324
  defaultValues?: {
@@ -1883,7 +1888,7 @@ type VeScaNormalMethods = {
1883
1888
  splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
1884
1889
  mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
1885
1890
  };
1886
- type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
1891
+ type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
1887
1892
  type VeScaQuickMethods = {
1888
1893
  /**
1889
1894
  * Quick methods to automate
@@ -1901,13 +1906,41 @@ type VeScaQuickMethods = {
1901
1906
  * @param lockPeriodInDays
1902
1907
  * @param autoCheck
1903
1908
  */
1904
- lockScaQuick(amountOrCoin?: SuiObjectArg | number, lockPeriodInDays?: number, veScaKey?: SuiObjectArg, autoCheck?: boolean): Promise<void>;
1905
- extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1906
- extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1907
- renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1908
- redeemScaQuick: <T extends boolean>(veScaKey?: SuiObjectArg, transferSca?: T) => Promise<QuickMethodReturnType<T>>;
1909
- splitVeScaQuick: <T extends boolean>(splitAmount: string, veScaKey: string, transferVeScaKey?: T) => Promise<QuickMethodReturnType<T>>;
1910
- mergeVeScaQuick: (targetVeScaKey: string, sourceVeScaKey: string) => Promise<void>;
1909
+ lockScaQuick(params: {
1910
+ amountOrCoin?: SuiObjectArg | number;
1911
+ lockPeriodInDays?: number;
1912
+ autoCheck?: boolean;
1913
+ veScaKey?: SuiObjectData$1 | string;
1914
+ }): Promise<void>;
1915
+ extendLockPeriodQuick: (params: {
1916
+ lockPeriodInDays: number;
1917
+ autoCheck?: boolean;
1918
+ veScaKey?: SuiObjectData$1 | string;
1919
+ }) => Promise<void>;
1920
+ extendLockAmountQuick: (params: {
1921
+ scaAmount: number;
1922
+ autoCheck?: boolean;
1923
+ veScaKey?: SuiObjectData$1 | string;
1924
+ }) => Promise<void>;
1925
+ renewExpiredVeScaQuick: (params: {
1926
+ scaAmount: number;
1927
+ lockPeriodInDays: number;
1928
+ autoCheck?: boolean;
1929
+ veScaKey?: SuiObjectData$1 | string;
1930
+ }) => Promise<void>;
1931
+ redeemScaQuick: <T extends boolean>(params: {
1932
+ veScaKey?: SuiObjectData$1 | string;
1933
+ transferSca?: T;
1934
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
1935
+ splitVeScaQuick: <T extends boolean>(params: {
1936
+ splitAmount: string;
1937
+ veScaKey: string;
1938
+ transferVeScaKey?: T;
1939
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
1940
+ mergeVeScaQuick: (params: {
1941
+ targetVeScaKey: string;
1942
+ sourceVeScaKey: string;
1943
+ }) => Promise<void>;
1911
1944
  };
1912
1945
  type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
1913
1946
  type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
package/dist/index.d.ts CHANGED
@@ -148,7 +148,9 @@ declare class ScallopAxios extends ScallopQueryClient {
148
148
 
149
149
  type ScallopAddressParams = {
150
150
  addressId?: string;
151
- addressApiUrl?: string;
151
+ urls?: {
152
+ addresses?: string[];
153
+ };
152
154
  auth?: string;
153
155
  network?: NetworkType;
154
156
  forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
@@ -247,9 +249,10 @@ declare class ScallopAddress {
247
249
  }): Promise<{
248
250
  [k: string]: AddressesInterface;
249
251
  }>;
250
- protected readApi<T>({ url, queryKey, }: {
252
+ protected readApi<T>({ url, queryKey, config, }: {
251
253
  url: string;
252
254
  queryKey: QueryKey;
255
+ config?: AxiosRequestConfig;
253
256
  }): Promise<T>;
254
257
  /**
255
258
  * Read and synchronizes all addresses from the API into instance.
@@ -312,8 +315,10 @@ type SCoinRawName = string;
312
315
  */
313
316
  type SCoinName = string;
314
317
  type ScallopConstantsParams = {
315
- poolAddressesApiUrl?: string;
316
- whitelistApiUrl?: string;
318
+ urls?: {
319
+ poolAddresses?: string[];
320
+ whitelist?: string[];
321
+ };
317
322
  forcePoolAddressInterface?: Record<string, PoolAddress>;
318
323
  forceWhitelistInterface?: Whitelist | Record<string, any>;
319
324
  defaultValues?: {
@@ -1883,7 +1888,7 @@ type VeScaNormalMethods = {
1883
1888
  splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
1884
1889
  mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
1885
1890
  };
1886
- type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
1891
+ type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
1887
1892
  type VeScaQuickMethods = {
1888
1893
  /**
1889
1894
  * Quick methods to automate
@@ -1901,13 +1906,41 @@ type VeScaQuickMethods = {
1901
1906
  * @param lockPeriodInDays
1902
1907
  * @param autoCheck
1903
1908
  */
1904
- lockScaQuick(amountOrCoin?: SuiObjectArg | number, lockPeriodInDays?: number, veScaKey?: SuiObjectArg, autoCheck?: boolean): Promise<void>;
1905
- extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1906
- extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1907
- renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
1908
- redeemScaQuick: <T extends boolean>(veScaKey?: SuiObjectArg, transferSca?: T) => Promise<QuickMethodReturnType<T>>;
1909
- splitVeScaQuick: <T extends boolean>(splitAmount: string, veScaKey: string, transferVeScaKey?: T) => Promise<QuickMethodReturnType<T>>;
1910
- mergeVeScaQuick: (targetVeScaKey: string, sourceVeScaKey: string) => Promise<void>;
1909
+ lockScaQuick(params: {
1910
+ amountOrCoin?: SuiObjectArg | number;
1911
+ lockPeriodInDays?: number;
1912
+ autoCheck?: boolean;
1913
+ veScaKey?: SuiObjectData$1 | string;
1914
+ }): Promise<void>;
1915
+ extendLockPeriodQuick: (params: {
1916
+ lockPeriodInDays: number;
1917
+ autoCheck?: boolean;
1918
+ veScaKey?: SuiObjectData$1 | string;
1919
+ }) => Promise<void>;
1920
+ extendLockAmountQuick: (params: {
1921
+ scaAmount: number;
1922
+ autoCheck?: boolean;
1923
+ veScaKey?: SuiObjectData$1 | string;
1924
+ }) => Promise<void>;
1925
+ renewExpiredVeScaQuick: (params: {
1926
+ scaAmount: number;
1927
+ lockPeriodInDays: number;
1928
+ autoCheck?: boolean;
1929
+ veScaKey?: SuiObjectData$1 | string;
1930
+ }) => Promise<void>;
1931
+ redeemScaQuick: <T extends boolean>(params: {
1932
+ veScaKey?: SuiObjectData$1 | string;
1933
+ transferSca?: T;
1934
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
1935
+ splitVeScaQuick: <T extends boolean>(params: {
1936
+ splitAmount: string;
1937
+ veScaKey: string;
1938
+ transferVeScaKey?: T;
1939
+ }) => Promise<QuickMethodReturnType<T> | undefined>;
1940
+ mergeVeScaQuick: (params: {
1941
+ targetVeScaKey: string;
1942
+ sourceVeScaKey: string;
1943
+ }) => Promise<void>;
1911
1944
  };
1912
1945
  type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
1913
1946
  type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;