sentientpay
2
总安装量
2
周安装量
#63767
全站排名
安装命令
npx skills add https://github.com/webcraft3r/sentient-pay --skill sentientpay
Agent 安装分布
amp
2
gemini-cli
2
github-copilot
2
codex
2
kimi-cli
2
cursor
2
Skill 文档
Instructions
SentientPay provides card issuance via the Masked Cash API. It lists available card templates, fetches an unsigned Solana USDC transfer transaction for a chosen template, then after the transaction is signed and confirmed you call the issue endpoint to receive the card details.
You can sign the transaction in two ways:
- Server-side (CLI): Use the bundled
sign-unsigned-tx.jsscript withSOLANA_PRIVATE_KEYandSOLANA_RPC_URLin.env. The script signs and submits the tx, then you call issue with the returned signature. - Frontend: Decode the unsigned transaction in your app, have the user sign and submit with their wallet (e.g. Phantom, Solflare), get the signature, then call issue card with that signature. No private key in .env needed.
End-to-end flow
- GET available cards â Choose a template (use
idandprice_usdfrom the response). - GET/POST unsigned transaction with
template_idandsolana_payer(the wallet that will pay and receive the card) â You receiveunsignedTransaction(base64). - Sign and submit the transaction:
- Option A (server): Run
node scripts/sign-unsigned-tx.js <unsigned_transaction_base64>(usesSOLANA_PRIVATE_KEYfrom .env). Output includessignature. - Option B (frontend): Decode the base64 tx in your app, have the user sign and submit with their wallet, then use the returned signature.
- Option A (server): Run
- POST issue card with header
X-Transaction-Signature: <signature>and body{ template_id, solana_payer }â ReceivecardId,maskedCardNumber,cardType,creditLimit, andmessage.
Signing options
- Server-side (CLI): Use
sign-unsigned-tx.jswithSOLANA_PRIVATE_KEYandSOLANA_RPC_URLin .env. Pass the base64unsignedTransactionfrom step 2; the script signs, submits to Solana, and outputs the signature for use withissue-card. - Frontend: If you want to sign the tx in the frontend (e.g. Phantom, Solflare), decode the unsigned tx, have the user sign and submit in the browser, get the signature, then call issue card with that signature (same
template_idandsolana_payer). No private key in .env needed for that path.
How to run (implementation)
From the SentientPay directory:
- Get available cards:
node scripts/get-available-cards.jsornpm run available - Get unsigned transaction:
node scripts/get-unsigned-tx.js <template_id> <solana_payer>ornpm run unsigned -- <template_id> <solana_payer> - Sign and submit (server-side):
node scripts/sign-unsigned-tx.js <unsigned_transaction_base64>ornpm run sign -- <base64>
RequiresSOLANA_PRIVATE_KEY(and optionallySOLANA_RPC_URL) in .env. - Issue card:
node scripts/issue-card.js <template_id> <solana_payer> <signature>ornpm run issue -- <template_id> <solana_payer> <signature>
Scripts print JSON to stdout on success, or error JSON to stderr and exit non-zero on failure.
Setup
Set the API key (required for unsigned and issue endpoints):
export SENTIENTPAY_API_KEY=your-sentientpay-api-key
For server-side signing only, also set:
export SOLANA_PRIVATE_KEY=your-base58-private-key
export SOLANA_RPC_URL=https://api.mainnet-beta.solana.com # optional, this is the default
Endpoint 1 (get available cards) does not require auth.
Functions to call
| Function | Params | Notes |
|---|---|---|
| getAvailableCards() | (none) | No auth. Returns list of card templates in stock. |
| getUnsignedTransaction(templateId, solanaPayer) | templateId (number), solanaPayer (string, base58 wallet) |
API key required. Returns unsignedTransaction (base64) and metadata. |
| signAndSubmitTransaction(unsignedTransactionBase64) | unsignedTransactionBase64 (string) |
Optional. Uses SOLANA_PRIVATE_KEY and SOLANA_RPC_URL from .env. Signs and submits to Solana; returns signature. |
| issueCard(templateId, solanaPayer, signature) | templateId (number), solanaPayer (string), signature (string, base58) |
API key required. Call after signing (server-side or frontend). Returns card details. |
Flow using function calls
- Call getAvailableCards() â get list of templates; pick one and note its
id(andprice_usd). - Call getUnsignedTransaction(templateId, solanaPayer) with that template id and the payerâs Solana wallet â you get
unsignedTransaction(base64) and metadata. - Sign and submit the transaction (one of two ways):
- Server-side: Call signAndSubmitTransaction(unsignedTransactionBase64) with the base64 string from step 2 â you get
signature. - Frontend: Decode the base64 tx, have the user sign and submit with their wallet â you get
signature.
- Server-side: Call signAndSubmitTransaction(unsignedTransactionBase64) with the base64 string from step 2 â you get
- Call issueCard(templateId, solanaPayer, signature) with the same
templateId, samesolanaPayer, and thesignaturefrom step 3 â you get card details (e.g.cardId,maskedCardNumber,creditLimit).