add e-money, bigsong tauri.conf

This commit is contained in:
liangping 2021-10-11 15:10:29 +08:00
parent be26d29cad
commit 170a53f5e4
33 changed files with 13242 additions and 9668 deletions

View File

@ -93,7 +93,7 @@
"eslint-plugin-vue": "6.2.2", "eslint-plugin-vue": "6.2.2",
"sass": "1.32.*", "sass": "1.32.*",
"sass-loader": "^10.1.0", "sass-loader": "^10.1.0",
"vue-cli-plugin-tauri": "~1.0.0-beta.3", "vue-cli-plugin-tauri": "~1.0.0-beta.6",
"vue-template-compiler": "2.x" "vue-template-compiler": "2.x"
} }
} }

4
src-tauri/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
WixTools

3773
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

25
src-tauri/Cargo.toml Normal file
View File

@ -0,0 +1,25 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
build = "src/build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.0.0-beta.1" }
# miner = { git="https://github.com/olsf/libra", version="0.1.0" }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-beta.2", features = ["api-all", "menu", "system-tray"] }
[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
src-tauri/icons/icon.icns Normal file

Binary file not shown.

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

14
src-tauri/rustfmt.toml Normal file
View File

@ -0,0 +1,14 @@
max_width = 100
hard_tabs = false
tab_spaces = 2
newline_style = "Auto"
use_small_heuristics = "Default"
reorder_imports = true
reorder_modules = true
remove_nested_parens = true
edition = "2018"
merge_derives = true
use_try_shorthand = false
use_field_init_shorthand = false
force_explicit_abi = true
imports_granularity = "Crate"

3
src-tauri/src/build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

29
src-tauri/src/main.rs Normal file
View File

@ -0,0 +1,29 @@
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use tauri::{CustomMenuItem, SystemTray, SystemTrayMenu, SystemTrayMenuItem, MenuItem};
#[tauri::command]
fn my_custom_command(msg: String) -> String {
println!("I was invoked from JS! {}", msg);
return "Hello from Rust".into()
}
fn main() {
// here `"quit".to_string()` defines the menu item id, and the second parameter is the menu item label.
let quit = CustomMenuItem::new("quit".to_string(), "Quit");
let hide = CustomMenuItem::new("hide".to_string(), "Hide");
let tray_menu = SystemTrayMenu::new()
.add_item(quit)
.add_native_item(SystemTrayMenuItem::Separator)
.add_item(hide);
let tray = SystemTray::new().with_menu(tray_menu);
tauri::Builder::default()
.system_tray(tray)
// This is where you pass in your commands
.invoke_handler(tauri::generate_handler![my_custom_command])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

70
src-tauri/tauri.conf.json Normal file
View File

@ -0,0 +1,70 @@
{
"package": {
"productName": "Ping-Wallet",
"version": "0.1.0"
},
"build": {
"distDir": "Set automatically by Vue CLI plugin",
"devPath": "Set automatically by Vue CLI plugin",
"beforeDevCommand": "",
"beforeBuildCommand": "",
"withGlobalTauri": true
},
"tauri": {
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.tauri.dev",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "DeveloperTool",
"shortDescription": "",
"longDescription": "",
"deb": {
"depends": [],
"useBootstrapper": false
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false,
"exceptionDomain": "",
"signingIdentity": null,
"entitlements": null
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"updater": {
"active": false
},
"allowlist": {
"all": true
},
"windows": [
{
"title": "Ping Wallet",
"width": 1024,
"height": 768,
"resizable": true
}
],
"systemTray": {
"iconPath": "icons/icon.png"
},
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}
}
}

View File

@ -20,6 +20,8 @@
"sentinel": "Sentinel", "sentinel": "Sentinel",
"sifchain": "Sifchain", "sifchain": "Sifchain",
"starname": "Starname", "starname": "Starname",
"bitsong": "BitSong",
"emoney": "E-Money",
"staking": "Staking", "staking": "Staking",
"governance": "Governance", "governance": "Governance",

View File

@ -1,32 +0,0 @@
import {
makeAuthInfoBytes, makeSignDoc, Registry,
// makeSignBytes,
} from '@cosmjs/proto-signing'
export default class Client {
async signDirect(signerAddress, messages, fee, memo, { accountNumber, sequence, chainId }) {
// const accountFromSigner = (await this.signer.getAccounts()).find(account => account.address === signerAddress)
// if (!accountFromSigner) {
// throw new Error('Failed to retrieve account from signer')
// }
const pubkey = ''
const txBodyEncodeObject = {
typeUrl: '/cosmos.tx.v1beta1.TxBody',
value: {
messages,
memo,
},
}
const txBodyBytes = new Registry().encode(txBodyEncodeObject)
const gasLimit = 1
const authInfoBytes = makeAuthInfoBytes([pubkey], fee.amount, gasLimit, sequence)
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber)
const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc)
return tx_4.TxRaw.fromPartial({
bodyBytes: signed.bodyBytes,
authInfoBytes: signed.authInfoBytes,
signatures: [encoding_1.fromBase64(signature.signature)],
})
}
}

View File

