@exodus/solana-lib 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-lib",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Exodus internal Solana low-level library",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -19,7 +19,6 @@
19
19
  "@exodus/models": "^8.10.4",
20
20
  "@exodus/solana-spl-token": "0.1.8-exodus.1",
21
21
  "@project-serum/serum": "0.13.64",
22
- "@solana/web3.js": "1.31.0",
23
22
  "bn.js": "^4.11.0",
24
23
  "borsh": "^0.7.0",
25
24
  "bs58": "^4.0.1",
@@ -27,5 +26,5 @@
27
26
  "lodash": "^4.17.11",
28
27
  "tweetnacl": "^1.0.3"
29
28
  },
30
- "gitHead": "301d6e9222b3c0828c73cea460c94c9bbce878e6"
29
+ "gitHead": "145ae526c51aefa39ffda8c63c70b30724aa9881"
31
30
  }
package/src/keypair.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // @flow
2
2
  import nacl from 'tweetnacl'
3
+ import { PublicKey } from './vendor'
3
4
 
4
5
  export function getKeyPairFromPrivateKey(privateKey: string | Buffer): Object {
5
6
  const { publicKey, secretKey } = nacl.sign.keyPair.fromSeed(
@@ -17,7 +18,7 @@ export function generateKeyPair() {
17
18
 
18
19
  return {
19
20
  secretKey: Buffer.from(secretKey, 'hex'), // secretKey
20
- publicKey: Buffer.from(publicKey, 'hex'),
21
+ publicKey: new PublicKey(publicKey),
21
22
  }
22
23
  }
23
24
 
@@ -1,5 +1,5 @@
1
1
  import * as nacl from 'tweetnacl'
2
- import { PACKET_DATA_SIZE } from '@solana/web3.js'
2
+ import { PACKET_DATA_SIZE } from '../vendor'
3
3
 
4
4
  // Copied from:
5
5
  // https://github.com/solana-labs/solana-web3.js/blob/42612c936d8d4ddbcb09dbb73db9e1aeaf6d8764/src/util/shortvec-encoding.ts#L15-L28.
@@ -8,7 +8,7 @@ import {
8
8
  SystemProgram,
9
9
  TransactionInstruction,
10
10
  PublicKey,
11
- } from '@solana/web3.js'
11
+ } from './../vendor'
12
12
  import bs58 from 'bs58'
13
13
 
14
14
  type DecodedInstruction = {
@@ -72,6 +72,10 @@ export class Message {
72
72
  this.instructions = args.instructions
73
73
  }
74
74
 
75
+ isAccountSigner(index: number): boolean {
76
+ return index < this.header.numRequiredSignatures
77
+ }
78
+
75
79
  isAccountWritable(index: number): boolean {
76
80
  return (
77
81
  index < this.header.numRequiredSignatures - this.header.numReadonlySignedAccounts ||
@@ -356,12 +356,6 @@ export class Transaction {
356
356
  }
357
357
  })
358
358
 
359
- if (numRequiredSignatures !== this.signatures.length) {
360
- throw new Error(
361
- `missing signer(s) - required signatures: ${numRequiredSignatures}, got ${this.signatures.length}`
362
- )
363
- }
364
-
365
359
  const accountKeys = signedKeys.concat(unsignedKeys)
366
360
  const instructions: CompiledInstruction[] = this.instructions.map((instruction) => {
367
361
  const { data, programId } = instruction