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

@canvas-js/interfaces

Package Overview
Dependencies
Maintainers
3
Versions
221
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.33 to 0.0.34-alpha

6

lib/actions.d.ts

@@ -14,7 +14,9 @@ import type { Chain, ChainId } from "./contracts.js";

timestamp: number;
block?: Block;
chain: Chain;
chainId: ChainId;
blockhash: string | null;
};
export type ActionPayload = ActionContext & {
call: string;
args: ActionArgument[];
args: Record<string, ActionArgument>;
};

@@ -21,0 +23,0 @@ export type Action = {

@@ -1,2 +0,2 @@

import type { Block } from "./actions.js";
import { Chain, ChainId } from "./contracts.js";
export type SessionPayload = {

@@ -8,3 +8,5 @@ from: string;

duration: number;
block?: Block;
blockhash: string | null;
chain: Chain;
chainId: ChainId;
};

@@ -11,0 +13,0 @@ export type Session = {

@@ -33,2 +33,3 @@ import { utils } from "ethers";

}
const namePattern = /^[a-zA-Z][a-zA-Z0-9]*$/;
export function getActionSignatureData(payload) {

@@ -39,5 +40,14 @@ const domain = {

};
const keys = Object.keys(payload.args).sort();
const params = keys.map((key) => {
if (namePattern.test(key)) {
return `${key}: ${serializeActionArgument(payload.args[key])}`;
}
else {
throw new Error("invalid argument name");
}
});
const actionValue = {
sendAction: payload.call,
params: payload.args.map(serializeActionArgument),
params: params,
application: payload.spec,

@@ -44,0 +54,0 @@ timestamp: payload.timestamp.toString(),

{
"name": "@canvas-js/interfaces",
"version": "0.0.33",
"version": "0.0.34-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