This repo provides references for a few simple flows
- Body signature
- Sign a message with your solana keys client side
- Add the message into the body of an API request
- Verify the signature
solana-as-api/make_signed_requests.py
Lines 37 to 41 in 7b92f17
- Header Sig
- Same as body signature, except the authorization token is within the headers - "Authorization: bearer <token>"
solana-as-api/make_signed_header.py
Lines 40 to 43 in 7b92f17
- Oauth type flow (pictured below)
- Send tx to Solana
- this could include a value transfer
- recieve the tx hash back
- Send tx hash to server signed to show the api request was made by the same entity that submitted the Solana tx
- This is a great use case for Solana because
- latency really affects UX
- Tx finality is important because an off protocol API response will be triggered. A rollback would be bad
- Send tx to Solana
Get all NFTs from a wallet https://solanacookbook.com/references/nfts.html#candy-machine-v1
solana-keygen new --outfile ~/.config/solana/burner3.json
https://developer.token.io/seasons_rest_api_doc/content/e-rest/jwt_auth.htm
Next steps, TODOs:
- Sign in with Solana
- JWT type format
- token gating flow
- Some tokens represent different rate limits. How do you queue if there is ever a capacity reached?
- AMM?
- Token tx flow
- Utilize the usage field of NFTs for access rights
- Sync with Tiago on the octane type relayer flow for DeFi
poetry install
poetry run dev
ps -ef|grep python or sudo lsof -i:3333
pkill -9 kill -9