mirror of
https://github.com/lil-org/tokenary.git
synced 2025-01-08 14:49:38 +03:00
Specify wallet provider within an inpage message
This commit is contained in:
parent
c86ea9678e
commit
53ae306f5d
File diff suppressed because one or more lines are too long
@ -332,7 +332,7 @@ class TokenaryEthereum extends EventEmitter {
|
||||
networkId: this.net_version(),
|
||||
host: window.location.host
|
||||
};
|
||||
window.tokenary.postMessage(object);
|
||||
window.tokenary.postMessage(object, "ethereum");
|
||||
} else {
|
||||
// don't forget to verify in the app
|
||||
this.sendError(id, new ProviderRpcError(4100, "provider is not ready"));
|
||||
|
@ -7,8 +7,9 @@ import TokenaryEthereum from "./ethereum";
|
||||
import TokenarySolana from "./solana";
|
||||
|
||||
window.tokenary = {};
|
||||
window.tokenary.postMessage = (jsonString) => {
|
||||
window.postMessage({direction: "from-page-script", message: jsonString}, "*");
|
||||
window.tokenary.postMessage = (message, provider) => {
|
||||
message.provider = provider;
|
||||
window.postMessage({direction: "from-page-script", message: message}, "*");
|
||||
};
|
||||
|
||||
window.ethereum = new TokenaryEthereum();
|
||||
|
@ -165,7 +165,7 @@ class TokenarySolana extends EventEmitter {
|
||||
networkId: "", // won't be there for solana
|
||||
host: window.location.host
|
||||
};
|
||||
window.tokenary.postMessage(object);
|
||||
window.tokenary.postMessage(object, "solana");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user