@ -20,6 +20,7 @@ const modules = [
scope: 'normal', scope: 'normal',
title: 'governance', title: 'governance',
route: 'governance', route: 'governance',
exclude: 'emoney',
}, },
{ {
scope: 'normal', scope: 'normal',
@ -54,14 +55,17 @@ function processMenu() {
title: chain, title: chain,
icon: store.state.chains.config[chain].logo, icon: store.state.chains.config[chain].logo,
} }
const { excludes } = store.state.chains.config[chain]
const children = [] const children = []
modules.forEach(m => { modules.forEach(m => {
if (m.scope.match('normal') || m.scope.match(chain)) { if (excludes === undefined || excludes.indexOf(m.route) === -1) {
children.push({ if (m.scope.match('normal') || m.scope.match(chain)) {
children.push({
// header: `item-${chain}-${m.route}`, // header: `item-${chain}-${m.route}`,
title: m.title, title: m.title,
route: { name: m.route, params: { chain } }, route: { name: m.route, params: { chain } },
}) })
}
} }
}) })
menu.children = children menu.children = children

View File

@ -0,0 +1,7 @@
{
"chain_name": "bitsong",
"api": "https://lcd.explorebitsong.com",
"addr_prefix": "bitsong",
"logo": "https://dl.airtable.com/.attachments/8016b71b69fb108f0ff33eb9af1c943f/f5fe4ef4/bitsong.svg",
"sdk_version": "0.39.2"
}

View File

@ -0,0 +1,8 @@
{
"chain_name": "e-money",
"api": "https://emoney.validator.network/api",
"addr_prefix": "emoney",
"logo": "https://dl.airtable.com/.attachments/276e4d6de567b073a5e400240d7d83e9/9bb49806/yoR2r25W_400x400.jpg",
"sdk_version": "0.42.10",
"excludes": "mint governance"
}

View File

@ -3,5 +3,6 @@
"api": "https://iris.api.ping.pub", "api": "https://iris.api.ping.pub",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"addr_prefix": "iaa", "addr_prefix": "iaa",
"excludes": "mint",
"logo": "https://dl.airtable.com/.attachments/2d6d51b1b262db00ecc51616ffc3bdf5/90ff00d0/IRISnet.svg" "logo": "https://dl.airtable.com/.attachments/2d6d51b1b262db00ecc51616ffc3bdf5/90ff00d0/IRISnet.svg"
} }

View File

@ -41,7 +41,7 @@
<summary-parmeters-component :data="staking" /> <summary-parmeters-component :data="staking" />
</b-col> </b-col>
</b-row> </b-row>
<b-row> <b-row v-if="gov.items.length > 0">
<b-col> <b-col>
<summary-parmeters-component :data="gov" /> <summary-parmeters-component :data="gov" />
</b-col> </b-col>
@ -159,11 +159,6 @@ export default {
this.marketData = res this.marketData = res
}) })
this.$http.getMintingInflation().then(res => {
const chainIndex = this.chain.items.findIndex(x => x.subtitle === 'inflation')
this.$set(this.chain.items[chainIndex], 'title', `${percent(res)}%`)
})
this.$http.getStakingParameters().then(res => { this.$http.getStakingParameters().then(res => {
this.staking = this.normalize(res, 'Staking Parameters') this.staking = this.normalize(res, 'Staking Parameters')
Promise.all([this.$http.getStakingPool(), this.$http.getBankTotal(res.bond_denom)]) Promise.all([this.$http.getStakingPool(), this.$http.getBankTotal(res.bond_denom)])
@ -178,10 +173,14 @@ export default {
this.slasing = this.normalize(res, 'Slashing Parameters') this.slasing = this.normalize(res, 'Slashing Parameters')
}) })
const selected = this.$route.params.chain const conf = this.$http.getSelectedConfig()
if (selected === 'iris') { if (conf.excludes && conf.excludes.indexOf('mint') > -1) {
this.mint = null this.mint = null
} else { } else {
this.$http.getMintingInflation().then(res => {
const chainIndex = this.chain.items.findIndex(x => x.subtitle === 'inflation')
this.$set(this.chain.items[chainIndex], 'title', `${percent(res)}%`)
})
this.$http.getMintParameters().then(res => { this.$http.getMintParameters().then(res => {
this.mint = this.normalize(res, 'Minting Parameters') this.mint = this.normalize(res, 'Minting Parameters')
}) })
@ -190,19 +189,23 @@ export default {
this.$http.getDistributionParameters().then(res => { this.$http.getDistributionParameters().then(res => {
this.distribution = this.normalize(res, 'Distribution Parameters') this.distribution = this.normalize(res, 'Distribution Parameters')
}) })
Promise.all([ if (conf.excludes && conf.excludes.indexOf('governance') > -1) {
this.$http.getGovernanceParameterDeposit(), this.gov.items = []
this.$http.getGovernanceParameterTallying(), } else {
this.$http.getGovernanceParameterVoting(), Promise.all([
]).then(data => { this.$http.getGovernanceParameterDeposit(),
let items = [] this.$http.getGovernanceParameterTallying(),
data.forEach(item => { this.$http.getGovernanceParameterVoting(),
const values = this.normalize(item, '').items ]).then(data => {
items = items.concat(values) let items = []
data.forEach(item => {
const values = this.normalize(item, '').items
items = items.concat(values)
})
this.gov.items = items
this.$set(this.gov, 'items', items)
}) })
this.gov.items = items }
this.$set(this.gov, 'items', items)
})
}, },
methods: { methods: {
normalize(data, title) { normalize(data, title) {

View File

@ -411,7 +411,7 @@ export default {
labels: Object.keys(total.value), labels: Object.keys(total.value),
datasets: [ datasets: [
{ {
label: 'Value', label: 'Market Cap',
data: Object.values(total.value), data: Object.values(total.value),
backgroundColor: chartColors(), backgroundColor: chartColors(),
borderWidth: 0, borderWidth: 0,

18881
yarn.lock

File diff suppressed because it is too large Load Diff