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

@metaplex-foundation/beet-solana

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metaplex-foundation/beet-solana - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

13

dist/src/beet-solana.d.ts
import { SupportedTypeDefinition } from '@metaplex-foundation/beet';
import { KeysExports, KeysTypeMapKey } from './keys';
export * from './keys';
/**
* @category TypeDefinition
*/
export declare type BeetSolanaTypeMapKey = KeysTypeMapKey;
/**
* @category TypeDefinition
*/
export declare type BeetSolanaExports = KeysExports;
/**
* Maps solana beet exports to metadata which describes in which package it
* is defined as well as which TypeScript type is used to represent the
* deserialized value in JavaScript.
*
* @category TypeDefinition
*/
export declare const supportedTypeMap: Record<BeetSolanaTypeMapKey, SupportedTypeDefinition & {
beet: BeetSolanaExports;
}>;

@@ -16,3 +16,10 @@ "use strict";

__exportStar(require("./keys"), exports);
/**
* Maps solana beet exports to metadata which describes in which package it
* is defined as well as which TypeScript type is used to represent the
* deserialized value in JavaScript.
*
* @category TypeDefinition
*/
exports.supportedTypeMap = keys_1.keysTypeMap;
//# sourceMappingURL=beet-solana.js.map
import { PublicKey } from '@solana/web3.js';
import { Beet, SupportedTypeDefinition } from '@metaplex-foundation/beet';
/**
* De/Serializer for solana {@link PublicKey}s aka `publicKey`.
*
*
* ## Using PublicKey Directly
*
* ```ts
* import { publicKey } from '@metaplex-foundation/beet-solana'
*
* const generatedKey = Keypair.generate().publicKey
* const buf = Buffer.alloc(publicKey.byteSize)
* beet.write(buf, 0, generatedKey)
* beet.read(buf, 0) // same as generatedKey
* ```
*
* ## PublicKey as part of a Struct Configuration
*
* ```ts
* import { publicKey } from '@metaplex-foundation/beet-solana'
*
* type InstructionArgs = {
* authority: web3.PublicKey
* }
*
* const createStruct = new beet.BeetArgsStruct<InstructionArgs>(
* [
* ['authority', publicKey]
* ],
* 'InstructionArgs'
* )
* ```
*
* @category beet/solana
*/
export declare const publicKey: Beet<PublicKey>;
/**
* @category TypeDefinition
*/
export declare type KeysExports = keyof typeof import('./keys');
/**
* @category TypeDefinition
*/
export declare type KeysTypeMapKey = 'publicKey';
/**
* @category TypeDefinition
*/
export declare type KeysTypeMap = Record<KeysTypeMapKey, SupportedTypeDefinition & {
beet: KeysExports;
}>;
/**
* Maps solana keys beet exports to metadata which describes in which package it
* is defined as well as which TypeScript type is used to represent the
* deserialized value in JavaScript.
*
* @category TypeDefinition
*/
export declare const keysTypeMap: KeysTypeMap;

44

dist/src/keys.js

@@ -6,6 +6,39 @@ "use strict";

const beet_1 = require("@metaplex-foundation/beet");
const package_json_1 = require("../package.json");
const BEET_SOLANA_PACKAGE = package_json_1.name;
const BEET_SOLANA_PACKAGE = '@metaplex-foundation/beet-solana';
const SOLANA_WEB3_PACKAGE = '@solana/web3.js';
const uint8Array32 = (0, beet_1.fixedSizeUint8Array)(32);
/**
* De/Serializer for solana {@link PublicKey}s aka `publicKey`.
*
*
* ## Using PublicKey Directly
*
* ```ts
* import { publicKey } from '@metaplex-foundation/beet-solana'
*
* const generatedKey = Keypair.generate().publicKey
* const buf = Buffer.alloc(publicKey.byteSize)
* beet.write(buf, 0, generatedKey)
* beet.read(buf, 0) // same as generatedKey
* ```
*
* ## PublicKey as part of a Struct Configuration
*
* ```ts
* import { publicKey } from '@metaplex-foundation/beet-solana'
*
* type InstructionArgs = {
* authority: web3.PublicKey
* }
*
* const createStruct = new beet.BeetArgsStruct<InstructionArgs>(
* [
* ['authority', publicKey]
* ],
* 'InstructionArgs'
* )
* ```
*
* @category beet/solana
*/
exports.publicKey = {

@@ -23,2 +56,9 @@ write: function (buf, offset, value) {

};
/**
* Maps solana keys beet exports to metadata which describes in which package it
* is defined as well as which TypeScript type is used to represent the
* deserialized value in JavaScript.
*
* @category TypeDefinition
*/
exports.keysTypeMap = {

@@ -25,0 +65,0 @@ publicKey: {

6

package.json
{
"name": "@metaplex-foundation/beet-solana",
"version": "0.0.0",
"version": "0.0.1",
"description": "Solana specific extension for beet, the borsh compatible de/serializer",

@@ -18,3 +18,3 @@ "main": "dist/src/beet-solana.js",

"lint:fix": "prettier --write ./src",
"doc": "typedoc src/*.ts --readme README.md"
"doc": "rimraf ../docs/beet-solana && typedoc"
},

@@ -43,2 +43,2 @@ "repository": "git@github.com:metaplex-foundation/beet-solana.git",

}
}
}
# @metaplex-foundation/beet-solana
Solana specific extension for beet, the borsh compatible de/serializer
## API
Please find the [API docs here](https://metaplex-foundation.github.io/beet/docs/beet-solana).
## Examples
### Using PublicKey Directly
```ts
import { publicKey } from '@metaplex-foundation/beet-solana'
const generatedKey = Keypair.generate().publicKey
const buf = Buffer.alloc(publicKey.byteSize)
beet.write(buf, 0, generatedKey)
beet.read(buf, 0) // same as generatedKey
```
### PublicKey as part of a Struct Configuration
```ts
import * as web3 from '@solana/web3.js'
import * as beet from '@metaplex-foundation/beet'
import * as beetSolana from '@metaplex-foundation/beet-solana'
type InstructionArgs = {
authority: web3.PublicKey
}
const createStruct = new beet.BeetArgsStruct<InstructionArgs>(
[
['authority', beetSolana.publicKey]
],
'InstructionArgs'
)
```
## LICENSE
Apache-2.0

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