-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS-7967 Enenrgy WEB EVM/X #854
Changes from 7 commits
1bb3c98
32a4207
0401f56
b29092e
5f9c31f
5278b2c
f6e50c2
3351b53
ff720ea
bbc875c
40d75e3
44a9742
5f203b3
249a5b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// EnergyWebXExternalLinkProvider.swift | ||
// BlockchainSdk | ||
// | ||
// Created by Aleksei Muraveinik on 28.9.24.. | ||
// Copyright © 2024 Tangem AG. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct EnergyWebXExternalLinkProvider { | ||
private let baseExplorerUrl: String | ||
|
||
init(isTestnet: Bool) { | ||
baseExplorerUrl = isTestnet | ||
? "https://energywebx-testnet.subscan.io" | ||
: "https://energywebx.subscan.io" | ||
} | ||
} | ||
|
||
extension EnergyWebXExternalLinkProvider: ExternalLinkProvider { | ||
var testnetFaucetURL: URL? { | ||
nil | ||
} | ||
|
||
func url(address: String, contractAddress: String?) -> URL? { | ||
URL(string: "\(baseExplorerUrl)/account/\(address)") | ||
} | ||
|
||
func url(transaction hash: String) -> URL? { | ||
URL(string: "\(baseExplorerUrl)/extrinsic/\(hash)") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ private extension EthereumTarget { | |
return AnyEncodable([AnyEncodable(params), AnyEncodable("latest")]) | ||
case .feeHistory: | ||
// Get fee history for 5 blocks (around a minute) with 25,50,75 percentiles (selected empirically) | ||
return AnyEncodable([AnyEncodable(5), AnyEncodable("latest"), AnyEncodable([25,50,75])]) | ||
return AnyEncodable([AnyEncodable("0x5"), AnyEncodable("latest"), AnyEncodable([25,50,75])]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Пришлось тут добавить так, потому что у меня запрос фи хистори для EWC падал 🟠 12:17:45:563: Response: https://energy-web-chain.rpc.thirdweb.com/ {
"jsonrpc": "2.0",
"error": {
"message": "Invalid params: invalid type: integer 5, expected a 0x-prefixed hex string with length between (0; 64].",
"code": -32602
},
"id": 25
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Откатил. По видимому разные сети по разному обрабатывают. @tureck1y Вроде нам же этот запрос не нужен здесь, т.к. можно пренебречь что он будет падать для EWC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. да, допиши плиз этот коммент напротив тоггла eip1559 у этой сети. Что в целом присылает нули и вот этот момент с энкодингом |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// EnergyWebChainExternalLinkProvider.swift | ||
// BlockchainSdk | ||
// | ||
// Created by Aleksei Muraveinik on 28.9.24.. | ||
// Copyright © 2024 Tangem AG. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct EnergyWebChainExternalLinkProvider { | ||
private let baseExplorerUrl: String | ||
|
||
init(isTestnet: Bool) { | ||
baseExplorerUrl = isTestnet | ||
? "https://volta-explorer.energyweb.org" | ||
: "https://explorer.energyweb.org" | ||
} | ||
} | ||
|
||
extension EnergyWebChainExternalLinkProvider: ExternalLinkProvider { | ||
var testnetFaucetURL: URL? { | ||
URL(string: "https://voltafaucet.energyweb.org") | ||
} | ||
|
||
func url(address: String, contractAddress: String?) -> URL? { | ||
URL(string: "\(baseExplorerUrl)/address/\(address)") | ||
} | ||
|
||
func url(transaction hash: String) -> URL? { | ||
URL(string: "\(baseExplorerUrl)/tx/\(hash)") | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ class PolkadotTransactionBuilder { | |
*/ | ||
private var balanceTransferCallIndex: Data { | ||
switch network { | ||
case .polkadot, .azero, .joystream, .bittensor: | ||
case .polkadot, .azero, .joystream, .bittensor, .energyWebX: // TODO: [Energy Web X] Questionable | ||
return Data(hexString: "0x0500") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. для joystream и bittensor просто брал польковскую, экспериментальным путем проверялось, если транзакции ходят - все ок There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. По идее у всех парачейнов польки будет это значение There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. нужно попробовать отправить транзакцию обязательно |
||
case .kusama: | ||
return Data(hexString: "0x0400") | ||
|
@@ -126,7 +126,7 @@ class PolkadotTransactionBuilder { | |
return specVersion < 28 | ||
case .kusama: | ||
return specVersion < 2028 | ||
case .westend, .azero, .bittensor: | ||
case .westend, .azero, .bittensor, .energyWebX: // TODO: [Energy Web X] Questionable | ||
return false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. тут тоже экспериментальным путем подбиралось значение There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. допиши плиз в код комменты про экспериментальный подбор тут и в других аналогичных местах |
||
case .joystream: | ||
// specVersion at the moment of initial implementation is '2003' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ struct SubstrateRuntimeVersionProvider { | |
// 198 is from the first user report | ||
return meta.specVersion >= 198 ? .v15 : .v14 | ||
case .azero, | ||
.joystream: | ||
.joystream, | ||
.energyWebX: // TODO: [Energy Web X] Questionable | ||
return .v14 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. тут мы обновляли через баг, потому что непонятно, опять же отправить транзакцию нужно, с неправильным спеком не пройдет There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ставим тут v15? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Оставил 14, транзакция ушла |
||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в целом у нас в приле это сейчас не поддерживается, запланируем выпил