diff --git a/dist/trust-min.js b/dist/trust-min.js index 2fedc7bd..052d3986 100644 --- a/dist/trust-min.js +++ b/dist/trust-min.js @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f125c6e2ea85c391af8834fbdc74817bec2275256b2208fbb05e9ce2a43409d9 -size 535775 +oid sha256:d8963e1bff7e144011a16a988f79eaa7a94a96ece6f2c1946172a9e7d0d608ad +size 535911 diff --git a/ios/TrustWeb3Provider/DAppWebViewController.swift b/ios/TrustWeb3Provider/DAppWebViewController.swift index e3edf856..ece09275 100644 --- a/ios/TrustWeb3Provider/DAppWebViewController.swift +++ b/ios/TrustWeb3Provider/DAppWebViewController.swift @@ -13,7 +13,7 @@ class DAppWebViewController: UIViewController { @IBOutlet weak var urlField: UITextField! var homepage: String { - return "https://chainlist.org" + return "https://bscscan.com/address/0x05ff2b0db69458a0750badebc4f9e13add608c7f" } let privateKey = PrivateKey(data: Data(hexString: "0x4646464646464646464646464646464646464646464646464646464646464646")!)! @@ -21,8 +21,8 @@ class DAppWebViewController: UIViewController { lazy var scriptConfig: WKUserScriptConfig = { return WKUserScriptConfig( address: address, - chainId: 1, - rpcUrl: "https://mainnet.infura.io/v3/6e822818ec644335be6f0ed231f48310" + chainId: 56, + rpcUrl: "https://bsc-dataseed2.binance.org" ) }() diff --git a/src/index.js b/src/index.js index 1798a4b7..0b8b0bc7 100644 --- a/src/index.js +++ b/src/index.js @@ -29,8 +29,16 @@ class TrustWeb3Provider extends EventEmitter { } setAddress(address) { - this.address = (address || "").toLowerCase(); + const lowerAddress = (address || "").toLowerCase(); + this.address = lowerAddress; this.ready = !!address; + for (var i = 0; i < window.frames.length; i++) { + const frame = window.frames[i]; + if (frame.ethereum.isTrust) { + frame.ethereum.address = lowerAddress; + frame.ethereum.ready = !!address; + } + } } setConfig(config) { @@ -345,5 +353,5 @@ class TrustWeb3Provider extends EventEmitter { window.trustwallet = { Provider: TrustWeb3Provider, Web3: Web3, - postMessage: null + postMessage: null, };