voxelithic-interfaces 0.4.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/LICENSE +15 -0
- package/README.md +76 -0
- package/dist/abi.d.ts +1111 -0
- package/dist/abi.js +6 -0
- package/dist/addresses.d.ts +6 -0
- package/dist/addresses.js +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -0
- package/dist/tokens.d.ts +10 -0
- package/dist/tokens.js +27 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.js +1 -0
- package/package.json +47 -0
- package/src/abi.ts +10 -0
- package/src/addresses.ts +7 -0
- package/src/index.ts +6 -0
- package/src/tokens.ts +37 -0
- package/src/types.ts +4 -0
package/dist/abi.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// ABI контрактов, взяты из артефактов сборки Foundry, не набраны руками.
|
|
2
|
+
// Совпадают с верифицированным на Blockscout байткодом.
|
|
3
|
+
export const VoxRouterABI = [{ "type": "constructor", "inputs": [], "stateMutability": "nonpayable" }, { "type": "fallback", "stateMutability": "nonpayable" }, { "type": "function", "name": "MAX_FEE_BPS", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" }, { "type": "function", "name": "acceptOwnership", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "feeBps", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" }, { "type": "function", "name": "feeRecipient", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "pendingOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "rescue", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "to", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setFee", "inputs": [{ "name": "bps", "type": "uint16", "internalType": "uint16" }, { "name": "recipient", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "swapExactIn", "inputs": [{ "name": "tokenIn", "type": "address", "internalType": "address" }, { "name": "tokenOut", "type": "address", "internalType": "address" }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }, { "name": "minOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }, { "name": "hops", "type": "tuple[]", "internalType": "struct VoxRouter.Hop[]", "components": [{ "name": "kind", "type": "uint8", "internalType": "uint8" }, { "name": "pool", "type": "address", "internalType": "address" }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }, { "name": "feePpm", "type": "uint24", "internalType": "uint24" }] }], "outputs": [{ "name": "outToUser", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferOwnership", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "uniswapV3SwapCallback", "inputs": [{ "name": "amount0Delta", "type": "int256", "internalType": "int256" }, { "name": "amount1Delta", "type": "int256", "internalType": "int256" }, { "name": "", "type": "bytes", "internalType": "bytes" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "FeeSet", "inputs": [{ "name": "feeBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "feeRecipient", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OwnerSet", "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OwnerTransferStarted", "inputs": [{ "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Rescued", "inputs": [{ "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RouteExecuted", "inputs": [{ "name": "user", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenIn", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenOut", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amountIn", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amountOut", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "venueCount", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AmountTooLarge", "inputs": [] }, { "type": "error", "name": "BadHops", "inputs": [] }, { "type": "error", "name": "CallbackOverdraw", "inputs": [{ "name": "owed", "type": "uint256", "internalType": "uint256" }, { "name": "allowed", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "Expired", "inputs": [{ "name": "deadline", "type": "uint256", "internalType": "uint256" }, { "name": "nowTs", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "FeeTooHigh", "inputs": [{ "name": "bps", "type": "uint16", "internalType": "uint16" }] }, { "type": "error", "name": "NotAContract", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotOwner", "inputs": [] }, { "type": "error", "name": "PartialFill", "inputs": [{ "name": "paid", "type": "uint256", "internalType": "uint256" }, { "name": "wanted", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "Reentered", "inputs": [] }, { "type": "error", "name": "RouteMismatch", "inputs": [{ "name": "got", "type": "address", "internalType": "address" }, { "name": "want", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "TransferFailed", "inputs": [] }, { "type": "error", "name": "UnexpectedCallback", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "UnsupportedVenue", "inputs": [{ "name": "kind", "type": "uint8", "internalType": "uint8" }] }, { "type": "error", "name": "VoxSlippage", "inputs": [{ "name": "received", "type": "uint256", "internalType": "uint256" }, { "name": "minOut", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
4
|
+
export const VoxQuoterABI = [{ "type": "fallback", "stateMutability": "nonpayable" }, { "type": "function", "name": "quoteExactIn", "inputs": [{ "name": "pool", "type": "address", "internalType": "address" }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "amountOut", "type": "uint256", "internalType": "uint256" }, { "name": "amountPaid", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "quoteMany", "inputs": [{ "name": "legs", "type": "tuple[]", "internalType": "struct VoxQuoter.Leg[]", "components": [{ "name": "pool", "type": "address", "internalType": "address" }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }] }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "outs", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "paid", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "nonpayable" }, { "type": "error", "name": "PoolDidNotRevert", "inputs": [] }, { "type": "error", "name": "QuoteResult", "inputs": [{ "name": "amountOut", "type": "uint256", "internalType": "uint256" }, { "name": "amountPaid", "type": "uint256", "internalType": "uint256" }] }];
|
|
5
|
+
export const VoxRouterV4ABI = [{ "type": "constructor", "inputs": [{ "name": "poolManager", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "MAX_FEE_BPS", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" }, { "type": "function", "name": "MAX_HOPS", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "acceptOwnership", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "feeBps", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" }, { "type": "function", "name": "feeRecipient", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "manager", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IPoolManagerV4" }], "stateMutability": "view" }, { "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "pendingOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "rescue", "inputs": [{ "name": "token", "type": "address", "internalType": "address" }, { "name": "to", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setFee", "inputs": [{ "name": "bps", "type": "uint16", "internalType": "uint16" }, { "name": "recipient", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "swapExactIn", "inputs": [{ "name": "hops", "type": "tuple[]", "internalType": "struct VoxRouterV4.Hop[]", "components": [{ "name": "key", "type": "tuple", "internalType": "struct PoolKey", "components": [{ "name": "currency0", "type": "address", "internalType": "address" }, { "name": "currency1", "type": "address", "internalType": "address" }, { "name": "fee", "type": "uint24", "internalType": "uint24" }, { "name": "tickSpacing", "type": "int24", "internalType": "int24" }, { "name": "hooks", "type": "address", "internalType": "address" }] }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }] }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }, { "name": "minOut", "type": "uint256", "internalType": "uint256" }, { "name": "deadline", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "outToUser", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferOwnership", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unlockCallback", "inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "nonpayable" }, { "type": "event", "name": "FeeSet", "inputs": [{ "name": "feeBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "feeRecipient", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OwnerSet", "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "OwnerTransferStarted", "inputs": [{ "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "Rescued", "inputs": [{ "name": "token", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "RouteExecuted", "inputs": [{ "name": "user", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenIn", "type": "address", "indexed": true, "internalType": "address" }, { "name": "tokenOut", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amountIn", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "amountOut", "type": "uint256", "indexed": false, "internalType": "uint256" }, { "name": "venueCount", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "error", "name": "AmountTooLarge", "inputs": [] }, { "type": "error", "name": "BadDelta", "inputs": [{ "name": "delta", "type": "int256", "internalType": "int256" }] }, { "type": "error", "name": "CircularPath", "inputs": [] }, { "type": "error", "name": "Expired", "inputs": [{ "name": "deadline", "type": "uint256", "internalType": "uint256" }, { "name": "nowTs", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "FeeTooHigh", "inputs": [{ "name": "bps", "type": "uint16", "internalType": "uint16" }] }, { "type": "error", "name": "HooksNotSupported", "inputs": [{ "name": "hooks", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NativeNotSupported", "inputs": [] }, { "type": "error", "name": "NoHops", "inputs": [] }, { "type": "error", "name": "NotAContract", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "NotOwner", "inputs": [] }, { "type": "error", "name": "PartialFill", "inputs": [{ "name": "paid", "type": "uint256", "internalType": "uint256" }, { "name": "wanted", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "PathBroken", "inputs": [{ "name": "hopIndex", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "Reentered", "inputs": [] }, { "type": "error", "name": "TooManyHops", "inputs": [{ "name": "given", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "TransferFailed", "inputs": [] }, { "type": "error", "name": "UnexpectedCallback", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }, { "type": "error", "name": "VoxSlippage", "inputs": [{ "name": "received", "type": "uint256", "internalType": "uint256" }, { "name": "minOut", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "ZeroAddress", "inputs": [] }, { "type": "error", "name": "ZeroAmount", "inputs": [] }];
|
|
6
|
+
export const VoxQuoterV4ABI = [{ "type": "constructor", "inputs": [{ "name": "poolManager", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "manager", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IPoolManagerV4" }], "stateMutability": "view" }, { "type": "function", "name": "quoteExactIn", "inputs": [{ "name": "key", "type": "tuple", "internalType": "struct PoolKey", "components": [{ "name": "currency0", "type": "address", "internalType": "address" }, { "name": "currency1", "type": "address", "internalType": "address" }, { "name": "fee", "type": "uint24", "internalType": "uint24" }, { "name": "tickSpacing", "type": "int24", "internalType": "int24" }, { "name": "hooks", "type": "address", "internalType": "address" }] }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "amountOut", "type": "uint256", "internalType": "uint256" }, { "name": "amountPaid", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "quoteMany", "inputs": [{ "name": "legs", "type": "tuple[]", "internalType": "struct VoxQuoterV4.Leg[]", "components": [{ "name": "key", "type": "tuple", "internalType": "struct PoolKey", "components": [{ "name": "currency0", "type": "address", "internalType": "address" }, { "name": "currency1", "type": "address", "internalType": "address" }, { "name": "fee", "type": "uint24", "internalType": "uint24" }, { "name": "tickSpacing", "type": "int24", "internalType": "int24" }, { "name": "hooks", "type": "address", "internalType": "address" }] }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }] }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "outs", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "paids", "type": "uint256[]", "internalType": "uint256[]" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "quotePath", "inputs": [{ "name": "path", "type": "tuple[]", "internalType": "struct VoxQuoterV4.Leg[]", "components": [{ "name": "key", "type": "tuple", "internalType": "struct PoolKey", "components": [{ "name": "currency0", "type": "address", "internalType": "address" }, { "name": "currency1", "type": "address", "internalType": "address" }, { "name": "fee", "type": "uint24", "internalType": "uint24" }, { "name": "tickSpacing", "type": "int24", "internalType": "int24" }, { "name": "hooks", "type": "address", "internalType": "address" }] }, { "name": "zeroForOne", "type": "bool", "internalType": "bool" }] }, { "name": "amountIn", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "amountOut", "type": "uint256", "internalType": "uint256" }, { "name": "amountPaid", "type": "uint256", "internalType": "uint256" }, { "name": "hopsFilled", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "unlockCallback", "inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "nonpayable" }, { "type": "error", "name": "BadDelta", "inputs": [{ "name": "delta", "type": "int256", "internalType": "int256" }] }, { "type": "error", "name": "ManagerDidNotRevert", "inputs": [] }, { "type": "error", "name": "QuoteFailed", "inputs": [{ "name": "reason", "type": "bytes", "internalType": "bytes" }] }, { "type": "error", "name": "QuoteResult", "inputs": [{ "name": "amountOut", "type": "uint256", "internalType": "uint256" }, { "name": "amountPaid", "type": "uint256", "internalType": "uint256" }, { "name": "hopsFilled", "type": "uint256", "internalType": "uint256" }] }, { "type": "error", "name": "UnexpectedCallback", "inputs": [{ "name": "caller", "type": "address", "internalType": "address" }] }];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CHAIN_ID = 4663;
|
|
2
|
+
export declare const ROUTER: "0x87cD7EbE8c213455e5e5a8554657D5f294a82e64";
|
|
3
|
+
export declare const QUOTER: "0x9616627E871c96e38cb21b9551F62Ed93366bE1B";
|
|
4
|
+
export declare const ROUTER_V4: "0x290b9b46308f7a3B80A5F62214B426d3bfAfaab5";
|
|
5
|
+
export declare const QUOTER_V4: "0x5858F06894623eF4862103A747074E5AA3436d4F";
|
|
6
|
+
export declare const UNISWAP_V4_SINGLETON: "0xc851aDa1e4Fa2A9dd5483284d6b30e2950Cc4F04";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const CHAIN_ID = 4663;
|
|
2
|
+
export const ROUTER = '0x87cD7EbE8c213455e5e5a8554657D5f294a82e64';
|
|
3
|
+
export const QUOTER = '0x9616627E871c96e38cb21b9551F62Ed93366bE1B';
|
|
4
|
+
export const ROUTER_V4 = '0x290b9b46308f7a3B80A5F62214B426d3bfAfaab5';
|
|
5
|
+
export const QUOTER_V4 = '0x5858F06894623eF4862103A747074E5AA3436d4F';
|
|
6
|
+
export const UNISWAP_V4_SINGLETON = '0xc851aDa1e4Fa2A9dd5483284d6b30e2950Cc4F04';
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface TokenMeta {
|
|
2
|
+
symbol: string;
|
|
3
|
+
name: string;
|
|
4
|
+
decimals: number;
|
|
5
|
+
address: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const TOKENS: Record<string, TokenMeta>;
|
|
8
|
+
export declare const SYMBOLS: string[];
|
|
9
|
+
/** Канонический адрес по тикеру. На этом чейне тикер носят и чужие контракты. */
|
|
10
|
+
export declare function addressOf(symbol: string): string | undefined;
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Сгенерировано scripts/gen-tokens.mjs из конфигурации роутера.
|
|
2
|
+
// Каждый адрес сверен с чейном 2026-09-02:
|
|
3
|
+
// symbol() и decimals() совпали. Руками не править — перегенерировать.
|
|
4
|
+
export const TOKENS = {
|
|
5
|
+
NVDA: { symbol: 'NVDA', name: "NVIDIA • Robinhood Token", decimals: 18, address: '0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec' },
|
|
6
|
+
SPY: { symbol: 'SPY', name: "SPDR S&P 500 ETF Trust • Robinhood Token", decimals: 18, address: '0x117cc2133c37b721f49de2a7a74833232b3b4c0c' },
|
|
7
|
+
AAPL: { symbol: 'AAPL', name: "Apple • Robinhood Token", decimals: 18, address: '0xaf3d76f1834a1d425780943c99ea8a608f8a93f9' },
|
|
8
|
+
TSM: { symbol: 'TSM', name: "Taiwan Semiconductor Manufacturing • Robinhood Token", decimals: 18, address: '0x58ffe4a942d3885baa22d7520691f611ef09e7aa' },
|
|
9
|
+
MSTR: { symbol: 'MSTR', name: "Strategy Inc. • Robinhood Token", decimals: 18, address: '0xec262a75e413fafd0df80480274532c79d42da09' },
|
|
10
|
+
GOOGL: { symbol: 'GOOGL', name: "Alphabet Class A • Robinhood Token", decimals: 18, address: '0x2e0847e8910a9732eb3fb1bb4b70a580adad4fe3' },
|
|
11
|
+
COIN: { symbol: 'COIN', name: "Coinbase • Robinhood Token", decimals: 18, address: '0x6330d8c3178a418788df01a47479c0ce7ccf450b' },
|
|
12
|
+
MU: { symbol: 'MU', name: "Micron Technology • Robinhood Token", decimals: 18, address: '0xff080c8ce2e5feadaca0da81314ae59d232d4afd' },
|
|
13
|
+
TSLA: { symbol: 'TSLA', name: "Tesla • Robinhood Token", decimals: 18, address: '0x322f0929c4625ed5bad873c95208d54e1c003b2d' },
|
|
14
|
+
META: { symbol: 'META', name: "Meta Platforms • Robinhood Token", decimals: 18, address: '0xc0d6457c16cc70d6790dd43521c899c87ce02f35' },
|
|
15
|
+
PLTR: { symbol: 'PLTR', name: "Palantir Technologies • Robinhood Token", decimals: 18, address: '0x894e1ec2d74ffe5aef8dc8a9e84686accb964f2a' },
|
|
16
|
+
QQQ: { symbol: 'QQQ', name: "Invesco QQQ • Robinhood Token", decimals: 18, address: '0xd5f3879160bc7c32ebb4dc785f8a4f505888de68' },
|
|
17
|
+
AMD: { symbol: 'AMD', name: "AMD • Robinhood Token", decimals: 18, address: '0x86923f96303d656e4aa86d9d42d1e57ad2023fdc' },
|
|
18
|
+
NFLX: { symbol: 'NFLX', name: "Netflix • Robinhood Token", decimals: 18, address: '0xe0444ef8bf4ed74f74fd73686e2ddf4c1c5591e8' },
|
|
19
|
+
AMZN: { symbol: 'AMZN', name: "Amazon • Robinhood Token", decimals: 18, address: '0x12f190a9f9d7d37a250758b26824b97ce941bf54' },
|
|
20
|
+
USDG: { symbol: 'USDG', name: "USDG", decimals: 6, address: '0x5fc5360d0400a0fd4f2af552add042d716f1d168' },
|
|
21
|
+
WETH: { symbol: 'WETH', name: "Wrapped Ether", decimals: 18, address: '0x0bd7d308f8e1639fab988df18a8011f41eacad73' },
|
|
22
|
+
};
|
|
23
|
+
export const SYMBOLS = Object.keys(TOKENS);
|
|
24
|
+
/** Канонический адрес по тикеру. На этом чейне тикер носят и чужие контракты. */
|
|
25
|
+
export function addressOf(symbol) {
|
|
26
|
+
return TOKENS[symbol.toUpperCase()]?.address;
|
|
27
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Hop {
|
|
2
|
+
pool: string;
|
|
3
|
+
tokenIn: string;
|
|
4
|
+
tokenOut: string;
|
|
5
|
+
kind: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Route {
|
|
8
|
+
hops: Hop[];
|
|
9
|
+
amountIn: bigint;
|
|
10
|
+
minOut: bigint;
|
|
11
|
+
family: 'v3' | 'v4';
|
|
12
|
+
}
|
|
13
|
+
export interface Quote {
|
|
14
|
+
amountOut: bigint;
|
|
15
|
+
hops: Hop[];
|
|
16
|
+
venue: string;
|
|
17
|
+
price: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PoolKey {
|
|
20
|
+
currency0: string;
|
|
21
|
+
currency1: string;
|
|
22
|
+
fee: number;
|
|
23
|
+
tickSpacing: number;
|
|
24
|
+
hooks: string;
|
|
25
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "voxelithic-interfaces",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "TypeScript types, contract ABIs and verified addresses for Voxelithic on Robinhood Chain (4663)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"robinhood-chain",
|
|
7
|
+
"tokenized-equities",
|
|
8
|
+
"dex-aggregator",
|
|
9
|
+
"uniswap-v4",
|
|
10
|
+
"abi",
|
|
11
|
+
"evm"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://voxelithic.xyz",
|
|
14
|
+
"bugs": "https://github.com/Voxelithicag/interfaces/issues",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Voxelithicag/interfaces.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"src",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"gen:tokens": "node scripts/gen-tokens.mjs",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"typescript": "^5.6.0"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/abi.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// ABI контрактов, взяты из артефактов сборки Foundry, не набраны руками.
|
|
2
|
+
// Совпадают с верифицированным на Blockscout байткодом.
|
|
3
|
+
|
|
4
|
+
export const VoxRouterABI = [{"type":"constructor","inputs":[],"stateMutability":"nonpayable"},{"type":"fallback","stateMutability":"nonpayable"},{"type":"function","name":"MAX_FEE_BPS","inputs":[],"outputs":[{"name":"","type":"uint16","internalType":"uint16"}],"stateMutability":"view"},{"type":"function","name":"acceptOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"feeBps","inputs":[],"outputs":[{"name":"","type":"uint16","internalType":"uint16"}],"stateMutability":"view"},{"type":"function","name":"feeRecipient","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"pendingOwner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"rescue","inputs":[{"name":"token","type":"address","internalType":"address"},{"name":"to","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setFee","inputs":[{"name":"bps","type":"uint16","internalType":"uint16"},{"name":"recipient","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"swapExactIn","inputs":[{"name":"tokenIn","type":"address","internalType":"address"},{"name":"tokenOut","type":"address","internalType":"address"},{"name":"amountIn","type":"uint256","internalType":"uint256"},{"name":"minOut","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"hops","type":"tuple[]","internalType":"struct VoxRouter.Hop[]","components":[{"name":"kind","type":"uint8","internalType":"uint8"},{"name":"pool","type":"address","internalType":"address"},{"name":"zeroForOne","type":"bool","internalType":"bool"},{"name":"feePpm","type":"uint24","internalType":"uint24"}]}],"outputs":[{"name":"outToUser","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"transferOwnership","inputs":[{"name":"to","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"uniswapV3SwapCallback","inputs":[{"name":"amount0Delta","type":"int256","internalType":"int256"},{"name":"amount1Delta","type":"int256","internalType":"int256"},{"name":"","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"FeeSet","inputs":[{"name":"feeBps","type":"uint16","indexed":false,"internalType":"uint16"},{"name":"feeRecipient","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnerSet","inputs":[{"name":"owner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnerTransferStarted","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Rescued","inputs":[{"name":"token","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"RouteExecuted","inputs":[{"name":"user","type":"address","indexed":true,"internalType":"address"},{"name":"tokenIn","type":"address","indexed":true,"internalType":"address"},{"name":"tokenOut","type":"address","indexed":true,"internalType":"address"},{"name":"amountIn","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"amountOut","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"venueCount","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"error","name":"AmountTooLarge","inputs":[]},{"type":"error","name":"BadHops","inputs":[]},{"type":"error","name":"CallbackOverdraw","inputs":[{"name":"owed","type":"uint256","internalType":"uint256"},{"name":"allowed","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"Expired","inputs":[{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"nowTs","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"FeeTooHigh","inputs":[{"name":"bps","type":"uint16","internalType":"uint16"}]},{"type":"error","name":"NotAContract","inputs":[{"name":"target","type":"address","internalType":"address"}]},{"type":"error","name":"NotOwner","inputs":[]},{"type":"error","name":"PartialFill","inputs":[{"name":"paid","type":"uint256","internalType":"uint256"},{"name":"wanted","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"Reentered","inputs":[]},{"type":"error","name":"RouteMismatch","inputs":[{"name":"got","type":"address","internalType":"address"},{"name":"want","type":"address","internalType":"address"}]},{"type":"error","name":"TransferFailed","inputs":[]},{"type":"error","name":"UnexpectedCallback","inputs":[{"name":"caller","type":"address","internalType":"address"}]},{"type":"error","name":"UnsupportedVenue","inputs":[{"name":"kind","type":"uint8","internalType":"uint8"}]},{"type":"error","name":"VoxSlippage","inputs":[{"name":"received","type":"uint256","internalType":"uint256"},{"name":"minOut","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"ZeroAddress","inputs":[]},{"type":"error","name":"ZeroAmount","inputs":[]}] as const
|
|
5
|
+
|
|
6
|
+
export const VoxQuoterABI = [{"type":"fallback","stateMutability":"nonpayable"},{"type":"function","name":"quoteExactIn","inputs":[{"name":"pool","type":"address","internalType":"address"},{"name":"zeroForOne","type":"bool","internalType":"bool"},{"name":"amountIn","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"amountOut","type":"uint256","internalType":"uint256"},{"name":"amountPaid","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"quoteMany","inputs":[{"name":"legs","type":"tuple[]","internalType":"struct VoxQuoter.Leg[]","components":[{"name":"pool","type":"address","internalType":"address"},{"name":"zeroForOne","type":"bool","internalType":"bool"}]},{"name":"amountIn","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"outs","type":"uint256[]","internalType":"uint256[]"},{"name":"paid","type":"uint256[]","internalType":"uint256[]"}],"stateMutability":"nonpayable"},{"type":"error","name":"PoolDidNotRevert","inputs":[]},{"type":"error","name":"QuoteResult","inputs":[{"name":"amountOut","type":"uint256","internalType":"uint256"},{"name":"amountPaid","type":"uint256","internalType":"uint256"}]}] as const
|
|
7
|
+
|
|
8
|
+
export const VoxRouterV4ABI = [{"type":"constructor","inputs":[{"name":"poolManager","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"MAX_FEE_BPS","inputs":[],"outputs":[{"name":"","type":"uint16","internalType":"uint16"}],"stateMutability":"view"},{"type":"function","name":"MAX_HOPS","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"acceptOwnership","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"feeBps","inputs":[],"outputs":[{"name":"","type":"uint16","internalType":"uint16"}],"stateMutability":"view"},{"type":"function","name":"feeRecipient","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"manager","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IPoolManagerV4"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"pendingOwner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"rescue","inputs":[{"name":"token","type":"address","internalType":"address"},{"name":"to","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setFee","inputs":[{"name":"bps","type":"uint16","internalType":"uint16"},{"name":"recipient","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"swapExactIn","inputs":[{"name":"hops","type":"tuple[]","internalType":"struct VoxRouterV4.Hop[]","components":[{"name":"key","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"address"},{"name":"currency1","type":"address","internalType":"address"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"address"}]},{"name":"zeroForOne","type":"bool","internalType":"bool"}]},{"name":"amountIn","type":"uint256","internalType":"uint256"},{"name":"minOut","type":"uint256","internalType":"uint256"},{"name":"deadline","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"outToUser","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"transferOwnership","inputs":[{"name":"to","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"unlockCallback","inputs":[{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"nonpayable"},{"type":"event","name":"FeeSet","inputs":[{"name":"feeBps","type":"uint16","indexed":false,"internalType":"uint16"},{"name":"feeRecipient","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnerSet","inputs":[{"name":"owner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"OwnerTransferStarted","inputs":[{"name":"from","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"Rescued","inputs":[{"name":"token","type":"address","indexed":true,"internalType":"address"},{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"amount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"RouteExecuted","inputs":[{"name":"user","type":"address","indexed":true,"internalType":"address"},{"name":"tokenIn","type":"address","indexed":true,"internalType":"address"},{"name":"tokenOut","type":"address","indexed":true,"internalType":"address"},{"name":"amountIn","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"amountOut","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"venueCount","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"error","name":"AmountTooLarge","inputs":[]},{"type":"error","name":"BadDelta","inputs":[{"name":"delta","type":"int256","internalType":"int256"}]},{"type":"error","name":"CircularPath","inputs":[]},{"type":"error","name":"Expired","inputs":[{"name":"deadline","type":"uint256","internalType":"uint256"},{"name":"nowTs","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"FeeTooHigh","inputs":[{"name":"bps","type":"uint16","internalType":"uint16"}]},{"type":"error","name":"HooksNotSupported","inputs":[{"name":"hooks","type":"address","internalType":"address"}]},{"type":"error","name":"NativeNotSupported","inputs":[]},{"type":"error","name":"NoHops","inputs":[]},{"type":"error","name":"NotAContract","inputs":[{"name":"target","type":"address","internalType":"address"}]},{"type":"error","name":"NotOwner","inputs":[]},{"type":"error","name":"PartialFill","inputs":[{"name":"paid","type":"uint256","internalType":"uint256"},{"name":"wanted","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"PathBroken","inputs":[{"name":"hopIndex","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"Reentered","inputs":[]},{"type":"error","name":"TooManyHops","inputs":[{"name":"given","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"TransferFailed","inputs":[]},{"type":"error","name":"UnexpectedCallback","inputs":[{"name":"caller","type":"address","internalType":"address"}]},{"type":"error","name":"VoxSlippage","inputs":[{"name":"received","type":"uint256","internalType":"uint256"},{"name":"minOut","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"ZeroAddress","inputs":[]},{"type":"error","name":"ZeroAmount","inputs":[]}] as const
|
|
9
|
+
|
|
10
|
+
export const VoxQuoterV4ABI = [{"type":"constructor","inputs":[{"name":"poolManager","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"manager","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IPoolManagerV4"}],"stateMutability":"view"},{"type":"function","name":"quoteExactIn","inputs":[{"name":"key","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"address"},{"name":"currency1","type":"address","internalType":"address"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"address"}]},{"name":"zeroForOne","type":"bool","internalType":"bool"},{"name":"amountIn","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"amountOut","type":"uint256","internalType":"uint256"},{"name":"amountPaid","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"quoteMany","inputs":[{"name":"legs","type":"tuple[]","internalType":"struct VoxQuoterV4.Leg[]","components":[{"name":"key","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"address"},{"name":"currency1","type":"address","internalType":"address"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"address"}]},{"name":"zeroForOne","type":"bool","internalType":"bool"}]},{"name":"amountIn","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"outs","type":"uint256[]","internalType":"uint256[]"},{"name":"paids","type":"uint256[]","internalType":"uint256[]"}],"stateMutability":"nonpayable"},{"type":"function","name":"quotePath","inputs":[{"name":"path","type":"tuple[]","internalType":"struct VoxQuoterV4.Leg[]","components":[{"name":"key","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"address"},{"name":"currency1","type":"address","internalType":"address"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"address"}]},{"name":"zeroForOne","type":"bool","internalType":"bool"}]},{"name":"amountIn","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"amountOut","type":"uint256","internalType":"uint256"},{"name":"amountPaid","type":"uint256","internalType":"uint256"},{"name":"hopsFilled","type":"uint256","internalType":"uint256"}],"stateMutability":"nonpayable"},{"type":"function","name":"unlockCallback","inputs":[{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"nonpayable"},{"type":"error","name":"BadDelta","inputs":[{"name":"delta","type":"int256","internalType":"int256"}]},{"type":"error","name":"ManagerDidNotRevert","inputs":[]},{"type":"error","name":"QuoteFailed","inputs":[{"name":"reason","type":"bytes","internalType":"bytes"}]},{"type":"error","name":"QuoteResult","inputs":[{"name":"amountOut","type":"uint256","internalType":"uint256"},{"name":"amountPaid","type":"uint256","internalType":"uint256"},{"name":"hopsFilled","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"UnexpectedCallback","inputs":[{"name":"caller","type":"address","internalType":"address"}]}] as const
|
package/src/addresses.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const CHAIN_ID = 4663
|
|
2
|
+
|
|
3
|
+
export const ROUTER = '0x87cD7EbE8c213455e5e5a8554657D5f294a82e64' as const
|
|
4
|
+
export const QUOTER = '0x9616627E871c96e38cb21b9551F62Ed93366bE1B' as const
|
|
5
|
+
export const ROUTER_V4 = '0x290b9b46308f7a3B80A5F62214B426d3bfAfaab5' as const
|
|
6
|
+
export const QUOTER_V4 = '0x5858F06894623eF4862103A747074E5AA3436d4F' as const
|
|
7
|
+
export const UNISWAP_V4_SINGLETON = '0xc851aDa1e4Fa2A9dd5483284d6b30e2950Cc4F04' as const
|
package/src/index.ts
ADDED
package/src/tokens.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Сгенерировано scripts/gen-tokens.mjs из конфигурации роутера.
|
|
2
|
+
// Каждый адрес сверен с чейном 2026-09-02:
|
|
3
|
+
// symbol() и decimals() совпали. Руками не править — перегенерировать.
|
|
4
|
+
|
|
5
|
+
export interface TokenMeta {
|
|
6
|
+
symbol: string
|
|
7
|
+
name: string
|
|
8
|
+
decimals: number
|
|
9
|
+
address: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const TOKENS: Record<string, TokenMeta> = {
|
|
13
|
+
NVDA: { symbol: 'NVDA', name: "NVIDIA • Robinhood Token", decimals: 18, address: '0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec' },
|
|
14
|
+
SPY: { symbol: 'SPY', name: "SPDR S&P 500 ETF Trust • Robinhood Token", decimals: 18, address: '0x117cc2133c37b721f49de2a7a74833232b3b4c0c' },
|
|
15
|
+
AAPL: { symbol: 'AAPL', name: "Apple • Robinhood Token", decimals: 18, address: '0xaf3d76f1834a1d425780943c99ea8a608f8a93f9' },
|
|
16
|
+
TSM: { symbol: 'TSM', name: "Taiwan Semiconductor Manufacturing • Robinhood Token", decimals: 18, address: '0x58ffe4a942d3885baa22d7520691f611ef09e7aa' },
|
|
17
|
+
MSTR: { symbol: 'MSTR', name: "Strategy Inc. • Robinhood Token", decimals: 18, address: '0xec262a75e413fafd0df80480274532c79d42da09' },
|
|
18
|
+
GOOGL: { symbol: 'GOOGL', name: "Alphabet Class A • Robinhood Token", decimals: 18, address: '0x2e0847e8910a9732eb3fb1bb4b70a580adad4fe3' },
|
|
19
|
+
COIN: { symbol: 'COIN', name: "Coinbase • Robinhood Token", decimals: 18, address: '0x6330d8c3178a418788df01a47479c0ce7ccf450b' },
|
|
20
|
+
MU: { symbol: 'MU', name: "Micron Technology • Robinhood Token", decimals: 18, address: '0xff080c8ce2e5feadaca0da81314ae59d232d4afd' },
|
|
21
|
+
TSLA: { symbol: 'TSLA', name: "Tesla • Robinhood Token", decimals: 18, address: '0x322f0929c4625ed5bad873c95208d54e1c003b2d' },
|
|
22
|
+
META: { symbol: 'META', name: "Meta Platforms • Robinhood Token", decimals: 18, address: '0xc0d6457c16cc70d6790dd43521c899c87ce02f35' },
|
|
23
|
+
PLTR: { symbol: 'PLTR', name: "Palantir Technologies • Robinhood Token", decimals: 18, address: '0x894e1ec2d74ffe5aef8dc8a9e84686accb964f2a' },
|
|
24
|
+
QQQ: { symbol: 'QQQ', name: "Invesco QQQ • Robinhood Token", decimals: 18, address: '0xd5f3879160bc7c32ebb4dc785f8a4f505888de68' },
|
|
25
|
+
AMD: { symbol: 'AMD', name: "AMD • Robinhood Token", decimals: 18, address: '0x86923f96303d656e4aa86d9d42d1e57ad2023fdc' },
|
|
26
|
+
NFLX: { symbol: 'NFLX', name: "Netflix • Robinhood Token", decimals: 18, address: '0xe0444ef8bf4ed74f74fd73686e2ddf4c1c5591e8' },
|
|
27
|
+
AMZN: { symbol: 'AMZN', name: "Amazon • Robinhood Token", decimals: 18, address: '0x12f190a9f9d7d37a250758b26824b97ce941bf54' },
|
|
28
|
+
USDG: { symbol: 'USDG', name: "USDG", decimals: 6, address: '0x5fc5360d0400a0fd4f2af552add042d716f1d168' },
|
|
29
|
+
WETH: { symbol: 'WETH', name: "Wrapped Ether", decimals: 18, address: '0x0bd7d308f8e1639fab988df18a8011f41eacad73' },
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const SYMBOLS = Object.keys(TOKENS)
|
|
33
|
+
|
|
34
|
+
/** Канонический адрес по тикеру. На этом чейне тикер носят и чужие контракты. */
|
|
35
|
+
export function addressOf(symbol: string): string | undefined {
|
|
36
|
+
return TOKENS[symbol.toUpperCase()]?.address
|
|
37
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export interface Hop { pool: string; tokenIn: string; tokenOut: string; kind: number }
|
|
2
|
+
export interface Route { hops: Hop[]; amountIn: bigint; minOut: bigint; family: 'v3' | 'v4' }
|
|
3
|
+
export interface Quote { amountOut: bigint; hops: Hop[]; venue: string; price: number }
|
|
4
|
+
export interface PoolKey { currency0: string; currency1: string; fee: number; tickSpacing: number; hooks: string }
|