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

@canvas-js/interfaces

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@canvas-js/interfaces - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17-alpha

3

lib/actions.d.ts

@@ -25,4 +25,1 @@ import type { Chain, ChainId } from "./contracts.js";

};
export declare type ActionResult = {
hash: string;
};

4

lib/sessions.d.ts

@@ -6,4 +6,4 @@ import type { Block } from "./actions.js";

timestamp: number;
session_public_key: string;
session_duration: number;
address: string;
duration: number;
block?: Block;

@@ -10,0 +10,0 @@ };

@@ -11,10 +11,32 @@ import { utils } from "ethers";

};
function serializeActionArgument(arg) {
if (typeof arg === "number") {
if (isNaN(arg)) {
return "NaN";
}
else if (Object.is(arg, -0)) {
return "-0";
}
else if (arg === Infinity) {
return "Infinity";
}
else if (arg === -Infinity) {
return "-Infinity";
}
else {
return arg.toString();
}
}
else {
return JSON.stringify(arg);
}
}
export function getActionSignatureData(payload) {
const domain = {
name: "Canvas",
salt: utils.hexlify(utils.zeroPad(utils.arrayify(payload.from), 32)),
salt: utils.hexlify(utils.zeroPad(utils.arrayify(payload.from), 32)).toLowerCase(),
};
const actionValue = {
sendAction: payload.call,
params: payload.args.map((a) => JSON.stringify(a)),
params: payload.args.map(serializeActionArgument),
application: payload.spec,

@@ -32,3 +54,3 @@ timestamp: payload.timestamp.toString(),

{ name: "loginTo", type: "string" },
{ name: "registerSessionKey", type: "string" },
{ name: "registerSessionAddress", type: "string" },
{ name: "registerSessionDuration", type: "uint256" },

@@ -41,8 +63,8 @@ { name: "timestamp", type: "uint256" },

name: "Canvas",
salt: utils.hexlify(utils.zeroPad(utils.arrayify(payload.from), 32)),
salt: utils.hexlify(utils.zeroPad(utils.arrayify(payload.from), 32)).toLowerCase(),
};
const sessionValue = {
loginTo: payload.spec,
registerSessionKey: payload.session_public_key,
registerSessionDuration: payload.session_duration.toString(),
registerSessionAddress: payload.address.toLowerCase(),
registerSessionDuration: payload.duration.toString(),
timestamp: payload.timestamp.toString(),

@@ -49,0 +71,0 @@ };

{
"name": "@canvas-js/interfaces",
"version": "0.0.16",
"version": "0.0.17-alpha",
"type": "module",

@@ -5,0 +5,0 @@ "author": "Canvas Technology Corporation (https://canvas.xyz)",

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