trustwallet / trustsdk-ios Goto Github PK
View Code? Open in Web Editor NEWNo longer maintained. https://community.trustwallet.com/t/trustsdk-is-discontinued/213116
License: MIT License
No longer maintained. https://community.trustwallet.com/t/trustsdk-is-discontinued/213116
License: MIT License
Hi.... thanks for making this library...
In the example project, I get the following compile errors:
/TrustSDK-iOS/Sources/TrustSDK/Commands/SignTransactionCommand.swift:15:29: Use of undeclared type 'EthereumTransaction'
/TrustSDK-iOS/Sources/TrustSDK/Commands/SignTransactionCommand.swift:30:30: Use of undeclared type 'EthereumTransaction'
/TrustSDK-iOS/Sources/TrustSDK/Commands/SignTransactionCommand.swift:78:48: Use of undeclared type 'EthereumTransaction'
/TrustSDK-iOS/Sources/TrustSDK/ObjCWrapper/TrustSDKObjC.swift:27:27: Use of unresolved identifier 'EthereumTransaction'
/TrustSDK-iOS/Sources/TrustSDK/ObjCWrapper/TrustSDKObjC.swift:31:17: Use of unresolved identifier 'EthereumAddress'
/TrustSDK-iOS/Sources/TrustSDK/ObjCWrapper/TrustSDKObjC.swift:48:65: Use of unresolved identifier 'EthereumAddress'
The same thing works fine with TrustWalletCore
The DApp browser has been removed from the iOS version of Trust Wallet, so I went through all the steps to connect to pancakeswap on safari web browser to my trust wallet, but when I swap tokens on exchange.pancakeswap.finance it takes me back to my trust wallet to confirm the transaction, but there’s no option it gives me to confirm the transaction, it just takes me to my trust wallet main page. Please help.
Thank you.
Does trust adopt single sign on technology?
Good afternoon.
I've tried to verify the signature, but, unfortunately, I couldn't do that (I get 'false').
Signature created by: Trust.signMessage()
I've used this approach for verifying:
let hash = Crypto.hash(messageData)
let isValid = Crypto.verify(signature: signed, message: hash, publicKey: myWalletAddress.data(using: .utf8)!)
And two more things:
Hello!
Trying to sign eth contract method call with TrustSDK/WalletCore, then try to sign this data with sdk_sign
URL Scheme. TrustWallet responds with the sign_error
. Any example of how we can sign a contract call correctly?
let signerInput = EthereumSigningInput.with {
$0.toAddress = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
$0.chainID = BigInt("1").serialize()!
$0.nonce = BigInt("477").serialize()!
$0.gasPrice = BigInt("2112000000").serialize()!
$0.gasLimit = BigInt("21000").serialize()!
$0.privateKey = wallet.getKeyForCoin(coin: .ethereum).data
$0.transaction = EthereumTransaction.with {
$0.contractGeneric = EthereumTransaction.ContractGeneric.with {
$0.data = Data(hexString:"ad5c4648")!
$0.amount = BigInt("0").serialize()!
}
}
}
If we use erc20 transfer – it's all ok, but no success with ContractGeneric.
I am using TrustWalletCore(wallet-core) instead of TrustCore(trust-core) in TrustSDK-iOS
In TrustCore use EthereumTransaction for Transaction.
In TrustWalletCore I use EthereumSigner for Transaction.
Following is my code
TrustSDKObjC.swift
@objc
public func signTransaction(_ gasPrice: String, _ gasLimit: UInt64, _ address: String, amount: String, success: @escaping (Data) -> Void, failure: @escaping (NSError) -> Void) {
/*
let transaction = EthereumTransaction(
nonce: 0,
gasPrice: BigInt(gasPrice)!,
gasLimit: BigInt(gasLimit),
to: EthereumAddress(string: address)!,
amount: BigInt(amount)!,
payload: .none
)
*/
let transaction = EthereumSigner (
gasPrice: gasPrice.data(using: .utf8)!,
gasLimit: gasLimit,
to: EthereumAddress(string: address)!,
amount: amount.data(using: .utf8)!,
payload: .none
)
signTransaction(transaction) { result in
switch result {
case .success(let signedMesssage):
success(signedMesssage)
case .failure(let error):
failure(error as NSError)
}
}
}
But getting following error
Sources/TrustSDK/ObjCWrapper/TrustSDKObjC.swift
error: 'init' is inaccessible due to 'internal' protection level
note: 'init' declared here
Since flutter supports multiple platforms, it can be very useful.
!
Coin not supported
Hello
Originally posted by @1hi1ok in https://github.com/etherscan/writecontract/issues/70#issuecomment-846321389
@madcake please make it for Android too
Can we add a parameter to send transaction as well? Requested by the users.
@alejandro-isaza can you pass me a flag? I will handle that on my side then
@madcake can we do the same on Android side?
LSApplicationQueriesSchemes
to configuration section.TrustButton
User reported:
thanks for TrustSDK this is great, want to integrate it in iOS project but got problems like no TrustSDK "no such module", have tried all type of general solution but no luck,
followed this link : https://github.com/TrustWallet/TrustSDK-iOS
please help me how can i integrate it in my project (need steps).
On pod install getting error : "Unable to find a specification for TrezorCrypto (~> 0.0.8)
depended upon by TrustCore
"
Hi, I have an issue when I try to send transaction with a "payload" field. For Example, when I send transaction with some data to TrustWallet:
var transaction = Transaction(gasPrice: BigInt(21), gasLimit: 21000, to: address)
transaction.amount = amount
transaction.payload = Data(hexString: "0x8f834227000000000000000000000000000000005224") //some data
trustSDK.signTransaction(transaction) { [weak self] signedTransaction in
let alert = UIAlertController(title: "Signed Transaction", message: signedTransaction.hexString,
preferredStyle: .alert)
alert.addAction(.init(title: "OK", style: .default, handler: nil))
self?.present(alert, animated: true, completion: nil)
}
I think it happened because transaction data is base64 encoded string and TrustWalletSDK can't parse it correctly. If change this code (in source TrustWalletSDK - > TrustWalletSDK.swift -> handleSignTransaction function):
transaction.payload = components.queryParameterValue(for: "data").flatMap({ Data(hexString: $0) })
for something like this:
let data = components.queryParameterValue(for: "data").flatMap({ String($0) })!
let dataEncoded = Data(base64Encoded: data)!
transaction.payload = dataEncoded
Good afternoon.
Tell me, please, how can I decode signedTransaction
data to Transaction object?
On Android I've done like this:
val tx = Geth.newTransactionFromRLP(Numeric.hexStringToByteArray(response.result))
Thank you in advance.
@madcake please make it for Android too
HH
Instead of using Azure
when new release tag happen
Description
Although Trust has Wallet connect (nice!), it doesn't work if you close the app.
When the Wallet Trust App is in the background or closed, and you try to use the Dapp, the Dapp will send the transaction to be signed by the wallet. The issue is that if the app is not opened this message is lost. Furthermore, if you open later Trust wallet Dapp on top of not getting the messages sent while it was inactive, it doesn't get any new messages either.
My best guess is that, once the websocket is broken, it doesn't recover and recreate a new websocket using the topic id.
Other wallets, like Metamask allow the app to be in the background
How to reproduce
The SDK implementation or even the example is not working on my iPhone XR. It opens the Trust Wallet app but does nothing.
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.