Pavel Strakhov 4 місяців тому
батько
коміт
a0428e0027

+ 1 - 0
lazer/contracts/solana/package.json

@@ -1,5 +1,6 @@
 {
   "name": "@pythnetwork/pyth-lazer-solana-contract",
+  "type": "module",
   "private": true,
   "license": "ISC",
   "scripts": {

+ 2 - 2
lazer/contracts/solana/scripts/add_ecdsa_signer.ts

@@ -1,8 +1,8 @@
 import * as anchor from "@coral-xyz/anchor";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 import yargs from "yargs/yargs";
 import { readFileSync } from "fs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
 
 // Add a trusted signer or change its expiry time.
 //

+ 2 - 2
lazer/contracts/solana/scripts/add_ed25519_signer.ts

@@ -1,8 +1,8 @@
 import * as anchor from "@coral-xyz/anchor";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 import yargs from "yargs/yargs";
 import { readFileSync } from "fs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
 
 // Add a trusted signer or change its expiry time.
 //

+ 2 - 2
lazer/contracts/solana/scripts/check_trusted_signer.ts

@@ -1,7 +1,7 @@
 import * as anchor from "@coral-xyz/anchor";
 import yargs from "yargs/yargs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
+import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 
 const parser = yargs(process.argv.slice(2)).options({
   url: {

+ 2 - 2
lazer/contracts/solana/scripts/setup.ts

@@ -1,8 +1,8 @@
 import * as anchor from "@coral-xyz/anchor";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 import yargs from "yargs/yargs";
 import { readFileSync } from "fs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
 
 // This script initializes the program. It should be run once after the program is deployed. Additionally, if the
 // top authority be the same as the given keypair and the trusted signer and expiry time are provided, the trusted

+ 2 - 2
lazer/contracts/solana/scripts/verify_ecdsa_message.ts

@@ -1,8 +1,8 @@
 import * as anchor from "@coral-xyz/anchor";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 import yargs from "yargs/yargs";
 import { readFileSync } from "fs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
 
 async function main() {
   let argv = await yargs(process.argv.slice(2))

+ 2 - 3
lazer/contracts/solana/scripts/verify_ed25519_message.ts

@@ -1,9 +1,8 @@
 import * as anchor from "@coral-xyz/anchor";
-import { PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src";
+import { createEd25519Instruction, PYTH_LAZER_SOLANA_CONTRACT_IDL, type PythLazerSolanaContract } from "../src/index.js";
 import yargs from "yargs/yargs";
 import { readFileSync } from "fs";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
-import { createEd25519Instruction } from "../src/ed25519";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
 import {
   sendAndConfirmTransaction,
   SendTransactionError,

+ 4 - 4
lazer/contracts/solana/src/index.ts

@@ -1,6 +1,6 @@
-import { type PythLazerSolanaContract } from "./idl/pyth_lazer_solana_contract";
-import * as IDL from "./idl/pyth_lazer_solana_contract.json";
+import { type PythLazerSolanaContract } from "./idl/pyth_lazer_solana_contract.js";
+import * as IDL from "./idl/pyth_lazer_solana_contract.json" with { type: "json" };
 
-export { type PythLazerSolanaContract } from "./idl/pyth_lazer_solana_contract";
+export { type PythLazerSolanaContract } from "./idl/pyth_lazer_solana_contract.js";
 export const PYTH_LAZER_SOLANA_CONTRACT_IDL = IDL as PythLazerSolanaContract;
-export { createEd25519Instruction } from "./ed25519";
+export { createEd25519Instruction } from "./ed25519.js";

+ 1 - 1
lazer/contracts/solana/tests/pyth-lazer-solana-contract.ts

@@ -1,6 +1,6 @@
 import * as anchor from "@coral-xyz/anchor";
 import { Program } from "@coral-xyz/anchor";
-import { PythLazerSolanaContract } from "../src/idl/pyth_lazer_solana_contract";
+import { PythLazerSolanaContract } from "../src/index.js";
 import { BN } from "bn.js";
 
 describe("pyth-lazer-solana-contract", () => {