@pythnetwork/pyth-solana-receiver 0.11.0 → 0.13.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/PythSolanaReceiver.cjs +581 -0
- package/{lib → dist}/PythSolanaReceiver.d.ts +10 -10
- package/dist/address.cjs +61 -0
- package/{lib → dist}/address.d.ts +0 -1
- package/dist/compute_budget.cjs +46 -0
- package/{lib → dist}/compute_budget.d.ts +0 -1
- package/{lib/idl/pyth_push_oracle.js → dist/idl/pyth_push_oracle.cjs} +50 -37
- package/{lib → dist}/idl/pyth_push_oracle.d.ts +0 -1
- package/{lib/idl/pyth_solana_receiver.js → dist/idl/pyth_solana_receiver.cjs} +309 -236
- package/{lib → dist}/idl/pyth_solana_receiver.d.ts +79 -23
- package/{lib/idl/wormhole_core_bridge_solana.js → dist/idl/wormhole_core_bridge_solana.cjs} +607 -464
- package/{lib → dist}/idl/wormhole_core_bridge_solana.d.ts +0 -1
- package/dist/index.cjs +44 -0
- package/dist/index.d.ts +5 -0
- package/dist/package.json +1 -0
- package/dist/vaa.cjs +221 -0
- package/{lib → dist}/vaa.d.ts +6 -7
- package/package.json +52 -13
- package/lib/PythSolanaReceiver.d.ts.map +0 -1
- package/lib/PythSolanaReceiver.js +0 -633
- package/lib/address.d.ts.map +0 -1
- package/lib/address.js +0 -46
- package/lib/compute_budget.d.ts.map +0 -1
- package/lib/compute_budget.js +0 -35
- package/lib/idl/pyth_push_oracle.d.ts.map +0 -1
- package/lib/idl/pyth_solana_receiver.d.ts.map +0 -1
- package/lib/idl/wormhole_core_bridge_solana.d.ts.map +0 -1
- package/lib/index.d.ts +0 -6
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -17
- package/lib/vaa.d.ts.map +0 -1
- package/lib/vaa.js +0 -270
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get DEFAULT_RECEIVER_PROGRAM_ID () {
|
|
13
|
+
return _address.DEFAULT_RECEIVER_PROGRAM_ID;
|
|
14
|
+
},
|
|
15
|
+
get DEFAULT_WORMHOLE_PROGRAM_ID () {
|
|
16
|
+
return _address.DEFAULT_WORMHOLE_PROGRAM_ID;
|
|
17
|
+
},
|
|
18
|
+
get PythSolanaReceiver () {
|
|
19
|
+
return _PythSolanaReceiver.PythSolanaReceiver;
|
|
20
|
+
},
|
|
21
|
+
get PythTransactionBuilder () {
|
|
22
|
+
return _PythSolanaReceiver.PythTransactionBuilder;
|
|
23
|
+
},
|
|
24
|
+
get TransactionBuilder () {
|
|
25
|
+
return _solanautils.TransactionBuilder;
|
|
26
|
+
},
|
|
27
|
+
get getConfigPda () {
|
|
28
|
+
return _address.getConfigPda;
|
|
29
|
+
},
|
|
30
|
+
get getPriceFeedAccountForProgram () {
|
|
31
|
+
return _PythSolanaReceiver.getPriceFeedAccountForProgram;
|
|
32
|
+
},
|
|
33
|
+
get pythSolanaReceiverIdl () {
|
|
34
|
+
return _pyth_solana_receiver.IDL;
|
|
35
|
+
},
|
|
36
|
+
get wormholeCoreBridgeIdl () {
|
|
37
|
+
return _wormhole_core_bridge_solana.IDL;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const _PythSolanaReceiver = require("./PythSolanaReceiver.cjs");
|
|
41
|
+
const _solanautils = require("@pythnetwork/solana-utils");
|
|
42
|
+
const _address = require("./address.cjs");
|
|
43
|
+
const _pyth_solana_receiver = require("./idl/pyth_solana_receiver.cjs");
|
|
44
|
+
const _wormhole_core_bridge_solana = require("./idl/wormhole_core_bridge_solana.cjs");
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PythSolanaReceiver, PythTransactionBuilder, getPriceFeedAccountForProgram, } from "./PythSolanaReceiver";
|
|
2
|
+
export { TransactionBuilder, type InstructionWithEphemeralSigners, } from "@pythnetwork/solana-utils";
|
|
3
|
+
export { getConfigPda, DEFAULT_RECEIVER_PROGRAM_ID, DEFAULT_WORMHOLE_PROGRAM_ID, } from "./address";
|
|
4
|
+
export { IDL as pythSolanaReceiverIdl, type PythSolanaReceiver as PythSolanaReceiverProgram, } from "./idl/pyth_solana_receiver";
|
|
5
|
+
export { IDL as wormholeCoreBridgeIdl, type WormholeCoreBridgeSolana as WormholeCoreBridgeProgram, } from "./idl/wormhole_core_bridge_solana";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
package/dist/vaa.cjs
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get DEFAULT_REDUCED_GUARDIAN_SET_SIZE () {
|
|
13
|
+
return DEFAULT_REDUCED_GUARDIAN_SET_SIZE;
|
|
14
|
+
},
|
|
15
|
+
get VAA_SIGNATURE_SIZE () {
|
|
16
|
+
return VAA_SIGNATURE_SIZE;
|
|
17
|
+
},
|
|
18
|
+
get VAA_SPLIT_INDEX () {
|
|
19
|
+
return VAA_SPLIT_INDEX;
|
|
20
|
+
},
|
|
21
|
+
get VAA_START () {
|
|
22
|
+
return VAA_START;
|
|
23
|
+
},
|
|
24
|
+
get buildCloseEncodedVaaInstruction () {
|
|
25
|
+
return buildCloseEncodedVaaInstruction;
|
|
26
|
+
},
|
|
27
|
+
get buildEncodedVaaCreateInstruction () {
|
|
28
|
+
return buildEncodedVaaCreateInstruction;
|
|
29
|
+
},
|
|
30
|
+
get buildPostEncodedVaaInstructions () {
|
|
31
|
+
return buildPostEncodedVaaInstructions;
|
|
32
|
+
},
|
|
33
|
+
get buildPostEncodedVaasForTwapInstructions () {
|
|
34
|
+
return buildPostEncodedVaasForTwapInstructions;
|
|
35
|
+
},
|
|
36
|
+
get findEncodedVaaAccountsByWriteAuthority () {
|
|
37
|
+
return findEncodedVaaAccountsByWriteAuthority;
|
|
38
|
+
},
|
|
39
|
+
get getGuardianSetIndex () {
|
|
40
|
+
return getGuardianSetIndex;
|
|
41
|
+
},
|
|
42
|
+
get trimSignatures () {
|
|
43
|
+
return trimSignatures;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const _bytes = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
|
|
47
|
+
const _sha256 = require("@noble/hashes/sha256");
|
|
48
|
+
const _web3 = require("@solana/web3.js");
|
|
49
|
+
const _address = require("./address.cjs");
|
|
50
|
+
const _compute_budget = require("./compute_budget.cjs");
|
|
51
|
+
function getGuardianSetIndex(vaa) {
|
|
52
|
+
return vaa.readUInt32BE(1);
|
|
53
|
+
}
|
|
54
|
+
const DEFAULT_REDUCED_GUARDIAN_SET_SIZE = 5;
|
|
55
|
+
const VAA_SIGNATURE_SIZE = 66;
|
|
56
|
+
const VAA_START = 46;
|
|
57
|
+
const VAA_SPLIT_INDEX = 721;
|
|
58
|
+
function trimSignatures(vaa, n = DEFAULT_REDUCED_GUARDIAN_SET_SIZE) {
|
|
59
|
+
const currentNumSignatures = vaa[5];
|
|
60
|
+
if (currentNumSignatures === undefined) {
|
|
61
|
+
throw new Error("vaa[5] is undefined");
|
|
62
|
+
}
|
|
63
|
+
if (n > currentNumSignatures) {
|
|
64
|
+
throw new Error("Resulting VAA can't have more signatures than the original VAA");
|
|
65
|
+
}
|
|
66
|
+
const trimmedVaa = Buffer.concat([
|
|
67
|
+
vaa.subarray(0, 6 + n * VAA_SIGNATURE_SIZE),
|
|
68
|
+
vaa.subarray(6 + currentNumSignatures * VAA_SIGNATURE_SIZE)
|
|
69
|
+
]);
|
|
70
|
+
trimmedVaa[5] = n;
|
|
71
|
+
return trimmedVaa;
|
|
72
|
+
}
|
|
73
|
+
// Core function to generate VAA instruction groups
|
|
74
|
+
async function generateVaaInstructionGroups(wormhole, vaa) {
|
|
75
|
+
const encodedVaaKeypair = new _web3.Keypair();
|
|
76
|
+
// Create and init instructions
|
|
77
|
+
const initInstructions = [
|
|
78
|
+
await buildEncodedVaaCreateInstruction(wormhole, vaa, encodedVaaKeypair),
|
|
79
|
+
{
|
|
80
|
+
instruction: await wormhole.methods.initEncodedVaa().accounts({
|
|
81
|
+
encodedVaa: encodedVaaKeypair.publicKey
|
|
82
|
+
}).instruction(),
|
|
83
|
+
signers: [],
|
|
84
|
+
computeUnits: _compute_budget.INIT_ENCODED_VAA_COMPUTE_BUDGET
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
// First write instruction
|
|
88
|
+
const writeFirstPartInstructions = [
|
|
89
|
+
{
|
|
90
|
+
instruction: await wormhole.methods.writeEncodedVaa({
|
|
91
|
+
index: 0,
|
|
92
|
+
data: vaa.subarray(0, VAA_SPLIT_INDEX)
|
|
93
|
+
}).accounts({
|
|
94
|
+
draftVaa: encodedVaaKeypair.publicKey
|
|
95
|
+
}).instruction(),
|
|
96
|
+
signers: [],
|
|
97
|
+
computeUnits: _compute_budget.WRITE_ENCODED_VAA_COMPUTE_BUDGET
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
// Second write and verify instructions
|
|
101
|
+
const writeSecondPartAndVerifyInstructions = [];
|
|
102
|
+
// The second write instruction is only needed if there are more bytes past the split index in the VAA
|
|
103
|
+
if (vaa.length > VAA_SPLIT_INDEX) {
|
|
104
|
+
writeSecondPartAndVerifyInstructions.push({
|
|
105
|
+
instruction: await wormhole.methods.writeEncodedVaa({
|
|
106
|
+
index: VAA_SPLIT_INDEX,
|
|
107
|
+
data: vaa.subarray(VAA_SPLIT_INDEX)
|
|
108
|
+
}).accounts({
|
|
109
|
+
draftVaa: encodedVaaKeypair.publicKey
|
|
110
|
+
}).instruction(),
|
|
111
|
+
signers: [],
|
|
112
|
+
computeUnits: _compute_budget.WRITE_ENCODED_VAA_COMPUTE_BUDGET
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
writeSecondPartAndVerifyInstructions.push({
|
|
116
|
+
instruction: await wormhole.methods.verifyEncodedVaaV1().accounts({
|
|
117
|
+
guardianSet: (0, _address.getGuardianSetPda)(getGuardianSetIndex(vaa), wormhole.programId),
|
|
118
|
+
draftVaa: encodedVaaKeypair.publicKey
|
|
119
|
+
}).instruction(),
|
|
120
|
+
signers: [],
|
|
121
|
+
computeUnits: _compute_budget.VERIFY_ENCODED_VAA_COMPUTE_BUDGET
|
|
122
|
+
});
|
|
123
|
+
// Close instructions
|
|
124
|
+
const closeInstructions = [
|
|
125
|
+
{
|
|
126
|
+
instruction: await wormhole.methods.closeEncodedVaa().accounts({
|
|
127
|
+
encodedVaa: encodedVaaKeypair.publicKey
|
|
128
|
+
}).instruction(),
|
|
129
|
+
signers: [],
|
|
130
|
+
computeUnits: _compute_budget.CLOSE_ENCODED_VAA_COMPUTE_BUDGET
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
return {
|
|
134
|
+
initInstructions,
|
|
135
|
+
writeFirstPartInstructions,
|
|
136
|
+
writeSecondPartAndVerifyInstructions,
|
|
137
|
+
closeInstructions,
|
|
138
|
+
encodedVaaAddress: encodedVaaKeypair.publicKey
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
async function buildPostEncodedVaaInstructions(wormhole, vaa) {
|
|
142
|
+
const groups = await generateVaaInstructionGroups(wormhole, vaa);
|
|
143
|
+
// Pack instructions for optimal 2-transaction pattern:
|
|
144
|
+
// TX1: init + first write
|
|
145
|
+
// TX2: second write + verify
|
|
146
|
+
return {
|
|
147
|
+
encodedVaaAddress: groups.encodedVaaAddress,
|
|
148
|
+
postInstructions: [
|
|
149
|
+
...groups.initInstructions,
|
|
150
|
+
...groups.writeFirstPartInstructions,
|
|
151
|
+
...groups.writeSecondPartAndVerifyInstructions
|
|
152
|
+
],
|
|
153
|
+
closeInstructions: groups.closeInstructions
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async function buildPostEncodedVaasForTwapInstructions(wormhole, startUpdateData, endUpdateData) {
|
|
157
|
+
const startGroups = await generateVaaInstructionGroups(wormhole, startUpdateData.vaa);
|
|
158
|
+
const endGroups = await generateVaaInstructionGroups(wormhole, endUpdateData.vaa);
|
|
159
|
+
// Pack instructions for optimal 3-transaction pattern:
|
|
160
|
+
// TX1: start VAA init + first write
|
|
161
|
+
// TX2: end VAA init + first write
|
|
162
|
+
// TX3: both VAAs second write + verify
|
|
163
|
+
const postInstructions = [
|
|
164
|
+
// TX1
|
|
165
|
+
...startGroups.initInstructions,
|
|
166
|
+
...startGroups.writeFirstPartInstructions,
|
|
167
|
+
// TX2
|
|
168
|
+
...endGroups.initInstructions,
|
|
169
|
+
...endGroups.writeFirstPartInstructions,
|
|
170
|
+
// TX3
|
|
171
|
+
...startGroups.writeSecondPartAndVerifyInstructions,
|
|
172
|
+
...endGroups.writeSecondPartAndVerifyInstructions
|
|
173
|
+
];
|
|
174
|
+
return {
|
|
175
|
+
startEncodedVaaAddress: startGroups.encodedVaaAddress,
|
|
176
|
+
endEncodedVaaAddress: endGroups.encodedVaaAddress,
|
|
177
|
+
postInstructions,
|
|
178
|
+
closeInstructions: [
|
|
179
|
+
...startGroups.closeInstructions,
|
|
180
|
+
...endGroups.closeInstructions
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async function buildCloseEncodedVaaInstruction(wormhole, encodedVaa) {
|
|
185
|
+
const instruction = await wormhole.methods.closeEncodedVaa().accounts({
|
|
186
|
+
encodedVaa
|
|
187
|
+
}).instruction();
|
|
188
|
+
return {
|
|
189
|
+
instruction,
|
|
190
|
+
signers: [],
|
|
191
|
+
computeUnits: _compute_budget.CLOSE_ENCODED_VAA_COMPUTE_BUDGET
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
async function buildEncodedVaaCreateInstruction(wormhole, vaa, encodedVaaKeypair) {
|
|
195
|
+
const encodedVaaSize = vaa.length + VAA_START;
|
|
196
|
+
return {
|
|
197
|
+
instruction: await wormhole.account.encodedVaa.createInstruction(encodedVaaKeypair, encodedVaaSize),
|
|
198
|
+
signers: [
|
|
199
|
+
encodedVaaKeypair
|
|
200
|
+
]
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
async function findEncodedVaaAccountsByWriteAuthority(connection, writeAuthority, wormholeProgramId) {
|
|
204
|
+
const result = await connection.getProgramAccounts(wormholeProgramId, {
|
|
205
|
+
filters: [
|
|
206
|
+
{
|
|
207
|
+
memcmp: {
|
|
208
|
+
offset: 0,
|
|
209
|
+
bytes: _bytes.bs58.encode(Buffer.from((0, _sha256.sha256)("account:EncodedVaa").slice(0, 8)))
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
memcmp: {
|
|
214
|
+
offset: 8 + 1,
|
|
215
|
+
bytes: _bytes.bs58.encode(writeAuthority.toBuffer())
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
return result.map((account)=>new _web3.PublicKey(account.pubkey));
|
|
221
|
+
}
|
package/{lib → dist}/vaa.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
2
|
-
import { WormholeCoreBridgeSolana } from "./idl/wormhole_core_bridge_solana";
|
|
3
1
|
import { Program } from "@coral-xyz/anchor";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import type { AccumulatorUpdateData } from "@pythnetwork/price-service-sdk";
|
|
3
|
+
import type { InstructionWithEphemeralSigners } from "@pythnetwork/solana-utils";
|
|
4
|
+
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
5
|
+
import type { WormholeCoreBridgeSolana } from "./idl/wormhole_core_bridge_solana";
|
|
6
6
|
/**
|
|
7
7
|
* Get the index of the guardian set that signed a VAA
|
|
8
8
|
*/
|
|
@@ -49,7 +49,7 @@ export declare function trimSignatures(vaa: Buffer, n?: number): Buffer;
|
|
|
49
49
|
*
|
|
50
50
|
* @param wormhole - The Wormhole program instance
|
|
51
51
|
* @param vaa - The VAA buffer to post
|
|
52
|
-
* @returns
|
|
52
|
+
* @returns Result containing:
|
|
53
53
|
* - encodedVaaAddress: Public key of the encoded VAA account
|
|
54
54
|
* - postInstructions: Instructions to post and verify the VAA
|
|
55
55
|
* - closeInstructions: Instructions to close the encoded VAA account and recover rent
|
|
@@ -71,7 +71,7 @@ export declare function buildPostEncodedVaaInstructions(wormhole: Program<Wormho
|
|
|
71
71
|
* @param wormhole - The Wormhole program instance
|
|
72
72
|
* @param startUpdateData - Accumulator update data containing the start VAA
|
|
73
73
|
* @param endUpdateData - Accumulator update data containing the end VAA
|
|
74
|
-
* @returns
|
|
74
|
+
* @returns Result containing:
|
|
75
75
|
* - startEncodedVaaAddress: Public key of the start VAA account
|
|
76
76
|
* - endEncodedVaaAddress: Public key of the end VAA account
|
|
77
77
|
* - postInstructions: Instructions to post and verify both VAAs
|
|
@@ -98,4 +98,3 @@ export declare function buildEncodedVaaCreateInstruction(wormhole: Program<Wormh
|
|
|
98
98
|
* @returns a list of the public keys of the encoded VAA accounts
|
|
99
99
|
*/
|
|
100
100
|
export declare function findEncodedVaaAccountsByWriteAuthority(connection: Connection, writeAuthority: PublicKey, wormholeProgramId: PublicKey): Promise<PublicKey[]>;
|
|
101
|
-
//# sourceMappingURL=vaa.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pythnetwork/pyth-solana-receiver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Pyth solana receiver SDK",
|
|
5
5
|
"homepage": "https://pyth.network",
|
|
6
|
-
"main": "
|
|
7
|
-
"types": "
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"
|
|
9
|
+
"dist/**/*"
|
|
10
10
|
],
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -22,33 +22,72 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"devDependencies": {
|
|
25
|
+
"@cprussin/eslint-config": "^4.0.2",
|
|
25
26
|
"@types/jest": "^29.4.0",
|
|
26
27
|
"@types/node": "^22.14.0",
|
|
27
|
-
"
|
|
28
|
-
"@typescript-eslint/parser": "^5.20.0",
|
|
29
|
-
"eslint": "^8.13.0",
|
|
28
|
+
"eslint": "^9.23.0",
|
|
30
29
|
"jest": "^29.4.0",
|
|
31
30
|
"prettier": "^3.5.3",
|
|
32
31
|
"quicktype": "^23.0.76",
|
|
33
32
|
"ts-jest": "^29.0.5",
|
|
34
33
|
"ts-node": "^10.9.2",
|
|
35
|
-
"
|
|
36
|
-
"@pythnetwork/hermes-client": "2.0.0"
|
|
34
|
+
"@pythnetwork/hermes-client": "2.1.0"
|
|
37
35
|
},
|
|
38
36
|
"dependencies": {
|
|
39
37
|
"@coral-xyz/anchor": "^0.29.0",
|
|
40
38
|
"@noble/hashes": "^1.4.0",
|
|
41
39
|
"@solana/web3.js": "^1.90.0",
|
|
42
|
-
"@pythnetwork/price-service-sdk": "1.
|
|
43
|
-
"@pythnetwork/solana-utils": "0.
|
|
40
|
+
"@pythnetwork/price-service-sdk": "1.9.0",
|
|
41
|
+
"@pythnetwork/solana-utils": "0.6.0"
|
|
44
42
|
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.14.0"
|
|
45
|
+
},
|
|
46
|
+
"type": "module",
|
|
47
|
+
"exports": {
|
|
48
|
+
"./PythSolanaReceiver": {
|
|
49
|
+
"types": "./dist/PythSolanaReceiver.d.ts",
|
|
50
|
+
"default": "./dist/PythSolanaReceiver.cjs"
|
|
51
|
+
},
|
|
52
|
+
"./address": {
|
|
53
|
+
"types": "./dist/address.d.ts",
|
|
54
|
+
"default": "./dist/address.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./compute_budget": {
|
|
57
|
+
"types": "./dist/compute_budget.d.ts",
|
|
58
|
+
"default": "./dist/compute_budget.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./idl/pyth_push_oracle": {
|
|
61
|
+
"types": "./dist/idl/pyth_push_oracle.d.ts",
|
|
62
|
+
"default": "./dist/idl/pyth_push_oracle.cjs"
|
|
63
|
+
},
|
|
64
|
+
"./idl/pyth_solana_receiver": {
|
|
65
|
+
"types": "./dist/idl/pyth_solana_receiver.d.ts",
|
|
66
|
+
"default": "./dist/idl/pyth_solana_receiver.cjs"
|
|
67
|
+
},
|
|
68
|
+
"./idl/wormhole_core_bridge_solana": {
|
|
69
|
+
"types": "./dist/idl/wormhole_core_bridge_solana.d.ts",
|
|
70
|
+
"default": "./dist/idl/wormhole_core_bridge_solana.cjs"
|
|
71
|
+
},
|
|
72
|
+
".": {
|
|
73
|
+
"types": "./dist/index.d.ts",
|
|
74
|
+
"default": "./dist/index.cjs"
|
|
75
|
+
},
|
|
76
|
+
"./vaa": {
|
|
77
|
+
"types": "./dist/vaa.d.ts",
|
|
78
|
+
"default": "./dist/vaa.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./package.json": "./package.json"
|
|
81
|
+
},
|
|
82
|
+
"module": "./dist/esm/index.js",
|
|
45
83
|
"scripts": {
|
|
46
|
-
"build": "
|
|
84
|
+
"build": "ts-duality --noEsm",
|
|
47
85
|
"test:lint": "eslint src/ --max-warnings 0",
|
|
48
86
|
"test:format": "prettier --check \"src/**/*.ts\"",
|
|
49
87
|
"fix:lint": "eslint src/ --fix --max-warnings 0",
|
|
50
88
|
"fix:format": "prettier --write \"src/**/*.ts\"",
|
|
51
89
|
"preversion": "pnpm run test:lint",
|
|
52
|
-
"version": "pnpm run format && git add -A src"
|
|
90
|
+
"version": "pnpm run format && git add -A src",
|
|
91
|
+
"clean": "rm -rf ./dist"
|
|
53
92
|
}
|
|
54
93
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PythSolanaReceiver.d.ts","sourceRoot":"","sources":["../src/PythSolanaReceiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,MAAM,EACN,WAAW,EACX,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,IAAI,yBAAyB,EAEhD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,wBAAwB,EAEzB,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AAYrD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAS3C,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,kBAAkB,GAC5B,WAAW,CAAC,yBAAyB,CAAC,CAAC,eAAe,CAAC,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAC3B,WAAW,CAAC,yBAAyB,CAAC,CAAC,YAAY,CAAC,CAAC;AACvD;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,IAAI,C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