@augustdigital/sdk 4.15.5-alpha.0 → 4.16.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.
Files changed (80) hide show
  1. package/lib/abis/AddressResolver.d.ts +28 -40
  2. package/lib/abis/ChainlinkV3.d.ts +83 -109
  3. package/lib/abis/ERC20.d.ts +137 -191
  4. package/lib/abis/ERC20_Bytes32.d.ts +125 -178
  5. package/lib/abis/ERC4626.d.ts +341 -480
  6. package/lib/abis/ERC721.d.ts +213 -299
  7. package/lib/abis/FeeOracle.d.ts +112 -149
  8. package/lib/abis/LendingPool.d.ts +1293 -1702
  9. package/lib/abis/LendingPoolV2.d.ts +37 -42
  10. package/lib/abis/LendingPoolV3.d.ts +25 -29
  11. package/lib/abis/Loan.d.ts +768 -1007
  12. package/lib/abis/Multicall3.d.ts +30 -43
  13. package/lib/abis/PoolAdapter.d.ts +35 -46
  14. package/lib/abis/RewardDistributor.d.ts +33 -38
  15. package/lib/abis/SmartAccount.d.ts +16 -23
  16. package/lib/abis/TextResolver.d.ts +16 -23
  17. package/lib/abis/TokenizedVaultV2.d.ts +1292 -1684
  18. package/lib/abis/TokenizedVaultV2DepositWithPermit.d.ts +55 -62
  19. package/lib/abis/TokenizedVaultV2Receipt.d.ts +1463 -1934
  20. package/lib/abis/TokenizedVaultV2WhitelistedAssets.d.ts +250 -333
  21. package/lib/abis/UniversalResolverResolve.d.ts +69 -97
  22. package/lib/abis/UniversalSignatureValidator.d.ts +17 -23
  23. package/lib/abis/WrapperAdapter.d.ts +67 -89
  24. package/lib/adapters/evm/getters.d.ts +2 -8
  25. package/lib/adapters/evm/index.d.ts +15 -19
  26. package/lib/adapters/evm/utils.d.ts +2 -12
  27. package/lib/adapters/solana/constants.d.ts +17 -23
  28. package/lib/adapters/solana/getters.d.ts +1 -4
  29. package/lib/adapters/solana/idl/vault-idl.d.ts +279 -340
  30. package/lib/adapters/solana/index.d.ts +116 -212
  31. package/lib/adapters/solana/types.d.ts +50 -50
  32. package/lib/adapters/solana/utils.d.ts +78 -139
  33. package/lib/adapters/solana/vault.actions.d.ts +12 -37
  34. package/lib/adapters/sui/constants.d.ts +8 -9
  35. package/lib/adapters/sui/getters.d.ts +1 -3
  36. package/lib/adapters/sui/index.d.ts +21 -29
  37. package/lib/adapters/sui/transformer.d.ts +2 -6
  38. package/lib/adapters/sui/types.d.ts +56 -56
  39. package/lib/adapters/sui/utils.d.ts +1 -4
  40. package/lib/core/base.class.d.ts +23 -30
  41. package/lib/core/constants/adapters.d.ts +83 -111
  42. package/lib/core/constants/core.d.ts +69 -76
  43. package/lib/core/constants/vaults.d.ts +5 -63
  44. package/lib/core/constants/vaults.js +3 -3
  45. package/lib/core/constants/vaults.js.map +1 -1
  46. package/lib/core/constants/web3.d.ts +18 -19
  47. package/lib/core/fetcher.d.ts +17 -71
  48. package/lib/core/helpers/adapters.d.ts +2 -7
  49. package/lib/core/helpers/core.d.ts +8 -33
  50. package/lib/core/helpers/signer.d.ts +2 -6
  51. package/lib/core/helpers/vaults.d.ts +15 -38
  52. package/lib/core/helpers/web3.d.ts +19 -87
  53. package/lib/core/logger/index.d.ts +11 -11
  54. package/lib/core/logger/slack.d.ts +8 -9
  55. package/lib/index.d.ts +1 -61
  56. package/lib/main.d.ts +141 -158
  57. package/lib/modules/vaults/adapter.helpers.d.ts +38 -72
  58. package/lib/modules/vaults/fetcher.d.ts +69 -85
  59. package/lib/modules/vaults/getters.d.ts +100 -205
  60. package/lib/modules/vaults/index.d.ts +1 -6
  61. package/lib/modules/vaults/main.d.ts +131 -224
  62. package/lib/modules/vaults/read.actions.d.ts +2 -8
  63. package/lib/modules/vaults/utils.d.ts +19 -55
  64. package/lib/modules/vaults/write.actions.d.ts +14 -26
  65. package/lib/services/coingecko/fetcher.d.ts +1 -4
  66. package/lib/services/debank/fetcher.d.ts +1 -4
  67. package/lib/services/debank/utils.d.ts +27 -38
  68. package/lib/services/octavfi/fetcher.d.ts +1 -3
  69. package/lib/services/octavfi/types.d.ts +24 -24
  70. package/lib/services/octavfi/utils.d.ts +2 -6
  71. package/lib/services/subgraph/fetcher.d.ts +2 -12
  72. package/lib/services/subgraph/vaults.d.ts +9 -42
  73. package/lib/types/points.d.ts +26 -35
  74. package/lib/types/pools.d.ts +112 -149
  75. package/lib/types/staking.d.ts +25 -25
  76. package/lib/types/subgraph.d.ts +33 -33
  77. package/lib/types/vaults.d.ts +219 -232
  78. package/lib/types/web3.d.ts +9 -9
  79. package/lib/types/webserver.d.ts +448 -466
  80. package/package.json +1 -1
