fix(@desktop/tokens): Compute deployment fees dynamically

Issue #13646
This commit is contained in:
Michal Iskierko 2024-02-21 16:59:55 +01:00 committed by Michał Iskierko
parent 2f0343f0e9
commit 211801afd3
2 changed files with 6 additions and 6 deletions

View File

@ -78,8 +78,8 @@ const asyncGetDeployFeesTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.
var feeTable: Table[int, SuggestedFeesDto] # fees for chain
let response = eth.suggestedFees(arg.chainId).result
feeTable[arg.chainId] = response.toSuggestedFeesDto()
let deployGas = if arg.tokenType == TokenType.ERC721: community_tokens.deployCollectiblesEstimate().result.getInt
else: community_tokens.deployAssetsEstimate().result.getInt
let deployGas = if arg.tokenType == TokenType.ERC721: community_tokens.deployCollectiblesEstimate(arg.chainId, arg.addressFrom).result.getInt
else: community_tokens.deployAssetsEstimate(arg.chainId, arg.addressFrom).result.getInt
gasTable[(arg.chainId, "")] = deployGas
arg.finish(%* {

View File

@ -84,12 +84,12 @@ proc remainingSupply*(chainId: int, contractAddress: string): RpcResponse[JsonNo
let payload = %* [chainId, contractAddress]
return core.callPrivateRPC("communitytokens_remainingSupply", payload)
proc deployCollectiblesEstimate*(): RpcResponse[JsonNode] =
let payload = %*[]
proc deployCollectiblesEstimate*(chainId: int, addressFrom: string): RpcResponse[JsonNode] =
let payload = %*[chainId, addressFrom]
return core.callPrivateRPC("communitytokens_deployCollectiblesEstimate", payload)
proc deployAssetsEstimate*(): RpcResponse[JsonNode] =
let payload = %*[]
proc deployAssetsEstimate*(chainId: int, addressFrom: string): RpcResponse[JsonNode] =
let payload = %*[chainId, addressFrom]
return core.callPrivateRPC("communitytokens_deployAssetsEstimate", payload)
proc remoteDestructedAmount*(chainId: int, contractAddress: string): RpcResponse[JsonNode] =