개발자를 위한 문서 / SENDIT
개발자를 위한 SENDIT
SENDIT은 Pickle Chain 위에서 하나의 뱅크를 중심으로 모인 컨트랙트 집합과 두 개의 읽기 API입니다. 트레이더가 하는 모든 일은 지갑에서든 등록된 트레이딩 키에서든 여러분이 직접 보낼 수 있는 트랜잭션입니다.
구성 요소
- SenditBank는 모든 계정의 pUSD, ETH, 출시된 토큰과 트레이딩 키를 보관합니다. 다른 모든 컨트랙트는
pull로 뱅크에서 차감하고push로 뱅크에 입금하는 베뉴입니다. - 무기한 선물 엔진(PepperPerps VERSION 3), 2단계 시장과 트리거를 위한 주문서, 그리고 LP 볼트.
- 현물 라우터, pUSD 교환 컨트랙트, 카피 트레이딩, 그리고 pUSD 자체.
- HTTP API: 시장, 포지션, 잔액, 피드, 토큰을 위한 dex-api와 세션을 위한 social-api.
- 봇 만들기가 이 모두를 하나로 엮습니다.
SENDIT은 공개 테스트넷(체인 ID 78270)에서 돌아갑니다. 앱과 API는 https://sendit.picklechain.xyz에서 제공되고, JSON-RPC는 체인의 것으로 https://rpc.picklechain.xyz에 있습니다.
매니페스트 읽기
주소는 실행 시점에 읽으십시오. 엔진 업그레이드는 기존 컨트랙트 옆에 새 컨트랙트를 배포하고 모든 키를 옮기며, EVM에서는 코드가 없는 주소에 대한 호출도 성공하므로, 낡아 버린 하드코딩 주소는 아무 말 없이 실패합니다.
const ORIGIN = "https://sendit.picklechain.xyz";
// The deployment, as the app itself reads it. Never cached (Cache-Control: no-store).
const manifest = await fetch(`${ORIGIN}/op-deployment/l2-perps.json`).then((r) => r.json());
const { bank, perps, perpOrders, perpVault, spotRouter, copyFactory, pusd, pusdExchange } = manifest;
// Or the same addresses, lower-cased and renamed, from the API:
// { engine, orders, vault, previous, bank, spotRouter, pusdExchange }
const deployment = await fetch(`${ORIGIN}/api/perp/deployment`).then((r) => r.json());매니페스트 키
| 키 | 타입 |
|---|---|
| perps | addressThe perps engine, PepperPerps VERSION 3. /api/perp/deployment calls it `engine`. |
| perpOrders | addressThe two-step orders book, PepperPerpOrders. `orders` in /api/perp/deployment. |
| perpVault | addressThe LP vault, PepperPerpVault (pLP). `vault` in /api/perp/deployment. |
| bank | addressSenditBank: every trader's pUSD, ETH and launched tokens, and the trading keys. |
| spotRouter | addressSenditSpotRouter: buy, sell and launch tokens with bank money. |
| copyFactory | addressCopyFactory VERSION 3: one CopyAccount per copier and leader. |
| copyAccountImpl | addressThe CopyAccount implementation every copy account clones (EIP-1167). |
| pusd | addressPickleUSD (pUSD), six decimals. The test dollar every position is margined in. |
| pusdExchange | addressSenditPusdExchange: pUSD for ETH at one dollar. |
| perpsPrevious | arrayEngines that still hold positions: [{ engine, orders, vault, block, version }]. Legacy positions there are closed by the wallet. |
| copyFactoryPrevious | arrayEarlier copy factories: [{ factory, impl, block, version, engine }]. Stop and withdraw old copies there. |
| perpsBlock, bankBlock, copyFactoryBlock, pusdExchangeBlock | numberThe block each contract was deployed in: where an indexer starts reading logs. |
| pusdWethPool, feeRecipient, keeper | addressThe pool the protocol's fee share is sold through, the FeeRouter that receives it, and the keeper's wallet. |
idBase는 매니페스트에 없습니다. 엔진에서 idBase()를 읽으십시오.
현재 주소
2026-10-20 기준으로 제공된 값입니다. 매니페스트와 대조하고, 하드코딩하지 마십시오.
| 키 | 주소 |
|---|---|
| bank | 0x3366f560DC1539B5Db4f889CB603C3BDd369298F |
| perps | 0x57c61D24BaE12D24100ac1FB20950B88904be971VERSION 3, idBase() 10000000: position and request ids start at 10,000,001 |
| perpOrders | 0xcb62fcb714f8aa69d2b2abC8Ba9cCEF2A1E02C84 |
| perpVault | 0x20F4E42E5f56E47e6e058fA137c698C86B0aF459 |
| spotRouter | 0xD6516A4720018AFa6c777F2D686247d715EDa04B |
| copyFactory | 0xf288A5F90Ea3b07b014f52110FC4C7f82206dd95 |
| pusd | 0x47091c58e34bDC4f32A05541C1243710249Dd777 |
| pusdExchange | 0x07b5E6fd6b5A86FBE3685B434988D3b5aFB4385F |
| perpsPrevious[0].engine | 0x8452242B9d7C453556E3a9b0556e48a25ced0ef2VERSION 1, ids from 1, wallet-signed only |
id와 이전 엔진
현재 엔진은 포지션 번호를 idBase() + 1, 즉 10,000,001부터 매기고, 그 주문서도 같은 기준에서 요청 번호를 매기므로, 하나의 id는 어느 엔진이 보유하든 체인 전체에서 하나의 포지션이나 요청을 가리킵니다. 이전 엔진(VERSION 1, perpsPrevious에 있음)은 1부터 번호를 매기고, 뱅크보다 먼저 만들어졌으며, 지갑 서명으로만 작동합니다. 그곳에 아직 열린 포지션은 그 포지션을 연 지갑에서 그 엔진 자신의 close로 종료합니다. dex-api는 그 엔진에서 온 모든 행에 legacy: true를 표시합니다.
매니페스트는 앱 자신이 쓰는 유일한 기준입니다. 키가 없으면(어떤 네트워크에 뱅크가 없거나, 아직 교환 컨트랙트가 없거나) 그곳에서 그 기능은 꺼져 있으며, /api/perp/deployment는 그 필드를 빼고 답합니다.