PDA_Squads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getFullnodeUrl, SuiClient } from "@mysten/sui.js/client"; | |
import { decodeSuiPrivateKey } from "@mysten/sui.js/cryptography"; | |
import { Ed25519Keypair } from "@mysten/sui.js/keypairs/ed25519"; | |
import { TransactionBlock } from "@mysten/sui.js/transactions"; | |
import { MIST_PER_SUI } from "@mysten/sui.js/utils"; | |
/* NAVI addresses */ | |
const NAVI_PACKAGE_ID = | |
"0xc6374c7da60746002bfee93014aeb607e023b2d6b25c9e55a152b826dbc8c1ce"; | |
const FLASH_LOAN_CONFIG_ID = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getFullnodeUrl, SuiClient } from "@mysten/sui.js/client"; | |
import { decodeSuiPrivateKey } from "@mysten/sui.js/cryptography"; | |
import { Ed25519Keypair } from "@mysten/sui.js/keypairs/ed25519"; | |
import { TransactionBlock } from "@mysten/sui.js/transactions"; | |
import { MIST_PER_SUI } from "@mysten/sui.js/utils"; | |
/* NAVI addresses */ | |
const NAVI_PACKAGE_ID = | |
"0xc6374c7da60746002bfee93014aeb607e023b2d6b25c9e55a152b826dbc8c1ce"; | |
const STORAGE_ID = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verify Github on Galaxy. gid:gayDueF3wyePgDacuzJqTm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Metadata } from '@metaplex-foundation/mpl-token-metadata'; | |
import { writeJSON } from 'fs-extra'; | |
import { PublicKey } from '@solana/web3.js'; | |
import { PROGRAMS, SOLANA_CONNECTION } from '../constants'; | |
(async function () { | |
const CANDY_MACHINE_ACCOUNT_KEY = new PublicKey( | |
'Bi9A9brhkTXRMwq9aBimNZNefLkcMFHobtkwqBjTeqc5' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// newJSON -> metadataJSON | |
// imageBuffer -> Buffer created from canvas | |
async function uploadToArweave(newJSON: any, imageBuffer: Buffer) { | |
const sundeepPrivateKey = process.env.MY_WALLET_PRIVATE_KEY!; | |
if (!sundeepPrivateKey) { | |
throw new Error('Private Key not found'); | |
} | |
const solanaSigner = new signers.SolanaSigner( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
did:3:bafyreifd3yxwagxxjwss3zeb76qvefj3d2ytw6s6n77kv2xkdwn6env344 |
I hereby claim:
- I am sunguru98 on github.
- I am pacmanrulez98 (https://keybase.io/pacmanrulez98) on keybase.
- I have a public key ASBSnB4RQ24aTbS9Icee73hTsn7TsxfZ9_YewnnTo46-rQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flattenArray = nestedArr => { | |
// Checking for the emptiness of array | |
if (!nestedArr.length) return null; | |
// Creating a new array for every recursive call | |
const newArr = []; | |
// If the current element is an array, we recursively call the function and then push the values present in the returned array. | |
// Else we just push the current element on to the new Array. | |
nestedArr.forEach(el => | |
Array.isArray(el) ? newArr.push(...flattenArray(el)) : newArr.push(el) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = reqBodyObj => { | |
// Preparing the product object | |
const { | |
name, | |
description, | |
price, | |
quantities, | |
dosages, | |
sideEffects, | |
stockAvailable, |
NewerOlder