-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
211 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"chain_name": "SIDE-Testnet", | ||
"api": [], | ||
"rpc": [ | ||
"https://testnet-rpc.side.one", | ||
"https://testnet-rpc2.side.one" | ||
], | ||
"faucet": "https://testnet.side.one/faucet", | ||
"snapshot_provider": "", | ||
"sdk_version": "0.45.6", | ||
"coin_type": "118", | ||
"min_tx_fee": "800", | ||
"addr_prefix": "side", | ||
"logo": "/logos/side.png", | ||
"theme_color": "#161723", | ||
"assets": [ | ||
{ | ||
"base": "uside", | ||
"symbol": "SIDE", | ||
"name": "Side protocol", | ||
"exponent": "6", | ||
"coingecko_id": "usd-coin", | ||
"logo": "side-SIDE", | ||
"precision": 6 | ||
}, | ||
{ | ||
"base": "abtct", | ||
"symbol": "BTCT", | ||
"name": "Bitcoin Token", | ||
"exponent": "8", | ||
"coingecko_id": "bitcoin", | ||
"logo": "", | ||
"precision": 8 | ||
}, | ||
{ | ||
"base": "uusdc", | ||
"symbol": "USDC", | ||
"name": "USD Coin", | ||
"exponent": "6", | ||
"coingecko_id": "usd-coin", | ||
"logo": "side-USDC", | ||
"precision": 6 | ||
}, | ||
{ | ||
"base": "uusdt", | ||
"symbol": "USDT", | ||
"name": "Tether USD", | ||
"exponent": "6", | ||
"coingecko_id": "usd-coin", | ||
"logo": "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMzkuNDMgMjk1LjI3Ij48dG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{ | ||
"base": "uwbtc", | ||
"coingecko_id": "bitcoin", | ||
"exponent": "8", | ||
"logo": "", | ||
"name": "Wrapped BTC", | ||
"precision": 8, | ||
"symbol": "wBTC" | ||
}, | ||
{ | ||
"base": "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", | ||
"symbol": "USDC", | ||
"name": "USD Coin (ibc)", | ||
"exponent": "6", | ||
"coingecko_id": "usd-coin", | ||
"logo": "side-USDC", | ||
"precision": 6 | ||
}, | ||
{ | ||
"base": "ibc/4BDF2D63B8FFE3454AF30E9BC10D2D7979BD3A938D989889ABC94FC5B86F1E2D", | ||
"symbol": "aUSDC", | ||
"name": "aUSDC.axl (ibc)", | ||
"exponent": "6", | ||
"coingecko_id": "usd-coin", | ||
"logo": "https://testnet.satellite.money/assets/tokens/uausdc.logo.svg", | ||
"precision": 6 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import { useDashboard, type ChainConfig, useBlockchain } from '@/stores'; | ||
import { CosmosRestClient } from '@/libs/client'; | ||
import { onMounted } from 'vue'; | ||
import AdBanner from '@/components/ad/AdBanner.vue'; | ||
const error = ref("") | ||
const conf = ref("") | ||
const dashboard = useDashboard() | ||
const selected = ref({} as ChainConfig) | ||
onMounted(() => { | ||
const chainStore = useBlockchain() | ||
selected.value = chainStore.current || Object.values(dashboard.chains)[0]; | ||
}) | ||
async function initParamsForKeplr() { | ||
const chain = selected.value | ||
if(!chain.endpoints?.rest?.at(0)) throw new Error("Endpoint does not set"); | ||
const client = CosmosRestClient.newDefault(chain.endpoints.rest?.at(0)?.address || "") | ||
const b = await client.getBaseBlockLatest() | ||
const chainid = b.block.header.chain_id | ||
const gasPriceStep = chain.keplrPriceStep || { | ||
low: 0.01, | ||
average: 0.025, | ||
high: 0.03, | ||
} | ||
const coinDecimals = chain.assets[0].denom_units.find(x => x.denom === chain.assets[0].symbol.toLowerCase())?.exponent || 6 | ||
conf.value = JSON.stringify({ | ||
chainId: chainid, | ||
chainName: chain.chainName, | ||
rpc: chain.endpoints?.rpc?.at(0)?.address, | ||
rest: chain.endpoints?.rest?.at(0)?.address, | ||
bip44: { | ||
coinType: Number(chain.coinType), | ||
}, | ||
coinType: Number(chain.coinType), | ||
bech32Config: { | ||
bech32PrefixAccAddr: chain.bech32Prefix, | ||
bech32PrefixAccPub: `${chain.bech32Prefix}pub`, | ||
bech32PrefixValAddr: `${chain.bech32Prefix}valoper`, | ||
bech32PrefixValPub: `${chain.bech32Prefix}valoperpub`, | ||
bech32PrefixConsAddr: `${chain.bech32Prefix}valcons`, | ||
bech32PrefixConsPub: `${chain.bech32Prefix}valconspub`, | ||
}, | ||
currencies: [ | ||
{ | ||
coinDenom: chain.assets[0].symbol, | ||
coinMinimalDenom: chain.assets[0].base, | ||
coinDecimals, | ||
coinGeckoId: chain.assets[0].coingecko_id || 'unknown', | ||
}, | ||
], | ||
feeCurrencies: [ | ||
{ | ||
coinDenom: chain.assets[0].symbol, | ||
coinMinimalDenom: chain.assets[0].base, | ||
coinDecimals, | ||
coinGeckoId: chain.assets[0].coingecko_id || 'unknown', | ||
gasPriceStep, | ||
}, | ||
], | ||
gasPriceStep, | ||
stakeCurrency: { | ||
coinDenom: chain.assets[0].symbol, | ||
coinMinimalDenom: chain.assets[0].base, | ||
coinDecimals, | ||
coinGeckoId: chain.assets[0].coingecko_id || 'unknown', | ||
}, | ||
features: chain.keplrFeatures || [], | ||
}, null, '\t') | ||
} | ||
function suggest() { | ||
// @ts-ignore | ||
if (window.unisat) { | ||
// @ts-ignore | ||
window.unisat.experimentalSuggestChain(JSON.parse(conf.value)).catch(e => { | ||
error.value = e | ||
}) | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="bg-base-100 p-4 rounded text-center"> | ||
<AdBanner id="keplr-banner-ad" unit="banner" width="970px" height="90px" /> | ||
<div class="flex"> | ||
<select v-model="selected" class="select select-bordered mx-5" @change="initParamsForKeplr"> | ||
<option v-for="c in dashboard.chains" :value="c"> | ||
{{ c.chainName }} | ||
</option> | ||
</select> | ||
<button class="btn !bg-yes !border-yes text-white px-10" @click="suggest">Add {{ selected.chainName }} TO Unisat Wallet</button> | ||
</div> | ||
<div class="text-main mt-5"> | ||
<textarea v-model="conf" class="textarea textarea-bordered w-full" rows="15"></textarea> | ||
</div> | ||
<div class="mt-4 mb-4"> | ||
If the chain is not offically support on Keplr, you can submit these parameters to enable Keplr. | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters