Skip to content

Commit

Permalink
Merge pull request #76 from leo42/ProductionPrep
Browse files Browse the repository at this point in the history
Set default network to mainnet
  • Loading branch information
leo42 authored Dec 21, 2023
2 parents ecbd92f + fd5cecb commit ea1e8c0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
13 changes: 12 additions & 1 deletion Fe/src/components/PoolElement.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

}
2 changes: 1 addition & 1 deletion Fe/src/components/SettingsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function SettingsModal(props) {
function resetSettings(){
setProvider("MWallet")
setMetadataProvider("Blockfrost")
networkChange("Preprod")
networkChange("Mainnet")

}

Expand Down
2 changes: 1 addition & 1 deletion Fe/src/components/TransactionHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<div className="transactionHistoryItem">
<a href={`${urlPrefix}${transaction.tx_hash}`} target="_blank"> {transaction.tx_hash}<br/></a>
Expand Down
7 changes: 4 additions & 3 deletions Fe/src/components/WalletDelegation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function WalletDelegation(props) {
}
SearchPools(pool).then( (pools) => {
setSearching(false);

setPools(pools);
})
}, [pool, wallet])
Expand All @@ -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 => {
Expand Down Expand Up @@ -127,8 +128,8 @@ function WalletDelegation(props) {
</label>
{searching ? searchingAnimation() : pools.map( (pool) => (
<div key={pool}>
<PoolElement key={pool.pool_id_bech32} root={props.root} poolId={pool.pool_id_bech32} />
{pools.length !== 1 && <button type="button" className='commonBtn' onClick={() => setPool(pool.pool_id_bech32)}>Select</button>}
<PoolElement key={pool} root={props.root} poolId={pool} />
{pools.length !== 1 && <button type="button" className='commonBtn' onClick={() => setPool(pool)}>Select</button>}
<br/>
</div>
)
Expand Down
12 changes: 9 additions & 3 deletions Fe/src/helpers/SearchPools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
})

Expand All @@ -23,6 +25,7 @@ async function SearchPools(string){
method: "GET",
headers: {
"Content-Type": "application/json",
"authorization" : " Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyIjoic3Rha2UxdTk4cGp2eDduYTRmZDRoZzJtbTk1c2RycTZ6czk5NHduaGR2bGVtemR3ajRuOWNqMnd1bmEiLCJleHAiOjE3MzQ3MDM1MzAsInRpZXIiOjEsInByb2pJRCI6Im5SNXhkbWJrQlRUR3ZQN3gifQ.VAPc1HyKwiClRB0E9Sn5tjc2Im2g1p1hNSp1mxdbPHE",
}
})

Expand All @@ -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]
}

}

Expand Down
6 changes: 3 additions & 3 deletions Fe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ea1e8c0

Please sign in to comment.