├── README.md └── web3js ├── .gitignore ├── 01_HelloSolana ├── 01_HelloSolana.ts └── readme.md ├── 02_Wallet ├── 02_Wallet.ts └── readme.md ├── 03_Transfer ├── 03_Transfer.ts ├── img │ └── 3-1.png └── readme.md ├── 04_Account ├── 04_Account.ts ├── img │ ├── 4-1.png │ ├── 4-2.png │ └── 4-3.png └── readme.md ├── package-lock.json ├── package.json └── tsconfig.json /README.md: -------------------------------------------------------------------------------- 1 | # WTF Solana 教程 2 | 3 | WTF Solana 教程由 [WTF Academy](https://wtf.academy) 和 [ChainBuff](https://chainbuff.com) 共同推出,旨在帮助开发者快速上手 Solana 开发。 4 | 5 | ## Part1: Solana 基本架构 6 | 负责人 Inky @XingqiWang 7 | 8 | 9 | ## Part2: Solana Web3.js 极简教程 10 | 负责人 0xAA @AmazingAng 11 | 12 | Solana web3.js是一个完整而简洁的JavaScript库,可以让开发者便捷地与Solana区块链交互,与以太坊的ethers.js库类似。你需要使用npm安装它: 13 | 14 | ```bash 15 | npm install @solana/web3.js@1.98.0 16 | ``` 17 | 18 | **第1讲:Hello Solana**:【[教程](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/01_HelloSolana/readme.md)】【[Code](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/01_HelloSolana/01_HelloSolana.ts)】 19 | 20 | **第2讲:钱包**:【[教程](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/02_Wallet/readme.md)】【[Code](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/02_Wallet/02_Wallet.ts)】 21 | 22 | **第3讲:转账 Sol**:【[教程](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/03_Transfer/readme.md)】【[Code](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/03_Transfer/03_Transfer.ts)】 23 | 24 | 25 | **第4讲:账户**:【[教程](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/04_Account/readme.md)】【[Code](https://github.com/WTFAcademy/WTF-Solana/blob/main/web3js/04_Account/04_Account.ts)】 26 | 27 | 28 | 29 | ## Part3: Solana 智能合约开发 30 | 负责人 Haynar @0xhay 31 | 32 | ## 参考资料 33 | 34 | 1. [WTF Ethers.js 教程 by WTF Academy](https://github.com/WTFAcademy/WTF-Ethers) 35 | 2. [solana-web3js 教程 by ChainBuff](https://github.com/ChainBuff/solana-web3js) 36 | 3. [Solana Executive Overview by Helius](https://www.helius.dev/blog/solana-executive-overview) 37 | -------------------------------------------------------------------------------- /web3js/.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | .DS_Store 3 | node_modules 4 | server.js 5 | Test 6 | wallet.txt -------------------------------------------------------------------------------- /web3js/01_HelloSolana/01_HelloSolana.ts: -------------------------------------------------------------------------------- 1 | import { Connection, clusterApiUrl, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; 2 | 3 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 4 | const main = async () => { 5 | const publicKey = new PublicKey("mpa4abUkjQoAvPzREkh5Mo75hZhPFQ2FSH6w7dWKuQ5"); 6 | const balance = await connection.getBalance(publicKey); 7 | // 输出API URL 8 | console.log(`API URL: ${clusterApiUrl("mainnet-beta")}`); 9 | // 输出LAMPORTS_PER_SOL 10 | console.log(`LAMPORTS PER SOL: ${LAMPORTS_PER_SOL}`); 11 | // 输出SOL余额 12 | console.log(`SOL Balance: ${balance / LAMPORTS_PER_SOL} SOL`); 13 | } 14 | 15 | main(); -------------------------------------------------------------------------------- /web3js/01_HelloSolana/readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 1. Hello Solana 3 | tags: 4 | - solana 5 | - javascript 6 | - web3js 7 | - frontend 8 | - blockchain 9 | --- 10 | 11 | # WTF Solana Web3.js 极简教程: 1. Hello Solana 12 | 13 | WTF Solana Web3.js极简教程属于 WTF Solana 教程的一部分,由 WTF Academy 和 ChainBuff 共同推出。 14 | 15 | **推特**:[@0xAA_Science](https://twitter.com/0xAA_Science) | [@WTFAcademy_](https://twitter.com/WTFAcademy_) | [@ChainBuff](https://twitter.com/ChainBuff) 16 | 17 | **WTF Academy社群:** [官网 wtf.academy](https://wtf.academy) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link) | [Discord](https://discord.gg/5akcruXrsk) 18 | 19 | 所有代码和教程开源在GitHub: [github.com/WTFAcademy/WTF-Solana](https://github.com/WTFAcademy/WTF-Solana) 20 | 21 | ----- 22 | 23 | 这一讲,我们会介绍Solana的web3.js库,并学习如何在前端中使用web3.js读取Solana上指定地址的SOL余额。 24 | 25 | ## Solana web3.js简述 26 | 27 | Solana web3.js是一个完整而简洁的库,可以让开发者便捷地与Solana区块链交互,与以太坊的ethers.js库类似。 28 | 29 | 你需要使用npm安装web3.js库: 30 | 31 | ```bash 32 | npm install @solana/web3.js@1.98.0 33 | ``` 34 | 35 | ## Hello Solana 36 | 37 | 现在,让我们写一个简单的javascript程序 `HelloSolana`,查询给定Solana地址的SOL余额并输出到控制台。 38 | 39 | ```javascript 40 | import { Connection, clusterApiUrl, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; 41 | 42 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 43 | // 输出API URL 44 | console.log(`API URL: ${clusterApiUrl("mainnet-beta")}`); 45 | 46 | // 输出LAMPORTS_PER_SOL 47 | console.log(`LAMPORTS PER SOL: ${LAMPORTS_PER_SOL}`); 48 | 49 | const main = async () => { 50 | const publicKey = new PublicKey("mpa4abUkjQoAvPzREkh5Mo75hZhPFQ2FSH6w7dWKuQ5"); 51 | const balance = await connection.getBalance(publicKey); 52 | // 输出SOL余额 53 | console.log(`SOL Balance: ${balance / LAMPORTS_PER_SOL} SOL`); 54 | } 55 | 56 | main(); 57 | ``` 58 | 59 | 下面我们逐行分析代码 60 | 61 | ### 1. 导入Solana web3.js库 62 | 63 | ```javascript 64 | import { Connection, clusterApiUrl, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; 65 | ``` 66 | 67 | ### 2. 设置RPC连接 68 | 69 | Web3js中的 `Connection` 类是与Solana区块链交互的核心类,它提供了多种方法来与区块链进行交互,既可以读取链上信息,也可以通过发送交易写入信息。 70 | 71 | 通过给定RPC端口和确认级别,我们可以创建一个Connection实例。 72 | 73 | ```javascript 74 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 75 | // 输出API URL 76 | console.log(`API URL: ${clusterApiUrl("mainnet-beta")}`); 77 | // output: https://api.mainnet-beta.solana.com 78 | ``` 79 | 80 | 其中 `mainnet-beta` 是Solana官方提供的主网RPC端口,为 `https://api.mainnet-beta.solana.com`,`confirmed` 是默认的确认级别。 81 | 82 | > `processed` 是较低的确认级别,意味着查询的数据是经过验证但尚未完全确认的。`confirmed` 表示节点已经将交易写入区块链,但也不一定被最终确认。如果需要更高的确认级别,可以使用 `finalized`。 83 | 84 | ### 3. 查询余额 85 | 86 | 我们可以使用 `Connection` 类中的 `getBalance` 方法查询指定地址的SOL余额: 87 | 88 | ```javascript 89 | const main = async () => { 90 | const publicKey = new PublicKey("mpa4abUkjQoAvPzREkh5Mo75hZhPFQ2FSH6w7dWKuQ5"); 91 | const balance = await connection.getBalance(publicKey); 92 | // 输出SOL余额 93 | console.log(`SOL Balance: ${balance / LAMPORTS_PER_SOL} SOL`); 94 | } 95 | 96 | main(); 97 | ``` 98 | 99 | > `PublicKey` 类可创建Solana公钥对象。 100 | > `LAMPORTS_PER_SOL` 是Solana的Lamport单位(类似于以太坊中的gwei),1 SOL = 10^9 Lamport。 101 | 102 | 通过 `ts-node 01_HelloSolana.ts` 运行程序,输出结果如下: 103 | 104 | ```bash 105 | API URL: https://api.mainnet-beta.solana.com 106 | LAMPORTS PER SOL: 1000000000 107 | SOL Balance: 48.307267292 SOL 108 | ``` 109 | 110 | ## 总结 111 | 112 | 这是WTF Solana Web3.js极简教程的第一讲,我们介绍了web3.js,并写了一个简单的HelloSolana程序,用于查询指定地址的SOL余额。 113 | 114 | -------------------------------------------------------------------------------- /web3js/02_Wallet/02_Wallet.ts: -------------------------------------------------------------------------------- 1 | import { Keypair } from "@solana/web3.js"; 2 | import bs58 from "bs58"; 3 | import fs from "fs"; 4 | 5 | const wallet = Keypair.generate(); 6 | 7 | console.log("新钱包创建成功!"); 8 | console.log("Public Key:", wallet.publicKey.toBase58()); 9 | console.log("Private Key (base58):", bs58.encode(wallet.secretKey)); 10 | 11 | 12 | // Base58 和 原始私钥 13 | console.log("原始私钥:", wallet.secretKey); 14 | const privateKey58 = bs58.encode(wallet.secretKey); 15 | console.log("Base58 编码后的私钥:", privateKey58); 16 | const decoded = bs58.decode(privateKey58); 17 | console.log("解码后的原始私钥:", Uint8Array.from(decoded)); 18 | 19 | -------------------------------------------------------------------------------- /web3js/02_Wallet/readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 2. 钱包 3 | tags: 4 | - solana 5 | - javascript 6 | - web3js 7 | - wallet 8 | - blockchain 9 | --- 10 | 11 | # WTF Solana Web3.js 极简教程: 2. 钱包 12 | 13 | WTF Solana Web3.js 极简教程属于 WTF Solana 教程的一部分,由 WTF Academy 和 ChainBuff 共同推出。 14 | 15 | **推特**:[@0xAA_Science](https://twitter.com/0xAA_Science) | [@WTFAcademy_](https://twitter.com/WTFAcademy_) | [@ChainBuff](https://twitter.com/ChainBuff) 16 | 17 | **WTF Academy 社群:** [官网 wtf.academy](https://wtf.academy) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link) | [Discord](https://discord.gg/5akcruXrsk) 18 | 19 | 所有代码和教程开源在 GitHub: [github.com/WTFAcademy/WTF-Solana](https://github.com/WTFAcademy/WTF-Solana) 20 | 21 | --- 22 | 23 | 在 Solana 中,每一个钱包都是一个 `Keypair`,由私钥(secretKey)和公钥(publicKey)组成。`@solana/web3.js` 中的 `Keypair` 类提供了创建、导出、导入钱包的能力。 24 | 25 | 本讲我们将介绍三种操作: 26 | 1. 创建一个新钱包 27 | 2. 将钱包保存到本地(base58 编码) 28 | 3. 从本地导入钱包(从私钥恢复) 29 | 30 | 31 | ## 1. 创建新钱包 32 | 33 | ```ts 34 | import { Keypair } from "@solana/web3.js"; 35 | import bs58 from "bs58"; 36 | 37 | const wallet = Keypair.generate(); 38 | 39 | console.log("新钱包创建成功!"); 40 | console.log("Public Key:", wallet.publicKey.toBase58()); 41 | console.log("Private Key (base58):", bs58.encode(wallet.secretKey)); 42 | ``` 43 | 44 | ### 输出样例: 45 | 46 | ``` 47 | 新钱包创建成功! 48 | Public Key: 9Ujz...WYXh 49 | Private Key (base58): 3rcA...Ttzh 50 | ``` 51 | 52 | > `secretKey` 是 `Uint8Array`,我们通常将其转为 base58 编码后保存。 53 | 54 | 55 | ## 2. 将钱包保存到文件 56 | 57 | ```ts 58 | import fs from "fs"; 59 | 60 | const privateKey58 = bs58.encode(wallet.secretKey); 61 | fs.writeFileSync("wallet.txt", privateKey58); 62 | console.log("私钥已保存到 wallet.txt"); 63 | ``` 64 | 65 | 66 | ## 3. 从私钥导入钱包 67 | 68 | 你可以通过 base58 编码的私钥恢复钱包: 69 | 70 | ```ts 71 | const savedKey58 = fs.readFileSync("wallet.txt", "utf-8"); 72 | const recoveredSecretKey = bs58.decode(savedKey58); 73 | const recoveredWallet = Keypair.fromSecretKey(recoveredSecretKey); 74 | 75 | console.log("钱包恢复成功!"); 76 | console.log("Recovered Public Key:", recoveredWallet.publicKey.toBase58()); 77 | ``` 78 | 79 | ### 输出样例: 80 | 81 | ``` 82 | Recovered Public Key: 与原钱包一致 ✅ 83 | ``` 84 | 85 | 86 | > 请妥善保管你的私钥文件(`wallet.txt`),**不要上传到 GitHub**,也不要暴露在公网。 87 | > 如果你丢失了私钥,那么这个钱包中的资产就丢了。 88 | 89 | 90 | ## 4. 私钥格式说明:数字数组 vs base58 编码 91 | 92 | 你可能在一些 Solana 钱包导出的示例中看到如下格式的私钥: 93 | 94 | ```json 95 | [ 96 | 57, 112, 7, 145, 39, 71, 23, 123, 242, 25, 253, 97 | 181, 237, 249, 170, 112, 188, 82, 139, 27, 143, 208, 98 | 161, 23, 69, 245, 137, 67, 228, 2, 221, 13, 9, 99 | 112, 247, 27, 171, 133, 86, 0, 75, 209, 228, 223, 100 | 247, 43, 6, 234, 238, 57, 193, 249, 142, 212, 171, 101 | 253, 143, 168, 16, 252, 144, 142, 148, 203 102 | ] 103 | ``` 104 | 105 | 这是私钥(`secretKey`)的**原始格式**,是 JSON 格式的 `Uint8Array` 数组。 106 | 107 | Solana 通常使用 base58 编码(类似比特币地址)来展示私钥,因为它更短、更安全地避免了视觉歧义。 108 | 109 | 我们可以通过 `bs58` 库来实现两种格式的转换: 110 | 111 | ```ts 112 | console.log("原始私钥:", wallet.secretKey); 113 | const privateKey58 = bs58.encode(wallet.secretKey); 114 | console.log("Base58 编码后的私钥:", privateKey58); 115 | const decoded = bs58.decode(privateKey58); 116 | console.log("解码后的原始私钥:", Uint8Array.from(decoded)); 117 | ``` 118 | 119 | ### 输出样例: 120 | 121 | ``` 122 | 原始私钥: Uint8Array(64) [ 123 | 11, 74, 157, 238, 156, 52, 222, 69, 52, 127, 201, 124 | 185, 56, 143, 67, 18, 234, 102, 198, 188, 194, 53, 125 | 231, 238, 72, 150, 212, 135, 163, 153, 169, 145, 194, 126 | 251, 119, 181, 96, 210, 37, 173, 175, 102, 73, 98, 127 | 221, 89, 122, 52, 219, 241, 220, 50, 48, 69, 100, 128 | 43, 16, 87, 35, 246, 34, 235, 108, 200 129 | ] 130 | Base58 编码后的私钥: E6S4WWG3onkuAFPCmPfvnas2hsSQ2APPN6DHBU4bcYB97YmLmc7PxYsjDKh9HyGDJfWqzeu2wLUT2h2nHwji7ao 131 | 解码后的原始私钥: Uint8Array(64) [ 132 | 11, 74, 157, 238, 156, 52, 222, 69, 52, 127, 201, 133 | 185, 56, 143, 67, 18, 234, 102, 198, 188, 194, 53, 134 | 231, 238, 72, 150, 212, 135, 163, 153, 169, 145, 194, 135 | 251, 119, 181, 96, 210, 37, 173, 175, 102, 73, 98, 136 | 221, 89, 122, 52, 219, 241, 220, 50, 48, 69, 100, 137 | 43, 16, 87, 35, 246, 34, 235, 108, 200 138 | ] 139 | ``` 140 | 141 | 142 | ## 5. 总结 143 | 144 | 这一讲中,我们学习了如何用 Web3.js: 145 | 146 | - 创建一个新的 Solana 钱包(Keypair) 147 | - 保存并导出私钥(使用 base58 编码) 148 | - 从私钥导入并恢复钱包 149 | 150 | 你现在已经能够用代码安全地管理 Solana 钱包了! -------------------------------------------------------------------------------- /web3js/03_Transfer/03_Transfer.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Connection, 3 | clusterApiUrl, 4 | Keypair, 5 | PublicKey, 6 | LAMPORTS_PER_SOL, 7 | SystemProgram, 8 | Transaction, 9 | sendAndConfirmTransaction, 10 | } from "@solana/web3.js"; 11 | import bs58 from "bs58"; 12 | import fs from "fs"; 13 | 14 | // 连接主网 15 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 16 | 17 | // 从本地导入发送者私钥(请确保保密) 18 | const secretKeyBase58 = fs.readFileSync("wallet.txt", "utf-8"); 19 | const sender = Keypair.fromSecretKey(bs58.decode(secretKeyBase58)); 20 | 21 | // 接收者地址(可以改为你的另一个钱包) 22 | const receiver = new PublicKey("4xxeGf2jZAyLVW1sEELTJy2Fd4hwRerNTDCg8ZQuH4tn"); 23 | 24 | const main = async () => { 25 | // 1. 打印当前发送者余额 26 | const balance = await connection.getBalance(sender.publicKey); 27 | console.log(`💰 当前余额: ${balance / LAMPORTS_PER_SOL} SOL`); 28 | 29 | // 2. 构建转账指令(0.001 SOL) 30 | const instruction = SystemProgram.transfer({ 31 | fromPubkey: sender.publicKey, 32 | toPubkey: receiver, 33 | lamports: 0.001 * LAMPORTS_PER_SOL, 34 | }); 35 | 36 | // 3. 创建交易 37 | const transaction = new Transaction().add(instruction); 38 | 39 | console.log("recentBlockhash", transaction.recentBlockhash); 40 | console.log("lastValidBlockHeight", transaction.lastValidBlockHeight); 41 | console.log("nonceInfo", transaction.nonceInfo); 42 | 43 | // 4. 模拟交易 44 | const simulateResult = await connection.simulateTransaction(transaction, [sender]); 45 | console.log("模拟交易结果: ", simulateResult); 46 | 47 | // 5. 发送交易 48 | console.log("正在发送交易..."); 49 | const signature = await sendAndConfirmTransaction(connection, transaction, [sender]); 50 | 51 | console.log("交易成功!交易哈希:", signature); 52 | console.log(`查看交易:https://solscan.io/tx/${signature}?cluster=mainnet-beta`); 53 | }; 54 | 55 | main(); -------------------------------------------------------------------------------- /web3js/03_Transfer/img/3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WTFAcademy/WTF-Solana/fff46462a40077be22fbb043c5ac56b084a4d4d8/web3js/03_Transfer/img/3-1.png -------------------------------------------------------------------------------- /web3js/03_Transfer/readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 3. 发送交易: SOL转账 3 | tags: 4 | - solana 5 | - javascript 6 | - web3js 7 | - transfer 8 | - blockchain 9 | --- 10 | 11 | # WTF Solana Web3.js 极简教程: 3. 发送交易: SOL转账 12 | 13 | WTF Solana Web3.js 极简教程属于 WTF Solana 教程的一部分,由 WTF Academy 和 ChainBuff 共同推出。 14 | 15 | **推特**:[@0xAA_Science](https://twitter.com/0xAA_Science) | [@WTFAcademy_](https://twitter.com/WTFAcademy_) | [@ChainBuff](https://twitter.com/ChainBuff) 16 | 17 | **WTF Academy 社群:** [官网 wtf.academy](https://wtf.academy) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link) | [Discord](https://discord.gg/5akcruXrsk) 18 | 19 | 所有代码和教程开源在 GitHub: [github.com/WTFAcademy/WTF-Solana](https://github.com/WTFAcademy/WTF-Solana) 20 | 21 | --- 22 | 23 | ## 1. Solana 交易中的 Instruction 与 Transaction 24 | 25 | 在 Solana 中,**一次交易(Transaction)** 是由一个或多个 **指令(Instruction)** 组成的。 26 | 27 | 指令可以理解为一条链上操作,例如“转账”、“调用合约”。 28 | 29 | 一次交易可以包含一个或多个指令,并且每笔交易必须包含:**账户信息**、**指令**、**签名者**。交易构建后需签名并发送,才能被验证者节点打包进区块。 30 | 31 | 交易是“原子的”——所有指令必须成功处理,否则整个交易失败并且不会发生任何变化。 32 | 33 | ![](./img/3-1.png) 34 | 35 | ## 2. 连接 Solana 主网 36 | 37 | 在 web3.js 中,`Connection` 是连接 Solana 节点的核心类,提供链上查询、交易广播、确认状态等功能。 38 | 39 | ### 主网 / 测试网 / 本地网对比: 40 | 41 | | 网络 | 用途 | 地址 | 是否真实资产 | 42 | |------|------|------|---------------| 43 | | `mainnet-beta` | 生产环境 | https://api.mainnet-beta.solana.com | ✅ 是 | 44 | | `devnet` | 开发测试 | https://api.devnet.solana.com | ❌ 否 | 45 | | `testnet` | 节点测试 | https://api.testnet.solana.com | ❌ 否 | 46 | | `localhost` | 本地测试 | http://127.0.0.1:8899 | ❌ 否 | 47 | 48 | > 本讲使用主网(mainnet-beta),请谨慎操作,**所有转账均为真实资产!** 49 | 50 | ```ts 51 | import { Connection, clusterApiUrl } from "@solana/web3.js"; 52 | 53 | // 连接主网 54 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 55 | ``` 56 | 57 | ## 3. 构建一笔主网上的 SOL 转账 58 | 59 | 我们将从本地导入私钥,向另一个地址转账 0.001 SOL,并广播交易。 60 | 61 | 首先,我们使用 `SystemProgram.transfer` 构建转账指令,然后我们使用 "new Transaction()" 创建一笔交易,然后使用 "Transaction().add()" 将转账指令添加到交易中,最后通过 `sendAndConfirmTransaction` 签名并广播到链上。 62 | 63 | ### 示例代码:03_Transfer.ts 64 | 65 | ```ts 66 | import { 67 | Connection, 68 | clusterApiUrl, 69 | Keypair, 70 | PublicKey, 71 | LAMPORTS_PER_SOL, 72 | SystemProgram, 73 | Transaction, 74 | sendAndConfirmTransaction, 75 | } from "@solana/web3.js"; 76 | import bs58 from "bs58"; 77 | import fs from "fs"; 78 | 79 | // 连接主网 80 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 81 | 82 | // 从本地导入发送者私钥(请确保保密) 83 | const secretKeyBase58 = fs.readFileSync("wallet.txt", "utf-8"); 84 | const sender = Keypair.fromSecretKey(bs58.decode(secretKeyBase58)); 85 | 86 | // 接收者地址(可以改为你的另一个钱包) 87 | const receiver = new PublicKey("4xxeGf2jZAyLVW1sEELTJy2Fd4hwRerNTDCg8ZQuH4tn"); 88 | 89 | const main = async () => { 90 | // 1. 打印当前发送者余额 91 | const balance = await connection.getBalance(sender.publicKey); 92 | console.log(`当前余额: ${balance / LAMPORTS_PER_SOL} SOL`); 93 | 94 | // 2. 构建转账指令(0.001 SOL) 95 | const instruction = SystemProgram.transfer({ 96 | fromPubkey: sender.publicKey, 97 | toPubkey: receiver, 98 | lamports: 0.001 * LAMPORTS_PER_SOL, 99 | }); 100 | 101 | // 3. 创建交易 102 | const transaction = new Transaction().add(instruction); 103 | 104 | 105 | // 4. 模拟交易 106 | const simulateResult = await connection.simulateTransaction(transaction, [sender]); 107 | console.log("模拟交易结果: ", simulateResult); 108 | 109 | // 5. 发送交易 110 | console.log("正在发送交易..."); 111 | const signature = await sendAndConfirmTransaction(connection, transaction, [sender]); 112 | 113 | console.log("交易成功!交易哈希:", signature); 114 | console.log(`查看交易:https://solscan.io/tx/${signature}?cluster=mainnet-beta`); 115 | }; 116 | 117 | main(); 118 | ``` 119 | 120 | ### 输出样例 121 | 122 | ``` 123 | 当前余额: 0.1 SOL 124 | 模拟交易结果: { 125 | context: { apiVersion: '2.2.14', slot: 341716177 }, 126 | value: { 127 | accounts: null, 128 | err: null, 129 | innerInstructions: null, 130 | logs: [ 131 | 'Program 11111111111111111111111111111111 invoke [1]', 132 | 'Program 11111111111111111111111111111111 success' 133 | ], 134 | replacementBlockhash: null, 135 | returnData: null, 136 | unitsConsumed: 150 137 | } 138 | } 139 | 正在发送交易... 140 | 交易成功!交易哈希: 3vr9oZwTcdbLGJfMEX5auy82FFScMBfb5fzfj5SELMqzGuCCNqPV44QsE8rQVTTTmbqTenM1Eogh7aaeN1jnup8g 141 | 查看交易:https://solscan.io/tx/3vr9oZwTcdbLGJfMEX5auy82FFScMBfb5fzfj5SELMqzGuCCNqPV44QsE8rQVTTTmbqTenM1Eogh7aaeN1jnup8g?cluster=mainnet-beta 142 | ``` 143 | 144 | ## 4. 总结 145 | 146 | 这一讲,我们: 147 | - 了解了 Solana 交易中的 Instruction 与 Transaction 148 | - 了解如何使用 `Connection` 类连接到 Solana 主网 149 | - 使用 `SystemProgram.transfer` 发起一笔真实的 SOL 转账 150 | -------------------------------------------------------------------------------- /web3js/04_Account/04_Account.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Connection, 3 | Keypair, 4 | PublicKey, 5 | SystemProgram, 6 | LAMPORTS_PER_SOL, 7 | sendAndConfirmTransaction, 8 | Transaction, 9 | clusterApiUrl, 10 | } from "@solana/web3.js"; 11 | import bs58 from "bs58"; 12 | import fs from "fs"; 13 | 14 | // 连接主网 15 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 16 | 17 | // 读取已有私钥作为付款账户 18 | const secretKeyBase58 = fs.readFileSync("wallet.txt", "utf-8"); 19 | const payer = Keypair.fromSecretKey(bs58.decode(secretKeyBase58)); 20 | 21 | // 创建新账户 22 | const newAccount = Keypair.generate(); 23 | 24 | // 你可以先用 SystemProgram 作为 owner(表示这个账户没有合约逻辑) 25 | const programId = SystemProgram.programId; 26 | 27 | // 分配 64 字节空间(可自定义) 28 | const space = 64; 29 | 30 | const main = async () => { 31 | 32 | const pubkey = new PublicKey("6fuivRGE5Fr9bwkW2Wu1E2wTMQ8RnoNgtZb8tievLVmb") 33 | const accountInfo = await connection.getAccountInfo(pubkey); 34 | console.log(JSON.stringify(accountInfo, null, 2)); 35 | 36 | // 创建账户 37 | // 获取租金豁免所需 lamports 38 | const lamports = await connection.getMinimumBalanceForRentExemption(space); 39 | console.log("需要的租金:", lamports / LAMPORTS_PER_SOL, "SOL"); 40 | 41 | // 创建指令 42 | const instruction = SystemProgram.createAccount({ 43 | fromPubkey: payer.publicKey, 44 | newAccountPubkey: newAccount.publicKey, 45 | lamports, 46 | space, 47 | programId, 48 | }); 49 | 50 | const tx = new Transaction().add(instruction); 51 | 52 | // 发送交易 53 | console.log("🚀 正在创建账户..."); 54 | const sig = await sendAndConfirmTransaction(connection, tx, [payer, newAccount]); 55 | 56 | console.log("✅ 账户创建成功!"); 57 | const accountAddress = newAccount.publicKey 58 | console.log("新账户地址:", accountAddress.toBase58()); 59 | console.log("交易哈希:", sig); 60 | console.log(`🔍 https://solscan.io/tx/${sig}?cluster=mainnet-beta`); 61 | 62 | const accountInfo2 = await connection.getAccountInfo(accountAddress); 63 | 64 | if (!accountInfo2) { 65 | console.log("❌ 账户不存在或尚未初始化"); 66 | return; 67 | }else{ 68 | console.log("✅ 账户创建成功"); 69 | console.log(JSON.stringify(accountInfo2, null, 2)); 70 | } 71 | 72 | 73 | }; 74 | 75 | main(); 76 | -------------------------------------------------------------------------------- /web3js/04_Account/img/4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WTFAcademy/WTF-Solana/fff46462a40077be22fbb043c5ac56b084a4d4d8/web3js/04_Account/img/4-1.png -------------------------------------------------------------------------------- /web3js/04_Account/img/4-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WTFAcademy/WTF-Solana/fff46462a40077be22fbb043c5ac56b084a4d4d8/web3js/04_Account/img/4-2.png -------------------------------------------------------------------------------- /web3js/04_Account/img/4-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WTFAcademy/WTF-Solana/fff46462a40077be22fbb043c5ac56b084a4d4d8/web3js/04_Account/img/4-3.png -------------------------------------------------------------------------------- /web3js/04_Account/readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 4. 账户 3 | tags: 4 | - solana 5 | - javascript 6 | - web3js 7 | - account 8 | - blockchain 9 | --- 10 | 11 | # WTF Solana Web3.js 极简教程:4. 账户 12 | 13 | WTF Solana Web3.js 极简教程属于 WTF Solana 教程的一部分,由 WTF Academy 和 ChainBuff 共同推出。 14 | 15 | **推特**:[@0xAA_Science](https://twitter.com/0xAA_Science) | [@WTFAcademy_](https://twitter.com/WTFAcademy_) | [@ChainBuff](https://twitter.com/ChainBuff) 16 | 17 | **WTF Academy 社群:** [官网 wtf.academy](https://wtf.academy) | [微信群申请](https://docs.google.com/forms/d/e/1FAIpQLSe4KGT8Sh6sJ7hedQRuIYirOoZK_85miz3dw7vA1-YjodgJ-A/viewform?usp=sf_link) | [Discord](https://discord.gg/5akcruXrsk) 18 | 19 | 所有代码和教程开源在 GitHub: [github.com/WTFAcademy/WTF-Solana](https://github.com/WTFAcademy/WTF-Solana) 20 | 21 | --- 22 | 23 | ## 1. Solana 中的账户 24 | 25 | 在 Solana 中,一切(钱包、状态、程序)都是账户。您可以将 Solana 上的数据视为一个公共数据库,其中包含一个“帐户”表,该表中的每个条目都是一个“帐户”。 26 | 27 | ![](./img/4-1.png) 28 | 29 | Solana 上的每个帐户都有一个唯一的 32 字节地址,通常显示为 base58 编码的字符串(例如`6fuivRGE5Fr9bwkW2Wu1E2wTMQ8RnoNgtZb8tievLVmb`)。 30 | 31 | 账户与其地址之间的关系类似于键值对,其中地址是定位账户对应链上数据的关键。账户地址充当“账户”表中每个条目的“唯一ID”。 32 | 33 | ![](./img/4-2.png) 34 | 35 | 36 | 每个账户都拥有以下字段: 37 | 38 | 1. `lamports`: 当前账户余额,以lamports为单位(1 SOL = 10⁹ lamports)。 39 | 2. `owner`: 帐户所有者的程序ID(Programs ID)。在 Solana 中,智能合约被称为程序(Program),而程序ID就是程序账户的公钥。只有所有者程序可以更改帐户的数据或扣除其 Lamport 余额。 40 | 3. `data` 账户的数据区,可以存储账户相关的字节数组。对于不可执行的账户,这通常存储需要读取的状态。对于程序账户,这包含可执行的程序代码。数据字段通常称为“账户数据”。这里与以太坊的账户结构不同,Solana 账户内部没有 `storage`,如果需要存储状态,则需要创建新的账户进行存储。 41 | 4. `executable` 是否为可执行程序。 42 | 5. `rentEpoch` 租金相关字段,已废弃。 43 | 44 | ## 2. 读取账户信息 45 | 46 | 我们可以利用 `connection.getAccountInfo` 方法来读取账户信息。 47 | 48 | ```ts 49 | // 连接主网 50 | const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed"); 51 | 52 | // 获取账户信息 53 | const pubkey = new PublicKey("6fuivRGE5Fr9bwkW2Wu1E2wTMQ8RnoNgtZb8tievLVmb") 54 | const accountInfo = await connection.getAccountInfo(pubkey); 55 | console.log(JSON.stringify(accountInfo, null, 2)); 56 | ``` 57 | 58 | ### 输出样例 59 | 60 | 由于这是一个钱包账户,因此 `executable = false`,`data` 为空,`owner` 为系统程序,钱包中的余额为 `96302360` lamports,也就是 `0.096302360` SOL。 61 | 62 | ``` 63 | { 64 | "data": { 65 | "type": "Buffer", 66 | "data": [] 67 | }, 68 | "executable": false, 69 | "lamports": 96302360, 70 | "owner": "11111111111111111111111111111111", 71 | "rentEpoch": 18446744073709552000, 72 | "space": 0 73 | } 74 | ``` 75 | 76 | ## 3. 几种常用账户类型 77 | 78 | ### 系统程序账户 79 | 80 | 系统程序(System Program)是 Solana 的内核级程序,地址为 `11111111111111111111111111111111`,主要负责账户的创建、空间分配、转移/分配程序所有权。默认情况下,所有新帐户都归系统程序所有。 81 | 82 | 系统程序是所有钱包账户的所有者,并且只有系统程序拥有的账户才能支付交易费。 83 | 84 | ![](./img/4-3.png) 85 | 86 | 87 | ### 程序账户 88 | 89 | 部署 Solana 智能合约(程序)会创建一个程序账户(Program Account),该账户存储了程序的可执行代码,其中: 90 | 91 | - `executable = true` 92 | 93 | - `owner` = `BPFLoader` 或 `BPFLoaderUpgradeable` 94 | 95 | - `data` 存储的是 BPF 字节码(Rust 编译产物,类似以太坊的EVM字节码) 96 | 97 | 98 | 另外还有用于存储系统数据(如 `clock` `fees`)的 `Sysvar` 账户,数据帐户等账户类型,我们会在之后的教程中逐个介绍。 99 | 100 | 101 | ## 4. 创建账户 102 | 103 | 下面,我们用 `SystemProgram.createAccount` 方法创建一个新的账户,将该账户的所有者设置为系统账户,并给它分配64字节的数据空间。 104 | 105 | ```ts 106 | // 读取已有私钥作为付款账户 107 | const secretKeyBase58 = fs.readFileSync("wallet.txt", "utf-8"); 108 | const payer = Keypair.fromSecretKey(bs58.decode(secretKeyBase58)); 109 | 110 | // 创建新账户 111 | const newAccount = Keypair.generate(); 112 | 113 | // 你可以先用 SystemProgram 作为 owner(表示这个账户没有合约逻辑) 114 | const programId = SystemProgram.programId; 115 | 116 | // 分配 64 字节空间(可自定义) 117 | const space = 64; 118 | 119 | const main = async () => { 120 | // 获取租金豁免所需 lamports 121 | const lamports = await connection.getMinimumBalanceForRentExemption(space); 122 | console.log("需要的租金:", lamports / LAMPORTS_PER_SOL, "SOL"); 123 | 124 | // 创建指令 125 | const instruction = SystemProgram.createAccount({ 126 | fromPubkey: payer.publicKey, 127 | newAccountPubkey: newAccount.publicKey, 128 | lamports, 129 | space, 130 | programId, 131 | }); 132 | 133 | const tx = new Transaction().add(instruction); 134 | 135 | // 发送交易 136 | console.log("🚀 正在创建账户..."); 137 | const sig = await sendAndConfirmTransaction(connection, tx, [payer, newAccount]); 138 | 139 | console.log("✅ 账户创建成功!"); 140 | const accountAddress = newAccount.publicKey 141 | console.log("新账户地址:", accountAddress.toBase58()); 142 | console.log("交易哈希:", sig); 143 | console.log(`🔍 https://solscan.io/tx/${sig}?cluster=mainnet-beta`); 144 | 145 | const accountInfo2 = await connection.getAccountInfo(accountAddress); 146 | 147 | if (!accountInfo2) { 148 | console.log("❌ 账户不存在或尚未初始化"); 149 | return; 150 | }else{ 151 | console.log("✅ 账户创建成功"); 152 | console.log(JSON.stringify(accountInfo2, null, 2)); 153 | } 154 | }; 155 | ``` 156 | 157 | ### 输出样例 158 | 159 | ``` 160 | 需要的租金: 0.00133632 SOL 161 | 🚀 正在创建账户... 162 | ✅ 账户创建成功! 163 | 新账户地址: FoTafrESXHe82hCNELczhtBAN1eGu1CTrN9yxbbWx5Ez 164 | 交易哈希: 2LddWMVmWeKcbCapeWTBAqCty8HFC5dYh5ygaK2vf2UUTurbXPeCrh9y8uiftgAdavJSv4xH2FwPto1ma5ky23yE 165 | 🔍 https://solscan.io/tx/2LddWMVmWeKcbCapeWTBAqCty8HFC5dYh5ygaK2vf2UUTurbXPeCrh9y8uiftgAdavJSv4xH2FwPto1ma5ky23yE?cluster=mainnet-beta 166 | { 167 | "data": { 168 | "type": "Buffer", 169 | "data": [ 170 | 0, 171 | 0, 172 | ... 173 | 0 174 | ] 175 | }, 176 | "executable": false, 177 | "lamports": 1336320, 178 | "owner": "11111111111111111111111111111111", 179 | "rentEpoch": 18446744073709552000, 180 | "space": 64 181 | } 182 | ``` 183 | 184 | ## 5. 总结 185 | 186 | 这一讲,我们学习了: 187 | - Solana上的账户概念,以及常用账户类型 188 | - 读取账户信息 189 | - 创建账户 190 | 191 | -------------------------------------------------------------------------------- /web3js/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pump-fun-token-launcher", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "pump-fun-token-launcher", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@solana/spl-token": "^0.4.6", 13 | "@solana/web3.js": "^1.98.0", 14 | "axios": "^1.6.8", 15 | "bigint-buffer": "^1.1.5", 16 | "bs58": "^5.0.0" 17 | }, 18 | "devDependencies": { 19 | "typescript": "^5.4.5" 20 | } 21 | }, 22 | "node_modules/@babel/runtime": { 23 | "version": "7.26.7", 24 | "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.7.tgz", 25 | "integrity": "sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ==", 26 | "dependencies": { 27 | "regenerator-runtime": "^0.14.0" 28 | }, 29 | "engines": { 30 | "node": ">=6.9.0" 31 | } 32 | }, 33 | "node_modules/@noble/curves": { 34 | "version": "1.8.1", 35 | "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", 36 | "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", 37 | "dependencies": { 38 | "@noble/hashes": "1.7.1" 39 | }, 40 | "engines": { 41 | "node": "^14.21.3 || >=16" 42 | }, 43 | "funding": { 44 | "url": "https://paulmillr.com/funding/" 45 | } 46 | }, 47 | "node_modules/@noble/hashes": { 48 | "version": "1.7.1", 49 | "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", 50 | "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", 51 | "engines": { 52 | "node": "^14.21.3 || >=16" 53 | }, 54 | "funding": { 55 | "url": "https://paulmillr.com/funding/" 56 | } 57 | }, 58 | "node_modules/@solana/buffer-layout": { 59 | "version": "4.0.1", 60 | "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", 61 | "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", 62 | "dependencies": { 63 | "buffer": "~6.0.3" 64 | }, 65 | "engines": { 66 | "node": ">=5.10" 67 | } 68 | }, 69 | "node_modules/@solana/buffer-layout-utils": { 70 | "version": "0.2.0", 71 | "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz", 72 | "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==", 73 | "dependencies": { 74 | "@solana/buffer-layout": "^4.0.0", 75 | "@solana/web3.js": "^1.32.0", 76 | "bigint-buffer": "^1.1.5", 77 | "bignumber.js": "^9.0.1" 78 | }, 79 | "engines": { 80 | "node": ">= 10" 81 | } 82 | }, 83 | "node_modules/@solana/codecs": { 84 | "version": "2.0.0-rc.1", 85 | "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz", 86 | "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==", 87 | "dependencies": { 88 | "@solana/codecs-core": "2.0.0-rc.1", 89 | "@solana/codecs-data-structures": "2.0.0-rc.1", 90 | "@solana/codecs-numbers": "2.0.0-rc.1", 91 | "@solana/codecs-strings": "2.0.0-rc.1", 92 | "@solana/options": "2.0.0-rc.1" 93 | }, 94 | "peerDependencies": { 95 | "typescript": ">=5" 96 | } 97 | }, 98 | "node_modules/@solana/codecs-core": { 99 | "version": "2.0.0-rc.1", 100 | "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz", 101 | "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==", 102 | "dependencies": { 103 | "@solana/errors": "2.0.0-rc.1" 104 | }, 105 | "peerDependencies": { 106 | "typescript": ">=5" 107 | } 108 | }, 109 | "node_modules/@solana/codecs-data-structures": { 110 | "version": "2.0.0-rc.1", 111 | "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz", 112 | "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==", 113 | "dependencies": { 114 | "@solana/codecs-core": "2.0.0-rc.1", 115 | "@solana/codecs-numbers": "2.0.0-rc.1", 116 | "@solana/errors": "2.0.0-rc.1" 117 | }, 118 | "peerDependencies": { 119 | "typescript": ">=5" 120 | } 121 | }, 122 | "node_modules/@solana/codecs-numbers": { 123 | "version": "2.0.0-rc.1", 124 | "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz", 125 | "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==", 126 | "dependencies": { 127 | "@solana/codecs-core": "2.0.0-rc.1", 128 | "@solana/errors": "2.0.0-rc.1" 129 | }, 130 | "peerDependencies": { 131 | "typescript": ">=5" 132 | } 133 | }, 134 | "node_modules/@solana/codecs-strings": { 135 | "version": "2.0.0-rc.1", 136 | "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz", 137 | "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==", 138 | "dependencies": { 139 | "@solana/codecs-core": "2.0.0-rc.1", 140 | "@solana/codecs-numbers": "2.0.0-rc.1", 141 | "@solana/errors": "2.0.0-rc.1" 142 | }, 143 | "peerDependencies": { 144 | "fastestsmallesttextencoderdecoder": "^1.0.22", 145 | "typescript": ">=5" 146 | } 147 | }, 148 | "node_modules/@solana/errors": { 149 | "version": "2.0.0-rc.1", 150 | "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz", 151 | "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==", 152 | "dependencies": { 153 | "chalk": "^5.3.0", 154 | "commander": "^12.1.0" 155 | }, 156 | "bin": { 157 | "errors": "bin/cli.mjs" 158 | }, 159 | "peerDependencies": { 160 | "typescript": ">=5" 161 | } 162 | }, 163 | "node_modules/@solana/options": { 164 | "version": "2.0.0-rc.1", 165 | "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz", 166 | "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==", 167 | "dependencies": { 168 | "@solana/codecs-core": "2.0.0-rc.1", 169 | "@solana/codecs-data-structures": "2.0.0-rc.1", 170 | "@solana/codecs-numbers": "2.0.0-rc.1", 171 | "@solana/codecs-strings": "2.0.0-rc.1", 172 | "@solana/errors": "2.0.0-rc.1" 173 | }, 174 | "peerDependencies": { 175 | "typescript": ">=5" 176 | } 177 | }, 178 | "node_modules/@solana/spl-token": { 179 | "version": "0.4.12", 180 | "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.12.tgz", 181 | "integrity": "sha512-K6CxzSoO1vC+WBys25zlSDaW0w4UFZO/IvEZquEI35A/PjqXNQHeVigmDCZYEJfESvYarKwsr8tYr/29lPtvaw==", 182 | "dependencies": { 183 | "@solana/buffer-layout": "^4.0.0", 184 | "@solana/buffer-layout-utils": "^0.2.0", 185 | "@solana/spl-token-group": "^0.0.7", 186 | "@solana/spl-token-metadata": "^0.1.6", 187 | "buffer": "^6.0.3" 188 | }, 189 | "engines": { 190 | "node": ">=16" 191 | }, 192 | "peerDependencies": { 193 | "@solana/web3.js": "^1.95.5" 194 | } 195 | }, 196 | "node_modules/@solana/spl-token-group": { 197 | "version": "0.0.7", 198 | "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz", 199 | "integrity": "sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==", 200 | "dependencies": { 201 | "@solana/codecs": "2.0.0-rc.1" 202 | }, 203 | "engines": { 204 | "node": ">=16" 205 | }, 206 | "peerDependencies": { 207 | "@solana/web3.js": "^1.95.3" 208 | } 209 | }, 210 | "node_modules/@solana/spl-token-metadata": { 211 | "version": "0.1.6", 212 | "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz", 213 | "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==", 214 | "dependencies": { 215 | "@solana/codecs": "2.0.0-rc.1" 216 | }, 217 | "engines": { 218 | "node": ">=16" 219 | }, 220 | "peerDependencies": { 221 | "@solana/web3.js": "^1.95.3" 222 | } 223 | }, 224 | "node_modules/@solana/web3.js": { 225 | "version": "1.98.0", 226 | "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.0.tgz", 227 | "integrity": "sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA==", 228 | "dependencies": { 229 | "@babel/runtime": "^7.25.0", 230 | "@noble/curves": "^1.4.2", 231 | "@noble/hashes": "^1.4.0", 232 | "@solana/buffer-layout": "^4.0.1", 233 | "agentkeepalive": "^4.5.0", 234 | "bigint-buffer": "^1.1.5", 235 | "bn.js": "^5.2.1", 236 | "borsh": "^0.7.0", 237 | "bs58": "^4.0.1", 238 | "buffer": "6.0.3", 239 | "fast-stable-stringify": "^1.0.0", 240 | "jayson": "^4.1.1", 241 | "node-fetch": "^2.7.0", 242 | "rpc-websockets": "^9.0.2", 243 | "superstruct": "^2.0.2" 244 | } 245 | }, 246 | "node_modules/@solana/web3.js/node_modules/base-x": { 247 | "version": "3.0.10", 248 | "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", 249 | "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", 250 | "dependencies": { 251 | "safe-buffer": "^5.0.1" 252 | } 253 | }, 254 | "node_modules/@solana/web3.js/node_modules/bs58": { 255 | "version": "4.0.1", 256 | "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", 257 | "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", 258 | "dependencies": { 259 | "base-x": "^3.0.2" 260 | } 261 | }, 262 | "node_modules/@swc/helpers": { 263 | "version": "0.5.15", 264 | "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", 265 | "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", 266 | "dependencies": { 267 | "tslib": "^2.8.0" 268 | } 269 | }, 270 | "node_modules/@types/connect": { 271 | "version": "3.4.38", 272 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", 273 | "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", 274 | "dependencies": { 275 | "@types/node": "*" 276 | } 277 | }, 278 | "node_modules/@types/node": { 279 | "version": "12.20.55", 280 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", 281 | "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" 282 | }, 283 | "node_modules/@types/uuid": { 284 | "version": "8.3.4", 285 | "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", 286 | "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" 287 | }, 288 | "node_modules/@types/ws": { 289 | "version": "7.4.7", 290 | "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", 291 | "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", 292 | "dependencies": { 293 | "@types/node": "*" 294 | } 295 | }, 296 | "node_modules/agentkeepalive": { 297 | "version": "4.6.0", 298 | "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", 299 | "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", 300 | "dependencies": { 301 | "humanize-ms": "^1.2.1" 302 | }, 303 | "engines": { 304 | "node": ">= 8.0.0" 305 | } 306 | }, 307 | "node_modules/asynckit": { 308 | "version": "0.4.0", 309 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 310 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 311 | }, 312 | "node_modules/axios": { 313 | "version": "1.7.9", 314 | "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", 315 | "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", 316 | "dependencies": { 317 | "follow-redirects": "^1.15.6", 318 | "form-data": "^4.0.0", 319 | "proxy-from-env": "^1.1.0" 320 | } 321 | }, 322 | "node_modules/base-x": { 323 | "version": "4.0.0", 324 | "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", 325 | "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" 326 | }, 327 | "node_modules/base64-js": { 328 | "version": "1.5.1", 329 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 330 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 331 | "funding": [ 332 | { 333 | "type": "github", 334 | "url": "https://github.com/sponsors/feross" 335 | }, 336 | { 337 | "type": "patreon", 338 | "url": "https://www.patreon.com/feross" 339 | }, 340 | { 341 | "type": "consulting", 342 | "url": "https://feross.org/support" 343 | } 344 | ] 345 | }, 346 | "node_modules/bigint-buffer": { 347 | "version": "1.1.5", 348 | "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", 349 | "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", 350 | "hasInstallScript": true, 351 | "dependencies": { 352 | "bindings": "^1.3.0" 353 | }, 354 | "engines": { 355 | "node": ">= 10.0.0" 356 | } 357 | }, 358 | "node_modules/bignumber.js": { 359 | "version": "9.1.2", 360 | "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", 361 | "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", 362 | "engines": { 363 | "node": "*" 364 | } 365 | }, 366 | "node_modules/bindings": { 367 | "version": "1.5.0", 368 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", 369 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", 370 | "dependencies": { 371 | "file-uri-to-path": "1.0.0" 372 | } 373 | }, 374 | "node_modules/bn.js": { 375 | "version": "5.2.1", 376 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", 377 | "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" 378 | }, 379 | "node_modules/borsh": { 380 | "version": "0.7.0", 381 | "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", 382 | "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", 383 | "dependencies": { 384 | "bn.js": "^5.2.0", 385 | "bs58": "^4.0.0", 386 | "text-encoding-utf-8": "^1.0.2" 387 | } 388 | }, 389 | "node_modules/borsh/node_modules/base-x": { 390 | "version": "3.0.10", 391 | "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", 392 | "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", 393 | "dependencies": { 394 | "safe-buffer": "^5.0.1" 395 | } 396 | }, 397 | "node_modules/borsh/node_modules/bs58": { 398 | "version": "4.0.1", 399 | "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", 400 | "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", 401 | "dependencies": { 402 | "base-x": "^3.0.2" 403 | } 404 | }, 405 | "node_modules/bs58": { 406 | "version": "5.0.0", 407 | "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", 408 | "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", 409 | "dependencies": { 410 | "base-x": "^4.0.0" 411 | } 412 | }, 413 | "node_modules/buffer": { 414 | "version": "6.0.3", 415 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", 416 | "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", 417 | "funding": [ 418 | { 419 | "type": "github", 420 | "url": "https://github.com/sponsors/feross" 421 | }, 422 | { 423 | "type": "patreon", 424 | "url": "https://www.patreon.com/feross" 425 | }, 426 | { 427 | "type": "consulting", 428 | "url": "https://feross.org/support" 429 | } 430 | ], 431 | "dependencies": { 432 | "base64-js": "^1.3.1", 433 | "ieee754": "^1.2.1" 434 | } 435 | }, 436 | "node_modules/bufferutil": { 437 | "version": "4.0.9", 438 | "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz", 439 | "integrity": "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==", 440 | "hasInstallScript": true, 441 | "optional": true, 442 | "dependencies": { 443 | "node-gyp-build": "^4.3.0" 444 | }, 445 | "engines": { 446 | "node": ">=6.14.2" 447 | } 448 | }, 449 | "node_modules/chalk": { 450 | "version": "5.4.1", 451 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", 452 | "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", 453 | "engines": { 454 | "node": "^12.17.0 || ^14.13 || >=16.0.0" 455 | }, 456 | "funding": { 457 | "url": "https://github.com/chalk/chalk?sponsor=1" 458 | } 459 | }, 460 | "node_modules/combined-stream": { 461 | "version": "1.0.8", 462 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 463 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 464 | "dependencies": { 465 | "delayed-stream": "~1.0.0" 466 | }, 467 | "engines": { 468 | "node": ">= 0.8" 469 | } 470 | }, 471 | "node_modules/commander": { 472 | "version": "12.1.0", 473 | "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", 474 | "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", 475 | "engines": { 476 | "node": ">=18" 477 | } 478 | }, 479 | "node_modules/delay": { 480 | "version": "5.0.0", 481 | "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", 482 | "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", 483 | "engines": { 484 | "node": ">=10" 485 | }, 486 | "funding": { 487 | "url": "https://github.com/sponsors/sindresorhus" 488 | } 489 | }, 490 | "node_modules/delayed-stream": { 491 | "version": "1.0.0", 492 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 493 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", 494 | "engines": { 495 | "node": ">=0.4.0" 496 | } 497 | }, 498 | "node_modules/es6-promise": { 499 | "version": "4.2.8", 500 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", 501 | "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" 502 | }, 503 | "node_modules/es6-promisify": { 504 | "version": "5.0.0", 505 | "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", 506 | "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", 507 | "dependencies": { 508 | "es6-promise": "^4.0.3" 509 | } 510 | }, 511 | "node_modules/eventemitter3": { 512 | "version": "5.0.1", 513 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", 514 | "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" 515 | }, 516 | "node_modules/eyes": { 517 | "version": "0.1.8", 518 | "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", 519 | "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", 520 | "engines": { 521 | "node": "> 0.1.90" 522 | } 523 | }, 524 | "node_modules/fast-stable-stringify": { 525 | "version": "1.0.0", 526 | "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", 527 | "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==" 528 | }, 529 | "node_modules/fastestsmallesttextencoderdecoder": { 530 | "version": "1.0.22", 531 | "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", 532 | "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", 533 | "peer": true 534 | }, 535 | "node_modules/file-uri-to-path": { 536 | "version": "1.0.0", 537 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", 538 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" 539 | }, 540 | "node_modules/follow-redirects": { 541 | "version": "1.15.9", 542 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", 543 | "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", 544 | "funding": [ 545 | { 546 | "type": "individual", 547 | "url": "https://github.com/sponsors/RubenVerborgh" 548 | } 549 | ], 550 | "engines": { 551 | "node": ">=4.0" 552 | }, 553 | "peerDependenciesMeta": { 554 | "debug": { 555 | "optional": true 556 | } 557 | } 558 | }, 559 | "node_modules/form-data": { 560 | "version": "4.0.1", 561 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", 562 | "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", 563 | "dependencies": { 564 | "asynckit": "^0.4.0", 565 | "combined-stream": "^1.0.8", 566 | "mime-types": "^2.1.12" 567 | }, 568 | "engines": { 569 | "node": ">= 6" 570 | } 571 | }, 572 | "node_modules/humanize-ms": { 573 | "version": "1.2.1", 574 | "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", 575 | "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", 576 | "dependencies": { 577 | "ms": "^2.0.0" 578 | } 579 | }, 580 | "node_modules/ieee754": { 581 | "version": "1.2.1", 582 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 583 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 584 | "funding": [ 585 | { 586 | "type": "github", 587 | "url": "https://github.com/sponsors/feross" 588 | }, 589 | { 590 | "type": "patreon", 591 | "url": "https://www.patreon.com/feross" 592 | }, 593 | { 594 | "type": "consulting", 595 | "url": "https://feross.org/support" 596 | } 597 | ] 598 | }, 599 | "node_modules/isomorphic-ws": { 600 | "version": "4.0.1", 601 | "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", 602 | "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", 603 | "peerDependencies": { 604 | "ws": "*" 605 | } 606 | }, 607 | "node_modules/jayson": { 608 | "version": "4.1.3", 609 | "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.3.tgz", 610 | "integrity": "sha512-LtXh5aYZodBZ9Fc3j6f2w+MTNcnxteMOrb+QgIouguGOulWi0lieEkOUg+HkjjFs0DGoWDds6bi4E9hpNFLulQ==", 611 | "dependencies": { 612 | "@types/connect": "^3.4.33", 613 | "@types/node": "^12.12.54", 614 | "@types/ws": "^7.4.4", 615 | "commander": "^2.20.3", 616 | "delay": "^5.0.0", 617 | "es6-promisify": "^5.0.0", 618 | "eyes": "^0.1.8", 619 | "isomorphic-ws": "^4.0.1", 620 | "json-stringify-safe": "^5.0.1", 621 | "JSONStream": "^1.3.5", 622 | "uuid": "^8.3.2", 623 | "ws": "^7.5.10" 624 | }, 625 | "bin": { 626 | "jayson": "bin/jayson.js" 627 | }, 628 | "engines": { 629 | "node": ">=8" 630 | } 631 | }, 632 | "node_modules/jayson/node_modules/commander": { 633 | "version": "2.20.3", 634 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 635 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" 636 | }, 637 | "node_modules/json-stringify-safe": { 638 | "version": "5.0.1", 639 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 640 | "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" 641 | }, 642 | "node_modules/jsonparse": { 643 | "version": "1.3.1", 644 | "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", 645 | "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", 646 | "engines": [ 647 | "node >= 0.2.0" 648 | ] 649 | }, 650 | "node_modules/JSONStream": { 651 | "version": "1.3.5", 652 | "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", 653 | "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", 654 | "dependencies": { 655 | "jsonparse": "^1.2.0", 656 | "through": ">=2.2.7 <3" 657 | }, 658 | "bin": { 659 | "JSONStream": "bin.js" 660 | }, 661 | "engines": { 662 | "node": "*" 663 | } 664 | }, 665 | "node_modules/mime-db": { 666 | "version": "1.52.0", 667 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 668 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 669 | "engines": { 670 | "node": ">= 0.6" 671 | } 672 | }, 673 | "node_modules/mime-types": { 674 | "version": "2.1.35", 675 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 676 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 677 | "dependencies": { 678 | "mime-db": "1.52.0" 679 | }, 680 | "engines": { 681 | "node": ">= 0.6" 682 | } 683 | }, 684 | "node_modules/ms": { 685 | "version": "2.1.3", 686 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 687 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 688 | }, 689 | "node_modules/node-fetch": { 690 | "version": "2.7.0", 691 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", 692 | "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", 693 | "dependencies": { 694 | "whatwg-url": "^5.0.0" 695 | }, 696 | "engines": { 697 | "node": "4.x || >=6.0.0" 698 | }, 699 | "peerDependencies": { 700 | "encoding": "^0.1.0" 701 | }, 702 | "peerDependenciesMeta": { 703 | "encoding": { 704 | "optional": true 705 | } 706 | } 707 | }, 708 | "node_modules/node-gyp-build": { 709 | "version": "4.8.4", 710 | "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", 711 | "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", 712 | "optional": true, 713 | "bin": { 714 | "node-gyp-build": "bin.js", 715 | "node-gyp-build-optional": "optional.js", 716 | "node-gyp-build-test": "build-test.js" 717 | } 718 | }, 719 | "node_modules/proxy-from-env": { 720 | "version": "1.1.0", 721 | "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", 722 | "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" 723 | }, 724 | "node_modules/regenerator-runtime": { 725 | "version": "0.14.1", 726 | "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", 727 | "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" 728 | }, 729 | "node_modules/rpc-websockets": { 730 | "version": "9.0.4", 731 | "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.0.4.tgz", 732 | "integrity": "sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ==", 733 | "dependencies": { 734 | "@swc/helpers": "^0.5.11", 735 | "@types/uuid": "^8.3.4", 736 | "@types/ws": "^8.2.2", 737 | "buffer": "^6.0.3", 738 | "eventemitter3": "^5.0.1", 739 | "uuid": "^8.3.2", 740 | "ws": "^8.5.0" 741 | }, 742 | "funding": { 743 | "type": "paypal", 744 | "url": "https://paypal.me/kozjak" 745 | }, 746 | "optionalDependencies": { 747 | "bufferutil": "^4.0.1", 748 | "utf-8-validate": "^5.0.2" 749 | } 750 | }, 751 | "node_modules/rpc-websockets/node_modules/@types/ws": { 752 | "version": "8.5.14", 753 | "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz", 754 | "integrity": "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==", 755 | "dependencies": { 756 | "@types/node": "*" 757 | } 758 | }, 759 | "node_modules/rpc-websockets/node_modules/ws": { 760 | "version": "8.18.0", 761 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", 762 | "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", 763 | "engines": { 764 | "node": ">=10.0.0" 765 | }, 766 | "peerDependencies": { 767 | "bufferutil": "^4.0.1", 768 | "utf-8-validate": ">=5.0.2" 769 | }, 770 | "peerDependenciesMeta": { 771 | "bufferutil": { 772 | "optional": true 773 | }, 774 | "utf-8-validate": { 775 | "optional": true 776 | } 777 | } 778 | }, 779 | "node_modules/safe-buffer": { 780 | "version": "5.2.1", 781 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 782 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 783 | "funding": [ 784 | { 785 | "type": "github", 786 | "url": "https://github.com/sponsors/feross" 787 | }, 788 | { 789 | "type": "patreon", 790 | "url": "https://www.patreon.com/feross" 791 | }, 792 | { 793 | "type": "consulting", 794 | "url": "https://feross.org/support" 795 | } 796 | ] 797 | }, 798 | "node_modules/superstruct": { 799 | "version": "2.0.2", 800 | "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", 801 | "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", 802 | "engines": { 803 | "node": ">=14.0.0" 804 | } 805 | }, 806 | "node_modules/text-encoding-utf-8": { 807 | "version": "1.0.2", 808 | "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", 809 | "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" 810 | }, 811 | "node_modules/through": { 812 | "version": "2.3.8", 813 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 814 | "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" 815 | }, 816 | "node_modules/tr46": { 817 | "version": "0.0.3", 818 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 819 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" 820 | }, 821 | "node_modules/tslib": { 822 | "version": "2.8.1", 823 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", 824 | "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" 825 | }, 826 | "node_modules/typescript": { 827 | "version": "5.7.3", 828 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", 829 | "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", 830 | "bin": { 831 | "tsc": "bin/tsc", 832 | "tsserver": "bin/tsserver" 833 | }, 834 | "engines": { 835 | "node": ">=14.17" 836 | } 837 | }, 838 | "node_modules/utf-8-validate": { 839 | "version": "5.0.10", 840 | "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", 841 | "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", 842 | "hasInstallScript": true, 843 | "optional": true, 844 | "dependencies": { 845 | "node-gyp-build": "^4.3.0" 846 | }, 847 | "engines": { 848 | "node": ">=6.14.2" 849 | } 850 | }, 851 | "node_modules/uuid": { 852 | "version": "8.3.2", 853 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 854 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", 855 | "bin": { 856 | "uuid": "dist/bin/uuid" 857 | } 858 | }, 859 | "node_modules/webidl-conversions": { 860 | "version": "3.0.1", 861 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 862 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" 863 | }, 864 | "node_modules/whatwg-url": { 865 | "version": "5.0.0", 866 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 867 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 868 | "dependencies": { 869 | "tr46": "~0.0.3", 870 | "webidl-conversions": "^3.0.0" 871 | } 872 | }, 873 | "node_modules/ws": { 874 | "version": "7.5.10", 875 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", 876 | "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", 877 | "engines": { 878 | "node": ">=8.3.0" 879 | }, 880 | "peerDependencies": { 881 | "bufferutil": "^4.0.1", 882 | "utf-8-validate": "^5.0.2" 883 | }, 884 | "peerDependenciesMeta": { 885 | "bufferutil": { 886 | "optional": true 887 | }, 888 | "utf-8-validate": { 889 | "optional": true 890 | } 891 | } 892 | } 893 | } 894 | } 895 | -------------------------------------------------------------------------------- /web3js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pump-fun-token-launcher", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "typescript": "^5.4.5" 14 | }, 15 | "dependencies": { 16 | "@solana/spl-token": "^0.4.6", 17 | "@solana/web3.js": "^1.98.0", 18 | "axios": "^1.6.8", 19 | "bigint-buffer": "^1.1.5", 20 | "bs58": "^5.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web3js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ 40 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 41 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 42 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 43 | // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ 44 | // "resolveJsonModule": true, /* Enable importing .json files. */ 45 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 46 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 47 | 48 | /* JavaScript Support */ 49 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 50 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 51 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 52 | 53 | /* Emit */ 54 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 55 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 56 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 57 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "noEmit": true, /* Disable emitting files from a compilation. */ 60 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 61 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 62 | // "removeComments": true, /* Disable emitting comments. */ 63 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 64 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 65 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 66 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 67 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 68 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 69 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 70 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 71 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 72 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 73 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 74 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 75 | 76 | /* Interop Constraints */ 77 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 78 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 79 | // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ 80 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 81 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 82 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 83 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 84 | 85 | /* Type Checking */ 86 | "strict": true, /* Enable all strict type-checking options. */ 87 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 88 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 89 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 90 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 91 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 92 | // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ 93 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 94 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 95 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 96 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 97 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 98 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 99 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 100 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 101 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 102 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 103 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 104 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 105 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 106 | 107 | /* Completeness */ 108 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 109 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 110 | } 111 | } 112 | --------------------------------------------------------------------------------