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

@project-serum/anchor

Package Overview
Dependencies
Maintainers
6
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@project-serum/anchor - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

21

dist/cjs/coder.js

@@ -278,3 +278,15 @@ "use strict";

return IdlCoder.typeDefLayout(filtered[0], types, fieldName);
// @ts-ignore
}
else if (field.type.array) {
// @ts-ignore
let arrayTy = field.type.array[0];
// @ts-ignore
let arrayLen = field.type.array[1];
let innerLayout = IdlCoder.fieldLayout({
name: undefined,
type: arrayTy,
}, types);
return borsh.array(innerLayout, arrayLen, fieldName);
}
else {

@@ -388,2 +400,11 @@ throw new Error(`Not yet implemented: ${field}`);

}
// @ts-ignore
if (ty.array !== undefined) {
// @ts-ignore
let arrayTy = ty.array[0];
// @ts-ignore
let arraySize = ty.array[1];
// @ts-ignore
return typeSize(idl, arrayTy) * arraySize;
}
throw new Error(`Invalid type ${JSON.stringify(ty)}`);

@@ -390,0 +411,0 @@ }

@@ -252,3 +252,15 @@ import camelCase from "camelcase";

return IdlCoder.typeDefLayout(filtered[0], types, fieldName);
// @ts-ignore
}
else if (field.type.array) {
// @ts-ignore
let arrayTy = field.type.array[0];
// @ts-ignore
let arrayLen = field.type.array[1];
let innerLayout = IdlCoder.fieldLayout({
name: undefined,
type: arrayTy,
}, types);
return borsh.array(innerLayout, arrayLen, fieldName);
}
else {

@@ -359,2 +371,11 @@ throw new Error(`Not yet implemented: ${field}`);

}
// @ts-ignore
if (ty.array !== undefined) {
// @ts-ignore
let arrayTy = ty.array[0];
// @ts-ignore
let arraySize = ty.array[1];
// @ts-ignore
return typeSize(idl, arrayTy) * arraySize;
}
throw new Error(`Invalid type ${JSON.stringify(ty)}`);

@@ -361,0 +382,0 @@ }

4

package.json
{
"name": "@project-serum/anchor",
"version": "0.4.3",
"version": "0.4.4",
"description": "Anchor client",

@@ -23,3 +23,3 @@ "main": "dist/cjs/index.js",

"dependencies": {
"@project-serum/borsh": "^0.1.0",
"@project-serum/borsh": "^0.1.1",
"@solana/web3.js": "^1.2.0",

@@ -26,0 +26,0 @@ "@types/bn.js": "^4.11.6",

import camelCase from "camelcase";
import { snakeCase } from "snake-case";
import { Layout } from "buffer-layout";
import { Layout, seq } from "buffer-layout";
import * as sha256 from "js-sha256";

@@ -352,2 +352,16 @@ import * as borsh from "@project-serum/borsh";

return IdlCoder.typeDefLayout(filtered[0], types, fieldName);
// @ts-ignore
} else if (field.type.array) {
// @ts-ignore
let arrayTy = field.type.array[0];
// @ts-ignore
let arrayLen = field.type.array[1];
let innerLayout = IdlCoder.fieldLayout(
{
name: undefined,
type: arrayTy,
},
types
);
return borsh.array(innerLayout, arrayLen, fieldName);
} else {

@@ -468,2 +482,11 @@ throw new Error(`Not yet implemented: ${field}`);

}
// @ts-ignore
if (ty.array !== undefined) {
// @ts-ignore
let arrayTy = ty.array[0];
// @ts-ignore
let arraySize = ty.array[1];
// @ts-ignore
return typeSize(idl, arrayTy) * arraySize;
}
throw new Error(`Invalid type ${JSON.stringify(ty)}`);

@@ -470,0 +493,0 @@ }

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

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