qosgroup / litewallet Goto Github PK
View Code? Open in Web Editor NEWWe are supported by JetBrains OS tools:
Home Page: https://www.jetbrains.com/?from=litewallet
License: MIT License
We are supported by JetBrains OS tools:
Home Page: https://www.jetbrains.com/?from=litewallet
License: MIT License
latest dapp link should be provided in the readme of the project, so everyone access the repo could download the dapps to make full use of it.
when i Import Erc20 token: "EOS",
"LitewalletEthGetErc20Account" interface reports error: "abi: cannot marshal in to go slice: offset"
error feedback from the chain with error decoding transaction after modifying the codec for transfer module x/bank
to locally repo. There is definitely something to do with this locally migration and more investigation is needed to take into.
We should add two buttons for a pending transaction: accelerate/cancel, then prompt the additional gas fee, and the possible failure in case of cancellation. This will make our life much more easier.
This article explains how it works: https://medium.com/@jgm.orinoco/releasing-stuck-ethereum-transactions-1390149f297d
The tendermint LCD function is just experimental not practical for use. It could be followed with this ticket:tendermint/tendermint#3335
getUnbonding返回所有解绑列表数组
Per request from FE, one new function should be provided with nonce
at latest block state under the specific account.
06-06 16:38:16.306 E/Go (27757): panic: runtime error: invalid memory address or nil pointer dereference
06-06 16:38:16.306 E/Go (27757): [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0xcae91e5c]
06-06 16:38:16.306 E/Go (27757):
06-06 16:38:16.306 E/Go (27757): goroutine 17 [running, locked to thread]:
06-06 16:38:16.306 E/GoLog (27757): panic: runtime error: invalid memory address or nil pointer dereference
06-06 16:38:16.306 E/GoLog (27757): [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0xcae91e5c]
06-06 16:38:16.306 E/Go (27757): github.com/QOSGroup/litewallet/litewallet/eth.TransferETH(0x99eb02d0, 0x49, 0x99c78300,
9a03e090, 0x2a, ...)
06-06 16:38:16.306 E/Go (27757): /Users/skydevin/go/src/github.com/QOSGroup/litewallet/litewallet/eth/transfer.go:30 +0
06-06 16:38:16.306 E/Go (27757): github.com/QOSGroup/litewallet/litewallet.EthTransferETH(0x99eb02d0, 0x49, 0x99c78300, 0
a03e090, 0x2a, ...)
06-06 16:38:16.307 E/Go (27757): /Users/skydevin/go/src/github.com/QOSGroup/litewallet/litewallet/cshare.go:319 +0x94
06-06 16:38:16.307 E/Go (27757): main.proxylitewallet__EthTransferETH(0xd040b2c0, 0x49, 0xd046d700, 0x3b, 0xd08e64f8, 0x1
06-06 16:38:16.307 E/Go (27757): /tmp/gomobile-work-901923068/src/gobind/go_litewalletmain.go:367 +0x180
06-06 16:38:16.307 E/Go (27757): main._cgoexpwrap_7acd3932b608_proxylitewallet__EthTransferETH(0xd040b2c0, 0x49, 0xd046d7
, 0xb9f2a0c0, 0x2a, ...)
06-06 16:38:16.307 E/Go (27757): _cgo_gotypes.go:590 +0xcc
When one single Tx with multi-coins is to be generated within an ITx in litewallet/slim pack for QOS transfer scenario.
The ParseCoins
method is not compatible with latest code.
Here is origin code from QOSGroup/qos
:
// Parse QOS and QSCs from string
// str example : 100qos,100qstar
func ParseCoins(str string) (btypes.BigInt, QSCs, error) {
if len(str) == 0 {
return btypes.ZeroInt(), QSCs{}, nil
}
reDnm := `[[:alpha:]][[:alnum:]]{2,15}`
reAmt := `[[:digit:]]+`
reSpc := `[[:space:]]*`
reCoin := regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)$`, reAmt, reSpc, reDnm))
arr := strings.Split(str, ",")
qos := btypes.ZeroInt()
qscs := QSCs{}
for _, q := range arr {
coin := reCoin.FindStringSubmatch(q)
if len(coin) != 3 {
return btypes.ZeroInt(), nil, fmt.Errorf("coins str: %s parse faild", q)
}
coin[2] = strings.TrimSpace(coin[2])
amount, err := strconv.ParseInt(strings.TrimSpace(coin[1]), 10, 64)
if err != nil {
return btypes.ZeroInt(), nil, err
}
if strings.ToLower(coin[2]) == "qos" {
qos = btypes.NewInt(amount)
} else {
qscs = append(qscs, &QSC{
coin[2],
btypes.NewInt(amount),
})
}
}
return qos, qscs, nil
}
The code in current patch is too old and need to be updated immediately!
#feat: ETH 2.0 access
The litewallet should take some step into the most advanced blockchains in the industry, e.g. the ETH 2.0 beacon chain.
There could be some beacon chain nodes available in Infura
or self established one.
Public apis should be exposed outside.
transfer token fail, tansfer 5 qos,the amount is 500,000,000,000,000 in https://etherscan.io/
Token Transfer:
Pending Transfer to 0x2ecfea7fa8826d080c8d1ce93098bcede7425318For 500,000,000,000,000 ERC-20 (QOS Token)
https://etherscan.io/tx/0x248bf85269ff06a246a253521dcf548d90ff45bc46f07467f0a29238c8616e53
It's not so complicated that to make the seed or the salt with an original plaintext password. However, this could make the wallet not so secured because fo the source code open to community. There could be some security threat underline. So there should be an approach to make the wallet more secured.
https://cosmos.bigdipper.live/proposals/14
The cosmos hub-3 upgrading is coming, a new branch corresponding to this is under development.
There could be high priority on it due its deadline.
重构当前广播交易模式以支持REST API接口 #QOSGroup/qmoon#122
当前:build -> sign -> send via RPC
Feat:build -> sign -> send via REST
litewallet所做的是前两步build -> sign,前端集成HTTP API接口调用将签名的交易广播出去。类似的功能在后台充值提现中有实现https://github.com/cosmos/cosmos-sdk/commit/b1dce76c9684e3b6d0c7030157bb0cb5ff3be9b9
剩余delegate,unbondingdelegation,withdraw与前述版本一致;
新增redelegate, .etc
The new function collaboration with @zhangwen9229 , to generate a Tnx to send to tendermint full node.
According to FE design, the input of gasFee is consisting of gasPrice * gasLimit, to make the SDK and FE more feasible!
Transaction gas price is too low. There is another transaction with same nonce in the queue. Try increasing the gas price or incrementing the nonce.
It is an enhancement for current querying process for the detailed Tnx, this feature is initiated from Frontend user with receipt.
Currently, this part is resolved from block data via Qmoon. We think there is some trade-off here.
New interface should be designed here to query Tnx with tags from cosmos networks.
From next phase on, lite wallet will be fully supporting QOS chain on latest version and so on.
litewallet/litewallet/eth/transfer.go
Line 147 in 230742a
It is OK for value less than 1 which is meant for FE implementation for fraction value of erc20 tokens.
However, for the value greater than 1, this is not the case. Need to be reviewed with code and more specific testing.
As litewallet SDK itself, specific function on round robin selection is to be designed.
The draft code could be followed as below pattern if no further endurance:
node discovery with round-robin algorithm
var i = 0
var servers = []string{"127.0.0.1:8000", "127.0.0.1:8001", "127.0.0.1:8003"}
// Balance returns one of the servers based using round-robin algorithm
func Balance() string {
server := servers[i]
i++
// it means that we reached the end of servers
// and we need to reset the counter and start
// from the beginning
if i >= len(servers) {
i = 0
}
return server
}
func main() {
// requests loop
for i := 0; i < 20; i++ {
fmt.Println(Balance())
}
}
To collaborate with the enhancement for the comming #2 , some SDK code should be added to support the splitting including below parts:
sdksource
, besides Tnx Transfer
,Delegate
UnbondingDelegation
WithdrawRewards
slim
for QOS part,Transfer
It is weird that cosmos core team decided to create internal
package under the x/bank
module. It makes the reconstruction over cosmos v0.35.0
difficult due to the reason internal package not allowed to use
with Golang importing policy.
Some local code migration have been done into the branch dev-cosmosv35.0
, however, there are still consequences as what the internal package use has brought.
One issue was raised to the cosmos community, resulting in some brief feedback following closure. use of internal package github.com/cosmos/cosmos-sdk/x/bank/internal/types not allowed
I have no idea about why they do in this way.
However, the reconstruction should be continued with more efforts from our side:
This could be fixed only under the litewallet repo with local efforts.
以太币第一次转账奔溃,resource temporarily unavailable
Due to the cosmoshub-3 upgrading plan on 15th Sep., a testnet should be established for testing below:
导入钱包两次,第一次导入24单词成功,第二次12单词出错,resource temporarily unavailable
For the diversity of the wallet application in around the world, there are some requirements on the diversity of the mnemonic language, here are the lists:
与#2 类似的需求,查询状态的新增HTTP REST API接口,移动端前端集成,SDK部分维护原始的RPC方式
请提供一键取回该delegator下所有分红接口
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.