Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
BitHighlander committed Jan 3, 2025
1 parent 0c38152 commit 3612595
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 22 deletions.
38 changes: 19 additions & 19 deletions __tests__/test-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ let run_test = async function () {
console.log("SOL Balance:", balance, "SOL")

// get token balance (example)
let tokenBalance = await wallet.getTokenBalance("5gVSqhk41VA8U6U4Pvux6MSxFWqgptm3w58X9UTGpump", "solana:mainnet")
console.log("CLUBMOON Token Balance:", tokenBalance)
// let tokenBalance = await wallet.getTokenBalance("5gVSqhk41VA8U6U4Pvux6MSxFWqgptm3w58X9UTGpump", "solana:mainnet")
// console.log("CLUBMOON Token Balance:", tokenBalance)

// get NFTs
// let nfts = await wallet.getNfts("solana:mainnet")
// console.log("NFT Count:", nfts.length)
// console.log("NFT Count:", nfts)
// nfts.forEach((nft, i) => {
// console.log(`NFT #${i+1}: ${nft.name} (${nft.address.toBase58()})`)
// })
Expand All @@ -34,8 +34,8 @@ let run_test = async function () {
// console.log("Sent SOL Tx:", sendSolTx)

// Uncomment if you want to send tokens (ensure you have these tokens!)
// let sendTokenTx = await wallet.sendToken("5gVSqhk41VA8U6U4Pvux6MSxFWqgptm3w58X9UTGpump", "5RU2erdSLHU8oVEFVK82KCoTSpZt7a6J6gyXcfRVUj5v", 1, "solana:mainnet", true)
// console.log("Sent Token Tx:", sendTokenTx)
let sendTokenTx = await wallet.sendToken("5gVSqhk41VA8U6U4Pvux6MSxFWqgptm3w58X9UTGpump", "24na96EuMLCskTVREScgdiy79xg9HPR72zTJo6oyH2KV", 1, "solana:mainnet", true)
console.log("Sent Token Tx:", sendTokenTx)

// Uncomment if you want to send NFT (ensure you have the NFT in your wallet)
// let sendNftTx = await wallet.sendNft("NftMintAddressHere", "RecipientPublicKeyHere", "solana:mainnet")
Expand All @@ -44,20 +44,20 @@ let run_test = async function () {
// ---------------------------------------------------------
// Use the library method to get and parse incoming transfers
// ---------------------------------------------------------
let incomingTransfers = await wallet.getIncomingTransfers("solana:mainnet", 10)
console.log("\nIncoming Transfers:")
incomingTransfers.forEach(t => {
console.log(" - Incoming Transfer Detected:")
console.log(" Signature:", t.signature)
console.log(" Slot:", t.slot)
console.log(" Type:", t.type)
console.log(" Amount:", t.amount, t.type === 'SOL' ? 'SOL' : 'tokens')
console.log(" From:", t.from)
console.log(" To:", t.to)
if (t.tokenMint) {
console.log(" Token Mint:", t.tokenMint)
}
})
// let incomingTransfers = await wallet.getIncomingTransfers("solana:mainnet", 10)
// console.log("\nIncoming Transfers:")
// incomingTransfers.forEach(t => {
// console.log(" - Incoming Transfer Detected:")
// console.log(" Signature:", t.signature)
// console.log(" Slot:", t.slot)
// console.log(" Type:", t.type)
// console.log(" Amount:", t.amount, t.type === 'SOL' ? 'SOL' : 'tokens')
// console.log(" From:", t.from)
// console.log(" To:", t.to)
// if (t.tokenMint) {
// console.log(" Token Mint:", t.tokenMint)
// }
// })

} catch(e) {
console.error(e)
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.2",
"version": "0.1.7",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -48,6 +48,10 @@
},
"dependencies": {
"@metaplex-foundation/js": "^0.20.1",
"@metaplex-foundation/mpl-token-metadata": "^3.3.0",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
"@metaplex-foundation/umi-rpc-web3js": "^0.9.2",
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.95.8",
"bip39": "^3.1.0",
Expand Down
200 changes: 200 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default class SolanaLib {
const tx = new Transaction().add(instruction)

if (useFeeBump) {
let priorityFeeMicroLamports = 2
let priorityFeeMicroLamports = 40000
const setComputeUnitLimitIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 1400000 })
const setComputeUnitPriceIx = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityFeeMicroLamports })
tx.add(setComputeUnitLimitIx)
Expand All @@ -287,7 +287,7 @@ export default class SolanaLib {
tx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash
tx.sign(this.keypair)

const txid = await connection.sendRawTransaction(tx.serialize(), { skipPreflight: false })
const txid = await connection.sendRawTransaction(tx.serialize(), { skipPreflight: false, maxRetries: 10 })
await connection.confirmTransaction(txid, 'confirmed')
return txid
}
Expand Down

0 comments on commit 3612595

Please sign in to comment.