@curvefi/api 2.50.10 → 2.51.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/lib/constants/abis/factory-stable-ng/plain-stableswap-ng.json +1 -0
- package/lib/constants/abis/factory-stable-ng.json +1 -0
- package/lib/constants/aliases.js +14 -0
- package/lib/curve.d.ts +3 -0
- package/lib/curve.js +47 -2
- package/lib/external-api.js +1 -0
- package/lib/factory/constants.js +11 -0
- package/lib/factory/factory-api.js +5 -4
- package/lib/factory/factory.js +30 -24
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/interfaces.d.ts +1 -1
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{ "name": "Transfer", "inputs": [{ "name": "sender", "type": "address", "indexed": true }, { "name": "receiver", "type": "address", "indexed": true }, { "name": "value", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "Approval", "inputs": [{ "name": "owner", "type": "address", "indexed": true }, { "name": "spender", "type": "address", "indexed": true }, { "name": "value", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "TokenExchange", "inputs": [{ "name": "buyer", "type": "address", "indexed": true }, { "name": "sold_id", "type": "int128", "indexed": false }, { "name": "tokens_sold", "type": "uint256", "indexed": false }, { "name": "bought_id", "type": "int128", "indexed": false }, { "name": "tokens_bought", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "TokenExchangeUnderlying", "inputs": [{ "name": "buyer", "type": "address", "indexed": true }, { "name": "sold_id", "type": "int128", "indexed": false }, { "name": "tokens_sold", "type": "uint256", "indexed": false }, { "name": "bought_id", "type": "int128", "indexed": false }, { "name": "tokens_bought", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "AddLiquidity", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "token_amounts", "type": "uint256[]", "indexed": false }, { "name": "fees", "type": "uint256[]", "indexed": false }, { "name": "invariant", "type": "uint256", "indexed": false }, { "name": "token_supply", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "RemoveLiquidity", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "token_amounts", "type": "uint256[]", "indexed": false }, { "name": "fees", "type": "uint256[]", "indexed": false }, { "name": "token_supply", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "RemoveLiquidityOne", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "token_id", "type": "int128", "indexed": false }, { "name": "token_amount", "type": "uint256", "indexed": false }, { "name": "coin_amount", "type": "uint256", "indexed": false }, { "name": "token_supply", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "RemoveLiquidityImbalance", "inputs": [{ "name": "provider", "type": "address", "indexed": true }, { "name": "token_amounts", "type": "uint256[]", "indexed": false }, { "name": "fees", "type": "uint256[]", "indexed": false }, { "name": "invariant", "type": "uint256", "indexed": false }, { "name": "token_supply", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "RampA", "inputs": [{ "name": "old_A", "type": "uint256", "indexed": false }, { "name": "new_A", "type": "uint256", "indexed": false }, { "name": "initial_time", "type": "uint256", "indexed": false }, { "name": "future_time", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "StopRampA", "inputs": [{ "name": "A", "type": "uint256", "indexed": false }, { "name": "t", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "ApplyNewFee", "inputs": [{ "name": "fee", "type": "uint256", "indexed": false }, { "name": "offpeg_fee_multiplier", "type": "uint256", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "_name", "type": "string" }, { "name": "_symbol", "type": "string" }, { "name": "_A", "type": "uint256" }, { "name": "_fee", "type": "uint256" }, { "name": "_offpeg_fee_multiplier", "type": "uint256" }, { "name": "_ma_exp_time", "type": "uint256" }, { "name": "_coins", "type": "address[]" }, { "name": "_rate_multipliers", "type": "uint256[]" }, { "name": "_asset_types", "type": "uint8[]" }, { "name": "_method_ids", "type": "bytes4[]" }, { "name": "_oracles", "type": "address[]" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "_dx", "type": "uint256" }, { "name": "_min_dy", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "_dx", "type": "uint256" }, { "name": "_min_dy", "type": "uint256" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_received", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "_dx", "type": "uint256" }, { "name": "_min_dy", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "exchange_received", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "_dx", "type": "uint256" }, { "name": "_min_dy", "type": "uint256" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_liquidity", "inputs": [{ "name": "_amounts", "type": "uint256[]" }, { "name": "_min_mint_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_liquidity", "inputs": [{ "name": "_amounts", "type": "uint256[]" }, { "name": "_min_mint_amount", "type": "uint256" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity_one_coin", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "i", "type": "int128" }, { "name": "_min_received", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity_one_coin", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "i", "type": "int128" }, { "name": "_min_received", "type": "uint256" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity_imbalance", "inputs": [{ "name": "_amounts", "type": "uint256[]" }, { "name": "_max_burn_amount", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity_imbalance", "inputs": [{ "name": "_amounts", "type": "uint256[]" }, { "name": "_max_burn_amount", "type": "uint256" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "_min_amounts", "type": "uint256[]" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "_min_amounts", "type": "uint256[]" }, { "name": "_receiver", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "remove_liquidity", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "_min_amounts", "type": "uint256[]" }, { "name": "_receiver", "type": "address" }, { "name": "_claim_admin_fees", "type": "bool" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "withdraw_admin_fees", "inputs": [], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "last_price", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "ema_price", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_p", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "price_oracle", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "D_oracle", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "transfer", "inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "transferFrom", "inputs": [{ "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "approve", "inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "permit", "inputs": [{ "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }, { "name": "_deadline", "type": "uint256" }, { "name": "_v", "type": "uint8" }, { "name": "_r", "type": "bytes32" }, { "name": "_s", "type": "bytes32" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "DOMAIN_SEPARATOR", "inputs": [], "outputs": [{ "name": "", "type": "bytes32" }] }, { "stateMutability": "view", "type": "function", "name": "get_dx", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "dy", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_dy", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }, { "name": "dx", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "calc_withdraw_one_coin", "inputs": [{ "name": "_burn_amount", "type": "uint256" }, { "name": "i", "type": "int128" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "totalSupply", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_virtual_price", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "calc_token_amount", "inputs": [{ "name": "_amounts", "type": "uint256[]" }, { "name": "_is_deposit", "type": "bool" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "A", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "A_precise", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "balances", "inputs": [{ "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_balances", "inputs": [], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "stored_rates", "inputs": [], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "dynamic_fee", "inputs": [{ "name": "i", "type": "int128" }, { "name": "j", "type": "int128" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "ramp_A", "inputs": [{ "name": "_future_A", "type": "uint256" }, { "name": "_future_time", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "stop_ramp_A", "inputs": [], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_new_fee", "inputs": [{ "name": "_new_fee", "type": "uint256" }, { "name": "_new_offpeg_fee_multiplier", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_ma_exp_time", "inputs": [{ "name": "_ma_exp_time", "type": "uint256" }, { "name": "_D_ma_time", "type": "uint256" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "N_COINS", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "coins", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "offpeg_fee_multiplier", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_fee", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "initial_A", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "future_A", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "initial_A_time", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "future_A_time", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "admin_balances", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "ma_exp_time", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "D_ma_time", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "ma_last_time", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "name", "inputs": [], "outputs": [{ "name": "", "type": "string" }] }, { "stateMutability": "view", "type": "function", "name": "symbol", "inputs": [], "outputs": [{ "name": "", "type": "string" }] }, { "stateMutability": "view", "type": "function", "name": "decimals", "inputs": [], "outputs": [{ "name": "", "type": "uint8" }] }, { "stateMutability": "view", "type": "function", "name": "version", "inputs": [], "outputs": [{ "name": "", "type": "string" }] }, { "stateMutability": "view", "type": "function", "name": "balanceOf", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "allowance", "inputs": [{ "name": "arg0", "type": "address" }, { "name": "arg1", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "nonces", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "salt", "inputs": [], "outputs": [{ "name": "", "type": "bytes32" }] }]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{ "name": "BasePoolAdded", "inputs": [{ "name": "base_pool", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "PlainPoolDeployed", "inputs": [{ "name": "coins", "type": "address[]", "indexed": false }, { "name": "A", "type": "uint256", "indexed": false }, { "name": "fee", "type": "uint256", "indexed": false }, { "name": "deployer", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "MetaPoolDeployed", "inputs": [{ "name": "coin", "type": "address", "indexed": false }, { "name": "base_pool", "type": "address", "indexed": false }, { "name": "A", "type": "uint256", "indexed": false }, { "name": "fee", "type": "uint256", "indexed": false }, { "name": "deployer", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "name": "LiquidityGaugeDeployed", "inputs": [{ "name": "pool", "type": "address", "indexed": false }, { "name": "gauge", "type": "address", "indexed": false }], "anonymous": false, "type": "event" }, { "stateMutability": "nonpayable", "type": "constructor", "inputs": [{ "name": "_fee_receiver", "type": "address" }, { "name": "_owner", "type": "address" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "find_pool_for_coins", "inputs": [{ "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "find_pool_for_coins", "inputs": [{ "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "i", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "get_base_pool", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "get_n_coins", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_meta_n_coins", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_coins", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_underlying_coins", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_decimals", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_underlying_decimals", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_metapool_rates", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_balances", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_underlying_balances", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_A", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_fees", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256" }, { "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "get_admin_balances", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint256[]" }] }, { "stateMutability": "view", "type": "function", "name": "get_coin_indices", "inputs": [{ "name": "_pool", "type": "address" }, { "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }], "outputs": [{ "name": "", "type": "int128" }, { "name": "", "type": "int128" }, { "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "get_gauge", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "get_implementation_address", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "is_meta", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "get_pool_asset_types", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "uint8[]" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "deploy_plain_pool", "inputs": [{ "name": "_name", "type": "string" }, { "name": "_symbol", "type": "string" }, { "name": "_coins", "type": "address[]" }, { "name": "_A", "type": "uint256" }, { "name": "_fee", "type": "uint256" }, { "name": "_offpeg_fee_multiplier", "type": "uint256" }, { "name": "_ma_exp_time", "type": "uint256" }, { "name": "_implementation_idx", "type": "uint256" }, { "name": "_asset_types", "type": "uint8[]" }, { "name": "_method_ids", "type": "bytes4[]" }, { "name": "_oracles", "type": "address[]" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "deploy_metapool", "inputs": [{ "name": "_base_pool", "type": "address" }, { "name": "_name", "type": "string" }, { "name": "_symbol", "type": "string" }, { "name": "_coin", "type": "address" }, { "name": "_A", "type": "uint256" }, { "name": "_fee", "type": "uint256" }, { "name": "_offpeg_fee_multiplier", "type": "uint256" }, { "name": "_ma_exp_time", "type": "uint256" }, { "name": "_implementation_idx", "type": "uint256" }, { "name": "_asset_type", "type": "uint8" }, { "name": "_method_id", "type": "bytes4" }, { "name": "_oracle", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "deploy_gauge", "inputs": [{ "name": "_pool", "type": "address" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_base_pool", "inputs": [{ "name": "_base_pool", "type": "address" }, { "name": "_base_lp_token", "type": "address" }, { "name": "_asset_types", "type": "uint8[]" }, { "name": "_n_coins", "type": "uint256" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_pool_implementations", "inputs": [{ "name": "_implementation_index", "type": "uint256" }, { "name": "_implementation", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_metapool_implementations", "inputs": [{ "name": "_implementation_index", "type": "uint256" }, { "name": "_implementation", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_math_implementation", "inputs": [{ "name": "_math_implementation", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_gauge_implementation", "inputs": [{ "name": "_gauge_implementation", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_views_implementation", "inputs": [{ "name": "_views_implementation", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "commit_transfer_ownership", "inputs": [{ "name": "_addr", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "accept_transfer_ownership", "inputs": [], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "set_fee_receiver", "inputs": [{ "name": "_pool", "type": "address" }, { "name": "_fee_receiver", "type": "address" }], "outputs": [] }, { "stateMutability": "nonpayable", "type": "function", "name": "add_asset_type", "inputs": [{ "name": "_id", "type": "uint8" }, { "name": "_name", "type": "string" }], "outputs": [] }, { "stateMutability": "view", "type": "function", "name": "admin", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "future_admin", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "asset_types", "inputs": [{ "name": "arg0", "type": "uint8" }], "outputs": [{ "name": "", "type": "string" }] }, { "stateMutability": "view", "type": "function", "name": "pool_list", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "pool_count", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "base_pool_list", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "base_pool_count", "inputs": [], "outputs": [{ "name": "", "type": "uint256" }] }, { "stateMutability": "view", "type": "function", "name": "base_pool_data", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "tuple", "components": [{ "name": "lp_token", "type": "address" }, { "name": "coins", "type": "address[]" }, { "name": "decimals", "type": "uint256" }, { "name": "n_coins", "type": "uint256" }, { "name": "asset_types", "type": "uint8[]" }] }] }, { "stateMutability": "view", "type": "function", "name": "base_pool_assets", "inputs": [{ "name": "arg0", "type": "address" }], "outputs": [{ "name": "", "type": "bool" }] }, { "stateMutability": "view", "type": "function", "name": "pool_implementations", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "metapool_implementations", "inputs": [{ "name": "arg0", "type": "uint256" }], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "math_implementation", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "gauge_implementation", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "views_implementation", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }, { "stateMutability": "view", "type": "function", "name": "fee_receiver", "inputs": [], "outputs": [{ "name": "", "type": "address" }] }]
|
package/lib/constants/aliases.js
CHANGED
|
@@ -16,6 +16,7 @@ export var ALIASES_ETHEREUM = lowerCaseValues({
|
|
|
16
16
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
17
17
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
18
18
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
19
|
+
"stable_ng_factory": '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf',
|
|
19
20
|
"factory_admin": "",
|
|
20
21
|
});
|
|
21
22
|
export var ALIASES_POLYGON = lowerCaseValues({
|
|
@@ -34,6 +35,7 @@ export var ALIASES_POLYGON = lowerCaseValues({
|
|
|
34
35
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
35
36
|
"crypto_factory": "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69",
|
|
36
37
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
38
|
+
"stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
|
|
37
39
|
"factory_admin": "",
|
|
38
40
|
});
|
|
39
41
|
export var ALIASES_FANTOM = lowerCaseValues({
|
|
@@ -52,6 +54,7 @@ export var ALIASES_FANTOM = lowerCaseValues({
|
|
|
52
54
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
53
55
|
"crypto_factory": "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69",
|
|
54
56
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
57
|
+
"stable_ng_factory": '0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b',
|
|
55
58
|
"factory_admin": "",
|
|
56
59
|
});
|
|
57
60
|
export var ALIASES_AVALANCHE = lowerCaseValues({
|
|
@@ -70,6 +73,7 @@ export var ALIASES_AVALANCHE = lowerCaseValues({
|
|
|
70
73
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
71
74
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
72
75
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
76
|
+
"stable_ng_factory": '0x0000000000000000000000000000000000000000',
|
|
73
77
|
"factory_admin": "",
|
|
74
78
|
});
|
|
75
79
|
export var ALIASES_ARBITRUM = lowerCaseValues({
|
|
@@ -88,6 +92,7 @@ export var ALIASES_ARBITRUM = lowerCaseValues({
|
|
|
88
92
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
89
93
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
90
94
|
"tricrypto_factory": '0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8',
|
|
95
|
+
"stable_ng_factory": '0x9AF14D26075f142eb3F292D5065EB3faa646167b',
|
|
91
96
|
"factory_admin": "",
|
|
92
97
|
});
|
|
93
98
|
export var ALIASES_OPTIMISM = lowerCaseValues({
|
|
@@ -106,6 +111,7 @@ export var ALIASES_OPTIMISM = lowerCaseValues({
|
|
|
106
111
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
107
112
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
108
113
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
114
|
+
"stable_ng_factory": '0x5eeE3091f747E60a045a2E715a4c71e600e31F6E',
|
|
109
115
|
"factory_admin": "",
|
|
110
116
|
"gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f', // <-- NEW
|
|
111
117
|
});
|
|
@@ -125,6 +131,7 @@ export var ALIASES_XDAI = lowerCaseValues({
|
|
|
125
131
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
126
132
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
127
133
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
134
|
+
"stable_ng_factory": '0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8',
|
|
128
135
|
"factory_admin": "",
|
|
129
136
|
});
|
|
130
137
|
export var ALIASES_MOONBEAM = lowerCaseValues({
|
|
@@ -143,6 +150,7 @@ export var ALIASES_MOONBEAM = lowerCaseValues({
|
|
|
143
150
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
144
151
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
145
152
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
153
|
+
"stable_ng_factory": '0x0000000000000000000000000000000000000000',
|
|
146
154
|
"factory_admin": "",
|
|
147
155
|
});
|
|
148
156
|
export var ALIASES_AURORA = lowerCaseValues({
|
|
@@ -161,6 +169,7 @@ export var ALIASES_AURORA = lowerCaseValues({
|
|
|
161
169
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
162
170
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
163
171
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
172
|
+
"stable_ng_factory": '0x5eeE3091f747E60a045a2E715a4c71e600e31F6E',
|
|
164
173
|
"factory_admin": "",
|
|
165
174
|
});
|
|
166
175
|
export var ALIASES_KAVA = lowerCaseValues({
|
|
@@ -179,6 +188,7 @@ export var ALIASES_KAVA = lowerCaseValues({
|
|
|
179
188
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
180
189
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
181
190
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
191
|
+
"stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
|
|
182
192
|
"factory_admin": "",
|
|
183
193
|
});
|
|
184
194
|
export var ALIASES_CELO = lowerCaseValues({
|
|
@@ -197,6 +207,7 @@ export var ALIASES_CELO = lowerCaseValues({
|
|
|
197
207
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
198
208
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
199
209
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
210
|
+
"stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
|
|
200
211
|
"factory_admin": "",
|
|
201
212
|
});
|
|
202
213
|
export var ALIASES_ZKSYNC = lowerCaseValues({
|
|
@@ -215,6 +226,7 @@ export var ALIASES_ZKSYNC = lowerCaseValues({
|
|
|
215
226
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
216
227
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
217
228
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
229
|
+
"stable_ng_factory": '0x0000000000000000000000000000000000000000',
|
|
218
230
|
"factory_admin": "0x0000000000000000000000000000000000000000",
|
|
219
231
|
});
|
|
220
232
|
export var ALIASES_BASE = lowerCaseValues({
|
|
@@ -234,6 +246,7 @@ export var ALIASES_BASE = lowerCaseValues({
|
|
|
234
246
|
"crypto_factory": '0x5EF72230578b3e399E6C6F4F6360edF95e83BBfd',
|
|
235
247
|
"tricrypto_factory": '0xA5961898870943c68037F6848d2D866Ed2016bcB',
|
|
236
248
|
"factory_admin": "0x0000000000000000000000000000000000000000",
|
|
249
|
+
"stable_ng_factory": '0xd2002373543Ce3527023C75e7518C274A51ce712',
|
|
237
250
|
"gas_oracle": '0xc0d3C0d3C0d3c0D3C0D3C0d3C0d3C0D3C0D3000f', // <-- NEW
|
|
238
251
|
});
|
|
239
252
|
export var ALIASES_BSC = lowerCaseValues({
|
|
@@ -252,6 +265,7 @@ export var ALIASES_BSC = lowerCaseValues({
|
|
|
252
265
|
"eywa_factory": '0x0000000000000000000000000000000000000000',
|
|
253
266
|
"crypto_factory": '0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C',
|
|
254
267
|
"tricrypto_factory": '0xc55837710bc500F1E3c7bb9dd1d51F7c5647E657',
|
|
268
|
+
"stable_ng_factory": '0xd7E72f3615aa65b92A4DBdC211E296a35512988B',
|
|
255
269
|
"factory_admin": '0x0000000000000000000000000000000000000000',
|
|
256
270
|
});
|
|
257
271
|
var registry_exchange_deprecated = {
|
package/lib/curve.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ declare class Curve implements ICurve {
|
|
|
52
52
|
EYWA_FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
53
53
|
CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
54
54
|
TRICRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
55
|
+
STABLE_NG_FACTORY_POOLS_DATA: IDict<IPoolData>;
|
|
55
56
|
LLAMMAS_DATA: IDict<IPoolData>;
|
|
56
57
|
COINS: IDict<string>;
|
|
57
58
|
DECIMALS: IDict<number>;
|
|
@@ -83,6 +84,7 @@ declare class Curve implements ICurve {
|
|
|
83
84
|
fetchEywaFactoryPools: (useApi?: boolean) => Promise<void>;
|
|
84
85
|
fetchCryptoFactoryPools: (useApi?: boolean) => Promise<void>;
|
|
85
86
|
fetchTricryptoFactoryPools: (useApi?: boolean) => Promise<void>;
|
|
87
|
+
fetchStableNgFactoryPools: (useApi?: boolean) => Promise<void>;
|
|
86
88
|
fetchNewFactoryPools: () => Promise<string[]>;
|
|
87
89
|
fetchNewCryptoFactoryPools: () => Promise<string[]>;
|
|
88
90
|
fetchNewTricryptoFactoryPools: () => Promise<string[]>;
|
|
@@ -95,6 +97,7 @@ declare class Curve implements ICurve {
|
|
|
95
97
|
getEywaFactoryPoolList: () => string[];
|
|
96
98
|
getCryptoFactoryPoolList: () => string[];
|
|
97
99
|
getTricryptoFactoryPoolList: () => string[];
|
|
100
|
+
getStableNgFactoryPoolList: () => string[];
|
|
98
101
|
getPoolList: () => string[];
|
|
99
102
|
getPoolsData: () => IDict<IPoolData>;
|
|
100
103
|
getGaugeImplementation: (factoryType: IFactoryPoolType) => string;
|
package/lib/curve.js
CHANGED
|
@@ -84,6 +84,7 @@ import factoryEywaABI from './constants/abis/factory-eywa.json' assert { type: '
|
|
|
84
84
|
import factoryAdminABI from './constants/abis/factory-admin.json' assert { type: 'json' };
|
|
85
85
|
import cryptoFactoryABI from './constants/abis/factory-crypto.json' assert { type: 'json' };
|
|
86
86
|
import tricryptoFactoryABI from './constants/abis/factory-tricrypto.json' assert { type: 'json' };
|
|
87
|
+
import stableNgFactoryABI from './constants/abis/factory-stable-ng.json' assert { type: 'json' };
|
|
87
88
|
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' assert { type: 'json' };
|
|
88
89
|
import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, } from './constants/pools/index.js';
|
|
89
90
|
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, ALIASES_BSC, } from "./constants/aliases.js";
|
|
@@ -573,6 +574,44 @@ var Curve = /** @class */ (function () {
|
|
|
573
574
|
});
|
|
574
575
|
});
|
|
575
576
|
};
|
|
577
|
+
this.fetchStableNgFactoryPools = function (useApi) {
|
|
578
|
+
if (useApi === void 0) { useApi = true; }
|
|
579
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
580
|
+
var _a, _b, _c, _d, _e;
|
|
581
|
+
return __generator(this, function (_f) {
|
|
582
|
+
switch (_f.label) {
|
|
583
|
+
case 0:
|
|
584
|
+
if (![1, 56, 8453, 42161].includes(this.chainId))
|
|
585
|
+
return [2 /*return*/];
|
|
586
|
+
if (!useApi) return [3 /*break*/, 2];
|
|
587
|
+
_a = this.constants;
|
|
588
|
+
_b = lowerCasePoolDataAddresses;
|
|
589
|
+
return [4 /*yield*/, getFactoryPoolsDataFromApi.call(this, "factory-stable-ng")];
|
|
590
|
+
case 1:
|
|
591
|
+
_a.STABLE_NG_FACTORY_POOLS_DATA = _b.apply(void 0, [_f.sent()]);
|
|
592
|
+
return [3 /*break*/, 4];
|
|
593
|
+
case 2:
|
|
594
|
+
_c = this.constants;
|
|
595
|
+
_d = lowerCasePoolDataAddresses;
|
|
596
|
+
return [4 /*yield*/, getFactoryPoolData.call(this, 0, undefined, this.constants.ALIASES.stable_ng_factory)];
|
|
597
|
+
case 3:
|
|
598
|
+
_c.STABLE_NG_FACTORY_POOLS_DATA = _d.apply(void 0, [_f.sent()]);
|
|
599
|
+
_f.label = 4;
|
|
600
|
+
case 4:
|
|
601
|
+
console.log(this.constants.STABLE_NG_FACTORY_POOLS_DATA);
|
|
602
|
+
_e = this.constants;
|
|
603
|
+
return [4 /*yield*/, this._filterHiddenPools(this.constants.STABLE_NG_FACTORY_POOLS_DATA)];
|
|
604
|
+
case 5:
|
|
605
|
+
_e.STABLE_NG_FACTORY_POOLS_DATA = _f.sent();
|
|
606
|
+
this._updateDecimalsAndGauges(this.constants.STABLE_NG_FACTORY_POOLS_DATA);
|
|
607
|
+
return [4 /*yield*/, _killGauges(this.constants.STABLE_NG_FACTORY_POOLS_DATA)];
|
|
608
|
+
case 6:
|
|
609
|
+
_f.sent();
|
|
610
|
+
return [2 /*return*/];
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
});
|
|
614
|
+
};
|
|
576
615
|
this.fetchNewFactoryPools = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
577
616
|
var currentPoolIds, lastPoolIdx, poolData, _a;
|
|
578
617
|
return __generator(this, function (_b) {
|
|
@@ -687,8 +726,11 @@ var Curve = /** @class */ (function () {
|
|
|
687
726
|
this.getEywaFactoryPoolList = function () { return Object.keys(_this.constants.EYWA_FACTORY_POOLS_DATA); };
|
|
688
727
|
this.getCryptoFactoryPoolList = function () { return Object.keys(_this.constants.CRYPTO_FACTORY_POOLS_DATA); };
|
|
689
728
|
this.getTricryptoFactoryPoolList = function () { return Object.keys(_this.constants.TRICRYPTO_FACTORY_POOLS_DATA); };
|
|
690
|
-
this.
|
|
691
|
-
this.
|
|
729
|
+
this.getStableNgFactoryPoolList = function () { return Object.keys(_this.constants.STABLE_NG_FACTORY_POOLS_DATA); };
|
|
730
|
+
this.getPoolList = function () {
|
|
731
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], _this.getMainPoolList(), true), _this.getFactoryPoolList(), true), _this.getCrvusdFactoryPoolList(), true), _this.getEywaFactoryPoolList(), true), _this.getCryptoFactoryPoolList(), true), _this.getTricryptoFactoryPoolList(), true), _this.getStableNgFactoryPoolList(), true);
|
|
732
|
+
};
|
|
733
|
+
this.getPoolsData = function () { return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, _this.constants.POOLS_DATA), _this.constants.FACTORY_POOLS_DATA), _this.constants.CRVUSD_FACTORY_POOLS_DATA), _this.constants.EYWA_FACTORY_POOLS_DATA), _this.constants.CRYPTO_FACTORY_POOLS_DATA), _this.constants.TRICRYPTO_FACTORY_POOLS_DATA), _this.constants.STABLE_NG_FACTORY_POOLS_DATA), _this.constants.LLAMMAS_DATA)); };
|
|
692
734
|
this.getGaugeImplementation = function (factoryType) { return _this.constants.FACTORY_GAUGE_IMPLEMENTATIONS[factoryType] || _this.constants.ZERO_ADDRESS; };
|
|
693
735
|
// @ts-ignore
|
|
694
736
|
this.provider = null;
|
|
@@ -712,6 +754,7 @@ var Curve = /** @class */ (function () {
|
|
|
712
754
|
EYWA_FACTORY_POOLS_DATA: {},
|
|
713
755
|
CRYPTO_FACTORY_POOLS_DATA: {},
|
|
714
756
|
TRICRYPTO_FACTORY_POOLS_DATA: {},
|
|
757
|
+
STABLE_NG_FACTORY_POOLS_DATA: {},
|
|
715
758
|
LLAMMAS_DATA: {},
|
|
716
759
|
COINS: {},
|
|
717
760
|
DECIMALS: {},
|
|
@@ -751,6 +794,7 @@ var Curve = /** @class */ (function () {
|
|
|
751
794
|
EYWA_FACTORY_POOLS_DATA: {},
|
|
752
795
|
CRYPTO_FACTORY_POOLS_DATA: {},
|
|
753
796
|
TRICRYPTO_FACTORY_POOLS_DATA: {},
|
|
797
|
+
STABLE_NG_FACTORY_POOLS_DATA: {},
|
|
754
798
|
LLAMMAS_DATA: {},
|
|
755
799
|
COINS: {},
|
|
756
800
|
DECIMALS: {},
|
|
@@ -951,6 +995,7 @@ var Curve = /** @class */ (function () {
|
|
|
951
995
|
this.setContract(this.constants.ALIASES.eywa_factory, factoryEywaABI);
|
|
952
996
|
this.setContract(this.constants.ALIASES.crypto_factory, cryptoFactoryABI);
|
|
953
997
|
this.setContract(this.constants.ALIASES.tricrypto_factory, tricryptoFactoryABI);
|
|
998
|
+
this.setContract(this.constants.ALIASES.stable_ng_factory, stableNgFactoryABI);
|
|
954
999
|
this.setContract(this.constants.ALIASES.anycall, anycallABI);
|
|
955
1000
|
this.setContract(this.constants.ALIASES.voting_escrow_oracle, this.chainId === 1 ? votingEscrowOracleEthABI : votingEscrowOracleABI);
|
|
956
1001
|
if (L2Networks.includes(this.chainId)) {
|
package/lib/external-api.js
CHANGED
|
@@ -64,6 +64,7 @@ export var _getAllPoolsFromApi = function (network) { return __awaiter(void 0, v
|
|
|
64
64
|
_getPoolsFromApi(network, "factory-eywa"),
|
|
65
65
|
_getPoolsFromApi(network, "factory-crypto"),
|
|
66
66
|
_getPoolsFromApi(network, "factory-tricrypto"),
|
|
67
|
+
_getPoolsFromApi(network, "factory-stable-ng"),
|
|
67
68
|
])];
|
|
68
69
|
case 1: return [2 /*return*/, _a.sent()];
|
|
69
70
|
}
|
package/lib/factory/constants.js
CHANGED
|
@@ -27,6 +27,7 @@ import Plain6BasicABI from "../constants/abis/factory-v2/Plain6Basic.json" asser
|
|
|
27
27
|
import Plain6BalancesABI from "../constants/abis/factory-v2/Plain6Balances.json" assert { type: 'json' };
|
|
28
28
|
import Plain6ETHABI from "../constants/abis/factory-v2/Plain6ETH.json" assert { type: 'json' };
|
|
29
29
|
import Plain6OptimizedABI from "../constants/abis/factory-v2/Plain6Optimized.json" assert { type: 'json' };
|
|
30
|
+
import PlainStableswapNGABI from "../constants/abis/factory-stable-ng/plain-stableswap-ng.json" assert { type: 'json' };
|
|
30
31
|
// --- ZAPS --
|
|
31
32
|
import factoryDepositABI from "../constants/abis/factoryPools/deposit.json" assert { type: 'json' };
|
|
32
33
|
import fraxusdcMetaZapABI from "../constants/abis/fraxusdc/meta_zap.json" assert { type: 'json' };
|
|
@@ -71,6 +72,7 @@ export var implementationABIDictEthereum = lowerCaseKeys({
|
|
|
71
72
|
"0xd35B58386705CE75CE6d09842E38E9BE9CDe5bF6": Plain4BalancesABI,
|
|
72
73
|
"0x88855cdF2b0A8413D470B86952E726684de915be": Plain4ETHABI,
|
|
73
74
|
"0xaD4753D045D3Aed5C1a6606dFb6a7D7AD67C1Ad7": Plain4OptimizedABI,
|
|
75
|
+
"0x3E3B5F27bbf5CC967E074b70E9f4046e31663181": PlainStableswapNGABI,
|
|
74
76
|
});
|
|
75
77
|
export var implementationABIDictPolygon = lowerCaseKeys({
|
|
76
78
|
"0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c": MetaUSDABI,
|
|
@@ -89,6 +91,7 @@ export var implementationABIDictPolygon = lowerCaseKeys({
|
|
|
89
91
|
"0xC7c46488566b9ef9B981b87E328939CaA5ca152f": Plain4BalancesABI,
|
|
90
92
|
"0xf31bcdf0B9a5eCD7AB463eB905551fBc32e51856": Plain4ETHABI,
|
|
91
93
|
"0xAc273d5b4FC06625d8b1abA3BE8De15bDFb8E39f": Plain4OptimizedABI,
|
|
94
|
+
"0x506F594ceb4E33F5161139bAe3Ee911014df9f7f": PlainStableswapNGABI,
|
|
92
95
|
});
|
|
93
96
|
export var implementationABIDictFantom = lowerCaseKeys({
|
|
94
97
|
"0xfCE359115dFe1533a2458650123F86C454BC0213": MetaUSDABI,
|
|
@@ -114,6 +117,7 @@ export var implementationABIDictFantom = lowerCaseKeys({
|
|
|
114
117
|
"0x2C996b11a73276787Eb637D4459d1A7fea16B310": Plain6BalancesABI,
|
|
115
118
|
"0xa4Fc50E45aF5bF22b519468c7c342C704e1F3d44": Plain6ETHABI,
|
|
116
119
|
"0x65e38C41CcE6D9Bc202209Cc546B2f63985D4139": Plain6OptimizedABI,
|
|
120
|
+
"0xd2002373543Ce3527023C75e7518C274A51ce712": PlainStableswapNGABI,
|
|
117
121
|
});
|
|
118
122
|
export var implementationABIDictAvalanche = lowerCaseKeys({
|
|
119
123
|
"0xA237034249290De2B07988Ac64b96f22c0E76fE0": MetaUSDABI,
|
|
@@ -154,6 +158,7 @@ export var implementationABIDictArbitrum = lowerCaseKeys({
|
|
|
154
158
|
"0x2ac56cEBc2D27c9bB51a11773355E44371Eb88D3": Plain4BalancesABI,
|
|
155
159
|
"0x89287c32c2CAC1C76227F6d300B2DBbab6b75C08": Plain4ETHABI,
|
|
156
160
|
"0x06e3C4da96fd076b97b7ca3Ae23527314b6140dF": Plain4OptimizedABI,
|
|
161
|
+
"0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D": PlainStableswapNGABI,
|
|
157
162
|
});
|
|
158
163
|
export var implementationABIDictOptimism = lowerCaseKeys({
|
|
159
164
|
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": MetaUSDABI,
|
|
@@ -174,6 +179,7 @@ export var implementationABIDictOptimism = lowerCaseKeys({
|
|
|
174
179
|
"0xF6bDc2619FFDA72c537Cd9605e0A274Dc48cB1C9": Plain4BalancesABI,
|
|
175
180
|
"0x1AEf73d49Dedc4b1778d0706583995958Dc862e6": Plain4ETHABI,
|
|
176
181
|
"0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6": Plain4OptimizedABI,
|
|
182
|
+
"0x87FE17697D0f14A222e8bEf386a0860eCffDD617": PlainStableswapNGABI,
|
|
177
183
|
});
|
|
178
184
|
export var implementationABIDictXDai = lowerCaseKeys({
|
|
179
185
|
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": MetaUSDABI,
|
|
@@ -190,6 +196,7 @@ export var implementationABIDictXDai = lowerCaseKeys({
|
|
|
190
196
|
"0xcB4eB43E31C830e22baF764c64F11F32C280496c": Plain4BalancesABI,
|
|
191
197
|
"0xc1C49622b63B961ce1D352ecb7D8261Ab5556695": Plain4ETHABI,
|
|
192
198
|
"0x0E2615ce69Cd3Dc3Ff6f66a975bEa0655F3bA7b9": Plain4OptimizedABI,
|
|
199
|
+
"0xd2002373543Ce3527023C75e7518C274A51ce712": PlainStableswapNGABI,
|
|
193
200
|
});
|
|
194
201
|
export var implementationABIDictMoonbeam = lowerCaseKeys({
|
|
195
202
|
"0x6842E0412AC1c00464dc48961330156a07268d14": Plain2BasicABI,
|
|
@@ -218,6 +225,7 @@ export var implementationABIDictKava = lowerCaseKeys({
|
|
|
218
225
|
"0xd59c875dccb6cdcb3a75b91b58a363b5e4b0ca9a": Plain4BalancesABI,
|
|
219
226
|
"0x6378dd741b24bd884f3590d7bc7555fdb2f5b003": Plain4ETHABI,
|
|
220
227
|
"0x509495dfeec3a53acb2f60669985d868131ad9a5": Plain4OptimizedABI,
|
|
228
|
+
"0x1764ee18e8B3ccA4787249Ceb249356192594585": PlainStableswapNGABI,
|
|
221
229
|
});
|
|
222
230
|
export var implementationABIDictCelo = lowerCaseKeys({
|
|
223
231
|
"0xfEE7166C32Bdf6356Ef60636f43400AA55551A96": Plain2BasicABI,
|
|
@@ -232,6 +240,7 @@ export var implementationABIDictCelo = lowerCaseKeys({
|
|
|
232
240
|
"0x3730D8B82BF3fF6Cc6dFDBe2Fd7B2A655e74eAae": Plain4BalancesABI,
|
|
233
241
|
"0x0F5390AB4C5456a769056C96E4D7C71770b52319": Plain4ETHABI,
|
|
234
242
|
"0xA73b02a97B45604cd9f0BBAA153eCfe01f409350": Plain4OptimizedABI,
|
|
243
|
+
"0x506F594ceb4E33F5161139bAe3Ee911014df9f7f": PlainStableswapNGABI,
|
|
235
244
|
});
|
|
236
245
|
export var implementationABIDictZkSync = lowerCaseKeys({
|
|
237
246
|
"0x7c2a205C52361410233540008f7095dEF5915843": Plain2BasicABI,
|
|
@@ -260,6 +269,7 @@ export var implementationABIDictBase = lowerCaseKeys({
|
|
|
260
269
|
"0x2FdDeDF2D842f23da2B81b9144e75cEcb691Bf19": Plain4BalancesABI,
|
|
261
270
|
"0x50E09Ee7080b32aef3e92346891dD2DD389B5fAf": Plain4ETHABI,
|
|
262
271
|
"0x44d9B3f4EE15AC81FEb918501fca0ddc9d83C976": Plain4OptimizedABI,
|
|
272
|
+
"0x1764ee18e8B3ccA4787249Ceb249356192594585": PlainStableswapNGABI,
|
|
263
273
|
});
|
|
264
274
|
export var implementationABIDictBsc = lowerCaseKeys({
|
|
265
275
|
"0xB90B9B1F91a01Ea22A182CD84C1E22222e39B415": Plain2BasicABI,
|
|
@@ -274,6 +284,7 @@ export var implementationABIDictBsc = lowerCaseKeys({
|
|
|
274
284
|
"0x0Cc51c9786f3777a6d50961CEBb2BB6E69ec5e07": Plain4BalancesABI,
|
|
275
285
|
"0x0a31527a8dE2Ee97BBD8cCE14Db8E8826a0b6C4f": Plain4ETHABI,
|
|
276
286
|
"0x1086F023146f9026A9Bb22983CE866813C59518A": Plain4OptimizedABI,
|
|
287
|
+
"0x604388Bb1159AFd21eB5191cE22b4DeCdEE2Ae22": PlainStableswapNGABI,
|
|
277
288
|
});
|
|
278
289
|
export var implementationBasePoolIdDictEthereum = lowerCaseKeys({
|
|
279
290
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
@@ -64,6 +64,7 @@ import { FACTORY_CONSTANTS } from "./constants.js";
|
|
|
64
64
|
import { CRYPTO_FACTORY_CONSTANTS } from "./constants-crypto.js";
|
|
65
65
|
import { setFactoryZapContracts } from "./common.js";
|
|
66
66
|
import { _getPoolsFromApi } from "../external-api.js";
|
|
67
|
+
import { getPoolName } from "../utils.js";
|
|
67
68
|
export var lowerCasePoolDataAddresses = function (poolsData) {
|
|
68
69
|
var _a;
|
|
69
70
|
for (var _i = 0, poolsData_1 = poolsData; _i < poolsData_1.length; _i++) {
|
|
@@ -179,7 +180,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
|
|
|
179
180
|
var basePoolDecimals = __spreadArray([], allPoolsData[basePoolId].underlying_decimals, true);
|
|
180
181
|
var basePoolZap = basePoolIdZapDict[basePoolId];
|
|
181
182
|
FACTORY_POOLS_DATA[pool.id] = {
|
|
182
|
-
name: pool.name
|
|
183
|
+
name: getPoolName(pool.name),
|
|
183
184
|
full_name: pool.name,
|
|
184
185
|
symbol: pool.symbol,
|
|
185
186
|
reference_asset: "CRYPTO",
|
|
@@ -205,7 +206,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
|
|
|
205
206
|
}
|
|
206
207
|
else {
|
|
207
208
|
FACTORY_POOLS_DATA[pool.id] = {
|
|
208
|
-
name: factoryType === "factory-tricrypto" ? pool.name : pool.name
|
|
209
|
+
name: factoryType === "factory-tricrypto" ? pool.name : getPoolName(pool.name),
|
|
209
210
|
full_name: pool.name,
|
|
210
211
|
symbol: pool.symbol,
|
|
211
212
|
reference_asset: "CRYPTO",
|
|
@@ -245,7 +246,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
|
|
|
245
246
|
var basePoolDecimals = basePoolIdDecimalsDict[basePoolId];
|
|
246
247
|
var basePoolZap = basePoolIdZapDict[basePoolId];
|
|
247
248
|
FACTORY_POOLS_DATA[pool.id] = {
|
|
248
|
-
name: pool.name
|
|
249
|
+
name: getPoolName(pool.name),
|
|
249
250
|
full_name: pool.name,
|
|
250
251
|
symbol: pool.symbol,
|
|
251
252
|
reference_asset: pool.assetTypeName.toUpperCase(),
|
|
@@ -272,7 +273,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
|
|
|
272
273
|
else {
|
|
273
274
|
var implementationABIDict = FACTORY_CONSTANTS[_this.chainId].implementationABIDict;
|
|
274
275
|
FACTORY_POOLS_DATA[pool.id] = {
|
|
275
|
-
name: pool.name
|
|
276
|
+
name: getPoolName(pool.name),
|
|
276
277
|
full_name: pool.name,
|
|
277
278
|
symbol: pool.symbol,
|
|
278
279
|
reference_asset: pool.assetTypeName.toUpperCase(),
|
package/lib/factory/factory.js
CHANGED
|
@@ -61,6 +61,7 @@ import factoryGaugeABI from "../constants/abis/gauge_factory.json" assert { type
|
|
|
61
61
|
import gaugeChildABI from "../constants/abis/gauge_child.json" assert { type: 'json' };
|
|
62
62
|
import { setFactoryZapContracts } from "./common.js";
|
|
63
63
|
import { FACTORY_CONSTANTS } from "./constants.js";
|
|
64
|
+
import { getPoolName } from "../utils.js";
|
|
64
65
|
export var BLACK_LIST = {
|
|
65
66
|
1: [
|
|
66
67
|
"0x066b6e1e93fa7dcd3f0eb7f8bac7d5a747ce0bf9",
|
|
@@ -128,7 +129,8 @@ function getFactoryIdsAndSwapAddresses(fromIdx, factoryAddress) {
|
|
|
128
129
|
if (calls.length === 0)
|
|
129
130
|
return [2 /*return*/, [[], []]];
|
|
130
131
|
prefix = factoryAddress === this.constants.ALIASES.factory ? "factory-v2-" :
|
|
131
|
-
factoryAddress === this.constants.ALIASES.crvusd_factory ? "factory-crvusd-" :
|
|
132
|
+
factoryAddress === this.constants.ALIASES.crvusd_factory ? "factory-crvusd-" :
|
|
133
|
+
factoryAddress === this.constants.ALIASES.stable_ng_factory ? "factory-stable-ng-" : "factory-eywa-";
|
|
132
134
|
return [4 /*yield*/, this.multicallProvider.all(calls)];
|
|
133
135
|
case 2:
|
|
134
136
|
factories = (_f.sent()).map(function (addr, i) { return ({ id: prefix + (fromIdx + i), address: addr.toLowerCase() }); });
|
|
@@ -157,12 +159,13 @@ function _handleCoinAddresses(coinAddresses) {
|
|
|
157
159
|
}
|
|
158
160
|
function getPoolsData(factorySwapAddresses, factoryAddress) {
|
|
159
161
|
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
var factoryMulticallContract, isFactoryGaugeNull, factoryGaugeContract, calls, _i, factorySwapAddresses_1, addr, tempSwapContract, res, implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses
|
|
162
|
+
var factoryMulticallContract, isFactoryGaugeNull, isStableNgFactory, factoryGaugeContract, calls, _i, factorySwapAddresses_1, addr, tempSwapContract, res, implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses;
|
|
161
163
|
return __generator(this, function (_a) {
|
|
162
164
|
switch (_a.label) {
|
|
163
165
|
case 0:
|
|
164
166
|
factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
|
|
165
167
|
isFactoryGaugeNull = this.constants.ALIASES.gauge_factory === '0x0000000000000000000000000000000000000000';
|
|
168
|
+
isStableNgFactory = factoryAddress === this.constants.ALIASES['stable_ng_factory'];
|
|
166
169
|
factoryGaugeContract = this.contracts[this.constants.ALIASES.gauge_factory].multicallContract;
|
|
167
170
|
calls = [];
|
|
168
171
|
for (_i = 0, factorySwapAddresses_1 = factorySwapAddresses; _i < factorySwapAddresses_1.length; _i++) {
|
|
@@ -175,7 +178,9 @@ function getPoolsData(factorySwapAddresses, factoryAddress) {
|
|
|
175
178
|
else if (!isFactoryGaugeNull) {
|
|
176
179
|
calls.push(factoryGaugeContract.get_gauge_from_lp_token(addr));
|
|
177
180
|
}
|
|
178
|
-
|
|
181
|
+
if (!isStableNgFactory) {
|
|
182
|
+
calls.push(factoryMulticallContract.get_pool_asset_type(addr));
|
|
183
|
+
}
|
|
179
184
|
calls.push(tempSwapContract.symbol());
|
|
180
185
|
calls.push(tempSwapContract.name());
|
|
181
186
|
calls.push(factoryMulticallContract.is_meta(addr));
|
|
@@ -184,27 +189,28 @@ function getPoolsData(factorySwapAddresses, factoryAddress) {
|
|
|
184
189
|
return [4 /*yield*/, this.multicallProvider.all(calls)];
|
|
185
190
|
case 1:
|
|
186
191
|
res = _a.sent();
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
isMeta = res.filter(function (a, i) { return i % 7 == 5; });
|
|
194
|
-
coinAddresses = _handleCoinAddresses.call(this, res.filter(function (a, i) { return i % 7 == 6; }));
|
|
195
|
-
return [2 /*return*/, [implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses]];
|
|
192
|
+
if (isFactoryGaugeNull) {
|
|
193
|
+
res.forEach(function (item, index) {
|
|
194
|
+
if (index % 7 == 1) {
|
|
195
|
+
res.splice(index, 0, '0x0000000000000000000000000000000000000000');
|
|
196
|
+
}
|
|
197
|
+
});
|
|
196
198
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
coinAddresses = _handleCoinAddresses.call(this, res.filter(function (a, i) { return i % 7 == 5; }));
|
|
204
|
-
gaugeAddresses = Array.from(Array(factorySwapAddresses.length)).map(function () { return '0x0000000000000000000000000000000000000000'; });
|
|
205
|
-
return [2 /*return*/, [implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses]];
|
|
199
|
+
if (isStableNgFactory) {
|
|
200
|
+
res.forEach(function (item, index) {
|
|
201
|
+
if (index % 7 == 2) {
|
|
202
|
+
res.splice(index, 0, -1);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
206
205
|
}
|
|
207
|
-
return
|
|
206
|
+
implememntationAddresses = res.filter(function (a, i) { return i % 7 == 0; }).map(function (a) { return a.toLowerCase(); });
|
|
207
|
+
gaugeAddresses = res.filter(function (a, i) { return i % 7 == 1; }).map(function (a) { return a.toLowerCase(); });
|
|
208
|
+
referenceAssets = _handleReferenceAssets(res.filter(function (a, i) { return i % 7 == 2; }));
|
|
209
|
+
symbols = res.filter(function (a, i) { return i % 7 == 3; });
|
|
210
|
+
names = res.filter(function (a, i) { return i % 7 == 4; });
|
|
211
|
+
isMeta = res.filter(function (a, i) { return i % 7 == 5; });
|
|
212
|
+
coinAddresses = _handleCoinAddresses.call(this, res.filter(function (a, i) { return i % 7 == 6; }));
|
|
213
|
+
return [2 /*return*/, [implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses]];
|
|
208
214
|
}
|
|
209
215
|
});
|
|
210
216
|
});
|
|
@@ -352,7 +358,7 @@ export function getFactoryPoolData(fromIdx, swapAddress, factoryAddress) {
|
|
|
352
358
|
_loop_2 = function (i) {
|
|
353
359
|
if (!isMeta[i]) {
|
|
354
360
|
FACTORY_POOLS_DATA[poolIds[i]] = {
|
|
355
|
-
name: poolNames[i]
|
|
361
|
+
name: getPoolName(poolNames[i]),
|
|
356
362
|
full_name: poolNames[i],
|
|
357
363
|
symbol: poolSymbols[i],
|
|
358
364
|
reference_asset: referenceAssets[i],
|
|
@@ -383,7 +389,7 @@ export function getFactoryPoolData(fromIdx, swapAddress, factoryAddress) {
|
|
|
383
389
|
var basePoolIdZapDict = FACTORY_CONSTANTS[this_1.chainId].basePoolIdZapDict;
|
|
384
390
|
var basePoolZap = basePoolIdZapDict[basePoolIds[i]];
|
|
385
391
|
FACTORY_POOLS_DATA[poolIds[i]] = {
|
|
386
|
-
name: poolNames[i]
|
|
392
|
+
name: getPoolName(poolNames[i]),
|
|
387
393
|
full_name: poolNames[i],
|
|
388
394
|
symbol: poolSymbols[i],
|
|
389
395
|
reference_asset: referenceAssets[i],
|
package/lib/index.d.ts
CHANGED
|
@@ -93,6 +93,10 @@ declare const curve: {
|
|
|
93
93
|
fetchPools: (useApi?: boolean) => Promise<void>;
|
|
94
94
|
getPoolList: () => string[];
|
|
95
95
|
};
|
|
96
|
+
stableNgFactory: {
|
|
97
|
+
fetchPools: (useApi?: boolean) => Promise<void>;
|
|
98
|
+
getPoolList: () => string[];
|
|
99
|
+
};
|
|
96
100
|
cryptoFactory: {
|
|
97
101
|
fetchPools: (useApi?: boolean) => Promise<void>;
|
|
98
102
|
fetchNewPools: () => Promise<string[]>;
|
package/lib/index.js
CHANGED
|
@@ -133,6 +133,10 @@ var curve = {
|
|
|
133
133
|
fetchPools: _curve.fetchEywaFactoryPools,
|
|
134
134
|
getPoolList: _curve.getEywaFactoryPoolList,
|
|
135
135
|
},
|
|
136
|
+
stableNgFactory: {
|
|
137
|
+
fetchPools: _curve.fetchStableNgFactoryPools,
|
|
138
|
+
getPoolList: _curve.getStableNgFactoryPoolList,
|
|
139
|
+
},
|
|
136
140
|
cryptoFactory: {
|
|
137
141
|
fetchPools: _curve.fetchCryptoFactoryPools,
|
|
138
142
|
fetchNewPools: _curve.fetchNewCryptoFactoryPools,
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface IDict<T> {
|
|
|
5
5
|
}
|
|
6
6
|
export type INetworkName = "ethereum" | "bsc" | "optimism" | "xdai" | "polygon" | "fantom" | "zksync" | "moonbeam" | "kava" | "base" | "arbitrum" | "celo" | "avalanche" | "aurora";
|
|
7
7
|
export type IChainId = 1 | 10 | 56 | 100 | 137 | 250 | 324 | 1284 | 2222 | 8453 | 42161 | 42220 | 43114 | 1313161554;
|
|
8
|
-
export type IFactoryPoolType = "factory" | "factory-crvusd" | "factory-eywa" | "factory-crypto" | "factory-tricrypto";
|
|
8
|
+
export type IFactoryPoolType = "factory" | "factory-crvusd" | "factory-eywa" | "factory-crypto" | "factory-tricrypto" | "factory-stable-ng";
|
|
9
9
|
export type IPoolType = "main" | "crypto" | IFactoryPoolType;
|
|
10
10
|
export type ISwapType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
11
11
|
export type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
|
package/lib/utils.d.ts
CHANGED
|
@@ -56,3 +56,4 @@ export declare const getCoinsData: (...coins: string[] | string[][]) => Promise<
|
|
|
56
56
|
export declare const hasDepositAndStake: () => boolean;
|
|
57
57
|
export declare const hasRouter: () => boolean;
|
|
58
58
|
export declare const getCountArgsOfMethodByContract: (contract: Contract, methodName: string) => number;
|
|
59
|
+
export declare const getPoolName: (name: string) => string;
|
package/lib/utils.js
CHANGED
|
@@ -898,3 +898,12 @@ export var getCountArgsOfMethodByContract = function (contract, methodName) {
|
|
|
898
898
|
return -1;
|
|
899
899
|
}
|
|
900
900
|
};
|
|
901
|
+
export var getPoolName = function (name) {
|
|
902
|
+
var separatedName = name.split(": ");
|
|
903
|
+
if (separatedName.length > 1) {
|
|
904
|
+
return separatedName[1].trim();
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
return separatedName[0].trim();
|
|
908
|
+
}
|
|
909
|
+
};
|