@portkey/extension-provider v2.3.5-alpha.5
This project creates javascript code that will be injected into Portkey APP's WebView environment, for providing basic functions for DApp developers.
Usage
1. Use @portkey/detect-provider
We recommend to use the @portkey/detect-provider package to detect if Portkey is injected.
Click the link above to learn more.
2. Detect provider by your own code (not recommended)
provider will be injected to the window
or globalThis.window
object, providing you a way to detect it directly.
Also, when provider is injected, an event named portkeyInitEvent
will be triggered on the host object (window
).
const detectedProvider:IProvider = window.portkey;
if(!detectedProvider){
// Portkey is not injected yet
window.addEventListener('portkeyInitEvent', ()=>{
const provider = window.portkey;
// Do something with the provider
...
});
}
You can find more details and examples in @portkey/detect-provider 's README doc.
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago