divy-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/dist/index.cjs +472 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +281 -0
- package/dist/index.d.ts +281 -0
- package/dist/index.js +443 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
// src/client.ts
|
|
2
|
+
import {
|
|
3
|
+
createPublicClient,
|
|
4
|
+
createWalletClient,
|
|
5
|
+
http,
|
|
6
|
+
encodeFunctionData,
|
|
7
|
+
decodeEventLog,
|
|
8
|
+
zeroAddress
|
|
9
|
+
} from "viem";
|
|
10
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
11
|
+
|
|
12
|
+
// src/chain.ts
|
|
13
|
+
import { defineChain } from "viem";
|
|
14
|
+
var CHAIN_ID = 4663;
|
|
15
|
+
var DEFAULT_RPC_URL = "https://rpc.mainnet.chain.robinhood.com";
|
|
16
|
+
var DEFAULT_API_URL = "https://divy-api-j8di.onrender.com";
|
|
17
|
+
var EXPLORER_URL = "https://robinhoodchain.blockscout.com";
|
|
18
|
+
var addresses = {
|
|
19
|
+
chainId: CHAIN_ID,
|
|
20
|
+
registry: "0x0fEf638d8C88e6eD38eDcD9aB21BF39D083c8B1b",
|
|
21
|
+
factory: "0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e",
|
|
22
|
+
escrow: "0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e",
|
|
23
|
+
rpcUrl: DEFAULT_RPC_URL,
|
|
24
|
+
apiUrl: DEFAULT_API_URL,
|
|
25
|
+
explorerUrl: EXPLORER_URL
|
|
26
|
+
};
|
|
27
|
+
function defineDivyChain(rpcUrl = DEFAULT_RPC_URL) {
|
|
28
|
+
return defineChain({
|
|
29
|
+
id: CHAIN_ID,
|
|
30
|
+
name: "robinhood-chain",
|
|
31
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
32
|
+
rpcUrls: { default: { http: [rpcUrl] } },
|
|
33
|
+
blockExplorers: { default: { name: "Blockscout", url: EXPLORER_URL } }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function explorerTx(hash) {
|
|
37
|
+
return `${EXPLORER_URL}/tx/${hash}`;
|
|
38
|
+
}
|
|
39
|
+
function explorerAddress(address) {
|
|
40
|
+
return `${EXPLORER_URL}/address/${address}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/abi.ts
|
|
44
|
+
var curveAbi = [
|
|
45
|
+
{
|
|
46
|
+
type: "function",
|
|
47
|
+
name: "buy",
|
|
48
|
+
stateMutability: "payable",
|
|
49
|
+
inputs: [
|
|
50
|
+
{ name: "quoteIn", type: "uint256" },
|
|
51
|
+
{ name: "minTokensOut", type: "uint256" },
|
|
52
|
+
{ name: "recipient", type: "address" }
|
|
53
|
+
],
|
|
54
|
+
outputs: [{ name: "tokensOut", type: "uint256" }]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "function",
|
|
58
|
+
name: "sell",
|
|
59
|
+
stateMutability: "nonpayable",
|
|
60
|
+
inputs: [
|
|
61
|
+
{ name: "tokensIn", type: "uint256" },
|
|
62
|
+
{ name: "minQuoteOut", type: "uint256" },
|
|
63
|
+
{ name: "recipient", type: "address" }
|
|
64
|
+
],
|
|
65
|
+
outputs: [{ name: "quoteOut", type: "uint256" }]
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
var factoryTokenLaunchedAbi = [
|
|
69
|
+
{
|
|
70
|
+
type: "event",
|
|
71
|
+
name: "TokenLaunched",
|
|
72
|
+
inputs: [
|
|
73
|
+
{ indexed: true, name: "token", type: "address" },
|
|
74
|
+
{ indexed: true, name: "curve", type: "address" },
|
|
75
|
+
{ indexed: true, name: "deployer", type: "address" },
|
|
76
|
+
{ indexed: false, name: "pairToken", type: "address" },
|
|
77
|
+
{ indexed: false, name: "launchConfigId", type: "uint256" },
|
|
78
|
+
{ indexed: false, name: "graduationThreshold", type: "uint256" }
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
// src/errors.ts
|
|
84
|
+
var DivyError = class extends Error {
|
|
85
|
+
status;
|
|
86
|
+
constructor(message, status) {
|
|
87
|
+
super(message);
|
|
88
|
+
this.name = "DivyError";
|
|
89
|
+
this.status = status;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// src/http.ts
|
|
94
|
+
var stringify = (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value);
|
|
95
|
+
async function apiRequest(apiUrl, path, options = {}) {
|
|
96
|
+
const headers = {};
|
|
97
|
+
if (options.body !== void 0) headers["content-type"] = "application/json";
|
|
98
|
+
if (options.apiKey) headers.authorization = `Bearer ${options.apiKey}`;
|
|
99
|
+
const res = await fetch(`${apiUrl}${path}`, {
|
|
100
|
+
method: options.method ?? (options.body !== void 0 ? "POST" : "GET"),
|
|
101
|
+
headers,
|
|
102
|
+
body: options.body !== void 0 ? stringify(options.body) : void 0
|
|
103
|
+
});
|
|
104
|
+
const text = await res.text();
|
|
105
|
+
let json;
|
|
106
|
+
try {
|
|
107
|
+
json = text ? JSON.parse(text) : {};
|
|
108
|
+
} catch {
|
|
109
|
+
throw new DivyError(`${apiUrl} returned a non-JSON response (HTTP ${res.status} ${res.statusText}): the API may be down or restarting`, res.status);
|
|
110
|
+
}
|
|
111
|
+
if (!res.ok) {
|
|
112
|
+
throw new DivyError(typeof json.error === "string" ? json.error : res.statusText, res.status);
|
|
113
|
+
}
|
|
114
|
+
return json;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/parse.ts
|
|
118
|
+
var big = (v) => BigInt(v);
|
|
119
|
+
var bigOrNull = (v) => v === null || v === void 0 ? null : big(v);
|
|
120
|
+
function parseInfo(j) {
|
|
121
|
+
return {
|
|
122
|
+
chain: j.chain,
|
|
123
|
+
registry: j.registry,
|
|
124
|
+
factory: j.factory,
|
|
125
|
+
escrow: j.escrow,
|
|
126
|
+
hostedWallets: j.hostedWallets,
|
|
127
|
+
feePolicy: {
|
|
128
|
+
treasury: j.feePolicy.treasury,
|
|
129
|
+
divyBps: j.feePolicy.divyBps === null || j.feePolicy.divyBps === void 0 ? null : Number(j.feePolicy.divyBps),
|
|
130
|
+
agentShareOfBaseFee: j.feePolicy.agentShareOfBaseFee,
|
|
131
|
+
ponsShare: j.feePolicy.ponsShare,
|
|
132
|
+
divyShare: j.feePolicy.divyShare
|
|
133
|
+
},
|
|
134
|
+
launchFee: { wei: big(j.launchFee.wei), eth: j.launchFee.eth },
|
|
135
|
+
maxCreatorTaxBps: j.maxCreatorTaxBps,
|
|
136
|
+
economics: j.economics,
|
|
137
|
+
indexedBlock: bigOrNull(j.indexedBlock),
|
|
138
|
+
keeper: j.keeper
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function parseAgentLaunch(l) {
|
|
142
|
+
return {
|
|
143
|
+
token: l.token,
|
|
144
|
+
symbol: l.symbol,
|
|
145
|
+
name: l.name,
|
|
146
|
+
curve: l.curve,
|
|
147
|
+
pairToken: l.pairToken,
|
|
148
|
+
graduated: l.graduated,
|
|
149
|
+
launchedAt: l.launchedAt,
|
|
150
|
+
recorded: l.recorded
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function parseAgentRecord(j) {
|
|
154
|
+
return {
|
|
155
|
+
agent: j.agent,
|
|
156
|
+
split: j.split,
|
|
157
|
+
registered: j.registered,
|
|
158
|
+
record: { launches: big(j.record.launches), graduated: big(j.record.graduated), score: j.record.score },
|
|
159
|
+
fees: { agentEth: big(j.fees.agentEth), divyEth: big(j.fees.divyEth), pendingEscrowEth: big(j.fees.pendingEscrowEth) },
|
|
160
|
+
launches: j.launches.map(parseAgentLaunch),
|
|
161
|
+
...j.balanceEth !== void 0 ? { balanceEth: j.balanceEth } : {},
|
|
162
|
+
...j.payout !== void 0 ? { payout: j.payout } : {},
|
|
163
|
+
...j.label !== void 0 ? { label: j.label } : {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function parseLeaderboard(j) {
|
|
167
|
+
return j.map((r) => ({ agent: r.agent, launches: r.launches, graduated: r.graduated, score: r.score, feesEth: big(r.feesEth) }));
|
|
168
|
+
}
|
|
169
|
+
function parseLaunches(j) {
|
|
170
|
+
return j.map((r) => ({
|
|
171
|
+
token: r.token,
|
|
172
|
+
agent: r.agent,
|
|
173
|
+
split: r.split,
|
|
174
|
+
curve: r.curve,
|
|
175
|
+
pairToken: r.pairToken,
|
|
176
|
+
name: r.name,
|
|
177
|
+
symbol: r.symbol,
|
|
178
|
+
launchedBlock: r.launchedBlock,
|
|
179
|
+
launchedAt: r.launchedAt,
|
|
180
|
+
recorded: r.recorded,
|
|
181
|
+
graduated: r.graduated
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
function parseHealth(j) {
|
|
185
|
+
return { ok: j.ok, indexedBlock: bigOrNull(j.indexedBlock), head: big(j.head), lag: bigOrNull(j.lag) };
|
|
186
|
+
}
|
|
187
|
+
function parseTx(t) {
|
|
188
|
+
return { to: t.to, data: t.data, value: big(t.value) };
|
|
189
|
+
}
|
|
190
|
+
function parseQuote(j) {
|
|
191
|
+
return {
|
|
192
|
+
curve: j.curve,
|
|
193
|
+
amountIn: big(j.amountIn),
|
|
194
|
+
amountOut: big(j.amountOut),
|
|
195
|
+
minOut: big(j.minOut),
|
|
196
|
+
feeBps: j.feeBps,
|
|
197
|
+
creatorTaxBps: j.creatorTaxBps,
|
|
198
|
+
snipeTaxBps: j.snipeTaxBps,
|
|
199
|
+
tx: parseTx(j.tx),
|
|
200
|
+
approveTx: j.approveTx ? parseTx(j.approveTx) : null
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/client.ts
|
|
205
|
+
var PRIVATE_KEY_RE = /^0x[0-9a-fA-F]{64}$/;
|
|
206
|
+
var BPS_DENOM = 10000n;
|
|
207
|
+
function readAmount(amount) {
|
|
208
|
+
return typeof amount === "bigint" ? amount : BigInt(amount);
|
|
209
|
+
}
|
|
210
|
+
var Divy = class {
|
|
211
|
+
mode;
|
|
212
|
+
apiUrl;
|
|
213
|
+
apiKey;
|
|
214
|
+
account;
|
|
215
|
+
// viem's client generics resist a clean stored type across the three constructor branches;
|
|
216
|
+
// both are only ever touched through sendLocal(), which fixes the call shape in one place.
|
|
217
|
+
wallet;
|
|
218
|
+
pub;
|
|
219
|
+
chain;
|
|
220
|
+
constructor(options) {
|
|
221
|
+
const hasPrivateKey = "privateKey" in options && options.privateKey !== void 0;
|
|
222
|
+
const hasApiKey = "apiKey" in options && options.apiKey !== void 0;
|
|
223
|
+
if (hasPrivateKey && hasApiKey) {
|
|
224
|
+
throw new Error("pass either privateKey or apiKey to createDivy, not both");
|
|
225
|
+
}
|
|
226
|
+
this.apiUrl = options.apiUrl ?? addresses.apiUrl;
|
|
227
|
+
if (hasPrivateKey) {
|
|
228
|
+
const { privateKey, rpcUrl } = options;
|
|
229
|
+
if (!PRIVATE_KEY_RE.test(privateKey)) {
|
|
230
|
+
throw new Error("privateKey must be a 0x-prefixed 32-byte hex string");
|
|
231
|
+
}
|
|
232
|
+
this.mode = "self-custody";
|
|
233
|
+
this.account = privateKeyToAccount(privateKey);
|
|
234
|
+
this.chain = defineDivyChain(rpcUrl ?? addresses.rpcUrl);
|
|
235
|
+
const transport = http(rpcUrl ?? addresses.rpcUrl);
|
|
236
|
+
this.wallet = createWalletClient({ account: this.account, chain: this.chain, transport });
|
|
237
|
+
this.pub = createPublicClient({ chain: this.chain, transport });
|
|
238
|
+
} else if (hasApiKey) {
|
|
239
|
+
const { apiKey } = options;
|
|
240
|
+
if (typeof apiKey !== "string" || apiKey.length === 0) {
|
|
241
|
+
throw new Error("apiKey must be a non-empty string");
|
|
242
|
+
}
|
|
243
|
+
this.mode = "hosted";
|
|
244
|
+
this.apiKey = apiKey;
|
|
245
|
+
} else {
|
|
246
|
+
this.mode = "read-only";
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
requireSigner(action) {
|
|
250
|
+
if (this.mode === "read-only") {
|
|
251
|
+
throw new Error(`${action} requires a privateKey (self-custody) or apiKey (hosted) \u2014 this client is read-only`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async sendLocal(tx) {
|
|
255
|
+
if (!this.wallet || !this.pub || !this.account) throw new Error("self-custody wallet is not configured");
|
|
256
|
+
const hash = await this.wallet.sendTransaction({
|
|
257
|
+
account: this.account,
|
|
258
|
+
chain: this.chain,
|
|
259
|
+
to: tx.to,
|
|
260
|
+
data: tx.data,
|
|
261
|
+
value: tx.value
|
|
262
|
+
});
|
|
263
|
+
const receipt = await this.pub.waitForTransactionReceipt({ hash });
|
|
264
|
+
if (receipt.status !== "success") throw new Error(`transaction reverted on-chain: ${hash}`);
|
|
265
|
+
return receipt;
|
|
266
|
+
}
|
|
267
|
+
async buildTx(path, body) {
|
|
268
|
+
return apiRequest(this.apiUrl, path, { body: body ?? {} });
|
|
269
|
+
}
|
|
270
|
+
async info() {
|
|
271
|
+
return parseInfo(await apiRequest(this.apiUrl, "/"));
|
|
272
|
+
}
|
|
273
|
+
async agent(address) {
|
|
274
|
+
if (!address) {
|
|
275
|
+
if (this.mode === "hosted") {
|
|
276
|
+
return parseAgentRecord(await apiRequest(this.apiUrl, "/me", { apiKey: this.apiKey }));
|
|
277
|
+
}
|
|
278
|
+
if (this.mode === "self-custody" && this.account) {
|
|
279
|
+
address = this.account.address;
|
|
280
|
+
} else {
|
|
281
|
+
throw new Error("agent() requires an address in read-only mode");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return parseAgentRecord(await apiRequest(this.apiUrl, `/agents/${address}`));
|
|
285
|
+
}
|
|
286
|
+
async leaderboard() {
|
|
287
|
+
return parseLeaderboard(await apiRequest(this.apiUrl, "/leaderboard"));
|
|
288
|
+
}
|
|
289
|
+
async launches(options = {}) {
|
|
290
|
+
const qs = options.limit ? `?limit=${options.limit}` : "";
|
|
291
|
+
return parseLaunches(await apiRequest(this.apiUrl, `/launches${qs}`));
|
|
292
|
+
}
|
|
293
|
+
async health() {
|
|
294
|
+
return parseHealth(await apiRequest(this.apiUrl, "/health"));
|
|
295
|
+
}
|
|
296
|
+
async register() {
|
|
297
|
+
this.requireSigner("register");
|
|
298
|
+
if (this.mode === "hosted") {
|
|
299
|
+
const me = await apiRequest(this.apiUrl, "/me", { apiKey: this.apiKey });
|
|
300
|
+
if (me.registered) return { registered: true, split: me.split };
|
|
301
|
+
return { registered: false, split: null };
|
|
302
|
+
}
|
|
303
|
+
const address = this.account.address;
|
|
304
|
+
const first = await apiRequest(this.apiUrl, "/agents", {
|
|
305
|
+
body: { address }
|
|
306
|
+
});
|
|
307
|
+
if (first.registered) return { registered: true, split: first.split };
|
|
308
|
+
const receipt = await this.sendLocal({ to: first.tx.to, data: first.tx.data, value: BigInt(first.tx.value ?? 0) });
|
|
309
|
+
const after = await apiRequest(this.apiUrl, "/agents", { body: { address } });
|
|
310
|
+
return { registered: after.registered, split: after.split, txHash: receipt.transactionHash };
|
|
311
|
+
}
|
|
312
|
+
async quote(params) {
|
|
313
|
+
let recipient = params.recipient;
|
|
314
|
+
if (!recipient && this.mode === "self-custody" && this.account) recipient = this.account.address;
|
|
315
|
+
return parseQuote(
|
|
316
|
+
await apiRequest(this.apiUrl, "/quote", {
|
|
317
|
+
body: {
|
|
318
|
+
curve: params.curve,
|
|
319
|
+
token: params.token,
|
|
320
|
+
side: params.side,
|
|
321
|
+
amount: readAmount(params.amount).toString(),
|
|
322
|
+
recipient: recipient ?? zeroAddress
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
async launch(params) {
|
|
328
|
+
this.requireSigner("launch");
|
|
329
|
+
if (this.mode === "hosted") {
|
|
330
|
+
const out = await apiRequest(this.apiUrl, "/launch", {
|
|
331
|
+
apiKey: this.apiKey,
|
|
332
|
+
body: params
|
|
333
|
+
});
|
|
334
|
+
return { token: out.token, curve: out.curve, txHash: out.txHash };
|
|
335
|
+
}
|
|
336
|
+
const address = this.account.address;
|
|
337
|
+
const built = await apiRequest(this.apiUrl, "/launch", { body: { ...params, agent: address } });
|
|
338
|
+
const receipt = await this.sendLocal(built.tx);
|
|
339
|
+
let launched;
|
|
340
|
+
for (const log of receipt.logs) {
|
|
341
|
+
try {
|
|
342
|
+
const ev = decodeEventLog({ abi: factoryTokenLaunchedAbi, data: log.data, topics: log.topics });
|
|
343
|
+
if (ev.eventName === "TokenLaunched") {
|
|
344
|
+
launched = ev.args;
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
} catch {
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (!launched) throw new Error(`launch mined (${receipt.transactionHash}) but no TokenLaunched event was found`);
|
|
351
|
+
const result = { token: launched.token, curve: launched.curve, txHash: receipt.transactionHash };
|
|
352
|
+
try {
|
|
353
|
+
const recorded = await this.record(launched.token);
|
|
354
|
+
result.recordTxHash = recorded.txHash;
|
|
355
|
+
} catch (e) {
|
|
356
|
+
result.recordError = e instanceof Error ? e.message : String(e);
|
|
357
|
+
}
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
async record(token) {
|
|
361
|
+
if (this.mode !== "self-custody") {
|
|
362
|
+
throw new Error(
|
|
363
|
+
"record() requires self-custody (a privateKey): hosted and read-only launches are recorded automatically by Divy's keeper within about a minute \u2014 use waitForRecord() to wait for it"
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
const built = await apiRequest(this.apiUrl, "/record", { body: { token } });
|
|
367
|
+
const receipt = await this.sendLocal(built.tx);
|
|
368
|
+
return { txHash: receipt.transactionHash };
|
|
369
|
+
}
|
|
370
|
+
async buy(params) {
|
|
371
|
+
return this.trade("buy", readAmount(params.amountWei), params);
|
|
372
|
+
}
|
|
373
|
+
async sell(params) {
|
|
374
|
+
return this.trade("sell", readAmount(params.amountTokens), params);
|
|
375
|
+
}
|
|
376
|
+
async trade(side, amount, params) {
|
|
377
|
+
this.requireSigner(side);
|
|
378
|
+
const slippageBps = params.slippageBps ?? 100;
|
|
379
|
+
if (this.mode === "hosted") {
|
|
380
|
+
if (slippageBps !== 100) {
|
|
381
|
+
throw new Error("slippageBps is not configurable in hosted mode: /trade hardcodes a 1% (100bps) slippage floor");
|
|
382
|
+
}
|
|
383
|
+
const out = await apiRequest(this.apiUrl, "/trade", {
|
|
384
|
+
apiKey: this.apiKey,
|
|
385
|
+
body: { curve: params.curve, token: params.token, side, amount: amount.toString() }
|
|
386
|
+
});
|
|
387
|
+
return { txHash: out.txHash, amountOut: BigInt(out.amountOut) };
|
|
388
|
+
}
|
|
389
|
+
const address = this.account.address;
|
|
390
|
+
const q = await this.quote({ curve: params.curve, token: params.token, side, amount, recipient: address });
|
|
391
|
+
let tradeTx = q.tx;
|
|
392
|
+
if (slippageBps !== 100) {
|
|
393
|
+
const minOut = q.amountOut * (BPS_DENOM - BigInt(slippageBps)) / BPS_DENOM;
|
|
394
|
+
const data = encodeFunctionData({ abi: curveAbi, functionName: side, args: [q.amountIn, minOut, address] });
|
|
395
|
+
tradeTx = { ...q.tx, data };
|
|
396
|
+
}
|
|
397
|
+
if (q.approveTx) await this.sendLocal(q.approveTx);
|
|
398
|
+
const receipt = await this.sendLocal(tradeTx);
|
|
399
|
+
return { txHash: receipt.transactionHash, amountOut: q.amountOut };
|
|
400
|
+
}
|
|
401
|
+
async harvest() {
|
|
402
|
+
this.requireSigner("harvest");
|
|
403
|
+
if (this.mode === "hosted") {
|
|
404
|
+
const out = await apiRequest(this.apiUrl, "/harvest", { apiKey: this.apiKey, body: {} });
|
|
405
|
+
return { txHash: out.txHash };
|
|
406
|
+
}
|
|
407
|
+
const address = this.account.address;
|
|
408
|
+
const built = await apiRequest(this.apiUrl, "/harvest", { body: { agent: address } });
|
|
409
|
+
const receipt = await this.sendLocal(built.tx);
|
|
410
|
+
return { txHash: receipt.transactionHash };
|
|
411
|
+
}
|
|
412
|
+
async waitForRecord(token, options = {}) {
|
|
413
|
+
const timeoutMs = options.timeoutMs ?? 6e4;
|
|
414
|
+
const intervalMs = options.intervalMs ?? 3e3;
|
|
415
|
+
const deadline = Date.now() + timeoutMs;
|
|
416
|
+
const wanted = token.toLowerCase();
|
|
417
|
+
for (; ; ) {
|
|
418
|
+
const rows = await this.launches({ limit: 200 });
|
|
419
|
+
const row = rows.find((r) => r.token.toLowerCase() === wanted);
|
|
420
|
+
if (row?.recorded) return row;
|
|
421
|
+
if (Date.now() >= deadline) {
|
|
422
|
+
throw new DivyError(`timed out waiting for ${token} to be recorded`, 408);
|
|
423
|
+
}
|
|
424
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
function createDivy(options = {}) {
|
|
429
|
+
return new Divy(options);
|
|
430
|
+
}
|
|
431
|
+
export {
|
|
432
|
+
CHAIN_ID,
|
|
433
|
+
DEFAULT_API_URL,
|
|
434
|
+
DEFAULT_RPC_URL,
|
|
435
|
+
Divy,
|
|
436
|
+
DivyError,
|
|
437
|
+
addresses,
|
|
438
|
+
createDivy,
|
|
439
|
+
defineDivyChain,
|
|
440
|
+
explorerAddress,
|
|
441
|
+
explorerTx
|
|
442
|
+
};
|
|
443
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/chain.ts","../src/abi.ts","../src/errors.ts","../src/http.ts","../src/parse.ts"],"sourcesContent":["import {\n createPublicClient, createWalletClient, http, encodeFunctionData, decodeEventLog, zeroAddress,\n} from 'viem';\nimport type { Address, Hex } from 'viem';\nimport { privateKeyToAccount } from 'viem/accounts';\nimport { addresses, defineDivyChain } from './chain.js';\nimport { curveAbi, factoryTokenLaunchedAbi } from './abi.js';\nimport { DivyError } from './errors.js';\nimport { apiRequest } from './http.js';\nimport {\n parseAgentRecord, parseHealth, parseInfo, parseLaunches, parseLeaderboard, parseQuote,\n} from './parse.js';\nimport type {\n AgentRecord, BuyParams, CreateDivyOptions, DivyMode, HarvestResult, HealthResult, InfoResult,\n LaunchListItem, LaunchParams, LaunchResult, LeaderboardEntry, QuoteParams, QuoteResult, RecordResult,\n RegisterResult, SellParams, TradeResult, Tx, WaitForRecordOptions,\n} from './types.js';\n\nconst PRIVATE_KEY_RE = /^0x[0-9a-fA-F]{64}$/;\nconst BPS_DENOM = 10000n;\n\nfunction readAmount(amount: bigint | string): bigint {\n return typeof amount === 'bigint' ? amount : BigInt(amount);\n}\n\nexport class Divy {\n readonly mode: DivyMode;\n readonly apiUrl: string;\n\n private readonly apiKey?: string;\n private readonly account?: ReturnType<typeof privateKeyToAccount>;\n // viem's client generics resist a clean stored type across the three constructor branches;\n // both are only ever touched through sendLocal(), which fixes the call shape in one place.\n private readonly wallet?: any;\n private readonly pub?: any;\n private readonly chain?: ReturnType<typeof defineDivyChain>;\n\n constructor(options: CreateDivyOptions) {\n const hasPrivateKey = 'privateKey' in options && options.privateKey !== undefined;\n const hasApiKey = 'apiKey' in options && options.apiKey !== undefined;\n if (hasPrivateKey && hasApiKey) {\n throw new Error('pass either privateKey or apiKey to createDivy, not both');\n }\n\n this.apiUrl = options.apiUrl ?? addresses.apiUrl;\n\n if (hasPrivateKey) {\n const { privateKey, rpcUrl } = options as { privateKey: Hex; rpcUrl?: string };\n if (!PRIVATE_KEY_RE.test(privateKey)) {\n throw new Error('privateKey must be a 0x-prefixed 32-byte hex string');\n }\n this.mode = 'self-custody';\n this.account = privateKeyToAccount(privateKey);\n this.chain = defineDivyChain(rpcUrl ?? addresses.rpcUrl);\n const transport = http(rpcUrl ?? addresses.rpcUrl);\n this.wallet = createWalletClient({ account: this.account, chain: this.chain, transport });\n this.pub = createPublicClient({ chain: this.chain, transport });\n } else if (hasApiKey) {\n const { apiKey } = options as { apiKey: string };\n if (typeof apiKey !== 'string' || apiKey.length === 0) {\n throw new Error('apiKey must be a non-empty string');\n }\n this.mode = 'hosted';\n this.apiKey = apiKey;\n } else {\n this.mode = 'read-only';\n }\n }\n\n private requireSigner(action: string): void {\n if (this.mode === 'read-only') {\n throw new Error(`${action} requires a privateKey (self-custody) or apiKey (hosted) — this client is read-only`);\n }\n }\n\n private async sendLocal(tx: Tx) {\n if (!this.wallet || !this.pub || !this.account) throw new Error('self-custody wallet is not configured');\n const hash = await this.wallet.sendTransaction({\n account: this.account, chain: this.chain, to: tx.to, data: tx.data, value: tx.value,\n });\n const receipt = await this.pub.waitForTransactionReceipt({ hash });\n if (receipt.status !== 'success') throw new Error(`transaction reverted on-chain: ${hash}`);\n return receipt;\n }\n\n async buildTx<T = Record<string, unknown>>(path: string, body?: object): Promise<T> {\n return apiRequest<T>(this.apiUrl, path, { body: body ?? {} });\n }\n\n async info(): Promise<InfoResult> {\n return parseInfo(await apiRequest(this.apiUrl, '/'));\n }\n\n async agent(address?: Address): Promise<AgentRecord> {\n if (!address) {\n if (this.mode === 'hosted') {\n return parseAgentRecord(await apiRequest(this.apiUrl, '/me', { apiKey: this.apiKey }));\n }\n if (this.mode === 'self-custody' && this.account) {\n address = this.account.address;\n } else {\n throw new Error('agent() requires an address in read-only mode');\n }\n }\n return parseAgentRecord(await apiRequest(this.apiUrl, `/agents/${address}`));\n }\n\n async leaderboard(): Promise<LeaderboardEntry[]> {\n return parseLeaderboard(await apiRequest(this.apiUrl, '/leaderboard'));\n }\n\n async launches(options: { limit?: number } = {}): Promise<LaunchListItem[]> {\n const qs = options.limit ? `?limit=${options.limit}` : '';\n return parseLaunches(await apiRequest(this.apiUrl, `/launches${qs}`));\n }\n\n async health(): Promise<HealthResult> {\n return parseHealth(await apiRequest(this.apiUrl, '/health'));\n }\n\n async register(): Promise<RegisterResult> {\n this.requireSigner('register');\n\n if (this.mode === 'hosted') {\n const me = await apiRequest<{ registered: boolean; split: Address | null }>(this.apiUrl, '/me', { apiKey: this.apiKey });\n if (me.registered) return { registered: true, split: me.split };\n return { registered: false, split: null };\n }\n\n const address = this.account!.address;\n const first = await apiRequest<{ registered: boolean; split: Address; tx?: Tx }>(this.apiUrl, '/agents', {\n body: { address },\n });\n if (first.registered) return { registered: true, split: first.split };\n\n const receipt = await this.sendLocal({ to: first.tx!.to, data: first.tx!.data, value: BigInt(first.tx!.value ?? 0) });\n const after = await apiRequest<{ registered: boolean; split: Address }>(this.apiUrl, '/agents', { body: { address } });\n return { registered: after.registered, split: after.split, txHash: receipt.transactionHash };\n }\n\n async quote(params: QuoteParams): Promise<QuoteResult> {\n let recipient = params.recipient;\n if (!recipient && this.mode === 'self-custody' && this.account) recipient = this.account.address;\n return parseQuote(\n await apiRequest(this.apiUrl, '/quote', {\n body: {\n curve: params.curve, token: params.token, side: params.side,\n amount: readAmount(params.amount).toString(), recipient: recipient ?? zeroAddress,\n },\n }),\n );\n }\n\n async launch(params: LaunchParams): Promise<LaunchResult> {\n this.requireSigner('launch');\n\n if (this.mode === 'hosted') {\n const out = await apiRequest<{ token: Address; curve: Address; txHash: Hex }>(this.apiUrl, '/launch', {\n apiKey: this.apiKey, body: params,\n });\n return { token: out.token, curve: out.curve, txHash: out.txHash };\n }\n\n const address = this.account!.address;\n const built = await apiRequest<{ tx: Tx }>(this.apiUrl, '/launch', { body: { ...params, agent: address } });\n const receipt = await this.sendLocal(built.tx);\n\n let launched: { token: Address; curve: Address } | undefined;\n for (const log of receipt.logs) {\n try {\n const ev = decodeEventLog({ abi: factoryTokenLaunchedAbi, data: log.data, topics: log.topics });\n if (ev.eventName === 'TokenLaunched') { launched = ev.args as { token: Address; curve: Address }; break; }\n } catch { /* not a TokenLaunched log */ }\n }\n if (!launched) throw new Error(`launch mined (${receipt.transactionHash}) but no TokenLaunched event was found`);\n\n const result: LaunchResult = { token: launched.token, curve: launched.curve, txHash: receipt.transactionHash };\n try {\n const recorded = await this.record(launched.token);\n result.recordTxHash = recorded.txHash;\n } catch (e) {\n result.recordError = e instanceof Error ? e.message : String(e);\n }\n return result;\n }\n\n async record(token: Address): Promise<RecordResult> {\n if (this.mode !== 'self-custody') {\n throw new Error(\n 'record() requires self-custody (a privateKey): hosted and read-only launches are recorded '\n + 'automatically by Divy\\'s keeper within about a minute — use waitForRecord() to wait for it',\n );\n }\n const built = await apiRequest<{ tx: Tx }>(this.apiUrl, '/record', { body: { token } });\n const receipt = await this.sendLocal(built.tx);\n return { txHash: receipt.transactionHash };\n }\n\n async buy(params: BuyParams): Promise<TradeResult> {\n return this.trade('buy', readAmount(params.amountWei), params);\n }\n\n async sell(params: SellParams): Promise<TradeResult> {\n return this.trade('sell', readAmount(params.amountTokens), params);\n }\n\n private async trade(side: 'buy' | 'sell', amount: bigint, params: BuyParams | SellParams): Promise<TradeResult> {\n this.requireSigner(side);\n const slippageBps = params.slippageBps ?? 100;\n\n if (this.mode === 'hosted') {\n if (slippageBps !== 100) {\n throw new Error('slippageBps is not configurable in hosted mode: /trade hardcodes a 1% (100bps) slippage floor');\n }\n const out = await apiRequest<{ txHash: Hex; amountOut: string }>(this.apiUrl, '/trade', {\n apiKey: this.apiKey, body: { curve: params.curve, token: params.token, side, amount: amount.toString() },\n });\n return { txHash: out.txHash, amountOut: BigInt(out.amountOut) };\n }\n\n const address = this.account!.address;\n const q = await this.quote({ curve: params.curve, token: params.token, side, amount, recipient: address });\n\n let tradeTx = q.tx;\n if (slippageBps !== 100) {\n const minOut = (q.amountOut * (BPS_DENOM - BigInt(slippageBps))) / BPS_DENOM;\n const data = encodeFunctionData({ abi: curveAbi, functionName: side, args: [q.amountIn, minOut, address] });\n tradeTx = { ...q.tx, data };\n }\n\n if (q.approveTx) await this.sendLocal(q.approveTx);\n const receipt = await this.sendLocal(tradeTx);\n return { txHash: receipt.transactionHash, amountOut: q.amountOut };\n }\n\n async harvest(): Promise<HarvestResult> {\n this.requireSigner('harvest');\n\n if (this.mode === 'hosted') {\n const out = await apiRequest<{ txHash: Hex }>(this.apiUrl, '/harvest', { apiKey: this.apiKey, body: {} });\n return { txHash: out.txHash };\n }\n\n const address = this.account!.address;\n const built = await apiRequest<{ tx: Tx }>(this.apiUrl, '/harvest', { body: { agent: address } });\n const receipt = await this.sendLocal(built.tx);\n return { txHash: receipt.transactionHash };\n }\n\n async waitForRecord(token: Address, options: WaitForRecordOptions = {}): Promise<LaunchListItem> {\n const timeoutMs = options.timeoutMs ?? 60_000;\n const intervalMs = options.intervalMs ?? 3_000;\n const deadline = Date.now() + timeoutMs;\n const wanted = token.toLowerCase();\n\n for (;;) {\n const rows = await this.launches({ limit: 200 });\n const row = rows.find((r) => r.token.toLowerCase() === wanted);\n if (row?.recorded) return row;\n if (Date.now() >= deadline) {\n throw new DivyError(`timed out waiting for ${token} to be recorded`, 408);\n }\n await new Promise((resolve) => setTimeout(resolve, intervalMs));\n }\n }\n}\n\nexport function createDivy(options: CreateDivyOptions = {}): Divy {\n return new Divy(options);\n}\n","import { defineChain } from 'viem';\nimport type { Address } from 'viem';\n\nexport const CHAIN_ID = 4663;\nexport const DEFAULT_RPC_URL = 'https://rpc.mainnet.chain.robinhood.com';\nexport const DEFAULT_API_URL = 'https://divy-api-j8di.onrender.com';\nexport const EXPLORER_URL = 'https://robinhoodchain.blockscout.com';\n\nexport const addresses = {\n chainId: CHAIN_ID,\n registry: '0x0fEf638d8C88e6eD38eDcD9aB21BF39D083c8B1b' as Address,\n factory: '0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e' as Address,\n escrow: '0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e' as Address,\n rpcUrl: DEFAULT_RPC_URL,\n apiUrl: DEFAULT_API_URL,\n explorerUrl: EXPLORER_URL,\n} as const;\n\nexport function defineDivyChain(rpcUrl: string = DEFAULT_RPC_URL) {\n return defineChain({\n id: CHAIN_ID,\n name: 'robinhood-chain',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: { default: { http: [rpcUrl] } },\n blockExplorers: { default: { name: 'Blockscout', url: EXPLORER_URL } },\n });\n}\n\nexport function explorerTx(hash: string): string {\n return `${EXPLORER_URL}/tx/${hash}`;\n}\n\nexport function explorerAddress(address: string): string {\n return `${EXPLORER_URL}/address/${address}`;\n}\n","// Minimal ABIs: the API returns pre-encoded {to, data, value} for every write, so the SDK\n// only needs to encode locally when overriding the API's default 1% slippage floor, and to\n// decode the TokenLaunched event off a launch receipt.\n\nexport const curveAbi = [\n {\n type: 'function',\n name: 'buy',\n stateMutability: 'payable',\n inputs: [\n { name: 'quoteIn', type: 'uint256' },\n { name: 'minTokensOut', type: 'uint256' },\n { name: 'recipient', type: 'address' },\n ],\n outputs: [{ name: 'tokensOut', type: 'uint256' }],\n },\n {\n type: 'function',\n name: 'sell',\n stateMutability: 'nonpayable',\n inputs: [\n { name: 'tokensIn', type: 'uint256' },\n { name: 'minQuoteOut', type: 'uint256' },\n { name: 'recipient', type: 'address' },\n ],\n outputs: [{ name: 'quoteOut', type: 'uint256' }],\n },\n] as const;\n\nexport const factoryTokenLaunchedAbi = [\n {\n type: 'event',\n name: 'TokenLaunched',\n inputs: [\n { indexed: true, name: 'token', type: 'address' },\n { indexed: true, name: 'curve', type: 'address' },\n { indexed: true, name: 'deployer', type: 'address' },\n { indexed: false, name: 'pairToken', type: 'address' },\n { indexed: false, name: 'launchConfigId', type: 'uint256' },\n { indexed: false, name: 'graduationThreshold', type: 'uint256' },\n ],\n },\n] as const;\n","export class DivyError extends Error {\n readonly status: number;\n\n constructor(message: string, status: number) {\n super(message);\n this.name = 'DivyError';\n this.status = status;\n }\n}\n","import { DivyError } from './errors.js';\n\nconst stringify = (body: unknown): string =>\n JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value));\n\nexport interface RequestOptions {\n method?: 'GET' | 'POST' | 'PATCH';\n body?: unknown;\n apiKey?: string;\n}\n\nexport async function apiRequest<T = unknown>(apiUrl: string, path: string, options: RequestOptions = {}): Promise<T> {\n const headers: Record<string, string> = {};\n if (options.body !== undefined) headers['content-type'] = 'application/json';\n if (options.apiKey) headers.authorization = `Bearer ${options.apiKey}`;\n\n const res = await fetch(`${apiUrl}${path}`, {\n method: options.method ?? (options.body !== undefined ? 'POST' : 'GET'),\n headers,\n body: options.body !== undefined ? stringify(options.body) : undefined,\n });\n\n const text = await res.text();\n let json: any;\n try {\n json = text ? JSON.parse(text) : {};\n } catch {\n // A gateway or proxy in front of the API (Render, Cloudflare, ...) can return an HTML\n // error page instead of JSON, typically on a 502/504 while the API is cold-starting or down.\n throw new DivyError(`${apiUrl} returned a non-JSON response (HTTP ${res.status} ${res.statusText}): the API may be down or restarting`, res.status);\n }\n if (!res.ok) {\n throw new DivyError(typeof json.error === 'string' ? json.error : res.statusText, res.status);\n }\n return json as T;\n}\n","import type {\n AgentLaunch, AgentRecord, HealthResult, InfoResult, LaunchListItem, LeaderboardEntry, QuoteResult, Tx,\n} from './types.js';\n\nconst big = (v: unknown): bigint => BigInt(v as string);\nconst bigOrNull = (v: unknown): bigint | null => (v === null || v === undefined ? null : big(v));\n\nexport function parseInfo(j: any): InfoResult {\n return {\n chain: j.chain,\n registry: j.registry,\n factory: j.factory,\n escrow: j.escrow,\n hostedWallets: j.hostedWallets,\n feePolicy: {\n treasury: j.feePolicy.treasury,\n divyBps: j.feePolicy.divyBps === null || j.feePolicy.divyBps === undefined ? null : Number(j.feePolicy.divyBps),\n agentShareOfBaseFee: j.feePolicy.agentShareOfBaseFee,\n ponsShare: j.feePolicy.ponsShare,\n divyShare: j.feePolicy.divyShare,\n },\n launchFee: { wei: big(j.launchFee.wei), eth: j.launchFee.eth },\n maxCreatorTaxBps: j.maxCreatorTaxBps,\n economics: j.economics,\n indexedBlock: bigOrNull(j.indexedBlock),\n keeper: j.keeper,\n };\n}\n\nfunction parseAgentLaunch(l: any): AgentLaunch {\n return {\n token: l.token,\n symbol: l.symbol,\n name: l.name,\n curve: l.curve,\n pairToken: l.pairToken,\n graduated: l.graduated,\n launchedAt: l.launchedAt,\n recorded: l.recorded,\n };\n}\n\nexport function parseAgentRecord(j: any): AgentRecord {\n return {\n agent: j.agent,\n split: j.split,\n registered: j.registered,\n record: { launches: big(j.record.launches), graduated: big(j.record.graduated), score: j.record.score },\n fees: { agentEth: big(j.fees.agentEth), divyEth: big(j.fees.divyEth), pendingEscrowEth: big(j.fees.pendingEscrowEth) },\n launches: j.launches.map(parseAgentLaunch),\n ...(j.balanceEth !== undefined ? { balanceEth: j.balanceEth } : {}),\n ...(j.payout !== undefined ? { payout: j.payout } : {}),\n ...(j.label !== undefined ? { label: j.label } : {}),\n };\n}\n\nexport function parseLeaderboard(j: any[]): LeaderboardEntry[] {\n return j.map((r) => ({ agent: r.agent, launches: r.launches, graduated: r.graduated, score: r.score, feesEth: big(r.feesEth) }));\n}\n\nexport function parseLaunches(j: any[]): LaunchListItem[] {\n return j.map((r) => ({\n token: r.token, agent: r.agent, split: r.split, curve: r.curve, pairToken: r.pairToken,\n name: r.name, symbol: r.symbol, launchedBlock: r.launchedBlock, launchedAt: r.launchedAt,\n recorded: r.recorded, graduated: r.graduated,\n }));\n}\n\nexport function parseHealth(j: any): HealthResult {\n return { ok: j.ok, indexedBlock: bigOrNull(j.indexedBlock), head: big(j.head), lag: bigOrNull(j.lag) };\n}\n\nfunction parseTx(t: any): Tx {\n return { to: t.to, data: t.data, value: big(t.value) };\n}\n\nexport function parseQuote(j: any): QuoteResult {\n return {\n curve: j.curve,\n amountIn: big(j.amountIn),\n amountOut: big(j.amountOut),\n minOut: big(j.minOut),\n feeBps: j.feeBps,\n creatorTaxBps: j.creatorTaxBps,\n snipeTaxBps: j.snipeTaxBps,\n tx: parseTx(j.tx),\n approveTx: j.approveTx ? parseTx(j.approveTx) : null,\n };\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAoB;AAAA,EAAoB;AAAA,EAAM;AAAA,EAAoB;AAAA,EAAgB;AAAA,OAC7E;AAEP,SAAS,2BAA2B;;;ACJpC,SAAS,mBAAmB;AAGrB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E,CAAC;AACxG,aAAO,EAAE,QAAQ,IAAI,OAAO;AAAA,IAC9B;AAEA,UAAM,UAAU,KAAK,QAAS;AAC9B,UAAM,QAAQ,MAAM,WAAuB,KAAK,QAAQ,YAAY,EAAE,MAAM,EAAE,OAAO,QAAQ,EAAE,CAAC;AAChG,UAAM,UAAU,MAAM,KAAK,UAAU,MAAM,EAAE;AAC7C,WAAO,EAAE,QAAQ,QAAQ,gBAAgB;AAAA,EAC3C;AAAA,EAEA,MAAM,cAAc,OAAgB,UAAgC,CAAC,GAA4B;AAC/F,UAAM,YAAY,QAAQ,aAAa;AACvC,UAAM,aAAa,QAAQ,cAAc;AACzC,UAAM,WAAW,KAAK,IAAI,IAAI;AAC9B,UAAM,SAAS,MAAM,YAAY;AAEjC,eAAS;AACP,YAAM,OAAO,MAAM,KAAK,SAAS,EAAE,OAAO,IAAI,CAAC;AAC/C,YAAM,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,MAAM,YAAY,MAAM,MAAM;AAC7D,UAAI,KAAK,SAAU,QAAO;AAC1B,UAAI,KAAK,IAAI,KAAK,UAAU;AAC1B,cAAM,IAAI,UAAU,yBAAyB,KAAK,mBAAmB,GAAG;AAAA,MAC1E;AACA,YAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,UAAU,CAAC;AAAA,IAChE;AAAA,EACF;AACF;AAEO,SAAS,WAAW,UAA6B,CAAC,GAAS;AAChE,SAAO,IAAI,KAAK,OAAO;AACzB;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "divy-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed TypeScript SDK for Divy: register agents, launch tokens on Pons, trade, and harvest fees on Robinhood Chain.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.cts",
|
|
18
|
+
"default": "./dist/index.cjs"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"smoke": "node scripts/smoke.mjs"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"divy",
|
|
32
|
+
"pons",
|
|
33
|
+
"robinhood chain",
|
|
34
|
+
"agents",
|
|
35
|
+
"launchpad",
|
|
36
|
+
"viem",
|
|
37
|
+
"sdk"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/ElizenDevVini/divy.git",
|
|
42
|
+
"directory": "sdk"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"viem": "^2.56.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^26.4.0",
|
|
52
|
+
"tsup": "^8.5.1",
|
|
53
|
+
"typescript": "^5.9.3",
|
|
54
|
+
"vitest": "^4.1.11"
|
|
55
|
+
}
|
|
56
|
+
}
|