@underscore-finance/sdk 1.2.20-next.1 → 1.2.20-next.2
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/AGENTS.md +172 -0
- package/README.md +17 -116
- package/abis.json +193056 -0
- package/addresses.json +76 -0
- package/dist/contracts/AaveV3.d.ts +2594 -0
- package/dist/contracts/AaveV3.d.ts.map +1 -0
- package/dist/contracts/AaveV3.js +3272 -0
- package/dist/contracts/Addys.d.ts +124 -0
- package/dist/contracts/Addys.d.ts.map +1 -0
- package/dist/contracts/Addys.js +134 -0
- package/dist/contracts/AeroClassic.d.ts +2118 -0
- package/dist/contracts/AeroClassic.d.ts.map +1 -0
- package/dist/contracts/AeroClassic.js +2679 -0
- package/dist/contracts/AeroSlipstream.d.ts +2256 -0
- package/dist/contracts/AeroSlipstream.d.ts.map +1 -0
- package/dist/contracts/AeroSlipstream.js +2848 -0
- package/dist/contracts/AgentSenderGeneric.d.ts +4771 -0
- package/dist/contracts/AgentSenderGeneric.d.ts.map +1 -0
- package/dist/contracts/AgentSenderGeneric.js +6192 -0
- package/dist/contracts/AgentSenderSpecial.d.ts +2124 -0
- package/dist/contracts/AgentSenderSpecial.d.ts.map +1 -0
- package/dist/contracts/AgentSenderSpecial.js +2671 -0
- package/dist/contracts/AgentSenderSpecialAdmin.d.ts +984 -0
- package/dist/contracts/AgentSenderSpecialAdmin.d.ts.map +1 -0
- package/dist/contracts/AgentSenderSpecialAdmin.js +1185 -0
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +3180 -0
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +1 -0
- package/dist/contracts/AgentSenderSpecialSigHelper.js +4211 -0
- package/dist/contracts/AgentWrapper.d.ts +2678 -0
- package/dist/contracts/AgentWrapper.d.ts.map +1 -0
- package/dist/contracts/AgentWrapper.js +3602 -0
- package/dist/contracts/AgentWrapperV1.d.ts +3789 -0
- package/dist/contracts/AgentWrapperV1.d.ts.map +1 -0
- package/dist/contracts/AgentWrapperV1.js +4945 -0
- package/dist/contracts/AgentWrapperV2.d.ts +2494 -0
- package/dist/contracts/AgentWrapperV2.d.ts.map +1 -0
- package/dist/contracts/AgentWrapperV2.js +3354 -0
- package/dist/contracts/Appraiser.d.ts +577 -0
- package/dist/contracts/Appraiser.d.ts.map +1 -0
- package/dist/contracts/Appraiser.js +735 -0
- package/dist/contracts/Avantis.d.ts +2606 -0
- package/dist/contracts/Avantis.d.ts.map +1 -0
- package/dist/contracts/Avantis.js +3282 -0
- package/dist/contracts/Billing.d.ts +381 -0
- package/dist/contracts/Billing.d.ts.map +1 -0
- package/dist/contracts/Billing.js +451 -0
- package/dist/contracts/ChequeBook.d.ts +1860 -0
- package/dist/contracts/ChequeBook.d.ts.map +1 -0
- package/dist/contracts/ChequeBook.js +2131 -0
- package/dist/contracts/CompoundV3.d.ts +2622 -0
- package/dist/contracts/CompoundV3.d.ts.map +1 -0
- package/dist/contracts/CompoundV3.js +3304 -0
- package/dist/contracts/ConvertVaultToken.d.ts +64 -0
- package/dist/contracts/ConvertVaultToken.d.ts.map +1 -0
- package/dist/contracts/ConvertVaultToken.js +75 -0
- package/dist/contracts/Curve.d.ts +1107 -0
- package/dist/contracts/Curve.d.ts.map +1 -0
- package/dist/contracts/Curve.js +1379 -0
- package/dist/contracts/DefaultsBase.d.ts +306 -0
- package/dist/contracts/DefaultsBase.d.ts.map +1 -0
- package/dist/contracts/DefaultsBase.js +331 -0
- package/dist/contracts/DefaultsLocal.d.ts +320 -0
- package/dist/contracts/DefaultsLocal.d.ts.map +1 -0
- package/dist/contracts/DefaultsLocal.js +350 -0
- package/dist/contracts/ERC20.d.ts +813 -0
- package/dist/contracts/ERC20.d.ts.map +1 -0
- package/dist/contracts/ERC20.js +1006 -0
- package/dist/contracts/EarnVault.d.ts +1762 -0
- package/dist/contracts/EarnVault.d.ts.map +1 -0
- package/dist/contracts/EarnVault.js +2267 -0
- package/dist/contracts/EarnVaultAgent.d.ts +1160 -0
- package/dist/contracts/EarnVaultAgent.d.ts.map +1 -0
- package/dist/contracts/EarnVaultAgent.js +1435 -0
- package/dist/contracts/EarnVaultAgentSigHelper.d.ts +905 -0
- package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +1 -0
- package/dist/contracts/EarnVaultAgentSigHelper.js +1198 -0
- package/dist/contracts/EarnVaultWallet.d.ts +777 -0
- package/dist/contracts/EarnVaultWallet.d.ts.map +1 -0
- package/dist/contracts/EarnVaultWallet.js +987 -0
- package/dist/contracts/Erc20Token.d.ts +813 -0
- package/dist/contracts/Erc20Token.d.ts.map +1 -0
- package/dist/contracts/Erc20Token.js +1006 -0
- package/dist/contracts/Euler.d.ts +2662 -0
- package/dist/contracts/Euler.d.ts.map +1 -0
- package/dist/contracts/Euler.js +3350 -0
- package/dist/contracts/ExtraFi.d.ts +2637 -0
- package/dist/contracts/ExtraFi.d.ts.map +1 -0
- package/dist/contracts/ExtraFi.js +3323 -0
- package/dist/contracts/Fluid.d.ts +2634 -0
- package/dist/contracts/Fluid.d.ts.map +1 -0
- package/dist/contracts/Fluid.js +3318 -0
- package/dist/contracts/FortyAcres.d.ts +2620 -0
- package/dist/contracts/FortyAcres.d.ts.map +1 -0
- package/dist/contracts/FortyAcres.js +3300 -0
- package/dist/contracts/Hatchery.d.ts +392 -0
- package/dist/contracts/Hatchery.d.ts.map +1 -0
- package/dist/contracts/Hatchery.js +472 -0
- package/dist/contracts/Helpers.d.ts +1463 -0
- package/dist/contracts/Helpers.d.ts.map +1 -0
- package/dist/contracts/Helpers.js +1763 -0
- package/dist/contracts/HighCommand.d.ts +2169 -0
- package/dist/contracts/HighCommand.d.ts.map +1 -0
- package/dist/contracts/HighCommand.js +2474 -0
- package/dist/contracts/Kernel.d.ts +391 -0
- package/dist/contracts/Kernel.d.ts.map +1 -0
- package/dist/contracts/Kernel.js +446 -0
- package/dist/contracts/Ledger.d.ts +637 -0
- package/dist/contracts/Ledger.d.ts.map +1 -0
- package/dist/contracts/Ledger.js +759 -0
- package/dist/contracts/LegoBook.d.ts +1463 -0
- package/dist/contracts/LegoBook.d.ts.map +1 -0
- package/dist/contracts/LegoBook.js +1763 -0
- package/dist/contracts/LegoTools.d.ts +1913 -0
- package/dist/contracts/LegoTools.d.ts.map +1 -0
- package/dist/contracts/LegoTools.js +2402 -0
- package/dist/contracts/LevgVault.d.ts +2115 -0
- package/dist/contracts/LevgVault.d.ts.map +1 -0
- package/dist/contracts/LevgVault.js +2733 -0
- package/dist/contracts/LevgVaultAgent.d.ts +2013 -0
- package/dist/contracts/LevgVaultAgent.d.ts.map +1 -0
- package/dist/contracts/LevgVaultAgent.js +2563 -0
- package/dist/contracts/LevgVaultAgentSigHelper.d.ts +2221 -0
- package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +1 -0
- package/dist/contracts/LevgVaultAgentSigHelper.js +2963 -0
- package/dist/contracts/LevgVaultHelper.d.ts +977 -0
- package/dist/contracts/LevgVaultHelper.d.ts.map +1 -0
- package/dist/contracts/LevgVaultHelper.js +1289 -0
- package/dist/contracts/LevgVaultTools.d.ts +2629 -0
- package/dist/contracts/LevgVaultTools.d.ts.map +1 -0
- package/dist/contracts/LevgVaultTools.js +3560 -0
- package/dist/contracts/LevgVaultWallet.d.ts +1119 -0
- package/dist/contracts/LevgVaultWallet.d.ts.map +1 -0
- package/dist/contracts/LevgVaultWallet.js +1439 -0
- package/dist/contracts/LocalGov.d.ts +427 -0
- package/dist/contracts/LocalGov.d.ts.map +1 -0
- package/dist/contracts/LocalGov.js +507 -0
- package/dist/contracts/LootDistributor.d.ts +1053 -0
- package/dist/contracts/LootDistributor.d.ts.map +1 -0
- package/dist/contracts/LootDistributor.js +1291 -0
- package/dist/contracts/Migrator.d.ts +449 -0
- package/dist/contracts/Migrator.d.ts.map +1 -0
- package/dist/contracts/Migrator.js +535 -0
- package/dist/contracts/MissionControl.d.ts +1405 -0
- package/dist/contracts/MissionControl.d.ts.map +1 -0
- package/dist/contracts/MissionControl.js +1592 -0
- package/dist/contracts/Moonwell.d.ts +2623 -0
- package/dist/contracts/Moonwell.d.ts.map +1 -0
- package/dist/contracts/Moonwell.js +3304 -0
- package/dist/contracts/Morpho.d.ts +2662 -0
- package/dist/contracts/Morpho.d.ts.map +1 -0
- package/dist/contracts/Morpho.js +3350 -0
- package/dist/contracts/Ownership.d.ts +414 -0
- package/dist/contracts/Ownership.d.ts.map +1 -0
- package/dist/contracts/Ownership.js +472 -0
- package/dist/contracts/Paymaster.d.ts +1511 -0
- package/dist/contracts/Paymaster.d.ts.map +1 -0
- package/dist/contracts/Paymaster.js +1812 -0
- package/dist/contracts/RipeLego.d.ts +2913 -0
- package/dist/contracts/RipeLego.d.ts.map +1 -0
- package/dist/contracts/RipeLego.js +3643 -0
- package/dist/contracts/Sentinel.d.ts +2067 -0
- package/dist/contracts/Sentinel.d.ts.map +1 -0
- package/dist/contracts/Sentinel.js +2480 -0
- package/dist/contracts/SignatureHelper.d.ts +4250 -0
- package/dist/contracts/SignatureHelper.d.ts.map +1 -0
- package/dist/contracts/SignatureHelper.js +5714 -0
- package/dist/contracts/SignatureHelperV1.d.ts +4250 -0
- package/dist/contracts/SignatureHelperV1.d.ts.map +1 -0
- package/dist/contracts/SignatureHelperV1.js +5714 -0
- package/dist/contracts/SkyPsm.d.ts +2667 -0
- package/dist/contracts/SkyPsm.d.ts.map +1 -0
- package/dist/contracts/SkyPsm.js +3356 -0
- package/dist/contracts/Switchboard.d.ts +1483 -0
- package/dist/contracts/Switchboard.d.ts.map +1 -0
- package/dist/contracts/Switchboard.js +1790 -0
- package/dist/contracts/SwitchboardAlpha.d.ts +3161 -0
- package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -0
- package/dist/contracts/SwitchboardAlpha.js +3771 -0
- package/dist/contracts/SwitchboardBravo.d.ts +1591 -0
- package/dist/contracts/SwitchboardBravo.d.ts.map +1 -0
- package/dist/contracts/SwitchboardBravo.js +1872 -0
- package/dist/contracts/SwitchboardCharlie.d.ts +3172 -0
- package/dist/contracts/SwitchboardCharlie.d.ts.map +1 -0
- package/dist/contracts/SwitchboardCharlie.js +3713 -0
- package/dist/contracts/UnderscoreLego.d.ts +2592 -0
- package/dist/contracts/UnderscoreLego.d.ts.map +1 -0
- package/dist/contracts/UnderscoreLego.js +3264 -0
- package/dist/contracts/UndyAero.d.ts +1733 -0
- package/dist/contracts/UndyAero.d.ts.map +1 -0
- package/dist/contracts/UndyAero.js +2235 -0
- package/dist/contracts/UndyBtc.d.ts +1733 -0
- package/dist/contracts/UndyBtc.d.ts.map +1 -0
- package/dist/contracts/UndyBtc.js +2235 -0
- package/dist/contracts/UndyCbeth.d.ts +1733 -0
- package/dist/contracts/UndyCbeth.d.ts.map +1 -0
- package/dist/contracts/UndyCbeth.js +2235 -0
- package/dist/contracts/UndyEth.d.ts +1733 -0
- package/dist/contracts/UndyEth.d.ts.map +1 -0
- package/dist/contracts/UndyEth.js +2235 -0
- package/dist/contracts/UndyEurc.d.ts +1733 -0
- package/dist/contracts/UndyEurc.d.ts.map +1 -0
- package/dist/contracts/UndyEurc.js +2235 -0
- package/dist/contracts/UndyGho.d.ts +1733 -0
- package/dist/contracts/UndyGho.d.ts.map +1 -0
- package/dist/contracts/UndyGho.js +2235 -0
- package/dist/contracts/UndyHq.d.ts +1677 -0
- package/dist/contracts/UndyHq.d.ts.map +1 -0
- package/dist/contracts/UndyHq.js +2026 -0
- package/dist/contracts/UndyRewardsLego.d.ts +1572 -0
- package/dist/contracts/UndyRewardsLego.d.ts.map +1 -0
- package/dist/contracts/UndyRewardsLego.js +1994 -0
- package/dist/contracts/UndyToken.d.ts +821 -0
- package/dist/contracts/UndyToken.d.ts.map +1 -0
- package/dist/contracts/UndyToken.js +1017 -0
- package/dist/contracts/UndyUsd.d.ts +1733 -0
- package/dist/contracts/UndyUsd.d.ts.map +1 -0
- package/dist/contracts/UndyUsd.js +2235 -0
- package/dist/contracts/UndyUsdV2.d.ts +1762 -0
- package/dist/contracts/UndyUsdV2.d.ts.map +1 -0
- package/dist/contracts/UndyUsdV2.js +2267 -0
- package/dist/contracts/UndyUsds.d.ts +1733 -0
- package/dist/contracts/UndyUsds.d.ts.map +1 -0
- package/dist/contracts/UndyUsds.js +2235 -0
- package/dist/contracts/UndyVirtual.d.ts +1762 -0
- package/dist/contracts/UndyVirtual.d.ts.map +1 -0
- package/dist/contracts/UndyVirtual.js +2267 -0
- package/dist/contracts/UniswapV2.d.ts +2118 -0
- package/dist/contracts/UniswapV2.d.ts.map +1 -0
- package/dist/contracts/UniswapV2.js +2679 -0
- package/dist/contracts/UniswapV3.d.ts +2256 -0
- package/dist/contracts/UniswapV3.d.ts.map +1 -0
- package/dist/contracts/UniswapV3.js +2848 -0
- package/dist/contracts/UserWallet.d.ts +2650 -0
- package/dist/contracts/UserWallet.d.ts.map +1 -0
- package/dist/contracts/UserWallet.js +3520 -0
- package/dist/contracts/UserWalletConfig.d.ts +3918 -0
- package/dist/contracts/UserWalletConfig.d.ts.map +1 -0
- package/dist/contracts/UserWalletConfig.js +4527 -0
- package/dist/contracts/UserWalletConfigV1.d.ts +3692 -0
- package/dist/contracts/UserWalletConfigV1.d.ts.map +1 -0
- package/dist/contracts/UserWalletConfigV1.js +4276 -0
- package/dist/contracts/UserWalletSignatureHelper.d.ts +5558 -0
- package/dist/contracts/UserWalletSignatureHelper.d.ts.map +1 -0
- package/dist/contracts/UserWalletSignatureHelper.js +7480 -0
- package/dist/contracts/UserWalletV1.d.ts +2650 -0
- package/dist/contracts/UserWalletV1.d.ts.map +1 -0
- package/dist/contracts/UserWalletV1.js +3520 -0
- package/dist/contracts/VaultErc20Token.d.ts +522 -0
- package/dist/contracts/VaultErc20Token.d.ts.map +1 -0
- package/dist/contracts/VaultErc20Token.js +658 -0
- package/dist/contracts/VaultRegistry.d.ts +3162 -0
- package/dist/contracts/VaultRegistry.d.ts.map +1 -0
- package/dist/contracts/VaultRegistry.js +3893 -0
- package/dist/contracts/WalletBackpack.d.ts +1248 -0
- package/dist/contracts/WalletBackpack.d.ts.map +1 -0
- package/dist/contracts/WalletBackpack.js +1519 -0
- package/dist/contracts/Wasabi.d.ts +2620 -0
- package/dist/contracts/Wasabi.d.ts.map +1 -0
- package/dist/contracts/Wasabi.js +3300 -0
- package/dist/contracts/index.d.ts +86 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +89 -0
- package/dist/contracts/sdk.d.ts +176 -0
- package/dist/contracts/sdk.d.ts.map +1 -0
- package/dist/contracts/sdk.js +178 -0
- package/dist/getSwapInstructions.d.ts +34 -0
- package/dist/getSwapInstructions.d.ts.map +1 -0
- package/dist/getSwapInstructions.js +21 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +137 -0
- package/package.json +44 -17
- package/.claude/settings.local.json +0 -31
- package/.eslintrc.json +0 -27
- package/.prettierrc +0 -9
- package/.tool-versions +0 -1
- package/LICENSE +0 -41
- package/LICENSE_DATE.md +0 -34
- package/LICENSE_GRANTS.md +0 -33
- package/LICENSE_INFO.md +0 -90
- package/dapp.config.js +0 -154
- package/src/getSwapInstructions.ts +0 -55
- package/src/index.ts +0 -192
- package/tsconfig.json +0 -18
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { GetItemCallFunction, RequestCollection } from '@dappql/async';
|
|
2
|
+
import { Address, PublicClient, WalletClient } from 'viem';
|
|
3
|
+
import * as CONTRACTS from './contracts/index.js';
|
|
4
|
+
import { SDK } from './contracts/sdk.js';
|
|
5
|
+
export * from './contracts/index.js';
|
|
6
|
+
export type Contracts = SDK;
|
|
7
|
+
export type ContractsNames = keyof typeof CONTRACTS;
|
|
8
|
+
export declare const DEPARTMENT_IDS: {
|
|
9
|
+
LEDGER: bigint;
|
|
10
|
+
MISSION_CONTROL: bigint;
|
|
11
|
+
LEGO_BOOK: bigint;
|
|
12
|
+
SWITCHBOARD: bigint;
|
|
13
|
+
HATCHERY: bigint;
|
|
14
|
+
LOOT_DISTRIBUTOR: bigint;
|
|
15
|
+
APPRAISER: bigint;
|
|
16
|
+
WALLET_BACKPACK: bigint;
|
|
17
|
+
BILLING: bigint;
|
|
18
|
+
VAULT_REGISTRY: bigint;
|
|
19
|
+
HELPERS: bigint;
|
|
20
|
+
};
|
|
21
|
+
export declare const LEGOS_IDS: {
|
|
22
|
+
RIPE: bigint;
|
|
23
|
+
AAVE_V3: bigint;
|
|
24
|
+
COMPOUND_V3: bigint;
|
|
25
|
+
EULER: bigint;
|
|
26
|
+
FLUID: bigint;
|
|
27
|
+
MOONWELL: bigint;
|
|
28
|
+
MORPHO: bigint;
|
|
29
|
+
AERO_CLASSIC: bigint;
|
|
30
|
+
AERO_SLIPSTREAM: bigint;
|
|
31
|
+
CURVE: bigint;
|
|
32
|
+
UNISWAP_V2: bigint;
|
|
33
|
+
UNISWAP_V3: bigint;
|
|
34
|
+
UNDERSCORE: bigint;
|
|
35
|
+
FORTY_ACRES: bigint;
|
|
36
|
+
WASABI: bigint;
|
|
37
|
+
AVANTIS: bigint;
|
|
38
|
+
SKY_PSM: bigint;
|
|
39
|
+
EXTRA_FI: bigint;
|
|
40
|
+
};
|
|
41
|
+
export declare const HELPERS_IDS: {
|
|
42
|
+
LEGO_TOOLS: bigint;
|
|
43
|
+
LEVG_VAULT_TOOLS: bigint;
|
|
44
|
+
};
|
|
45
|
+
export type UnderscoreConfig = {
|
|
46
|
+
rpcUrl?: string;
|
|
47
|
+
publicClient?: PublicClient;
|
|
48
|
+
walletClient?: WalletClient;
|
|
49
|
+
};
|
|
50
|
+
declare class Underscore {
|
|
51
|
+
publicClient: PublicClient;
|
|
52
|
+
walletClient: WalletClient | undefined;
|
|
53
|
+
contracts: SDK;
|
|
54
|
+
addresses: Partial<Record<ContractsNames, `0x${string}`>>;
|
|
55
|
+
constructor(config?: UnderscoreConfig);
|
|
56
|
+
loadAddresses(): Promise<void>;
|
|
57
|
+
addressResolver: (name: string) => `0x${string}`;
|
|
58
|
+
setWalletClient(walletClient: WalletClient): void;
|
|
59
|
+
setPublicClient(publicClient: PublicClient): void;
|
|
60
|
+
multicall<T extends RequestCollection>(cb: (contracts: typeof CONTRACTS) => T, options?: {
|
|
61
|
+
blockNumber?: bigint;
|
|
62
|
+
}): Promise<{ [K in keyof T]: NonNullable<T[K]["defaultValue"]>; }>;
|
|
63
|
+
iterate<T>(cb: (contracts: typeof CONTRACTS) => {
|
|
64
|
+
total: bigint;
|
|
65
|
+
getItem: GetItemCallFunction<T>;
|
|
66
|
+
}, options?: {
|
|
67
|
+
blockNumber?: bigint;
|
|
68
|
+
firstIndex?: bigint;
|
|
69
|
+
}): Promise<{
|
|
70
|
+
value: NonNullable<T>;
|
|
71
|
+
queryIndex: bigint;
|
|
72
|
+
}[]>;
|
|
73
|
+
getSwapInstructionsAmountOut(payload: {
|
|
74
|
+
tokenIn: Address;
|
|
75
|
+
tokenOut: Address;
|
|
76
|
+
amountIn: bigint;
|
|
77
|
+
slippage: bigint;
|
|
78
|
+
includeLegoIds?: bigint[];
|
|
79
|
+
}): Promise<{
|
|
80
|
+
legoId: bigint;
|
|
81
|
+
amountIn: bigint;
|
|
82
|
+
minAmountOut: bigint;
|
|
83
|
+
tokenPath: `0x${string}`[];
|
|
84
|
+
poolPath: `0x${string}`[];
|
|
85
|
+
}[]>;
|
|
86
|
+
getSwapInstructionsAmountIn(payload: {
|
|
87
|
+
tokenIn: Address;
|
|
88
|
+
tokenOut: Address;
|
|
89
|
+
amountOut: bigint;
|
|
90
|
+
amountInAvailable: bigint;
|
|
91
|
+
slippage: bigint;
|
|
92
|
+
includeLegoIds?: bigint[];
|
|
93
|
+
}): Promise<{
|
|
94
|
+
legoId: bigint;
|
|
95
|
+
amountIn: bigint;
|
|
96
|
+
minAmountOut: bigint;
|
|
97
|
+
tokenPath: `0x${string}`[];
|
|
98
|
+
poolPath: `0x${string}`[];
|
|
99
|
+
}[]>;
|
|
100
|
+
DEPARTMENT_IDS: {
|
|
101
|
+
LEDGER: bigint;
|
|
102
|
+
MISSION_CONTROL: bigint;
|
|
103
|
+
LEGO_BOOK: bigint;
|
|
104
|
+
SWITCHBOARD: bigint;
|
|
105
|
+
HATCHERY: bigint;
|
|
106
|
+
LOOT_DISTRIBUTOR: bigint;
|
|
107
|
+
APPRAISER: bigint;
|
|
108
|
+
WALLET_BACKPACK: bigint;
|
|
109
|
+
BILLING: bigint;
|
|
110
|
+
VAULT_REGISTRY: bigint;
|
|
111
|
+
HELPERS: bigint;
|
|
112
|
+
};
|
|
113
|
+
LEGOS_IDS: {
|
|
114
|
+
RIPE: bigint;
|
|
115
|
+
AAVE_V3: bigint;
|
|
116
|
+
COMPOUND_V3: bigint;
|
|
117
|
+
EULER: bigint;
|
|
118
|
+
FLUID: bigint;
|
|
119
|
+
MOONWELL: bigint;
|
|
120
|
+
MORPHO: bigint;
|
|
121
|
+
AERO_CLASSIC: bigint;
|
|
122
|
+
AERO_SLIPSTREAM: bigint;
|
|
123
|
+
CURVE: bigint;
|
|
124
|
+
UNISWAP_V2: bigint;
|
|
125
|
+
UNISWAP_V3: bigint;
|
|
126
|
+
UNDERSCORE: bigint;
|
|
127
|
+
FORTY_ACRES: bigint;
|
|
128
|
+
WASABI: bigint;
|
|
129
|
+
AVANTIS: bigint;
|
|
130
|
+
SKY_PSM: bigint;
|
|
131
|
+
EXTRA_FI: bigint;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export default Underscore;
|
|
135
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAwB,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC5F,OAAO,EAAE,OAAO,EAA4B,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGpF,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAkB,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAEnD,cAAc,sBAAsB,CAAA;AAEpC,MAAM,MAAM,SAAS,GAAG,GAAG,CAAA;AAC3B,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,SAAS,CAAA;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;;;CAY1B,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAmBrB,CAAA;AAED,eAAO,MAAM,WAAW;;;CAGvB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED,cAAM,UAAU;IACP,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;IACtC,SAAS,EAAE,GAAG,CAAA;IACd,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC,CAAA;gBACpD,MAAM,CAAC,EAAE,gBAAgB;IAY/B,aAAa;IAoDnB,eAAe,GAAI,MAAM,MAAM,mBAE9B;IAED,eAAe,CAAC,YAAY,EAAE,YAAY;IAK1C,eAAe,CAAC,YAAY,EAAE,YAAY;IAKpC,SAAS,CAAC,CAAC,SAAS,iBAAiB,EACzC,EAAE,EAAE,CAAC,SAAS,EAAE,OAAO,SAAS,KAAK,CAAC,EACtC,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO;IAMlC,OAAO,CAAC,CAAC,EACb,EAAE,EAAE,CAAC,SAAS,EAAE,OAAO,SAAS,KAAK;QACnC,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;KAChC,EACD,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;KACf;;;;IAQF,4BAA4B,CAAC,OAAO,EAAE;QAC1C,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,OAAO,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAC1B;;;;;;;IAIK,2BAA2B,CAAC,OAAO,EAAE;QACzC,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,OAAO,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,iBAAiB,EAAE,MAAM,CAAA;QACzB,QAAQ,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAC1B;;;;;;;IAID,cAAc;;;;;;;;;;;;MAAiB;IAE/B,SAAS;;;;;;;;;;;;;;;;;;;MAAY;CACtB;AAED,eAAe,UAAU,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { iteratorQuery, query } from '@dappql/async';
|
|
2
|
+
import { createPublicClient, http } from 'viem';
|
|
3
|
+
import { base } from 'viem/chains';
|
|
4
|
+
import * as CONTRACTS from './contracts/index.js';
|
|
5
|
+
import createSdk from './contracts/sdk.js';
|
|
6
|
+
import { getSwapInstructionsAmountIn, getSwapInstructionsAmountOut } from './getSwapInstructions.js';
|
|
7
|
+
export * from './contracts/index.js';
|
|
8
|
+
export const DEPARTMENT_IDS = {
|
|
9
|
+
LEDGER: 1n,
|
|
10
|
+
MISSION_CONTROL: 2n,
|
|
11
|
+
LEGO_BOOK: 3n,
|
|
12
|
+
SWITCHBOARD: 4n,
|
|
13
|
+
HATCHERY: 5n,
|
|
14
|
+
LOOT_DISTRIBUTOR: 6n,
|
|
15
|
+
APPRAISER: 7n,
|
|
16
|
+
WALLET_BACKPACK: 8n,
|
|
17
|
+
BILLING: 9n,
|
|
18
|
+
VAULT_REGISTRY: 10n,
|
|
19
|
+
HELPERS: 11n,
|
|
20
|
+
};
|
|
21
|
+
export const LEGOS_IDS = {
|
|
22
|
+
RIPE: 1n,
|
|
23
|
+
AAVE_V3: 2n,
|
|
24
|
+
COMPOUND_V3: 3n,
|
|
25
|
+
EULER: 4n,
|
|
26
|
+
FLUID: 5n,
|
|
27
|
+
MOONWELL: 6n,
|
|
28
|
+
MORPHO: 7n,
|
|
29
|
+
AERO_CLASSIC: 8n,
|
|
30
|
+
AERO_SLIPSTREAM: 9n,
|
|
31
|
+
CURVE: 10n,
|
|
32
|
+
UNISWAP_V2: 11n,
|
|
33
|
+
UNISWAP_V3: 12n,
|
|
34
|
+
UNDERSCORE: 13n,
|
|
35
|
+
FORTY_ACRES: 14n,
|
|
36
|
+
WASABI: 15n,
|
|
37
|
+
AVANTIS: 16n,
|
|
38
|
+
SKY_PSM: 17n,
|
|
39
|
+
EXTRA_FI: 18n,
|
|
40
|
+
};
|
|
41
|
+
export const HELPERS_IDS = {
|
|
42
|
+
LEGO_TOOLS: 1n,
|
|
43
|
+
LEVG_VAULT_TOOLS: 2n,
|
|
44
|
+
};
|
|
45
|
+
class Underscore {
|
|
46
|
+
publicClient;
|
|
47
|
+
walletClient;
|
|
48
|
+
contracts;
|
|
49
|
+
addresses;
|
|
50
|
+
constructor(config) {
|
|
51
|
+
this.publicClient =
|
|
52
|
+
config?.publicClient ||
|
|
53
|
+
createPublicClient({
|
|
54
|
+
chain: base,
|
|
55
|
+
transport: http(config?.rpcUrl),
|
|
56
|
+
});
|
|
57
|
+
this.addresses = {};
|
|
58
|
+
this.walletClient = config?.walletClient;
|
|
59
|
+
this.contracts = createSdk(this.publicClient, this.walletClient, this.addressResolver);
|
|
60
|
+
}
|
|
61
|
+
async loadAddresses() {
|
|
62
|
+
const departments = await this.multicall((contracts) => {
|
|
63
|
+
return {
|
|
64
|
+
Ledger: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LEDGER),
|
|
65
|
+
MissionControl: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.MISSION_CONTROL),
|
|
66
|
+
LegoBook: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LEGO_BOOK),
|
|
67
|
+
Switchboard: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.SWITCHBOARD),
|
|
68
|
+
Hatchery: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.HATCHERY),
|
|
69
|
+
LootDistributor: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LOOT_DISTRIBUTOR),
|
|
70
|
+
Appraiser: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.APPRAISER),
|
|
71
|
+
WalletBackpack: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.WALLET_BACKPACK),
|
|
72
|
+
Billing: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.BILLING),
|
|
73
|
+
VaultRegistry: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.VAULT_REGISTRY),
|
|
74
|
+
Helpers: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.HELPERS),
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
const children = await this.multicall((contracts) => {
|
|
78
|
+
return {
|
|
79
|
+
RipeLego: contracts.LegoBook.call.getAddr(LEGOS_IDS.RIPE).at(departments.LegoBook),
|
|
80
|
+
AaveV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.AAVE_V3).at(departments.LegoBook),
|
|
81
|
+
CompoundV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.COMPOUND_V3).at(departments.LegoBook),
|
|
82
|
+
Euler: contracts.LegoBook.call.getAddr(LEGOS_IDS.EULER).at(departments.LegoBook),
|
|
83
|
+
Fluid: contracts.LegoBook.call.getAddr(LEGOS_IDS.FLUID).at(departments.LegoBook),
|
|
84
|
+
Moonwell: contracts.LegoBook.call.getAddr(LEGOS_IDS.MOONWELL).at(departments.LegoBook),
|
|
85
|
+
Morpho: contracts.LegoBook.call.getAddr(LEGOS_IDS.MORPHO).at(departments.LegoBook),
|
|
86
|
+
AeroClassic: contracts.LegoBook.call.getAddr(LEGOS_IDS.AERO_CLASSIC).at(departments.LegoBook),
|
|
87
|
+
AeroSlipstream: contracts.LegoBook.call.getAddr(LEGOS_IDS.AERO_SLIPSTREAM).at(departments.LegoBook),
|
|
88
|
+
Curve: contracts.LegoBook.call.getAddr(LEGOS_IDS.CURVE).at(departments.LegoBook),
|
|
89
|
+
UniswapV2: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNISWAP_V2).at(departments.LegoBook),
|
|
90
|
+
UniswapV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNISWAP_V3).at(departments.LegoBook),
|
|
91
|
+
UnderscoreLego: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNDERSCORE).at(departments.LegoBook),
|
|
92
|
+
FortyAcres: contracts.LegoBook.call.getAddr(LEGOS_IDS.FORTY_ACRES).at(departments.LegoBook),
|
|
93
|
+
Wasabi: contracts.LegoBook.call.getAddr(LEGOS_IDS.WASABI).at(departments.LegoBook),
|
|
94
|
+
Avantis: contracts.LegoBook.call.getAddr(LEGOS_IDS.AVANTIS).at(departments.LegoBook),
|
|
95
|
+
SkyPsm: contracts.LegoBook.call.getAddr(LEGOS_IDS.SKY_PSM).at(departments.LegoBook),
|
|
96
|
+
ExtraFi: contracts.LegoBook.call.getAddr(LEGOS_IDS.EXTRA_FI).at(departments.LegoBook),
|
|
97
|
+
SwitchboardAlpha: contracts.Switchboard.call.getAddr(1n).at(departments.Switchboard),
|
|
98
|
+
SwitchboardBravo: contracts.Switchboard.call.getAddr(2n).at(departments.Switchboard),
|
|
99
|
+
SwitchboardCharlie: contracts.Switchboard.call.getAddr(3n).at(departments.Switchboard),
|
|
100
|
+
LegoTools: contracts.Helpers.call.getAddr(1n).at(departments.Helpers),
|
|
101
|
+
LevgVaultTools: contracts.Helpers.call.getAddr(2n).at(departments.Helpers),
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
this.addresses = {
|
|
105
|
+
...departments,
|
|
106
|
+
...children,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
addressResolver = (name) => {
|
|
110
|
+
return this.addresses[name];
|
|
111
|
+
};
|
|
112
|
+
setWalletClient(walletClient) {
|
|
113
|
+
this.walletClient = walletClient;
|
|
114
|
+
this.contracts = createSdk(this.publicClient, this.walletClient);
|
|
115
|
+
}
|
|
116
|
+
setPublicClient(publicClient) {
|
|
117
|
+
this.publicClient = publicClient;
|
|
118
|
+
this.contracts = createSdk(this.publicClient, this.walletClient);
|
|
119
|
+
}
|
|
120
|
+
async multicall(cb, options = {}) {
|
|
121
|
+
const request = cb(CONTRACTS);
|
|
122
|
+
return query(this.publicClient, request, options, this.addressResolver);
|
|
123
|
+
}
|
|
124
|
+
async iterate(cb, options = {}) {
|
|
125
|
+
const { total, getItem } = cb(CONTRACTS);
|
|
126
|
+
return iteratorQuery(this.publicClient, total, getItem, options, this.addressResolver);
|
|
127
|
+
}
|
|
128
|
+
async getSwapInstructionsAmountOut(payload) {
|
|
129
|
+
return getSwapInstructionsAmountOut(this.publicClient, payload, this.addressResolver);
|
|
130
|
+
}
|
|
131
|
+
async getSwapInstructionsAmountIn(payload) {
|
|
132
|
+
return getSwapInstructionsAmountIn(this.publicClient, payload);
|
|
133
|
+
}
|
|
134
|
+
DEPARTMENT_IDS = DEPARTMENT_IDS;
|
|
135
|
+
LEGOS_IDS = LEGOS_IDS;
|
|
136
|
+
}
|
|
137
|
+
export default Underscore;
|
package/package.json
CHANGED
|
@@ -1,31 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@underscore-finance/sdk",
|
|
3
|
-
"version": "1.2.20-next.
|
|
3
|
+
"version": "1.2.20-next.2",
|
|
4
4
|
"description": "SDK for interacting with Underscore Finance Smart Contracts with TypeScript",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./contracts": {
|
|
14
|
+
"import": "./dist/contracts/index.js",
|
|
15
|
+
"types": "./dist/contracts/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./sdk": {
|
|
18
|
+
"import": "./dist/contracts/sdk.js",
|
|
19
|
+
"types": "./dist/contracts/sdk.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./abis": "./abis.json",
|
|
22
|
+
"./addresses": "./addresses.json",
|
|
23
|
+
"./agents": "./AGENTS.md"
|
|
10
24
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"abis.json",
|
|
28
|
+
"addresses.json",
|
|
29
|
+
"AGENTS.md",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
13
32
|
"license": "BSL-1.0",
|
|
33
|
+
"author": "Underscore Finance",
|
|
34
|
+
"keywords": [],
|
|
14
35
|
"bugs": {
|
|
15
36
|
"url": "https://github.com/underscore-finance/sdk/issues"
|
|
16
37
|
},
|
|
17
38
|
"homepage": "https://github.com/underscore-finance/sdk#readme",
|
|
18
|
-
"type": "module",
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"dappql": "^2.1.2",
|
|
21
|
-
"eslint": "^8.57.1",
|
|
22
|
-
"eslint-config-universe": "^14.0.0",
|
|
23
|
-
"prettier": "^3.5.3",
|
|
24
|
-
"typescript": "^5.8.2",
|
|
25
|
-
"version-bump-prompt": "^6.1.0"
|
|
26
|
-
},
|
|
27
39
|
"dependencies": {
|
|
28
40
|
"@dappql/async": "^1.1.3",
|
|
29
41
|
"viem": "^2.23.7"
|
|
42
|
+
},
|
|
43
|
+
"dappql": {
|
|
44
|
+
"manifestVersion": 1,
|
|
45
|
+
"chainId": 8453,
|
|
46
|
+
"protocol": {
|
|
47
|
+
"name": "Underscore Finance",
|
|
48
|
+
"description": "SDK for interacting with Underscore Finance smart contracts",
|
|
49
|
+
"website": "https://underscore.finance",
|
|
50
|
+
"repo": "https://github.com/underscore-finance/typescript-sdk"
|
|
51
|
+
},
|
|
52
|
+
"contracts": "./dist/contracts/index.js",
|
|
53
|
+
"sdk": "./dist/contracts/sdk.js",
|
|
54
|
+
"abis": "./abis.json",
|
|
55
|
+
"addresses": "./addresses.json",
|
|
56
|
+
"agents": "./AGENTS.md"
|
|
30
57
|
}
|
|
31
58
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"mcp__dappql__listContracts",
|
|
5
|
-
"mcp__dappql__getContract",
|
|
6
|
-
"mcp__dappql__callRead",
|
|
7
|
-
"mcp__dappql__multicall",
|
|
8
|
-
"mcp__dappql__searchMethods",
|
|
9
|
-
"mcp__dappql__callWrite",
|
|
10
|
-
"mcp__dappql__simulateWrite",
|
|
11
|
-
"Bash(curl *)",
|
|
12
|
-
"Bash(cast keccak *)",
|
|
13
|
-
"Bash(cast sig *)",
|
|
14
|
-
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); logs=d.get\\('result',[]\\); print\\('count:',len\\(logs\\)\\); [print\\(l['transactionHash'], l['blockNumber']\\) for l in logs[:20]]\")",
|
|
15
|
-
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); logs=d.get\\('result',[]\\); print\\('count:',len\\(logs\\)\\); err=d.get\\('error'\\); print\\('err:',err\\) if err else None; [print\\(l['transactionHash'], l['blockNumber'], l['data'][:10]\\) for l in logs[:10]]\")",
|
|
16
|
-
"Bash(curl -s -X POST https://mainnet.base.org -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0x2abae0e\",\"toBlock\":\"0x2abd185\",\"topics\":[\"0x0bc9e50671a07e979d2d6f9d5d8aa8ea24bddecb5f91246c157deaca37c2b7a4\"]}],\"id\":1}')",
|
|
17
|
-
"Bash(python3)",
|
|
18
|
-
"Bash(python3 -c ' *)",
|
|
19
|
-
"mcp__dappql__projectInfo",
|
|
20
|
-
"WebSearch",
|
|
21
|
-
"WebFetch(domain:github.com)",
|
|
22
|
-
"WebFetch(domain:www.npmjs.com)",
|
|
23
|
-
"mcp__dappql__getEvents",
|
|
24
|
-
"mcp__dappql__chainState",
|
|
25
|
-
"mcp__dappql__getDappqlReference",
|
|
26
|
-
"WebFetch(domain:docs.underscore.finance)"
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"enableAllProjectMcpServers": true,
|
|
30
|
-
"enabledMcpjsonServers": ["dappql"]
|
|
31
|
-
}
|
package/.eslintrc.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["universe/web"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
5
|
-
"@next/next/no-img-element": "off",
|
|
6
|
-
"import/order": [
|
|
7
|
-
"error",
|
|
8
|
-
{
|
|
9
|
-
"alphabetize": {
|
|
10
|
-
"caseInsensitive": true,
|
|
11
|
-
"order": "asc"
|
|
12
|
-
},
|
|
13
|
-
"groups": ["builtin", "external", "internal"],
|
|
14
|
-
"newlines-between": "always",
|
|
15
|
-
"pathGroups": [
|
|
16
|
-
{
|
|
17
|
-
"group": "external",
|
|
18
|
-
"pattern": "{react,react-native,react-dom}",
|
|
19
|
-
"position": "before"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"pathGroupsExcludedImportTypes": ["react"]
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"no-console": "error"
|
|
26
|
-
}
|
|
27
|
-
}
|
package/.prettierrc
DELETED
package/.tool-versions
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodejs 22.11.0
|
package/LICENSE
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Business Source License 1.1
|
|
2
|
-
|
|
3
|
-
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
4
|
-
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
5
|
-
|
|
6
|
-
-----------------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
Parameters
|
|
9
|
-
|
|
10
|
-
Licensor: Hightop Financial, Inc.
|
|
11
|
-
|
|
12
|
-
Licensed Work: Underscore Protocol
|
|
13
|
-
The Licensed Work is (c) 2025 Hightop Financial, Inc.
|
|
14
|
-
|
|
15
|
-
Additional Use Grant: Any uses listed and defined at
|
|
16
|
-
https://github.com/underscore-finance/underscore/blob/main/LICENSE_GRANTS.md
|
|
17
|
-
|
|
18
|
-
Change Date: The earlier of 2029-03-06 or a date specified at
|
|
19
|
-
https://github.com/underscore-finance/underscore/blob/main/LICENSE_DATE.md
|
|
20
|
-
|
|
21
|
-
Change License: MIT License
|
|
22
|
-
|
|
23
|
-
-----------------------------------------------------------------------------
|
|
24
|
-
|
|
25
|
-
Terms
|
|
26
|
-
|
|
27
|
-
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
|
|
28
|
-
|
|
29
|
-
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
|
|
30
|
-
|
|
31
|
-
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
|
|
32
|
-
|
|
33
|
-
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
|
|
34
|
-
|
|
35
|
-
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
|
|
36
|
-
|
|
37
|
-
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
|
38
|
-
|
|
39
|
-
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
|
|
40
|
-
|
|
41
|
-
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
package/LICENSE_DATE.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Underscore Protocol - License Change Date
|
|
2
|
-
|
|
3
|
-
This document specifies the Change Date for the Underscore Protocol's Business Source License 1.1 (BUSL-1.1), as referenced in the license terms.
|
|
4
|
-
|
|
5
|
-
## Current Change Date
|
|
6
|
-
|
|
7
|
-
**March 6, 2029**
|
|
8
|
-
|
|
9
|
-
On this date, the Underscore Protocol codebase will automatically convert from the Business Source License 1.1 to the MIT License.
|
|
10
|
-
|
|
11
|
-
## Change Date Policy
|
|
12
|
-
|
|
13
|
-
The Change Date represents Hightop Financial, Inc.'s commitment to eventually releasing the protocol under a fully permissive open source license. This date was chosen to balance:
|
|
14
|
-
|
|
15
|
-
1. Protection of the protocol's early development and ecosystem
|
|
16
|
-
2. Commitment to open source principles and long-term community ownership
|
|
17
|
-
|
|
18
|
-
## Governance Authority
|
|
19
|
-
|
|
20
|
-
The Underscore Protocol governance may vote to move the Change Date earlier than the date specified above, but it cannot be moved later.
|
|
21
|
-
|
|
22
|
-
## Verification
|
|
23
|
-
|
|
24
|
-
To verify this Change Date, please refer to:
|
|
25
|
-
|
|
26
|
-
1. The LICENSE file in the repository root
|
|
27
|
-
2. The BUSL_LICENSE file in the licenses directory
|
|
28
|
-
3. This document (LICENSE_DATE.md)
|
|
29
|
-
|
|
30
|
-
## Contact
|
|
31
|
-
|
|
32
|
-
For questions about licensing or to inquire about commercial licensing options before the Change Date, please contact:
|
|
33
|
-
|
|
34
|
-
- Email: team@hightop.com
|
package/LICENSE_GRANTS.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Underscore Protocol - Additional Use Grants
|
|
2
|
-
|
|
3
|
-
This document lists all Additional Use Grants for the Underscore Protocol, as referenced in the Business Source License 1.1 (BUSL-1.1) under which the protocol is licensed.
|
|
4
|
-
|
|
5
|
-
## Current Additional Use Grants
|
|
6
|
-
|
|
7
|
-
| Date Granted | Entity | Grant Description | Scope | Expiration |
|
|
8
|
-
| ------------ | ------ | --------------------------------------------- | ----- | ---------- |
|
|
9
|
-
| N/A | N/A | No additional use grants have been issued yet | N/A | N/A |
|
|
10
|
-
|
|
11
|
-
## Grant Process
|
|
12
|
-
|
|
13
|
-
Additional Use Grants are issued through the Underscore governance process. To request an Additional Use Grant:
|
|
14
|
-
|
|
15
|
-
1. Create a governance proposal specifying your intended use
|
|
16
|
-
2. Include the specific entity that would receive the grant
|
|
17
|
-
3. Provide details about the implementation and how it benefits the ecosystem
|
|
18
|
-
4. Submit the proposal through the governance process
|
|
19
|
-
|
|
20
|
-
## Grant Terms
|
|
21
|
-
|
|
22
|
-
Each Additional Use Grant will specify:
|
|
23
|
-
|
|
24
|
-
- The entity receiving the grant
|
|
25
|
-
- The specific use cases permitted
|
|
26
|
-
- Any limitations or conditions
|
|
27
|
-
- The duration of the grant (if applicable)
|
|
28
|
-
|
|
29
|
-
## Contact
|
|
30
|
-
|
|
31
|
-
For questions about Additional Use Grants or to inquire about commercial licensing options, please contact:
|
|
32
|
-
|
|
33
|
-
- Email: team@hightop.com
|
package/LICENSE_INFO.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Underscore Protocol License Information
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
Underscore Protocol is licensed under the Business Source License 1.1 (BUSL-1.1). This license was chosen to balance the benefits of open source with protection for the Underscore community and ecosystem.
|
|
6
|
-
|
|
7
|
-
## License Structure
|
|
8
|
-
|
|
9
|
-
The Underscore Protocol codebase is licensed under two licenses:
|
|
10
|
-
|
|
11
|
-
1. **Business Source License 1.1 (BUSL-1.1)**: This applies to the core protocol contracts and implementation details.
|
|
12
|
-
2. **MIT License**: This applies to interfaces and peripheral contracts needed for integration.
|
|
13
|
-
|
|
14
|
-
## Directory-Specific Licensing
|
|
15
|
-
|
|
16
|
-
### BUSL-1.1 Licensed Directories and Files
|
|
17
|
-
|
|
18
|
-
The following directories and their contents are licensed under the Business Source License 1.1:
|
|
19
|
-
|
|
20
|
-
- `contracts/core/` - Core protocol implementation
|
|
21
|
-
- `contracts/legos/` - All DeFi protocol integrations (Uniswap, Aave, etc.)
|
|
22
|
-
- `contracts/modules/` - Supporting modules for the core protocol
|
|
23
|
-
- `contracts/oracles/` - Price oracle implementations
|
|
24
|
-
|
|
25
|
-
### MIT Licensed Directories and Files
|
|
26
|
-
|
|
27
|
-
The following directories and their contents are licensed under the MIT License:
|
|
28
|
-
|
|
29
|
-
- `interfaces/` - All interface definitions
|
|
30
|
-
- `contracts/mock/` - mock contracts for testing
|
|
31
|
-
- `utils/` - Helper utilities needed for integration
|
|
32
|
-
|
|
33
|
-
## What the BUSL-1.1 Means for You
|
|
34
|
-
|
|
35
|
-
The BUSL-1.1 license:
|
|
36
|
-
|
|
37
|
-
- Allows you to view, modify, and use the code for non-production purposes (development, testing, academic research, personal learning)
|
|
38
|
-
- Restricts production use unless:
|
|
39
|
-
- You receive an Additional Use Grant
|
|
40
|
-
- The Change Date is reached (March 6, 2029, or earlier if specified at https://github.com/underscore-finance/underscore/blob/main/LICENSE_DATE.md)
|
|
41
|
-
- Will automatically convert to the MIT License on the Change Date
|
|
42
|
-
|
|
43
|
-
## What You Can Do Without Additional Permission
|
|
44
|
-
|
|
45
|
-
- View and study all code
|
|
46
|
-
- Fork the repository
|
|
47
|
-
- Modify the code for non-production use
|
|
48
|
-
- Use the code for development and testing
|
|
49
|
-
- Contribute to the codebase
|
|
50
|
-
- Integrate with the protocol through the MIT-licensed interfaces
|
|
51
|
-
|
|
52
|
-
## What Requires Additional Permission
|
|
53
|
-
|
|
54
|
-
Production use of BUSL-1.1 licensed code requires one of the following:
|
|
55
|
-
|
|
56
|
-
1. **Additional Use Grant**: Specific permission for production use, which can be granted through the governance process
|
|
57
|
-
2. **Commercial License**: A separate license agreement with Hightop Financial, Inc.
|
|
58
|
-
3. **Wait for the Change Date**: After March 6, 2029 (or an earlier date if specified), the code will be available under the MIT License
|
|
59
|
-
|
|
60
|
-
## Obtaining an Additional Use Grant
|
|
61
|
-
|
|
62
|
-
Additional Use Grants may be issued through the Underscore governance process. These grants are recorded at https://github.com/underscore-finance/underscore/blob/main/LICENSE_GRANTS.md.
|
|
63
|
-
|
|
64
|
-
To request an Additional Use Grant, check the above file.
|
|
65
|
-
|
|
66
|
-
## MIT-Licensed Components
|
|
67
|
-
|
|
68
|
-
The following components are licensed under the MIT License to enable integration with the protocol:
|
|
69
|
-
|
|
70
|
-
- Interface definitions (all files in `interfaces/` directory)
|
|
71
|
-
- Mock smart contracts used for testing (all files in `contracts/mock/` directory)
|
|
72
|
-
- Helper utilities (in the `utils/` directory)
|
|
73
|
-
|
|
74
|
-
## License Verification
|
|
75
|
-
|
|
76
|
-
To verify which license applies to a specific file:
|
|
77
|
-
|
|
78
|
-
1. Check the directory-specific licensing section in this document
|
|
79
|
-
2. If the file is in a directory listed under MIT Licensed Directories, it is MIT licensed
|
|
80
|
-
3. If the file is in a directory listed under BUSL-1.1 Licensed Directories, it is BUSL-1.1 licensed
|
|
81
|
-
|
|
82
|
-
## Questions and Commercial Licensing
|
|
83
|
-
|
|
84
|
-
For questions about the license or to inquire about commercial licensing options, please contact:
|
|
85
|
-
|
|
86
|
-
- Email: team@hightop.com
|
|
87
|
-
|
|
88
|
-
## Disclaimer
|
|
89
|
-
|
|
90
|
-
This document is provided for informational purposes only and does not constitute legal advice. You should consult with a lawyer to discuss your specific situation and licensing needs.
|