@@ -1,48 +1,23 @@
1
1
  import { INormalizedNumber } from '../../types';
2
- export declare function toNormalizedBn(
3
- value: string | bigint | number,
4
- decimals?: number | BigInt,
5
- ): INormalizedNumber;
2
+ export declare function toNormalizedBn(value: string | bigint | number, decimals?: number | BigInt): INormalizedNumber;
6
3
  export declare function getFallbackRpcUrls(chainId: number): string[];
7
4
  export declare const filterOutBySize: (usdAmount: number) => boolean;
8
5
  export declare function toTitleCase(str: string, type?: 'camel'): string;
9
6
  export declare function truncate(s: string, amount?: number): string;
10
- export declare function round(
11
- value: number | string | bigint,
12
- options?: {
7
+ export declare function round(value: number | string | bigint, options?: {
13
8
  showing?: number | 'all';
14
9
  usd?: boolean;
15
10
  decimals?: number;
16
- },
17
- ): string;
18
- export declare function loanStateToReadable(
19
- loanState: number | bigint,
20
- ):
21
- | 'PREAPPROVED'
22
- | 'FUNDING_REQUIRED'
23
- | 'FUNDED'
24
- | 'ACTIVE'
25
- | 'CANCELLED'
26
- | 'MATURED'
27
- | 'CLOSED';
11
+ }): string;
12
+ export declare function loanStateToReadable(loanState: number | bigint): "PREAPPROVED" | "FUNDING_REQUIRED" | "FUNDED" | "ACTIVE" | "CANCELLED" | "MATURED" | "CLOSED";
28
13
  export declare function dateToUnix(date: Date): number;
29
14
  export declare function unixToDate(epoch: number): Date;
30
15
  export declare function isEarlierThanNow(startTime: Date): boolean;
31
16
  export declare function daysAgo(days: number): Date;
32
17
  export declare function prepareDateForDb(date: string | Date): string;
