@exodus/solana-lib 1.2.23 → 1.2.24

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,11 +1,12 @@
1
1
  {
2
2
  "name": "@exodus/solana-lib",
3
- "version": "1.2.23",
3
+ "version": "1.2.24",
4
4
  "description": "Exodus internal Solana low-level library",
5
5
  "main": "src/index.js",
6
6
  "files": [
7
7
  "src/",
8
- "!src/__tests__"
8
+ "!src/__tests__",
9
+ "!src/magiceden/__tests__"
9
10
  ],
10
11
  "author": "Exodus",
11
12
  "license": "ISC",
@@ -23,5 +24,5 @@
23
24
  "lodash": "^4.17.11",
24
25
  "tweetnacl": "^1.0.3"
25
26
  },
26
- "gitHead": "7073b51b6cf558547ca05ae25eaac44cf28a022b"
27
+ "gitHead": "131c0987f26bbef2c42e9bcf54b799c63a0dea7b"
27
28
  }
package/src/encode.js CHANGED
@@ -38,7 +38,7 @@ export function getEncodedSecretKey(privateKey): string {
38
38
 
39
39
  export function getPrivateKeyFromSecretKey(secretKey: string): string {
40
40
  const privateKey = bs58.decode(secretKey).slice(0, 32) // Buffer
41
- assert(privateKey.length >= 32, 'privateKey has unexpected length')
41
+ assert(privateKey.length === 32, 'privateKey has unexpected length')
42
42
  return privateKey
43
43
  }
44
44
 
@@ -1,64 +0,0 @@
1
- import test from 'tape'
2
- import { BN } from 'bn.js'
3
- import { PublicKey } from '../../vendor'
4
-
5
- import { MagicEdenEscrowProgram } from '../escrow-program'
6
-
7
- import fixtures from './fixtures'
8
-
9
- const serializeTx = (tx) => {
10
- return tx.instructions.map((instruction) => ({
11
- instructions: instruction.keys.map((k) => ({ ...k, pubkey: k.pubkey.toBase58() })),
12
- programId: instruction.programId.toBase58(),
13
- data: instruction.data.toString('hex'),
14
- }))
15
- }
16
-
17
- test('MagicEden: initializeEscrow', (t) => {
18
- const tx = MagicEdenEscrowProgram.initializeEscrow({
19
- initializerPubkey: new PublicKey('EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC'),
20
- initializerDepositTokenPubkey: new PublicKey('38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB'),
21
- escrowPubkey: new PublicKey('AicHKDZR5jLfozYcek5ZHw5mJfxBNFbUwHF2nM4qF8oN'),
22
- lamports: 500,
23
- takerAmount: new BN(1e10),
24
- })
25
-
26
- t.deepEqual(serializeTx(tx), fixtures.initializeEscrow)
27
-
28
- t.end()
29
- })
30
-
31
- test('MagicEden: cancelEscrow', (t) => {
32
- const tx = MagicEdenEscrowProgram.cancelEscrow({
33
- initializerPubkey: new PublicKey('EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC'),
34
- initializerDepositTokenPubkey: new PublicKey('38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB'),
35
- pdaPubkey: new PublicKey('GUfCR9mK6azb9vcpsxgXyj7XRPAKJd4KMHTTVvtncGgp'),
36
- escrowPubkey: new PublicKey('AicHKDZR5jLfozYcek5ZHw5mJfxBNFbUwHF2nM4qF8oN'),
37
- })
38
-
39
- t.deepEqual(serializeTx(tx), fixtures.cancelEscrow)
40
-
41
- t.end()
42
- })
43
-
44
- test('MagicEden: exchange', (t) => {
45
- const tx = MagicEdenEscrowProgram.exchange({
46
- takerPubkey: new PublicKey('FuDxYSDtRAG4P65wxAmUZShBSGtn79o2yJpPF13LQB87'),
47
- initializerDepositTokenPubkey: new PublicKey('38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB'),
48
- initializerPubkey: new PublicKey('EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC'),
49
- escrowPubkey: new PublicKey('DvijtTLQGCmmFMPpthitkpP35hGHxdJRxAERjtN13mPg'),
50
- pdaPubkey: new PublicKey('GUfCR9mK6azb9vcpsxgXyj7XRPAKJd4KMHTTVvtncGgp'),
51
- metadataPubkey: new PublicKey('4ysTyhoHDAv28dGUD2ASS9zmAHi3QZyXVQW25f6QwWN'),
52
- creators: [
53
- {
54
- address: 'D6ZQMLTJAa14XhzCFBJ2uuPjYDbYfewrVDVSyFZSuBYe',
55
- verified: 1,
56
- share: 100,
57
- },
58
- ],
59
- })
60
-
61
- t.deepEqual(serializeTx(tx), fixtures.exchange)
62
-
63
- t.end()
64
- })
@@ -1,134 +0,0 @@
1
- export default {
2
- initializeEscrow: [
3
- {
4
- instructions: [
5
- {
6
- pubkey: 'EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC',
7
- isSigner: true,
8
- isWritable: true,
9
- },
10
- {
11
- pubkey: 'AicHKDZR5jLfozYcek5ZHw5mJfxBNFbUwHF2nM4qF8oN',
12
- isSigner: true,
13
- isWritable: true,
14
- },
15
- ],
16
- programId: '11111111111111111111111111111111',
17
- data:
18
- '00000000f4010000000000005000000000000000052f21a9fe604e569e956f29223106fa26ce0a21520247a93a07a1489239c8ff',
19
- },
20
- {
21
- instructions: [
22
- {
23
- pubkey: 'EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC',
24
- isWritable: false,
25
- isSigner: true,
26
- },
27
- {
28
- pubkey: '38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB',
29
- isWritable: true,
30
- isSigner: false,
31
- },
32
- {
33
- pubkey: 'AicHKDZR5jLfozYcek5ZHw5mJfxBNFbUwHF2nM4qF8oN',
34
- isWritable: true,
35
- isSigner: false,
36
- },
37
- {
38
- pubkey: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
39
- isWritable: false,
40
- isSigner: false,
41
- },
42
- ],
43
- programId: 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8',
44
- data: 'f3a04d990b5c30d100e40b5402000000',
45
- },
46
- ],
47
- cancelEscrow: [
48
- {
49
- instructions: [
50
- {
51
- pubkey: 'EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC',
52
- isWritable: false,
53
- isSigner: false,
54
- },
55
- {
56
- pubkey: '38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB',
57
- isWritable: true,
58
- isSigner: false,
59
- },
60
- {
61
- pubkey: 'GUfCR9mK6azb9vcpsxgXyj7XRPAKJd4KMHTTVvtncGgp',
62
- isWritable: false,
63
- isSigner: false,
64
- },
65
- {
66
- pubkey: 'AicHKDZR5jLfozYcek5ZHw5mJfxBNFbUwHF2nM4qF8oN',
67
- isWritable: true,
68
- isSigner: false,
69
- },
70
- {
71
- pubkey: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
72
- isWritable: false,
73
- isSigner: false,
74
- },
75
- ],
76
- programId: 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8',
77
- data: '9ccb36b326482115',
78
- },
79
- ],
80
- exchange: [
81
- {
82
- instructions: [
83
- {
84
- pubkey: 'FuDxYSDtRAG4P65wxAmUZShBSGtn79o2yJpPF13LQB87',
85
- isWritable: false,
86
- isSigner: true,
87
- },
88
- {
89
- pubkey: '38y2gagfKoVVmLXxqESXWkBLHarzEq6f6cmA1DoAqRnB',
90
- isWritable: true,
91
- isSigner: false,
92
- },
93
- {
94
- pubkey: 'EpGkR4PcMYHLwZJn7rnxmmLihaZkaAeQLsw4ao3nUUmC',
95
- isWritable: true,
96
- isSigner: false,
97
- },
98
- {
99
- pubkey: 'DvijtTLQGCmmFMPpthitkpP35hGHxdJRxAERjtN13mPg',
100
- isWritable: true,
101
- isSigner: false,
102
- },
103
- {
104
- pubkey: 'GUfCR9mK6azb9vcpsxgXyj7XRPAKJd4KMHTTVvtncGgp',
105
- isWritable: false,
106
- isSigner: false,
107
- },
108
- { pubkey: '11111111111111111111111111111111', isWritable: false, isSigner: false },
109
- {
110
- pubkey: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
111
- isWritable: false,
112
- isSigner: false,
113
- },
114
- {
115
- pubkey: '2NZukH2TXpcuZP4htiuT8CFxcaQSWzkkR6kepSWnZ24Q',
116
- isWritable: true,
117
- isSigner: false,
118
- },
119
- {
120
- pubkey: '4ysTyhoHDAv28dGUD2ASS9zmAHi3QZyXVQW25f6QwWN',
121
- isWritable: false,
122
- isSigner: false,
123
- },
124
- {
125
- pubkey: 'D6ZQMLTJAa14XhzCFBJ2uuPjYDbYfewrVDVSyFZSuBYe',
126
- isWritable: true,
127
- isSigner: false,
128
- },
129
- ],
130
- programId: 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8',
131
- data: '2f031b61d7ecdb90',
132
- },
133
- ],
134
- }