Socket
Socket
Sign inDemoInstall

@solana/signers

Package Overview
Dependencies
Maintainers
14
Versions
835
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/signers - npm Package Compare versions

Comparing version 2.0.0-rc.0 to 2.0.0-rc.1

2

dist/types/keypair-signer.d.ts

@@ -25,2 +25,4 @@ import { Address } from '@solana/addresses';

export declare function createKeyPairSignerFromBytes(bytes: ReadonlyUint8Array, extractable?: boolean): Promise<KeyPairSigner>;
/** Creates a signer capable of signing messages and transactions using the 32 bytes of a private key. */
export declare function createKeyPairSignerFromPrivateKeyBytes(bytes: ReadonlyUint8Array, extractable?: boolean): Promise<KeyPairSigner>;
//# sourceMappingURL=keypair-signer.d.ts.map

16

package.json
{
"name": "@solana/signers",
"version": "2.0.0-rc.0",
"version": "2.0.0-rc.1",
"description": "An abstraction layer over signing messages and transactions in Solana",

@@ -52,9 +52,9 @@ "exports": {

"dependencies": {
"@solana/addresses": "2.0.0-rc.0",
"@solana/codecs-core": "2.0.0-rc.0",
"@solana/errors": "2.0.0-rc.0",
"@solana/instructions": "2.0.0-rc.0",
"@solana/keys": "2.0.0-rc.0",
"@solana/transaction-messages": "2.0.0-rc.0",
"@solana/transactions": "2.0.0-rc.0"
"@solana/codecs-core": "2.0.0-rc.1",
"@solana/addresses": "2.0.0-rc.1",
"@solana/errors": "2.0.0-rc.1",
"@solana/instructions": "2.0.0-rc.1",
"@solana/transaction-messages": "2.0.0-rc.1",
"@solana/keys": "2.0.0-rc.1",
"@solana/transactions": "2.0.0-rc.1"
},

@@ -61,0 +61,0 @@ "peerDependencies": {

@@ -9,5 +9,5 @@ [![npm][npm-image]][npm-url]

[code-style-prettier-url]: https://github.com/prettier/prettier
[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/signers/experimental.svg?style=flat
[npm-image]: https://img.shields.io/npm/v/@solana/signers/experimental.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@solana/signers/v/experimental
[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/signers/rc.svg?style=flat
[npm-image]: https://img.shields.io/npm/v/@solana/signers/rc.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@solana/signers/v/rc
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg

@@ -18,3 +18,3 @@ [semantic-release-url]: https://github.com/semantic-release/semantic-release

This package provides an abstraction layer over signing messages and transactions in Solana. It can be used standalone, but it is also exported as part of the Solana JavaScript SDK [`@solana/web3.js@experimental`](https://github.com/solana-labs/solana-web3.js/tree/master/packages/library).
This package provides an abstraction layer over signing messages and transactions in Solana. It can be used standalone, but it is also exported as part of the Solana JavaScript SDK [`@solana/web3.js@rc`](https://github.com/solana-labs/solana-web3.js/tree/master/packages/library).

@@ -321,2 +321,32 @@ You can think of signers as an abstract way to sign messages and transactions. This could be using a Crypto KeyPair, a wallet adapter in the browser, a Noop signer for testing purposes, or anything you want. Here's an example using a `CryptoKeyPair` signer:

#### `createKeyPairSignerFromBytes()`
A convenience function that creates a new KeyPair from a 64-bytes `Uint8Array` secret key and immediately creates a `KeyPairSigner` from it.
```ts
import fs from 'fs';
import { createKeyPairFromBytes } from '@solana/keys';
// Get bytes from local keypair file.
const keypairFile = fs.readFileSync('~/.config/solana/id.json');
const keypairBytes = new Uint8Array(JSON.parse(keypairFile.toString()));
// Create a KeyPairSigner from the bytes.
const { privateKey, publicKey } = await createKeyPairSignerFromBytes(keypairBytes);
```
#### `createKeyPairSignerFromPrivateKeyBytes()`
A convenience function that creates a new KeyPair from a 32-bytes `Uint8Array` private key and immediately creates a `KeyPairSigner` from it.
```ts
import { getUtf8Encoder } from '@solana/codecs-strings';
import { createKeyPairFromPrivateKeyBytes } from '@solana/keys';
const message = getUtf8Encoder().encode('Hello, World!');
const seed = new Uint8Array(await crypto.subtle.digest('SHA-256', message));
const derivedSigner = await createKeyPairSignerFromPrivateKeyBytes(seed);
```
#### `isKeyPairSigner()`

@@ -323,0 +353,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

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