Developers
Install
npm install @unslept/sdk viempip install 'unslept[web3]'UNSLEPT_AGENT_ACCOUNT=<your agent account address>
UNSLEPT_SIGNER_KEY=<agent signer key>
UNSLEPT_CHAIN_ID=4663
UNSLEPT_RPC_URL=https://rpc.mainnet.chain.robinhood.com
UNSLEPT_USDG=0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168
UNSLEPT_ROUTER=0x1FeAB3B8f88FB0667B686fDCB0206194e88c984b
UNSLEPT_BUFFERS=0xcD853fb30eCe3134Cf21e2f47B9e23eaf965F40Dimport { Unslept } from "@unslept/sdk";
import { privateKeyToAccount } from "viem/accounts";
const unslept = new Unslept({
agentAccount: process.env.UNSLEPT_AGENT_ACCOUNT,
signer: privateKeyToAccount(process.env.UNSLEPT_SIGNER_KEY as `0x${string}`),
network: "robinhood-chain",
});
const res = await unslept.fetch("https://api.example.com/data");{
"mcpServers": {
"unslept": {
"command": "npx",
"args": [
"-y",
"@unslept/mcp"
],
"env": {
"UNSLEPT_AGENT_ACCOUNT": "<your agent account address>",
"UNSLEPT_SIGNER_KEY": "<agent signer key>",
"UNSLEPT_CHAIN_ID": "4663",
"UNSLEPT_RPC_URL": "https://rpc.mainnet.chain.robinhood.com",
"UNSLEPT_USDG": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
"UNSLEPT_ROUTER": "0x1FeAB3B8f88FB0667B686fDCB0206194e88c984b",
"UNSLEPT_BUFFERS": "0xcD853fb30eCe3134Cf21e2f47B9e23eaf965F40D"
}
}
}
}Keep the signer key in your secret store. It can only request payments inside the agent's policy.