From 8d54ec9ca44184c79f0206d05a70784c2af51a53 Mon Sep 17 00:00:00 2001 From: leo42 Date: Thu, 21 Dec 2023 15:30:17 +0200 Subject: [PATCH 1/4] Set default network to mainnet --- Fe/src/components/SettingsModal.js | 2 +- Fe/src/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Fe/src/components/SettingsModal.js b/Fe/src/components/SettingsModal.js index 46d7163..45fc881 100644 --- a/Fe/src/components/SettingsModal.js +++ b/Fe/src/components/SettingsModal.js @@ -44,7 +44,7 @@ function SettingsModal(props) { function resetSettings(){ setProvider("MWallet") setMetadataProvider("Blockfrost") - networkChange("Preprod") + networkChange("Mainnet") } diff --git a/Fe/src/index.js b/Fe/src/index.js index 8eec123..c1199ea 100644 --- a/Fe/src/index.js +++ b/Fe/src/index.js @@ -19,12 +19,12 @@ class App extends React.Component { module : "", settings: { metadataProvider :"Blockfrost", sendAll: false, - network: "Preprod", - explorer: "https://preprod.cardanoscan.io/" , + network: "Mainnet", + explorer: "https://cardanoscan.io/" , provider: "Blockfrost" , disableSync: false, termsAccepted: "NotAccepted", - api : {"url": "https://passthrough.broclan.io" , "projectId": "preprod"} + api : {"url": "https://passthrough.broclan.io" , "projectId": "mainnet"} }, mode: "darkMode", syncService: "https://sync.broclan.io", From 56d9f89e48cd4e5b0287b014b85134c2b61be1b9 Mon Sep 17 00:00:00 2001 From: leo42 Date: Thu, 21 Dec 2023 15:35:59 +0200 Subject: [PATCH 2/4] Fix broken link for mainnet --- Fe/src/components/TransactionHistory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fe/src/components/TransactionHistory.js b/Fe/src/components/TransactionHistory.js index 423d074..103e40b 100644 --- a/Fe/src/components/TransactionHistory.js +++ b/Fe/src/components/TransactionHistory.js @@ -68,7 +68,7 @@ function TransactionHistory (props) { } function TransactionListing(transaction){ - const urlPrefix = props.root.state.settings.network === "mainet" ? "https://cexplorer.io/tx/" : `https://${props.root.state.settings.network}.cexplorer.io/tx/` + const urlPrefix = props.root.state.settings.network === "Mainnet" ? "https://cexplorer.io/tx/" : `https://${props.root.state.settings.network}.cexplorer.io/tx/` const date = new Date(transaction.block_time* 1000) return (
{transaction.tx_hash}
From c5cb66b3bddd1391e06bc25ae5cc9d1101479ebe Mon Sep 17 00:00:00 2001 From: leo42 Date: Thu, 21 Dec 2023 16:27:57 +0200 Subject: [PATCH 3/4] Fixed pool searching --- Fe/src/components/PoolElement.css | 13 ++++++++++++- Fe/src/components/PoolElement.js | 2 +- Fe/src/components/WalletDelegation.js | 7 ++++--- Fe/src/helpers/SearchPools.js | 12 +++++++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Fe/src/components/PoolElement.css b/Fe/src/components/PoolElement.css index 61e2245..29c4671 100644 --- a/Fe/src/components/PoolElement.css +++ b/Fe/src/components/PoolElement.css @@ -19,6 +19,16 @@ } +.PoolElementAtributionText{ + display: flex; + flex-direction: row; + font-size: 12px; + color: #F48037; + align-items: center; + margin: 0; + padding: 0; + margin-left: 10px; +} .PoolElement { display: flex; flex-direction: row; @@ -71,7 +81,8 @@ .PoolElementAtributionImg{ width: 80px; height: 20px; + background-color: rgba(255, 255, 255, 0.747); + border-radius: 10px; z-index: 100; cursor: pointer; - } \ No newline at end of file diff --git a/Fe/src/components/PoolElement.js b/Fe/src/components/PoolElement.js index d577bb2..c577950 100644 --- a/Fe/src/components/PoolElement.js +++ b/Fe/src/components/PoolElement.js @@ -16,7 +16,7 @@ function handleClick(e) { window.open(`https://${urlPrefix}cexplorer.io/pool/${props.poolId}`, '_blank'); } - if (PoolInfo === undefined ) return (
Pool Not found
) + if (PoolInfo === undefined ) return (
{JSON.stringify(props.poolId)}Pool Not found
) const networkPrefix = props.root.state.settings.network === "Mainnet" ? "" : props.root.state.settings.network.toLowerCase() + "." return ( diff --git a/Fe/src/components/WalletDelegation.js b/Fe/src/components/WalletDelegation.js index f09f935..ec019e6 100644 --- a/Fe/src/components/WalletDelegation.js +++ b/Fe/src/components/WalletDelegation.js @@ -33,6 +33,7 @@ function WalletDelegation(props) { } SearchPools(pool).then( (pools) => { setSearching(false); + setPools(pools); }) }, [pool, wallet]) @@ -53,7 +54,7 @@ function WalletDelegation(props) { item ? wallet.getSigners()[index].hash : "" ) - props.moduleRoot.createDelegationTx(pools[0].pool_id_bech32, txSigners.filter((element, index) => signers[index])); + props.moduleRoot.createDelegationTx(pools[0], txSigners.filter((element, index) => signers[index])); } const Undelegate = event => { @@ -127,8 +128,8 @@ function WalletDelegation(props) { {searching ? searchingAnimation() : pools.map( (pool) => (
- - {pools.length !== 1 && } + + {pools.length !== 1 && }
) diff --git a/Fe/src/helpers/SearchPools.js b/Fe/src/helpers/SearchPools.js index dd737a7..cc5ece9 100644 --- a/Fe/src/helpers/SearchPools.js +++ b/Fe/src/helpers/SearchPools.js @@ -8,12 +8,14 @@ async function SearchPools(string){ // } const api = settings.network === "Mainnet" ? "https://api.koios.rest/api/v0/pool_list" : `https://${settings.network}.koios.rest/api/v0/pool_list` + try{ const responseTicker = await fetch( `${api}?ticker=like.${string}*`, { method: "GET", headers: { - "Content-Type": "application/json", + "accept": "application/json", + "authorization" : " Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyIjoic3Rha2UxdTk4cGp2eDduYTRmZDRoZzJtbTk1c2RycTZ6czk5NHduaGR2bGVtemR3ajRuOWNqMnd1bmEiLCJleHAiOjE3MzQ3MDM1MzAsInRpZXIiOjEsInByb2pJRCI6Im5SNXhkbWJrQlRUR3ZQN3gifQ.VAPc1HyKwiClRB0E9Sn5tjc2Im2g1p1hNSp1mxdbPHE", } }) @@ -23,6 +25,7 @@ async function SearchPools(string){ method: "GET", headers: { "Content-Type": "application/json", + "authorization" : " Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyIjoic3Rha2UxdTk4cGp2eDduYTRmZDRoZzJtbTk1c2RycTZ6czk5NHduaGR2bGVtemR3ajRuOWNqMnd1bmEiLCJleHAiOjE3MzQ3MDM1MzAsInRpZXIiOjEsInByb2pJRCI6Im5SNXhkbWJrQlRUR3ZQN3gifQ.VAPc1HyKwiClRB0E9Sn5tjc2Im2g1p1hNSp1mxdbPHE", } }) @@ -31,8 +34,11 @@ async function SearchPools(string){ const data2 = await responseId.json() //return sublist of data that matches string size 10 - return (data.length !== 0 ? data : data2).slice(0,10) - + return (data.length !== 0 ? data : data2).slice(0,10).map( pool => pool.pool_id_bech32) + } catch(e){ + console.log(e) + return [string] + } } From fd5cecb07cabd9c3517fd7d4bfc9d26187ea933e Mon Sep 17 00:00:00 2001 From: leo42 Date: Thu, 21 Dec 2023 16:36:36 +0200 Subject: [PATCH 4/4] remove unececery data --- Fe/src/components/PoolElement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fe/src/components/PoolElement.js b/Fe/src/components/PoolElement.js index c577950..d577bb2 100644 --- a/Fe/src/components/PoolElement.js +++ b/Fe/src/components/PoolElement.js @@ -16,7 +16,7 @@ function handleClick(e) { window.open(`https://${urlPrefix}cexplorer.io/pool/${props.poolId}`, '_blank'); } - if (PoolInfo === undefined ) return (
{JSON.stringify(props.poolId)}Pool Not found
) + if (PoolInfo === undefined ) return (
Pool Not found
) const networkPrefix = props.root.state.settings.network === "Mainnet" ? "" : props.root.state.settings.network.toLowerCase() + "." return (