개발자를 위한 문서 / SENDIT

개발자를 위한 SENDIT

SENDIT은 Pickle Chain 위에서 하나의 뱅크를 중심으로 모인 컨트랙트 집합과 두 개의 읽기 API입니다. 트레이더가 하는 모든 일은 지갑에서든 등록된 트레이딩 키에서든 여러분이 직접 보낼 수 있는 트랜잭션입니다.

구성 요소

SENDIT은 공개 테스트넷(체인 ID 78270)에서 돌아갑니다. 앱과 API는 https://sendit.picklechain.xyz에서 제공되고, JSON-RPC는 체인의 것으로 https://rpc.picklechain.xyz에 있습니다.

매니페스트 읽기

주소는 실행 시점에 읽으십시오. 엔진 업그레이드는 기존 컨트랙트 옆에 새 컨트랙트를 배포하고 모든 키를 옮기며, EVM에서는 코드가 없는 주소에 대한 호출도 성공하므로, 낡아 버린 하드코딩 주소는 아무 말 없이 실패합니다.

JavaScript
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());

매니페스트 키

키타입
perpsaddressThe perps engine, PepperPerps VERSION 3. /api/perp/deployment calls it `engine`.
perpOrdersaddressThe two-step orders book, PepperPerpOrders. `orders` in /api/perp/deployment.
perpVaultaddressThe LP vault, PepperPerpVault (pLP). `vault` in /api/perp/deployment.
bankaddressSenditBank: every trader's pUSD, ETH and launched tokens, and the trading keys.
spotRouteraddressSenditSpotRouter: buy, sell and launch tokens with bank money.
copyFactoryaddressCopyFactory VERSION 3: one CopyAccount per copier and leader.
copyAccountImpladdressThe CopyAccount implementation every copy account clones (EIP-1167).
pusdaddressPickleUSD (pUSD), six decimals. The test dollar every position is margined in.
pusdExchangeaddressSenditPusdExchange: pUSD for ETH at one dollar.
perpsPreviousarrayEngines that still hold positions: [{ engine, orders, vault, block, version }]. Legacy positions there are closed by the wallet.
copyFactoryPreviousarrayEarlier copy factories: [{ factory, impl, block, version, engine }]. Stop and withdraw old copies there.
perpsBlock, bankBlock, copyFactoryBlock, pusdExchangeBlocknumberThe block each contract was deployed in: where an indexer starts reading logs.
pusdWethPool, feeRecipient, keeperaddressThe pool the protocol's fee share is sold through, the FeeRouter that receives it, and the keeper's wallet.

idBase는 매니페스트에 없습니다. 엔진에서 idBase()를 읽으십시오.

현재 주소

2026-10-20 기준으로 제공된 값입니다. 매니페스트와 대조하고, 하드코딩하지 마십시오.

키주소
bank0x3366f560DC1539B5Db4f889CB603C3BDd369298F
perps0x57c61D24BaE12D24100ac1FB20950B88904be971VERSION 3, idBase() 10000000: position and request ids start at 10,000,001
perpOrders0xcb62fcb714f8aa69d2b2abC8Ba9cCEF2A1E02C84
perpVault0x20F4E42E5f56E47e6e058fA137c698C86B0aF459
spotRouter0xD6516A4720018AFa6c777F2D686247d715EDa04B
copyFactory0xf288A5F90Ea3b07b014f52110FC4C7f82206dd95
pusd0x47091c58e34bDC4f32A05541C1243710249Dd777
pusdExchange0x07b5E6fd6b5A86FBE3685B434988D3b5aFB4385F
perpsPrevious[0].engine0x8452242B9d7C453556E3a9b0556e48a25ced0ef2VERSION 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는 그 필드를 빼고 답합니다.