@pythnetwork/pyth-lazer-sdk 1.0.0 → 2.0.0
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/dist/cjs/constants.d.ts +2 -3
- package/dist/cjs/constants.js +3 -4
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/esm/constants.d.ts +2 -3
- package/dist/esm/constants.js +2 -3
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/package.json +1 -3
- package/dist/cjs/ed25519.d.ts +0 -2
- package/dist/cjs/ed25519.js +0 -79
- package/dist/esm/ed25519.d.ts +0 -2
- package/dist/esm/ed25519.js +0 -42
package/dist/cjs/constants.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const SOLANA_STORAGE_ID: PublicKey;
|
|
1
|
+
export declare const SOLANA_LAZER_PROGRAM_ID = "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt";
|
|
2
|
+
export declare const SOLANA_LAZER_STORAGE_ID = "3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL";
|
package/dist/cjs/constants.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
exports.
|
|
6
|
-
exports.SOLANA_STORAGE_ID = new web3_js_1.PublicKey("3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL");
|
|
3
|
+
exports.SOLANA_LAZER_STORAGE_ID = exports.SOLANA_LAZER_PROGRAM_ID = void 0;
|
|
4
|
+
exports.SOLANA_LAZER_PROGRAM_ID = "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt";
|
|
5
|
+
exports.SOLANA_LAZER_STORAGE_ID = "3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL";
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -16,5 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client.js"), exports);
|
|
18
18
|
__exportStar(require("./protocol.js"), exports);
|
|
19
|
-
__exportStar(require("./ed25519.js"), exports);
|
|
20
19
|
__exportStar(require("./constants.js"), exports);
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const SOLANA_STORAGE_ID: PublicKey;
|
|
1
|
+
export declare const SOLANA_LAZER_PROGRAM_ID = "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt";
|
|
2
|
+
export declare const SOLANA_LAZER_STORAGE_ID = "3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL";
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export const
|
|
3
|
-
export const SOLANA_STORAGE_ID = new PublicKey("3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL");
|
|
1
|
+
export const SOLANA_LAZER_PROGRAM_ID = "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt";
|
|
2
|
+
export const SOLANA_LAZER_STORAGE_ID = "3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL";
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pythnetwork/pyth-lazer-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Pyth Lazer SDK",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -48,8 +48,6 @@
|
|
|
48
48
|
"license": "Apache-2.0",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@isaacs/ttlcache": "^1.4.1",
|
|
51
|
-
"@solana/buffer-layout": "^4.0.1",
|
|
52
|
-
"@solana/web3.js": "^1.98.0",
|
|
53
51
|
"isomorphic-ws": "^5.0.0",
|
|
54
52
|
"ts-log": "^2.2.7",
|
|
55
53
|
"ws": "^8.18.0"
|
package/dist/cjs/ed25519.d.ts
DELETED
package/dist/cjs/ed25519.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createEd25519Instruction = void 0;
|
|
37
|
-
const BufferLayout = __importStar(require("@solana/buffer-layout"));
|
|
38
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
39
|
-
const ED25519_INSTRUCTION_LEN = 16;
|
|
40
|
-
const SIGNATURE_LEN = 64;
|
|
41
|
-
const PUBKEY_LEN = 32;
|
|
42
|
-
const MAGIC_LEN = 4;
|
|
43
|
-
const MESSAGE_SIZE_LEN = 2;
|
|
44
|
-
const ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([
|
|
45
|
-
BufferLayout.u8("numSignatures"),
|
|
46
|
-
BufferLayout.u8("padding"),
|
|
47
|
-
BufferLayout.u16("signatureOffset"),
|
|
48
|
-
BufferLayout.u16("signatureInstructionIndex"),
|
|
49
|
-
BufferLayout.u16("publicKeyOffset"),
|
|
50
|
-
BufferLayout.u16("publicKeyInstructionIndex"),
|
|
51
|
-
BufferLayout.u16("messageDataOffset"),
|
|
52
|
-
BufferLayout.u16("messageDataSize"),
|
|
53
|
-
BufferLayout.u16("messageInstructionIndex"),
|
|
54
|
-
]);
|
|
55
|
-
const createEd25519Instruction = (message, instructionIndex, startingOffset) => {
|
|
56
|
-
const signatureOffset = startingOffset + MAGIC_LEN;
|
|
57
|
-
const publicKeyOffset = signatureOffset + SIGNATURE_LEN;
|
|
58
|
-
const messageDataSizeOffset = publicKeyOffset + PUBKEY_LEN;
|
|
59
|
-
const messageDataOffset = messageDataSizeOffset + MESSAGE_SIZE_LEN;
|
|
60
|
-
const messageDataSize = message.readUInt16LE(messageDataSizeOffset - startingOffset);
|
|
61
|
-
const instructionData = Buffer.alloc(ED25519_INSTRUCTION_LEN);
|
|
62
|
-
ED25519_INSTRUCTION_LAYOUT.encode({
|
|
63
|
-
numSignatures: 1,
|
|
64
|
-
padding: 0,
|
|
65
|
-
signatureOffset,
|
|
66
|
-
signatureInstructionIndex: instructionIndex,
|
|
67
|
-
publicKeyOffset,
|
|
68
|
-
publicKeyInstructionIndex: instructionIndex,
|
|
69
|
-
messageDataOffset,
|
|
70
|
-
messageDataSize: messageDataSize,
|
|
71
|
-
messageInstructionIndex: instructionIndex,
|
|
72
|
-
}, instructionData);
|
|
73
|
-
return new web3_js_1.TransactionInstruction({
|
|
74
|
-
keys: [],
|
|
75
|
-
programId: web3_js_1.Ed25519Program.programId,
|
|
76
|
-
data: instructionData,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
exports.createEd25519Instruction = createEd25519Instruction;
|
package/dist/esm/ed25519.d.ts
DELETED
package/dist/esm/ed25519.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as BufferLayout from "@solana/buffer-layout";
|
|
2
|
-
import { Ed25519Program, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
-
const ED25519_INSTRUCTION_LEN = 16;
|
|
4
|
-
const SIGNATURE_LEN = 64;
|
|
5
|
-
const PUBKEY_LEN = 32;
|
|
6
|
-
const MAGIC_LEN = 4;
|
|
7
|
-
const MESSAGE_SIZE_LEN = 2;
|
|
8
|
-
const ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([
|
|
9
|
-
BufferLayout.u8("numSignatures"),
|
|
10
|
-
BufferLayout.u8("padding"),
|
|
11
|
-
BufferLayout.u16("signatureOffset"),
|
|
12
|
-
BufferLayout.u16("signatureInstructionIndex"),
|
|
13
|
-
BufferLayout.u16("publicKeyOffset"),
|
|
14
|
-
BufferLayout.u16("publicKeyInstructionIndex"),
|
|
15
|
-
BufferLayout.u16("messageDataOffset"),
|
|
16
|
-
BufferLayout.u16("messageDataSize"),
|
|
17
|
-
BufferLayout.u16("messageInstructionIndex"),
|
|
18
|
-
]);
|
|
19
|
-
export const createEd25519Instruction = (message, instructionIndex, startingOffset) => {
|
|
20
|
-
const signatureOffset = startingOffset + MAGIC_LEN;
|
|
21
|
-
const publicKeyOffset = signatureOffset + SIGNATURE_LEN;
|
|
22
|
-
const messageDataSizeOffset = publicKeyOffset + PUBKEY_LEN;
|
|
23
|
-
const messageDataOffset = messageDataSizeOffset + MESSAGE_SIZE_LEN;
|
|
24
|
-
const messageDataSize = message.readUInt16LE(messageDataSizeOffset - startingOffset);
|
|
25
|
-
const instructionData = Buffer.alloc(ED25519_INSTRUCTION_LEN);
|
|
26
|
-
ED25519_INSTRUCTION_LAYOUT.encode({
|
|
27
|
-
numSignatures: 1,
|
|
28
|
-
padding: 0,
|
|
29
|
-
signatureOffset,
|
|
30
|
-
signatureInstructionIndex: instructionIndex,
|
|
31
|
-
publicKeyOffset,
|
|
32
|
-
publicKeyInstructionIndex: instructionIndex,
|
|
33
|
-
messageDataOffset,
|
|
34
|
-
messageDataSize: messageDataSize,
|
|
35
|
-
messageInstructionIndex: instructionIndex,
|
|
36
|
-
}, instructionData);
|
|
37
|
-
return new TransactionInstruction({
|
|
38
|
-
keys: [],
|
|
39
|
-
programId: Ed25519Program.programId,
|
|
40
|
-
data: instructionData,
|
|
41
|
-
});
|
|
42
|
-
};
|