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

@metaplex-foundation/umi-serializer-data-view

Package Overview
Dependencies
Maintainers
10
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metaplex-foundation/umi-serializer-data-view - npm Package Compare versions

Comparing version 0.7.14 to 0.8.0-rc.0

6

package.json
{
"name": "@metaplex-foundation/umi-serializer-data-view",
"version": "0.7.14",
"version": "0.8.0-rc.0",
"description": "A serializer implementation relying on the native DataView API",

@@ -23,3 +23,3 @@ "license": "MIT",

"peerDependencies": {
"@metaplex-foundation/umi": "^0.7.14"
"@metaplex-foundation/umi": "^0.8.0-rc.0"
},

@@ -29,3 +29,3 @@ "devDependencies": {

"ava": "^5.1.0",
"@metaplex-foundation/umi": "^0.7.14"
"@metaplex-foundation/umi": "^0.8.0-rc.0"
},

@@ -32,0 +32,0 @@ "publishConfig": {

import {
publicKey as toPublicKey,
PUBLIC_KEY_LENGTH,
PublicKey,

@@ -7,7 +7,6 @@ PublicKeyInput,

Serializer,
publicKeyBytes,
publicKey as toPublicKey,
} from '@metaplex-foundation/umi';
import {
DeserializingEmptyBufferError,
DataViewSerializerError,
} from './errors';
import { DeserializingEmptyBufferError, NotEnoughBytesError } from './errors';

@@ -21,11 +20,13 @@ export function publicKey(

maxSize: 32,
serialize: (value: PublicKeyInput) => toPublicKey(value).bytes,
serialize: (value: PublicKeyInput) => publicKeyBytes(toPublicKey(value)),
deserialize: (bytes: Uint8Array, offset = 0) => {
if (bytes.slice(offset).length === 0) {
const pubkeyBytes = bytes.slice(offset, offset + 32);
if (pubkeyBytes.length === 0) {
throw new DeserializingEmptyBufferError('publicKey');
}
const pubkeyBytes = bytes.slice(offset, offset + 32);
if (pubkeyBytes.length < 32) {
throw new DataViewSerializerError(
`Serializer [publicKey] expected 32 bytes, got ${pubkeyBytes.length}.`
if (pubkeyBytes.length < PUBLIC_KEY_LENGTH) {
throw new NotEnoughBytesError(
'publicKey',
PUBLIC_KEY_LENGTH,
pubkeyBytes.length
);

@@ -32,0 +33,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

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