Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trustwallet/trust-web3-provider
Web3 javascript wrapper provider for iOS and Android platforms.
https://github.com/trustwallet/trust-web3-provider
blockchain dapps swift web3
Last synced: 4 days ago
JSON representation
Web3 javascript wrapper provider for iOS and Android platforms.
- Host: GitHub
- URL: https://github.com/trustwallet/trust-web3-provider
- Owner: trustwallet
- License: mit
- Created: 2018-02-12T00:44:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T13:10:23.000Z (7 months ago)
- Last Synced: 2024-05-29T16:44:34.290Z (7 months ago)
- Topics: blockchain, dapps, swift, web3
- Language: Swift
- Homepage: https://trustwallet.com
- Size: 3.96 MB
- Stars: 702
- Watchers: 64
- Forks: 402
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- best-of-crypto - GitHub - 23% open · ⏱️ 27.05.2024): (Exchange-based Tokens)
README
# TrustWeb3Provider
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/trustwallet/trust-web3-provider)
[![License](https://img.shields.io/cocoapods/l/TrustWeb3Provider.svg?style=flat)](http://cocoapods.org/pods/TrustWeb3Provider)
[![Platform](https://img.shields.io/cocoapods/p/TrustWeb3Provider.svg?style=flat)](http://cocoapods.org/pods/TrustWeb3Provider)
[![Platform](https://img.shields.io/badge/platform-android-lightgrey.svg)](https://jitpack.io/#TrustWallet/trust-web3-provider/0.2.1)TrustWeb3Provider is multi-network web3 provider used by TrustWallet. Currently it supports:
- Ethereum
- Solana## How to Identify Trust Provider
If trust provider injected properly `isTrust` will be `true`
```javascript
window.ethereum.isTrust
// or
window.trustwallet.solana.isTrust
```## Installation
### iOS
TrustWeb3Provider is available through CocoaPods and SPM (locally due to Xcode git lfs issue).
CocoaPods
Add this line to your `Podfile`:
```ruby
pod 'TrustWeb3Provider', :git => 'https://github.com/trustwallet/trust-web3-provider', :branch => 'master'
```Swift Package Manager
Add this repo as a `git submodule`, then add it this to your `Package.swift`:
```swift
.package(name: "TrustWeb3Provider", path: ""),
```Here is an example project located at `ios/TrustWeb3Provider.xcodeproj` to demonstrate how to use this provider.
### Android
TrustWeb3Provider is available through [Jitpack](https://jitpack.io)
#### JitpackTo install it:
Step 1. Add jitpack to `repositories` in your root `build.gradle` file:
```groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```Step 2. Add the dependency
```groovy
dependencies {
implementation 'com.github.trustwallet:trust-web3-provider:TAG'
}
```## Authors
[vikmeup](https://github.com/vikmeup)
[hewigovens](https://github.com/hewigovens)
[madcake](https://github.com/madcake)
[rsrbk](https://github.com/rsrbk)## License
TrustWeb3Provider is available under the MIT license. See the LICENSE file for more info.