-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4814450
commit be245c9
Showing
11 changed files
with
9,187 additions
and
9,567 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,33 @@ | |
"version": "0.2.0", | ||
"author": "Solana Maintainers <[email protected]>", | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"resolutions": { | ||
"blake3-wasm": "^3.0.0", | ||
"@c4312/blake3-internal": "^3.0.0" | ||
}, | ||
"dependencies": { | ||
"@heroicons/react": "^1.0.5", | ||
"@noble/ed25519": "^1.7.1", | ||
"@project-serum/anchor": "^0.26.0", | ||
"@solana/wallet-adapter-base": "^0.9.22", | ||
"@solana/wallet-adapter-react": "^0.15.32", | ||
"@solana/wallet-adapter-react-ui": "^0.9.31", | ||
"@solana/wallet-adapter-wallets": "^0.19.16", | ||
"@solana/web3.js": "^1.73.0", | ||
"@tailwindcss/typography": "^0.5.9", | ||
"axios": "^1.7.2", | ||
"blake3-wasm": "^3.0.0", | ||
"borsh": "^2.0.0", | ||
"bs58": "^5.0.0", | ||
"daisyui": "^1.24.3", | ||
"date-fns": "^2.29.3", | ||
"hash-wasm": "^4.11.0", | ||
"immer": "^9.0.12", | ||
"next": "^13.1.5", | ||
"next-compose-plugins": "^2.2.1", | ||
|
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | ||
import type { NextApiRequest, NextApiResponse } from 'next' | ||
import { Update } from 'spv/utils' | ||
import net from "net"; | ||
import { Connection } from '@solana/web3.js'; | ||
import * as borsh from "borsh" | ||
import { UpdateSchema } from 'spv/client'; | ||
import bs58 from "bs58" | ||
type SPVProxyRequestData = { | ||
txn: string, | ||
} | ||
export type SPVProxyResponse = { | ||
update: string, | ||
signature: string | ||
} | ||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<SPVProxyResponse> | ||
) { | ||
let data: SPVProxyRequestData = req.body; | ||
let signature: string; | ||
const client = net.connect( | ||
{ | ||
port: 5000, | ||
host: process.env.HOST || "127.0.0.1", | ||
}, | ||
async function () { | ||
console.log("LOG: Client connected to spv geyser"); | ||
const connection = new Connection("http://" + (process.env.HOST || "127.0.0.1") +":8899",{ | ||
commitment: "processed" | ||
}); | ||
signature = await connection.sendEncodedTransaction(data.txn,{ | ||
skipPreflight: true | ||
}) | ||
}, | ||
); | ||
|
||
client.on("data", async function (update: Uint8Array) { | ||
console.log("signature: ",signature); | ||
console.dir(update) | ||
|
||
// let received_update: Update = borsh.deserialize(UpdateSchema, update) as any; | ||
// console.dir(received_update) | ||
|
||
res.status(200).json({ | ||
signature, | ||
update: bs58.encode(update) | ||
}) | ||
}) | ||
// setTimeout(() => res.status(500).json({signature,update: new Uint8Array()}),1000 * 10); | ||
} |
Oops, something went wrong.