33
- export declare function orderObjArrByDate(
34
- objectArray: any[],
35
- options?: {
18
+ export declare function orderObjArrByDate(objectArray: any[], options?: {
36
19
  key?: string;
37
20
  order?: 'asc' | 'desc';
38
- },
39
- ): any[];
40
- export declare function calculateWeights(
41
- data?: Array<any>,
42
- weightProperty?: string,
43
- ): any[];
44
- export declare function calculateWeightedAverage(
45
- data?: Array<any>,
46
- valueProperty?: string,
47
- weightProperty?: string,
48
- ): any;
21
+ }): any[];
22
+ export declare function calculateWeights(data?: Array<any>, weightProperty?: string): any[];
23
+ export declare function calculateWeightedAverage(data?: Array<any>, valueProperty?: string, weightProperty?: string): any;
@@ -1,9 +1,5 @@
1
1
  import { Signer, Wallet } from 'ethers';
2
2
  export declare function isViemWalletClient(signer: any): boolean;
3
- export declare function viemToEthersSigner(
4
- walletClient: any,
5
- ): Promise<Signer | Wallet>;
6
- export declare function normalizeSigner(
7
- signer: Signer | Wallet | any,
8
- ): Promise<Signer | Wallet>;
3
+ export declare function viemToEthersSigner(walletClient: any): Promise<Signer | Wallet>;
4
+ export declare function normalizeSigner(signer: Signer | Wallet | any): Promise<Signer | Wallet>;
9
5
  export type CompatibleSigner = Signer | Wallet | any;
@@ -1,40 +1,17 @@
1
- import {
2
- IAddress,
3
- IContractRunner,
4
- ITokenizedVault,
5
- IVaultVersion,
6
- } from '../../types';
1
+ import { IAddress, IContractRunner, ITokenizedVault, IVaultVersion } from '../../types';
7
2
  export declare const isBadVault: (address?: string) => boolean;
8
- export declare function getVaultVersion(
9
- vault: string,
10
- ): IVaultVersion | undefined;
11
- export declare function getVaultVersionV2(
12
- vault: ITokenizedVault,
13
- ): IVaultVersion | undefined;
3
+ export declare function getVaultVersion(vault: string): IVaultVersion | undefined;
4
+ export declare function getVaultVersionV2(vault: ITokenizedVault): IVaultVersion | undefined;
14
5
  export declare const REWARD_DISTRIBUTOR_ADDRESS: (chainId: number) => string[];
15
- export declare const AVAX_PRICE_FEED_ADDRESS: (
16
- chainId: number,
17
- ) => '0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7' | '0x';
18
- export declare function getVaultSymbol(
19
- vault: IAddress,
20
- provider: IContractRunner,
21
- ): Promise<string | undefined>;
22
- export declare const SUBGRAPH_POOL_URLS: (
23
- apiKey: string,
24
- chainId?: number,
25
- pool?: IAddress,
26
- ) =>
27
- | {
28
- 1: string;
29
- 8453: string;
30
- 43114: string;
31
- 42161: string;
32
- 56: string;
33
- }
34
- | {
35
- 999: string;
36
- };
37
- export declare const getDefaultSubgraphUrl: (
38
- network: string,
39
- symbol: string,
40
- ) => string;
6
+ export declare const AVAX_PRICE_FEED_ADDRESS: (chainId: number) => "0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7" | "0x";
7
+ export declare function getVaultSymbol(vault: IAddress, provider: IContractRunner): Promise<string | undefined>;
8
+ export declare const SUBGRAPH_POOL_URLS: (apiKey: string, chainId?: number, pool?: IAddress) => {
9
+ 1: string;
10
+ 8453: string;
11
+ 43114: string;
12
+ 42161: string;
13
+ 56: string;
14
+ } | {
15
+ 999: string;
16
+ };
17
+ export declare const getDefaultSubgraphUrl: (network: string, symbol: string) => string;
@@ -1,97 +1,29 @@
1
1
  import { Contract, ethers, Interface, InterfaceAbi } from 'ethers';
