Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions aibtc-news/aibtc-news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,14 @@ program

const body: Record<string, unknown> = {
beat_slug: opts.beatId,
btc_address: headers["X-BTC-Address"],
content: opts.content,
};

if (opts.headline) body.headline = opts.headline;
if (sources.length > 0) body.sources = sources;
if (tags.length > 0) body.tags = tags;
if (disclosure !== undefined) body.disclosure = disclosure;
if (disclosure !== undefined) body.disclosure = typeof disclosure === "string" ? disclosure : JSON.stringify(disclosure);

// Step 1: POST with auth headers — may return 200 (free) or 402 (x402 payment required)
const signalsUrl = `${NEWS_API_BASE}/signals`;
Expand Down Expand Up @@ -413,7 +414,7 @@ program
const { getStacksNetwork } = await import("../src/lib/config/networks.js");
const { createFungiblePostCondition } = await import("../src/lib/transactions/post-conditions.js");
const { getHiroApi } = await import("../src/lib/services/hiro-api.js");
const { getAccount } = await import("../src/lib/services/wallet-manager.js");
const { getAccount } = await import("../src/lib/services/x402.service.js");

const paymentRequired = decodePaymentRequired(paymentHeader);
if (!paymentRequired?.accepts?.length) {
Expand Down Expand Up @@ -645,6 +646,8 @@ program

const body: Record<string, unknown> = {
beat_slug: opts.beatId,
slug: opts.beatId,
created_by: headers["X-BTC-Address"],
};

if (opts.name) body.name = opts.name;
Expand Down
6 changes: 6 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions hodlmm-flow/hodlmm-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ const MOCK_POOL_DETAIL = {
},
};

const originalFetch = globalThis.fetch;

afterEach(() => {
// Reset to real fetch after each test
globalThis.fetch = fetch;
globalThis.fetch = originalFetch;
});

test("analyzePool returns partial result with hiro_rate_limited when fetch throws 429", async () => {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"dotenv": "^17.2.3",
"micro-ordinals": "^0.3.0",
"sbtc": "^0.3.2",
"tiny-secp256k1": "^2.2.4",
"tslib": "^2.8.1",
"yaml": "^2.8.2",
"zod": "^4.3.5"
Expand Down
Loading