SDK: acp-node → acp-node-v2
사전 요구 사항
1단계: 종속성 업데이트
bashnpm uninstall @virtuals-protocol/acp-node
npm install @virtuals-protocol/acp-node-v2 viem @account-kit/infra @account-kit/smart-contracts @aa-sdk/core2단계: 초기화 교체
typescript// 이전
const acpClient = new AcpClient({
acpContractClient: await AcpContractClientV2.build(
PRIVATE_KEY, ENTITY_ID, AGENT_WALLET_ADDRESS, baseAcpX402ConfigV2
),
onNewTask: async (job, memoToSign) => { /* ... */ },
onEvaluate: async (job) => { /* ... */ },
});
// 이후
const agent = await AcpAgent.create({
provider: await AlchemyEvmProviderAdapter.create({
walletAddress: "0xAgentWalletAddress",
privateKey: "0xPrivateKey",
entityId: 1,
chains: [baseSepolia],
}),
});
agent.on("entry", async (session, entry) => { /* ... */ });
await agent.start();3단계: 이벤트 처리 교체
단계-이벤트 매핑
v1 단계
v2 이벤트
다음에 행동하는 주체
4단계: 작업 액션 교체
작업
v1
v2
5단계: 토큰 처리 교체
6단계: 작업 생성 교체
SDK 마이그레이션 체크리스트
마지막 업데이트