2
- import {
3
- IAddress,
4
- IChainId,
5
- IContractRunner,
6
- IExplorerType,
7
- IInfuraOptions,
8
- } from '../../types';
2
+ import { IAddress, IChainId, IContractRunner, IExplorerType, IInfuraOptions } from '../../types';
9
3
  export declare const determineBlockCutoff: (chain: number) => 120000 | 150000;
10
- export declare const determineBlockSkipInternal: (
11
- chain: number,
12
- ) => 8000 | 50000;
4
+ export declare const determineBlockSkipInternal: (chain: number) => 8000 | 50000;
13
5
  export declare const getChainId: (provider: IContractRunner) => Promise<number>;
14
- export declare function createContract({
15
- provider,
16
- address,
17
- abi,
18
- }: {
19
- address: string;
20
- provider: IContractRunner;
21
- abi: Interface | InterfaceAbi;
6
+ export declare function createContract({ provider, address, abi, }: {
7
+ address: string;
8
+ provider: IContractRunner;
9
+ abi: Interface | InterfaceAbi;
22
10
  }): Contract;
23
11
  export declare const createProvider: (rpcUrl: string) => any;
24
- export declare const getInfuraProvider: (
25
- infura: IInfuraOptions,
26
- ) => ethers.JsonRpcProvider;
27
- export declare const explorerLink: (
28
- hex: IAddress,
29
- chain: IChainId,
30
- type: IExplorerType,
31
- ) => string;
32
- export declare const getDecimals: (
33
- provider: IContractRunner,
34
- address: IAddress,
35
- isVault?: boolean,
36
- ) => Promise<any>;
37
- export declare const getReceiptTokenAddress: (
38
- provider: IContractRunner,
39
- address: IAddress,
40
- ) => Promise<any>;
41
- export declare const getSymbol: (
42
- provider: IContractRunner,
43
- address: IAddress | undefined,
44
- isVault?: boolean,
45
- ) => Promise<any>;
46
- export declare function getTokenMetadata(
47
- provider: IContractRunner,
48
- asset: IAddress,
49
- meta: ('symbol' | 'decimals' | 'name' | 'totalSupply')[],
50
- ): Promise<any[]>;
51
- export declare const getManagementFeePercent: (
52
- provider: IContractRunner,
53
- address: IAddress,
54
- ) => Promise<number>;
55
- export declare function simulateTransaction(
56
- provider: IContractRunner,
57
- abi: string[] | any,
58
- functionName: string,
59
- options?: {
12
+ export declare const getInfuraProvider: (infura: IInfuraOptions) => ethers.JsonRpcProvider;
13
+ export declare const explorerLink: (hex: IAddress, chain: IChainId, type: IExplorerType) => string;
14
+ export declare const getDecimals: (provider: IContractRunner, address: IAddress, isVault?: boolean) => Promise<any>;
15
+ export declare const getReceiptTokenAddress: (provider: IContractRunner, address: IAddress) => Promise<any>;
16
+ export declare const getSymbol: (provider: IContractRunner, address: IAddress | undefined, isVault?: boolean) => Promise<any>;
17
+ export declare function getTokenMetadata(provider: IContractRunner, asset: IAddress, meta: ('symbol' | 'decimals' | 'name' | 'totalSupply')[]): Promise<any[]>;
18
+ export declare const getManagementFeePercent: (provider: IContractRunner, address: IAddress) => Promise<number>;
19
+ export declare function simulateTransaction(provider: IContractRunner, abi: string[] | any, functionName: string, options?: {
60
20
  args?: (string | number | bigint)[][];
61
21
  from?: string;
62
22
  to?: string;
63
- },
64
- ): Promise<boolean | ethers.Result>;
65
- export declare function checkAddress(
66
- address: string,
67
- logger?: any,
68
- type?: 'wallet' | 'contract',
69
- ): boolean;
23
+ }): Promise<boolean | ethers.Result>;
24
+ export declare function checkAddress(address: string, logger?: any, type?: 'wallet' | 'contract'): boolean;
70
25
  type ILoanOracleFeeCategories = 'LOAN.REPAY.INTERESTS';
71
- export declare function getLoanOracleFeeRate(
72
- provider: IContractRunner,
73
- category_id: ILoanOracleFeeCategories,
74
- address: IAddress,
75
- chainId?: number,
76
- ): Promise<number>;
77
- export declare function getHistoricalContractData(
78
- provider: IContractRunner,
79
- contractAddress: IAddress,
80
- abi: Interface | InterfaceAbi,
81
- methodName: string,
82
- args: (string | number | bigint | boolean)[],
83
- startBlock: number,
84
- endBlock: number,
85
- blockInterval?: number,
86
- ): Promise<any[]>;
87
- export declare function getHistoricalContractDataByDate(
88
- provider: IContractRunner,
89
- contractAddress: IAddress,
90
- abi: Interface | InterfaceAbi,
91
- methodName: string,
92
- args: (string | number | bigint | boolean)[],
93
- startDate: string | number,
94
- endDate: string | number,
95
- intervalHours?: number,
96
- ): Promise<any[]>;
26
+ export declare function getLoanOracleFeeRate(provider: IContractRunner, category_id: ILoanOracleFeeCategories, address: IAddress, chainId?: number): Promise<number>;
27
+ export declare function getHistoricalContractData(provider: IContractRunner, contractAddress: IAddress, abi: Interface | InterfaceAbi, methodName: string, args: (string | number | bigint | boolean)[], startBlock: number, endBlock: number, blockInterval?: number): Promise<any[]>;
28
+ export declare function getHistoricalContractDataByDate(provider: IContractRunner, contractAddress: IAddress, abi: Interface | InterfaceAbi, methodName: string, args: (string | number | bigint | boolean)[], startDate: string | number, endDate: string | number, intervalHours?: number): Promise<any[]>;
97
29
  export {};
@@ -1,21 +1,21 @@
1
1
  export type SDKLogger = {
2
- setTag: (key: string, value: string) => void;
3
- captureException: (err: unknown, context?: Record<string, any>) => void;
2
+ setTag: (key: string, value: string) => void;
3
+ captureException: (err: unknown, context?: Record<string, any>) => void;
4
4
  };
5
5
  declare function setLogger(customLogger: SDKLogger): void;
6
6
  declare function getLogger(): SDKLogger | null;
7
7
  declare function setDevMode(devMode: boolean): void;
8
8
  declare function isDevMode(): boolean;
9
9
  declare const Logger: {
10
- setLogger: typeof setLogger;
11
- getLogger: typeof getLogger;
12
- setDevMode: typeof setDevMode;
13
- isDevMode: typeof isDevMode;
14
- log: {
15
- info: (tag: string, ...args: any[]) => void;
16
- warn: (tag: string, ...args: any[]) => void;
17
- error: (tag: string, error: unknown, context?: Record<string, any>) => void;
18
- };
10
+ setLogger: typeof setLogger;
11
+ getLogger: typeof getLogger;
12
+ setDevMode: typeof setDevMode;
13
+ isDevMode: typeof isDevMode;
14
+ log: {
15
+ info: (tag: string, ...args: any[]) => void;
16
+ warn: (tag: string, ...args: any[]) => void;
17
+ error: (tag: string, error: unknown, context?: Record<string, any>) => void;
18
+ };
19
19
  };
20
20
  import * as slack from './slack';
21
21
  export { slack as Slack, Logger };
@@ -1,14 +1,13 @@
1
- export declare const DEFAULT_SLACK_WEBHOOK_URL =
2
- 'T04CM84GAV6/B0A2DS3ST8C/FLtOA3Jna3FN7UO4DoGxHfhG';
1
+ export declare const DEFAULT_SLACK_WEBHOOK_URL = "T04CM84GAV6/B0A2DS3ST8C/FLtOA3Jna3FN7UO4DoGxHfhG";
3
2
  declare function error(options: {
4
- title: string;
5
- error: string;
6
- poolAddress: string;
7
- chainId: number;
8
- slackWebookUrl: string;
9
- address?: string;
3
+ title: string;
4
+ error: string;
5
+ poolAddress: string;
6
+ chainId: number;
7
+ slackWebookUrl: string;
8
+ address?: string;
10
9
  }): void;
11
10
  export declare const SLACK: {
12
- error: typeof error;
11
+ error: typeof error;
13
12
  };
14
13
  export {};
package/lib/index.d.ts CHANGED
@@ -3,66 +3,6 @@ export * from './core';
3
3
  export * from './abis';
4
4
  export * from './modules/vaults';
5
5
  export * from './adapters/solana';
6
- export declare const VAULT_ADDRESSES: Record<
7
- | 'sentusd'
8
- | 'pregrid'
9
- | 'repouscc'
10
- | 'earnxrp'
11
- | 'tivkbtc'
12
- | 'tivusdt0'
13
- | 'supermon'
14
- | 'earnmon'
15
- | 'k3europ'
16
- | 'wmon/ausd'
17
- | 'wbtc/ausd'
18
- | 'earnausd_monad'
19
- | 'sausd'
20
- | 'farmbold'
21
- | 'sentuscc'
22
- | 'sentbtc'
23
- | 'svusdc'
24
- | 'apusdc'
25
- | 'testwethtsa'
26
- | 'tacusr'
27
- | 'upinjusdt'
28
- | 'tac-teth'
29
- | 'upausd'
30
- | 'taccbbtc'
31
- | 'xupusdc'
32
- | 'uptbtc'
33
- | 'gteth'
34
- | 'ageth'
35
- | 'upusdc'
36
- | 'hgeth'
37
- | 'upssylva'
38
- | 'hbbtc'
39
- | 'hbhype'
40
- | 'upazt'
41
- | 'susdt'
42
- | 'upedge'
43
- | 'coreusdc'
44
- | 'upcusdo'
45
- | 'shifteth'
46
- | 'upsusde'
47
- | 'uplbtc'
48
- | 'upavax'
49
- | 'tacrseth'
50
- | 'musd'
51
- | 'earnausd'
52
- | 'alpineusdcflagship'
53
- | 'alpinecoinshiftusdc'
54
- | 'upbtc'
55
- | 'upstrbtc'
56
- | 'maxiusr'
57
- | 'upgammausdc'
58
- | 'xhype'
59
- | 'wildusd'
60
- | 'alpinebtc'
61
- | 'prenusd'
62
- | 'upyzusd'
63
- | 'upnusd'
64
- | 'hlpe',
65
- `0x${string}`
66
- >;
6
+ export declare const VAULT_ADDRESSES: Record<"sentusd" | "pregrid" | "repouscc" | "earnxrp" | "tivkbtc" | "tivusdt0" | "supermon" | "earnmon" | "k3europ" | "wmon/ausd" | "wbtc/ausd" | "earnausd_monad" | "sausd" | "farmbold" | "sentuscc" | "sentbtc" | "svusdc" | "apusdc" | "testwethtsa" | "tacusr" | "upinjusdt" | "tac-teth" | "upausd" | "taccbbtc" | "xupusdc" | "uptbtc" | "gteth" | "ageth" | "upusdc" | "hgeth" | "upssylva" | "hbbtc" | "hbhype" | "upazt" | "susdt" | "upedge" | "coreusdc" | "upcusdo" | "shifteth" | "upsusde" | "uplbtc" | "upavax" | "tacrseth" | "musd" | "earnausd" | "alpineusdcflagship" | "alpinecoinshiftusdc" | "upbtc" | "upstrbtc" | "maxiusr" | "upgammausdc" | "xhype" | "wildusd" | "alpinebtc" | "prenusd" | "upyzusd" | "upnusd" | "hlpe", `0x${string}`>;
67
7
  import { AugustSDK } from './main';
68
8
  export default AugustSDK;