Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dscvr-one/canvas-client-sdk

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dscvr-one/canvas-client-sdk - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

5

dist/index.d.ts

@@ -7,2 +7,3 @@ import * as CanvasInterface from '@dscvr-one/canvas-interface';

private initResponseMessage;
private initialInteractionRegistered;
private eventBus;

@@ -14,2 +15,3 @@ constructor();

openLink(url: string): void;
resize(newPayload?: CanvasInterface.User.ResizeRequestMessage['payload']): void;
connectWallet(chainId: string): Promise<CanvasInterface.User.ConnectWalletResponseMessage>;

@@ -23,4 +25,7 @@ signAndSendTransaction(payload: CanvasInterface.User.UnsignedTransaction & {

private handleReceiveMessage;
private handleInitialInteraction;
private removeInitialInteractionListeners;
private getWindowSize;
}
export { CanvasClient };

@@ -7,2 +7,3 @@ // src/client.ts

initResponseMessage = void 0;
initialInteractionRegistered = false;
eventBus = new EventEmitter();

@@ -14,2 +15,4 @@ constructor() {

window.addEventListener("message", this.handleReceiveMessage);
window.addEventListener("click", this.handleInitialInteraction);
window.addEventListener("focus", this.handleInitialInteraction);
if (!document.referrer) {

@@ -23,2 +26,3 @@ throw new CanvasInterface.ReferrerNotDefinedError();

window.removeEventListener("message", this.handleReceiveMessage);
this.removeInitialInteractionListeners();
}

@@ -51,2 +55,12 @@ get isReady() {

}
resize(newPayload) {
const payload = newPayload ?? this.getWindowSize();
if (payload.width <= 0 || payload.height <= 0) {
return;
}
this.sendMessage({
type: "user:resize-request",
payload
});
}
connectWallet(chainId) {

@@ -126,2 +140,21 @@ const responsePromise = new Promise(

};
handleInitialInteraction = () => {
this.removeInitialInteractionListeners();
if (!this.initialInteractionRegistered) {
this.initialInteractionRegistered = true;
this.sendMessage({
type: "user:initial-interaction-request"
});
}
};
removeInitialInteractionListeners() {
window.removeEventListener("click", this.handleInitialInteraction);
window.removeEventListener("focus", this.handleInitialInteraction);
}
getWindowSize() {
return {
width: window.document.body.clientWidth,
height: window.document.body.clientHeight
};
}
};

@@ -128,0 +161,0 @@

2

package.json
{
"name": "@dscvr-one/canvas-client-sdk",
"version": "1.0.6",
"version": "1.0.7",
"description": "SDK for iframes apps to connect to dscvr host using postMessage rpc",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc