feat: use new pending transfer API
This commit is contained in:
parent
7d56e66a86
commit
3a042a4a09
|
@ -149,7 +149,7 @@ QtObject:
|
|||
if (pendingTransactions != ""):
|
||||
for trx in pendingTransactions.parseJson["result"].getElems():
|
||||
if trx["type"].getStr == $PendingTransactionType.BuyStickerPack:
|
||||
pendingStickerPacks.incl(trx["data"].getStr.parseInt)
|
||||
pendingStickerPacks.incl(trx["additionalData"].getStr.parseInt)
|
||||
|
||||
for stickerPack in availableStickers:
|
||||
let isInstalled = installedStickerPacks.hasKey(stickerPack.id)
|
||||
|
|
|
@ -113,8 +113,8 @@ QtObject:
|
|||
return
|
||||
for trx in pendingTransactions.parseJson["result"].getElems():
|
||||
if trx["type"].getStr == $PendingTransactionType.RegisterENS:
|
||||
self.usernames.add trx["data"].getStr
|
||||
self.pendingUsernames.incl trx["data"].getStr
|
||||
self.usernames.add trx["additionalData"].getStr
|
||||
self.pendingUsernames.incl trx["additionalData"].getStr
|
||||
|
||||
|
||||
proc ensWasResolved*(self: EnsManager, ensResult: string) {.signal.}
|
||||
|
|
|
@ -95,8 +95,7 @@ proc hex2Token*(input: string, decimals: int): string =
|
|||
if(r > 0): result = fmt"{result}.{d}"
|
||||
|
||||
proc trackPendingTransaction*(transactionHash: string, fromAddress: string, toAddress: string, trxType: PendingTransactionType, data: string) =
|
||||
let blockNumber = parseInt($fromHex(Stuint[256], getBlockByNumber("latest").parseJson()["result"]["number"].getStr))
|
||||
let payload = %* [{"transactionHash": transactionHash, "blockNumber": blockNumber, "from_address": fromAddress, "to_address": toAddress, "type": $trxType, "data": data}]
|
||||
let payload = %* [{"transactionHash": transactionHash, "from": fromAddress, "to": toAddress, "type": $trxType, "additionalData": data, "data": "", "value": 0, "timestamp": 0, "gasPrice": 0, "gasLimit": 0}]
|
||||
discard callPrivateRPC("wallet_storePendingTransaction", payload)
|
||||
|
||||
proc getPendingTransactions*(): string =
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit fd49876a475d6366c1d915933048f1f916f78b70
|
||||
Subproject commit dde0331ed55a66f8824a94d9d37b40a5ca70693d
|
Loading…
Reference in New Issue