buffalojoec / graphql-wallet

Solana wallet built using Solana RPC-GraphQL
1 stars 2 forks source link

Set up pages #5

Closed buffalojoec closed 4 months ago

buffalojoec commented 4 months ago

I'd like for there to be three pages to this app:

Hrushi20 commented 4 months ago

Hey, I set up query to fetch a transaction. How do I get a list of all signatures in the wallet to display list of transactions present in wallet?

buffalojoec commented 4 months ago

Hey, I set up query to fetch a transaction. How do I get a list of all signatures in the wallet to display list of transactions present in wallet?

You can use the RPC's getSignaturesForAddress method, but we'll need to populate a few mock transactions for now using that script I've initialized. Maybe some simple transfers or token creations via CLI.

Hrushi20 commented 4 months ago

Hey, I set up query to fetch a transaction. How do I get a list of all signatures in the wallet to display list of transactions present in wallet?

You can use the RPC's getSignaturesForAddress method, but we'll need to populate a few mock transactions for now using that script I've initialized. Maybe some simple transfers or token creations via CLI.

I'll create a rest api and pass address to server, the server queries and returns the signatures to react application. Should I use the addresses in Account.tsx file to create transactions?

buffalojoec commented 4 months ago

I'll create a rest api and pass address, the server queries and returns the signatures to react application.

I've got a server going already in server.ts so you can add the endpoint there.

Should I use the addresses in Account.tsx file to create simple transfers?

We can probably just generate one or two keypairs with the CLI and send transfers to them. For now, I think we can use the local keypair (fee payer) as the wallet address, and later we can figure out how to add a user's actual address.

Creating tokens and token accounts will create the accounts on-chain automatically.

This can all be scripted into scripts/generate-transactions.sh.

Hrushi20 commented 4 months ago
0] SolanaError: Solana error #-32602; Decode this error by running `npx @solana/errors decode -- -32602 'X19zZXJ2ZXJNZXNzYWdlPUludmFsaWQlMjBwYXJhbSUzQSUyMEludmFsaWQ='`
[0]     at Object.send (/Users/pc/my/code/openSource/graphql-wallet/node_modules/@solana/rpc-spec/src/rpc.ts:79:13)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0]     at loadTransaction (/Users/pc/my/code/openSource/graphql-wallet/node_modules/@solana/rpc-graphql/src/loaders/program-accounts.ts:98:1)
[0]     at <anonymous> (/Users/pc/my/code/openSource/graphql-wallet/node_modules/@solana/rpc-graphql/src/loaders/transaction.ts:56:14) {
[0]   context: { __code: -32602, __serverMessage: 'Invalid param: Invalid' }

I fetched signatures for corresponding account. However while querying the corresponding transaction, I get the above error.