This file contains hidden or 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
| use borsh::{BorshDeserialize, BorshSerialize}; | |
| use solana_program::{ | |
| account_info::{next_account_info, AccountInfo}, | |
| entrypoint, | |
| entrypoint::ProgramResult, | |
| msg, | |
| program_error::ProgramError, | |
| pubkey::Pubkey, | |
| }; |
This file contains hidden or 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 { | |
| Connection, | |
| PublicKey, | |
| Keypair, | |
| TransactionInstruction, | |
| Transaction, | |
| sendAndConfirmTransaction, | |
| } from '@solana/web3.js'; | |
| import type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {getNodeURL} from '@figment-solana/lib'; |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {Connection, PublicKey} from '@solana/web3.js'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| import * as borsh from 'borsh'; | |
| // The state of a greeting account managed by the hello world program | |
| class GreetingAccount { | |
| counter = 0; | |
| constructor(fields: {counter: number} | undefined = undefined) { | |
| if (fields) { |
This file contains hidden or 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 { | |
| Connection, | |
| PublicKey, | |
| Keypair, | |
| SystemProgram, | |
| Transaction, | |
| sendAndConfirmTransaction, | |
| } from '@solana/web3.js'; | |
| import type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {getNodeURL} from '@figment-solana/lib'; |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {Connection, PublicKey} from '@solana/web3.js'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| import path from 'path'; | |
| import fs from 'mz/fs'; | |
| const PROGRAM_PATH = path.resolve('dist/solana/program'); | |
| const PROGRAM_SO_PATH = path.join(PROGRAM_PATH, 'helloworld.so'); | |
| export default async function deploy( |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| import { | |
| Connection, | |
| PublicKey, | |
| SystemProgram, | |
| Transaction, | |
| sendAndConfirmTransaction, | |
| } from '@solana/web3.js'; |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {Connection, PublicKey} from '@solana/web3.js'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| export default async function balance( | |
| req: NextApiRequest, | |
| res: NextApiResponse<string | number>, | |
| ) { | |
| try { | |
| const {network, address} = req.body; |
This file contains hidden or 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 {Connection, PublicKey, LAMPORTS_PER_SOL} from '@solana/web3.js'; | |
| import type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| export default async function fund( | |
| req: NextApiRequest, | |
| res: NextApiResponse<string>, | |
| ) { | |
| try { | |
| const {network, address} = req.body; |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {Keypair} from '@solana/web3.js'; | |
| /* | |
| * Like with most Web 3 protocols, transactions on Solana happen between accounts. | |
| * To create an account, a client generates a keypair which has a public key (or | |
| * address, used to identify and lookup an account) and a secret key used to sign | |
| * transactions. | |
| */ |
This file contains hidden or 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 type {NextApiRequest, NextApiResponse} from 'next'; | |
| import {getNodeURL} from '@figment-solana/lib'; | |
| import {Connection} from '@solana/web3.js'; | |
| export default async function connect( | |
| req: NextApiRequest, | |
| res: NextApiResponse<string>, | |
| ) { | |
| try { | |
| const {network} = req.body; |