@huggies/shit-1170-rex-engine-middleman 0.0.0-stage → 0.0.2
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 +9 -0
- package/README.md +43 -2
- package/bin/README.md +38 -0
- package/bin/fun/resolve_base_url.ts +45 -0
- package/bin/fun/split_argv.ts +67 -0
- package/bin/shit-1170/README.md +333 -0
- package/bin/shit-1170/api_shit_1170_api_key_me_get.ts +46 -0
- package/bin/shit-1170/api_shit_1170_api_key_rotate_post.ts +83 -0
- package/bin/shit-1170/api_shit_1170_api_keys_post.ts +68 -0
- package/bin/shit-1170/api_shit_1170_ping_get.ts +28 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_accounts_delete.ts +81 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_accounts_post.ts +80 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_get.ts +91 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_one_get.ts +62 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_post.ts +118 -0
- package/bin/shit-1170/api_shit_1170_swap_queue_sent_post.ts +87 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_accounts_delete.ts +68 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_accounts_post.ts +65 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_facets_get.ts +68 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_get.ts +99 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_one_get.ts +67 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_post.ts +243 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_sent_post.ts +172 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_stats_contracts_get.ts +60 -0
- package/bin/shit-1170/api_shit_1170_tx_queue_stats_methods_get.ts +60 -0
- package/bin/shit-1170/api_trezu_treasuries_get.ts +62 -0
- package/dist/fun/api_shit_1170_api_key_me_get.d.ts +4 -0
- package/dist/fun/api_shit_1170_api_key_me_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_api_key_me_get.js +38 -0
- package/dist/fun/api_shit_1170_api_key_me_get.js.map +1 -0
- package/dist/fun/api_shit_1170_api_key_rotate_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_api_key_rotate_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_api_key_rotate_post.js +46 -0
- package/dist/fun/api_shit_1170_api_key_rotate_post.js.map +1 -0
- package/dist/fun/api_shit_1170_api_keys_post.d.ts +3 -0
- package/dist/fun/api_shit_1170_api_keys_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_api_keys_post.js +52 -0
- package/dist/fun/api_shit_1170_api_keys_post.js.map +1 -0
- package/dist/fun/api_shit_1170_ping_get.d.ts +3 -0
- package/dist/fun/api_shit_1170_ping_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_ping_get.js +32 -0
- package/dist/fun/api_shit_1170_ping_get.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_delete.d.ts +4 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_delete.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_delete.js +46 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_delete.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_post.js +42 -0
- package/dist/fun/api_shit_1170_swap_queue_accounts_post.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_get.d.ts +5 -0
- package/dist/fun/api_shit_1170_swap_queue_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_get.js +77 -0
- package/dist/fun/api_shit_1170_swap_queue_get.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_one_get.d.ts +4 -0
- package/dist/fun/api_shit_1170_swap_queue_one_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_one_get.js +38 -0
- package/dist/fun/api_shit_1170_swap_queue_one_get.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_swap_queue_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_post.js +62 -0
- package/dist/fun/api_shit_1170_swap_queue_post.js.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_sent_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_swap_queue_sent_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_swap_queue_sent_post.js +63 -0
- package/dist/fun/api_shit_1170_swap_queue_sent_post.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_delete.d.ts +4 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_delete.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_delete.js +60 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_delete.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_post.js +54 -0
- package/dist/fun/api_shit_1170_tx_queue_accounts_post.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_facets_get.d.ts +5 -0
- package/dist/fun/api_shit_1170_tx_queue_facets_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_facets_get.js +45 -0
- package/dist/fun/api_shit_1170_tx_queue_facets_get.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_get.d.ts +5 -0
- package/dist/fun/api_shit_1170_tx_queue_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_get.js +70 -0
- package/dist/fun/api_shit_1170_tx_queue_get.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_one_get.d.ts +4 -0
- package/dist/fun/api_shit_1170_tx_queue_one_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_one_get.js +46 -0
- package/dist/fun/api_shit_1170_tx_queue_one_get.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_tx_queue_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_post.js +57 -0
- package/dist/fun/api_shit_1170_tx_queue_post.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_sent_post.d.ts +4 -0
- package/dist/fun/api_shit_1170_tx_queue_sent_post.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_sent_post.js +59 -0
- package/dist/fun/api_shit_1170_tx_queue_sent_post.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_contracts_get.d.ts +5 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_contracts_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_contracts_get.js +41 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_contracts_get.js.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_methods_get.d.ts +5 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_methods_get.d.ts.map +1 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_methods_get.js +41 -0
- package/dist/fun/api_shit_1170_tx_queue_stats_methods_get.js.map +1 -0
- package/dist/fun/api_trezu_treasuries_get.d.ts +4 -0
- package/dist/fun/api_trezu_treasuries_get.d.ts.map +1 -0
- package/dist/fun/api_trezu_treasuries_get.js +34 -0
- package/dist/fun/api_trezu_treasuries_get.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/stuff/api_call.d.ts +15 -0
- package/dist/stuff/api_call.d.ts.map +1 -0
- package/dist/stuff/api_call.js +86 -0
- package/dist/stuff/api_call.js.map +1 -0
- package/dist/stuff/endpoint_paths.d.ts +14 -0
- package/dist/stuff/endpoint_paths.d.ts.map +1 -0
- package/dist/stuff/endpoint_paths.js +30 -0
- package/dist/stuff/endpoint_paths.js.map +1 -0
- package/dist/stuff/parse_error.d.ts +12 -0
- package/dist/stuff/parse_error.d.ts.map +1 -0
- package/dist/stuff/parse_error.js +84 -0
- package/dist/stuff/parse_error.js.map +1 -0
- package/dist/stuff/request_options.d.ts +6 -0
- package/dist/stuff/request_options.d.ts.map +1 -0
- package/dist/stuff/request_options.js +43 -0
- package/dist/stuff/request_options.js.map +1 -0
- package/dist/types/common.d.ts +7 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +6 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/shit_1170_api_keys.d.ts +25 -0
- package/dist/types/shit_1170_api_keys.d.ts.map +1 -0
- package/dist/types/shit_1170_api_keys.js +23 -0
- package/dist/types/shit_1170_api_keys.js.map +1 -0
- package/dist/types/shit_1170_ping.d.ts +5 -0
- package/dist/types/shit_1170_ping.d.ts.map +1 -0
- package/dist/types/shit_1170_ping.js +11 -0
- package/dist/types/shit_1170_ping.js.map +1 -0
- package/dist/types/shit_1170_swap_queue.d.ts +57 -0
- package/dist/types/shit_1170_swap_queue.d.ts.map +1 -0
- package/dist/types/shit_1170_swap_queue.js +37 -0
- package/dist/types/shit_1170_swap_queue.js.map +1 -0
- package/dist/types/shit_1170_tx_queue.d.ts +74 -0
- package/dist/types/shit_1170_tx_queue.d.ts.map +1 -0
- package/dist/types/shit_1170_tx_queue.js +34 -0
- package/dist/types/shit_1170_tx_queue.js.map +1 -0
- package/dist/types/shit_1170_tx_queue_facets.d.ts +13 -0
- package/dist/types/shit_1170_tx_queue_facets.d.ts.map +1 -0
- package/dist/types/shit_1170_tx_queue_facets.js +20 -0
- package/dist/types/shit_1170_tx_queue_facets.js.map +1 -0
- package/dist/types/shit_1170_tx_queue_query.d.ts +15 -0
- package/dist/types/shit_1170_tx_queue_query.d.ts.map +1 -0
- package/dist/types/shit_1170_tx_queue_query.js +30 -0
- package/dist/types/shit_1170_tx_queue_query.js.map +1 -0
- package/dist/types/trezu_treasuries_query.d.ts +5 -0
- package/dist/types/trezu_treasuries_query.d.ts.map +1 -0
- package/dist/types/trezu_treasuries_query.js +9 -0
- package/dist/types/trezu_treasuries_query.js.map +1 -0
- package/dist/types/trezu_treasury.d.ts +10 -0
- package/dist/types/trezu_treasury.d.ts.map +1 -0
- package/dist/types/trezu_treasury.js +15 -0
- package/dist/types/trezu_treasury.js.map +1 -0
- package/dist/types/trezu_treasury_config.d.ts +8 -0
- package/dist/types/trezu_treasury_config.d.ts.map +1 -0
- package/dist/types/trezu_treasury_config.js +14 -0
- package/dist/types/trezu_treasury_config.js.map +1 -0
- package/dist/types/trezu_treasury_metadata.d.ts +5 -0
- package/dist/types/trezu_treasury_metadata.d.ts.map +1 -0
- package/dist/types/trezu_treasury_metadata.js +13 -0
- package/dist/types/trezu_treasury_metadata.js.map +1 -0
- package/package.json +45 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_accounts_post.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_accounts_post.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,oCAAoC,EACrC,MAAM,+BAA+B,CAAC;AAEvC,wBAAsB,sCAAsC,CAC1D,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,oCAAoC,EAC1C,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAgC/B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_SWAP_QUEUE_ACCOUNTS_POST
|
|
3
|
+
// POST /api/shit-1170/swap-queue/{swap_id}/accounts — add YOUR OWN
|
|
4
|
+
// account to a queued swap.
|
|
5
|
+
//
|
|
6
|
+
// the body:
|
|
7
|
+
// { "accountId": "alice.near" }
|
|
8
|
+
//
|
|
9
|
+
// the rule: the api key in the header must belong to that very account.
|
|
10
|
+
// you can only ever add YOURSELF.
|
|
11
|
+
//
|
|
12
|
+
// --- WHY --- the path is built HERE and not read out of the endpoint
|
|
13
|
+
// map: the swap_id sits in the MIDDLE of the path.
|
|
14
|
+
// ========================================
|
|
15
|
+
import { api_call } from "../stuff/api_call";
|
|
16
|
+
export async function api_shit_1170_swap_queue_accounts_post(base_url, swap_id, body, options = {}) {
|
|
17
|
+
const swap_id_trimmed = swap_id.trim();
|
|
18
|
+
if (swap_id_trimmed.length === 0) {
|
|
19
|
+
throw new Error("api_shit_1170_swap_queue_accounts_post failed: invalid_request: a swap id is required");
|
|
20
|
+
}
|
|
21
|
+
const json = await api_call({
|
|
22
|
+
base_url,
|
|
23
|
+
key: "api_shit_1170_swap_queue",
|
|
24
|
+
path: `/api/shit-1170/swap-queue/${encodeURIComponent(swap_id_trimmed)}/accounts`,
|
|
25
|
+
method: "POST",
|
|
26
|
+
body,
|
|
27
|
+
options,
|
|
28
|
+
label: "SHIT_1170 SWAP QUEUE ACCOUNTS POST",
|
|
29
|
+
fallback: "api_shit_1170_swap_queue_accounts_post failed",
|
|
30
|
+
});
|
|
31
|
+
if (typeof json !== "object" ||
|
|
32
|
+
json === null ||
|
|
33
|
+
Array.isArray(json) ||
|
|
34
|
+
typeof json.swapId !== "string" ||
|
|
35
|
+
!Array.isArray(json.accounts)) {
|
|
36
|
+
throw new Error("api_shit_1170_swap_queue_accounts_post failed: invalid_response: expected a json object with a swapId and an accounts array");
|
|
37
|
+
}
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
// ========================================
|
|
41
|
+
// copyright 2026 by sleet.near
|
|
42
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_accounts_post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_accounts_post.js","sourceRoot":"","sources":["../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ONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_SWAP_QUEUE_LIST } from "../types/shit_1170_swap_queue";
|
|
3
|
+
import type { SHIT_1170_SWAP_QUEUE_QUERY } from "../types/shit_1170_swap_queue";
|
|
4
|
+
export declare function api_shit_1170_swap_queue_get(base_url: string, query?: SHIT_1170_SWAP_QUEUE_QUERY, options?: REQUEST_OPTIONS): Promise<SHIT_1170_SWAP_QUEUE_LIST>;
|
|
5
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_get.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_get.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,0BAA+B,EACtC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAwCpC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_SWAP_QUEUE_GET
|
|
3
|
+
// GET /api/shit-1170/swap-queue — the swap list, filterable.
|
|
4
|
+
//
|
|
5
|
+
// the list is OPEN: anyone with an api key can list the swaps. a queued
|
|
6
|
+
// swap is an open offer, and hiding it would defeat the point.
|
|
7
|
+
//
|
|
8
|
+
// the answer is `{ "items": [ ...one swap each... ], "total": N,
|
|
9
|
+
// "nextCursor": "..." }`, where `total` is the count BEFORE the limit
|
|
10
|
+
// and the cursor took their cut. it is how many pages there are.
|
|
11
|
+
//
|
|
12
|
+
// --- WHY --- the query names are snake_case and are NOT renamed:
|
|
13
|
+
// `serde_urlencoded` matches the query key literally, so `tokenIn` would
|
|
14
|
+
// never see the `token_in` the route reads and the filter would be
|
|
15
|
+
// silently ignored.
|
|
16
|
+
//
|
|
17
|
+
// --- WHY --- `account_id` goes out as ONE COMMA SEPARATED STRING: the
|
|
18
|
+
// route reads one value per param, so a list would need the param to be
|
|
19
|
+
// repeated. one string carries many values, and a single value still
|
|
20
|
+
// works.
|
|
21
|
+
//
|
|
22
|
+
// --- WHY --- `contract_id` goes out as ONE COMMA SEPARATED STRING TOO:
|
|
23
|
+
// it is the same shape for the same reason — the reader picks several
|
|
24
|
+
// contracts and the route reads one value per param. a swap matches
|
|
25
|
+
// when EITHER of its two tokens is in the list, so picking one contract
|
|
26
|
+
// shows the swaps that sell it AND the swaps that buy it.
|
|
27
|
+
//
|
|
28
|
+
// --- WHY --- `hide_sent` needs an account and the check is made HERE as
|
|
29
|
+
// well as on the server: "has this account sent it" is a question about
|
|
30
|
+
// ONE account. a swap can be sent by alice and not by bob, so there is
|
|
31
|
+
// no single answer about all the accounts at once. asking for the
|
|
32
|
+
// filter without the account is a mistake worth naming before the round
|
|
33
|
+
// trip, and the backend answers a 400 for the same reason.
|
|
34
|
+
//
|
|
35
|
+
// --- WHY --- `hide_sent` goes out as the word `true` and not as `1`:
|
|
36
|
+
// the backend reads both, and the word is the readable one.
|
|
37
|
+
//
|
|
38
|
+
// --- WHY --- `cursor` is handed back EXACTLY as the backend gave it:
|
|
39
|
+
// the cursor is opaque, and a middleman that reshaped it would break
|
|
40
|
+
// the page the moment the backend changed the order.
|
|
41
|
+
// ========================================
|
|
42
|
+
import { api_call } from "../stuff/api_call";
|
|
43
|
+
export async function api_shit_1170_swap_queue_get(base_url, query = {}, options = {}) {
|
|
44
|
+
const account_id = query.account_id?.trim();
|
|
45
|
+
if (query.hide_sent && !account_id) {
|
|
46
|
+
throw new Error("api_shit_1170_swap_queue_get failed: invalid_request: hide_sent needs an account_id — it is a filter on one account's view");
|
|
47
|
+
}
|
|
48
|
+
const json = await api_call({
|
|
49
|
+
base_url,
|
|
50
|
+
key: "api_shit_1170_swap_queue",
|
|
51
|
+
query: {
|
|
52
|
+
account_id,
|
|
53
|
+
hide_sent: query.hide_sent,
|
|
54
|
+
contract_id: query.contract_id?.trim(),
|
|
55
|
+
token_in: query.token_in?.trim(),
|
|
56
|
+
token_out: query.token_out?.trim(),
|
|
57
|
+
limit: query.limit,
|
|
58
|
+
cursor: query.cursor?.trim(),
|
|
59
|
+
},
|
|
60
|
+
method: "GET",
|
|
61
|
+
options,
|
|
62
|
+
label: "SHIT_1170 SWAP QUEUE GET",
|
|
63
|
+
fallback: "api_shit_1170_swap_queue_get failed",
|
|
64
|
+
});
|
|
65
|
+
if (typeof json !== "object" ||
|
|
66
|
+
json === null ||
|
|
67
|
+
Array.isArray(json) ||
|
|
68
|
+
!Array.isArray(json.items) ||
|
|
69
|
+
typeof json.total !== "number" ||
|
|
70
|
+
(json.nextCursor !== null && typeof json.nextCursor !== "string")) {
|
|
71
|
+
throw new Error("api_shit_1170_swap_queue_get failed: invalid_response: expected a json object with an items array, a total and a nextCursor");
|
|
72
|
+
}
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
// ========================================
|
|
76
|
+
// copyright 2026 by sleet.near
|
|
77
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_get.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_get.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,+BAA+B;AAC/B,6DAA6D;AAC7D,EAAE;AACF,wEAAwE;AACxE,+DAA+D;AAC/D,EAAE;AACF,iEAAiE;AACjE,sEAAsE;AACtE,iEAAiE;AACjE,EAAE;AACF,kEAAkE;AAClE,yEAAyE;AACzE,mEAAmE;AACnE,oBAAoB;AACpB,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,qEAAqE;AACrE,SAA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,OAAO,CAAC,IAAI,CAAC;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;QAC9B,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,EACjE,CAAC;QACD,MAAM,IAAI,KAAK,CACb,6HAA6H,CAC9H,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_SWAP_QUEUE } from "../types/shit_1170_swap_queue";
|
|
3
|
+
export declare function api_shit_1170_swap_queue_one_get(base_url: string, swap_id: string, options?: REQUEST_OPTIONS): Promise<SHIT_1170_SWAP_QUEUE>;
|
|
4
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_one_get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_one_get.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_one_get.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CA+B/B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_SWAP_QUEUE_ONE_GET
|
|
3
|
+
// GET /api/shit-1170/swap-queue/{swap_id} — one queued swap.
|
|
4
|
+
//
|
|
5
|
+
// the reading is OPEN: anybody with an api key can read a queued swap.
|
|
6
|
+
// a swap is an open offer, and reading it is what lets a reader find it
|
|
7
|
+
// and act on it.
|
|
8
|
+
//
|
|
9
|
+
// --- WHY --- the path is built HERE and not read out of the endpoint
|
|
10
|
+
// map: the swap_id sits in the MIDDLE of the path.
|
|
11
|
+
// ========================================
|
|
12
|
+
import { api_call } from "../stuff/api_call";
|
|
13
|
+
export async function api_shit_1170_swap_queue_one_get(base_url, swap_id, options = {}) {
|
|
14
|
+
const swap_id_trimmed = swap_id.trim();
|
|
15
|
+
if (swap_id_trimmed.length === 0) {
|
|
16
|
+
throw new Error("api_shit_1170_swap_queue_one_get failed: invalid_request: a swap id is required");
|
|
17
|
+
}
|
|
18
|
+
const json = await api_call({
|
|
19
|
+
base_url,
|
|
20
|
+
key: "api_shit_1170_swap_queue",
|
|
21
|
+
path: `/api/shit-1170/swap-queue/${encodeURIComponent(swap_id_trimmed)}`,
|
|
22
|
+
method: "GET",
|
|
23
|
+
options,
|
|
24
|
+
label: "SHIT_1170 SWAP QUEUE ONE GET",
|
|
25
|
+
fallback: "api_shit_1170_swap_queue_one_get failed",
|
|
26
|
+
});
|
|
27
|
+
if (typeof json !== "object" ||
|
|
28
|
+
json === null ||
|
|
29
|
+
Array.isArray(json) ||
|
|
30
|
+
typeof json.swapId !== "string" ||
|
|
31
|
+
!Array.isArray(json.accounts)) {
|
|
32
|
+
throw new Error("api_shit_1170_swap_queue_one_get failed: invalid_response: expected a json object with a swapId and an accounts array");
|
|
33
|
+
}
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
// ========================================
|
|
37
|
+
// copyright 2026 by sleet.near
|
|
38
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_one_get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_one_get.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_one_get.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,mCAAmC;AACnC,6DAA6D;AAC7D,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,iBAAiB;AACjB,EAAE;AACF,sEAAsE;AACtE,mDAAmD;AACnD,2CAA2C;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,QAAgB,EAChB,OAAe,EACf,OAAO,GAAoB,EAAE;IAE7B,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACvC,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAuB;QAChD,QAAQ;QACR,GAAG,EAAE,0BAA0B;QAC/B,IAAI,EAAE,6BAA6B,kBAAkB,CAAC,eAAe,CAAC,EAAE;QACxE,MAAM,EAAE,KAAK;QACb,OAAO;QACP,KAAK,EAAE,8BAA8B;QACrC,QAAQ,EAAE,yCAAyC;KACpD,CAAC,CAAC;IAEH,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;QAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CACb,uHAAuH,CACxH,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_SWAP_QUEUE, SHIT_1170_SWAP_QUEUE_REQUEST } from "../types/shit_1170_swap_queue";
|
|
3
|
+
export declare function api_shit_1170_swap_queue_post(base_url: string, body: SHIT_1170_SWAP_QUEUE_REQUEST, options?: REQUEST_OPTIONS): Promise<SHIT_1170_SWAP_QUEUE>;
|
|
4
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_post.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_post.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AAEvC,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,4BAA4B,EAClC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CA0C/B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_SWAP_QUEUE_POST
|
|
3
|
+
// POST /api/shit-1170/swap-queue — queue a SWAP.
|
|
4
|
+
//
|
|
5
|
+
// the body:
|
|
6
|
+
// { "tokenIn": "...", "amountIn": "...", "tokenOut": "...", ... }
|
|
7
|
+
//
|
|
8
|
+
// a queued swap is NOT a queued batch of transactions: the agent does
|
|
9
|
+
// not know the route — it knows the token in, the amount in and the token
|
|
10
|
+
// out, and the route is worked out when the swap is executed.
|
|
11
|
+
//
|
|
12
|
+
// `amountIn` is the RAW unit amount — the token's smallest unit — and
|
|
13
|
+
// not a human amount. a human amount is only meaningful next to the
|
|
14
|
+
// token it belongs to.
|
|
15
|
+
//
|
|
16
|
+
// the WHO is the `accounts` list — the accounts the agent is queuing
|
|
17
|
+
// this for. every one of them must be an account the agent holds an api
|
|
18
|
+
// key for, or the backend answers a 400. that is the NAMING RULE: an
|
|
19
|
+
// agent may not drop a swap into somebody else's feed.
|
|
20
|
+
//
|
|
21
|
+
// the api key travels in the header and names the account the swap is
|
|
22
|
+
// queued FOR.
|
|
23
|
+
//
|
|
24
|
+
// --- WHY --- the swap is checked HERE and not only on the server: a swap
|
|
25
|
+
// with no token is a programming mistake, and catching it before the
|
|
26
|
+
// request means the caller gets a clear message instead of a 400 from
|
|
27
|
+
// the wire.
|
|
28
|
+
// ========================================
|
|
29
|
+
import { api_call } from "../stuff/api_call";
|
|
30
|
+
export async function api_shit_1170_swap_queue_post(base_url, body, options = {}) {
|
|
31
|
+
const token_in = body.tokenIn?.trim() ?? "";
|
|
32
|
+
const token_out = body.tokenOut?.trim() ?? "";
|
|
33
|
+
const amount_in = body.amountIn?.trim() ?? "";
|
|
34
|
+
if (token_in.length === 0 ||
|
|
35
|
+
token_out.length === 0 ||
|
|
36
|
+
amount_in.length === 0) {
|
|
37
|
+
throw new Error("api_shit_1170_swap_queue_post failed: invalid_request: a swap needs a tokenIn, an amountIn and a tokenOut");
|
|
38
|
+
}
|
|
39
|
+
if (token_in === token_out) {
|
|
40
|
+
throw new Error("api_shit_1170_swap_queue_post failed: invalid_request: a swap sells a token for itself");
|
|
41
|
+
}
|
|
42
|
+
const json = await api_call({
|
|
43
|
+
base_url,
|
|
44
|
+
key: "api_shit_1170_swap_queue",
|
|
45
|
+
method: "POST",
|
|
46
|
+
body,
|
|
47
|
+
options,
|
|
48
|
+
label: "SHIT_1170 SWAP QUEUE POST",
|
|
49
|
+
fallback: "api_shit_1170_swap_queue_post failed",
|
|
50
|
+
});
|
|
51
|
+
if (typeof json !== "object" ||
|
|
52
|
+
json === null ||
|
|
53
|
+
Array.isArray(json) ||
|
|
54
|
+
typeof json.swapId !== "string" ||
|
|
55
|
+
!Array.isArray(json.accounts)) {
|
|
56
|
+
throw new Error("api_shit_1170_swap_queue_post failed: invalid_response: expected a json object with a swapId and an accounts array");
|
|
57
|
+
}
|
|
58
|
+
return json;
|
|
59
|
+
}
|
|
60
|
+
// ========================================
|
|
61
|
+
// copyright 2026 by sleet.near
|
|
62
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_post.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_post.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,gCAAgC;AAChC,iDAAiD;AACjD,EAAE;AACF,YAAY;AACZ,oEAAoE;AACpE,EAAE;AACF,sEAAsE;AACtE,0EAA0E;AAC1E,8DAA8D;AAC9D,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,uBAAuB;AACvB,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AACrE,uDAAuD;AACvD,EAAE;AACF,sEAAsE;AACtE,cAAc;AACd,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,sEAAsE;AACtE,YAAY;AACZ,2CAA2C;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,QAAgB,EAChB,IAAkC,EAClC,OAAO,GAAoB,EAAE;IAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;QACrB,SAAS,CAAC,MAAM,KAAK,CAAC;QACtB,SAAS,CAAC,MAAM,KAAK,CAAC,EACtB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,2GAA2G,CAC5G,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAuB;QAChD,QAAQ;QACR,GAAG,EAAE,0BAA0B;QAC/B,MAAM,EAAE,MAAM;QACd,IAAI;QACJ,OAAO;QACP,KAAK,EAAE,2BAA2B;QAClC,QAAQ,EAAE,sCAAsC;KACjD,CAAC,CAAC;IAEH,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;QAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oHAAoH,CACrH,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_SWAP_QUEUE, SHIT_1170_SWAP_QUEUE_SENT_REQUEST } from "../types/shit_1170_swap_queue";
|
|
3
|
+
export declare function api_shit_1170_swap_queue_sent_post(base_url: string, swap_id: string, body: SHIT_1170_SWAP_QUEUE_SENT_REQUEST, options?: REQUEST_OPTIONS): Promise<SHIT_1170_SWAP_QUEUE>;
|
|
4
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_sent_post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_sent_post.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_sent_post.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,iCAAiC,EAClC,MAAM,+BAA+B,CAAC;AAEvC,wBAAsB,kCAAkC,CACtD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,iCAAiC,EACvC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAqC/B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_SWAP_QUEUE_SENT_POST
|
|
3
|
+
// POST /api/shit-1170/swap-queue/{swap_id}/sent — record that the swap
|
|
4
|
+
// was sent.
|
|
5
|
+
//
|
|
6
|
+
// the body:
|
|
7
|
+
// { "txHash": "...", "status": "succeeded", "amountOut": "..." }
|
|
8
|
+
//
|
|
9
|
+
// ONE call for one swap: a swap is one trade, and the swap page reports
|
|
10
|
+
// the whole thing in one call.
|
|
11
|
+
//
|
|
12
|
+
// `status` is optional: `succeeded` or `failed`. when it is left out the
|
|
13
|
+
// status is `sent`, which means "it went out and we do not know how it
|
|
14
|
+
// went yet".
|
|
15
|
+
//
|
|
16
|
+
// `amountOut` is optional too. it is the amount that came out of THAT
|
|
17
|
+
// send, in the output token's smallest unit. two accounts executing the
|
|
18
|
+
// same queued swap get two different amounts out, because the pools
|
|
19
|
+
// moved between the two sends.
|
|
20
|
+
//
|
|
21
|
+
// --- WHY --- the account comes from the HEADER and the body does NOT
|
|
22
|
+
// repeat it: the key IS the account. a body that named the account
|
|
23
|
+
// could name somebody else's, and then the check would be a suggestion.
|
|
24
|
+
//
|
|
25
|
+
// --- WHY --- the request is checked HERE and not only on the server: a
|
|
26
|
+
// send with no hash is a programming mistake, and catching it before the
|
|
27
|
+
// request means the caller gets a clear message instead of a 400 from
|
|
28
|
+
// the wire.
|
|
29
|
+
//
|
|
30
|
+
// --- WHY --- the path is built HERE and not read out of the endpoint
|
|
31
|
+
// map: the swap_id sits in the MIDDLE of the path.
|
|
32
|
+
// ========================================
|
|
33
|
+
import { api_call } from "../stuff/api_call";
|
|
34
|
+
export async function api_shit_1170_swap_queue_sent_post(base_url, swap_id, body, options = {}) {
|
|
35
|
+
const swap_id_trimmed = swap_id.trim();
|
|
36
|
+
if (swap_id_trimmed.length === 0) {
|
|
37
|
+
throw new Error("api_shit_1170_swap_queue_sent_post failed: invalid_request: a swap id is required");
|
|
38
|
+
}
|
|
39
|
+
if (body.txHash.trim().length === 0) {
|
|
40
|
+
throw new Error("api_shit_1170_swap_queue_sent_post failed: invalid_request: a send must carry a transaction hash");
|
|
41
|
+
}
|
|
42
|
+
const json = await api_call({
|
|
43
|
+
base_url,
|
|
44
|
+
key: "api_shit_1170_swap_queue",
|
|
45
|
+
path: `/api/shit-1170/swap-queue/${encodeURIComponent(swap_id_trimmed)}/sent`,
|
|
46
|
+
method: "POST",
|
|
47
|
+
body,
|
|
48
|
+
options,
|
|
49
|
+
label: "SHIT_1170 SWAP QUEUE SENT POST",
|
|
50
|
+
fallback: "api_shit_1170_swap_queue_sent_post failed",
|
|
51
|
+
});
|
|
52
|
+
if (typeof json !== "object" ||
|
|
53
|
+
json === null ||
|
|
54
|
+
Array.isArray(json) ||
|
|
55
|
+
typeof json.swapId !== "string" ||
|
|
56
|
+
!Array.isArray(json.accounts)) {
|
|
57
|
+
throw new Error("api_shit_1170_swap_queue_sent_post failed: invalid_response: expected a json object with a swapId and an accounts array");
|
|
58
|
+
}
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
// ========================================
|
|
62
|
+
// copyright 2026 by sleet.near
|
|
63
|
+
//# sourceMappingURL=api_shit_1170_swap_queue_sent_post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_swap_queue_sent_post.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_swap_queue_sent_post.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,qCAAqC;AACrC,uEAAuE;AACvE,YAAY;AACZ,EAAE;AACF,YAAY;AACZ,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,+BAA+B;AAC/B,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,aAAa;AACb,EAAE;AACF,sEAAsE;A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AED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_TX_QUEUE } from "../types/shit_1170_tx_queue";
|
|
3
|
+
export declare function api_shit_1170_tx_queue_accounts_delete(base_url: string, queue_id: string, account_id: string, options?: REQUEST_OPTIONS): Promise<SHIT_1170_TX_QUEUE>;
|
|
4
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_accounts_delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_accounts_delete.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_accounts_delete.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,wBAAsB,sCAAsC,CAC1D,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAqC7B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_TX_QUEUE_ACCOUNTS_DELETE
|
|
3
|
+
// DELETE /api/shit-1170/tx-queue/{queue_id}/accounts/{account_id} —
|
|
4
|
+
// remove YOUR OWN account from a queued batch.
|
|
5
|
+
//
|
|
6
|
+
// the rule is the same as the add: the api key must belong to the
|
|
7
|
+
// account being removed. you can remove yourself from a queue, and only
|
|
8
|
+
// yourself.
|
|
9
|
+
//
|
|
10
|
+
// what it writes is the deletion of the account's rows under every
|
|
11
|
+
// transaction of the batch. a row that already carries a hash is
|
|
12
|
+
// HISTORY and is not deleted — the tx happened, and the queue shows who
|
|
13
|
+
// did it.
|
|
14
|
+
//
|
|
15
|
+
// --- WHY --- the request has NO BODY. the account to remove is in the
|
|
16
|
+
// path, and the api key in the header says who is asking. a body would
|
|
17
|
+
// say the same thing twice, and a body that named somebody else's
|
|
18
|
+
// account would make the check a suggestion.
|
|
19
|
+
//
|
|
20
|
+
// --- WHY --- `body` is left undefined and not sent as `{}`: api_call
|
|
21
|
+
// only adds the content-type header and the body when there IS a body,
|
|
22
|
+
// and a DELETE with no body is what the route expects.
|
|
23
|
+
//
|
|
24
|
+
// --- WHY --- the path is built HERE and not read out of the endpoint
|
|
25
|
+
// map: the queue_id and the account_id both sit in the MIDDLE of the
|
|
26
|
+
// path.
|
|
27
|
+
//
|
|
28
|
+
// 404 = there is no queue with that id, or the account was not on it.
|
|
29
|
+
// ========================================
|
|
30
|
+
import { api_call } from "../stuff/api_call";
|
|
31
|
+
export async function api_shit_1170_tx_queue_accounts_delete(base_url, queue_id, account_id, options = {}) {
|
|
32
|
+
const queue_id_trimmed = queue_id.trim();
|
|
33
|
+
if (queue_id_trimmed.length === 0) {
|
|
34
|
+
throw new Error("api_shit_1170_tx_queue_accounts_delete failed: invalid_request: a queue id is required");
|
|
35
|
+
}
|
|
36
|
+
const account_id_trimmed = account_id.trim();
|
|
37
|
+
if (account_id_trimmed.length === 0) {
|
|
38
|
+
throw new Error("api_shit_1170_tx_queue_accounts_delete failed: invalid_request: an account id is required");
|
|
39
|
+
}
|
|
40
|
+
const json = await api_call({
|
|
41
|
+
base_url,
|
|
42
|
+
key: "api_shit_1170_tx_queue",
|
|
43
|
+
path: `/api/shit-1170/tx-queue/${encodeURIComponent(queue_id_trimmed)}/accounts/${encodeURIComponent(account_id_trimmed)}`,
|
|
44
|
+
method: "DELETE",
|
|
45
|
+
options,
|
|
46
|
+
label: "SHIT_1170 TX QUEUE ACCOUNTS DELETE",
|
|
47
|
+
fallback: "api_shit_1170_tx_queue_accounts_delete failed",
|
|
48
|
+
});
|
|
49
|
+
if (typeof json !== "object" ||
|
|
50
|
+
json === null ||
|
|
51
|
+
Array.isArray(json) ||
|
|
52
|
+
typeof json.queueId !== "string" ||
|
|
53
|
+
!Array.isArray(json.transactions)) {
|
|
54
|
+
throw new Error("api_shit_1170_tx_queue_accounts_delete failed: invalid_response: expected a json object with a queueId and a transactions array");
|
|
55
|
+
}
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
// ========================================
|
|
59
|
+
// copyright 2026 by sleet.near
|
|
60
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_accounts_delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_accounts_delete.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_accounts_delete.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,yCAAyC;AACzC,oEAAoE;AACpE,+CAA+C;AAC/C,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,YAAY;AACZ,EAAE;AACF,mEAAmE;AACnE,iEAAiE;AACjE,wEAAwE;AACxE,UAAU;AACV,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,kEAAkE;AAClE,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,uDAAuD;AACvD,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,QAAQ;AACR,EAAE;AACF,sEAAsE;AACtE,2CAA2C;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC1D,QAAgB,EAChB,QAAgB,EAChB,UAAkB,EAClB,OAAO,GAAoB,EAAE;IAE7B,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;IACJ,CAAC;IACD,MAAM,kBAAkB,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAC7C,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,2FAA2F,CAC5F,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAqB;QAC9C,QAAQ;QACR,GAAG,EAAE,wBAAwB;QAC7B,IAAI,EAAE,2BAA2B,kBAAkB,CAAC,gBAAgB,CAAC,aAAa,kBAAkB,CAAC,kBAAkB,CAAC,EAAE;QAC1H,MAAM,EAAE,QAAQ;QAChB,OAAO;QACP,KAAK,EAAE,oCAAoC;QAC3C,QAAQ,EAAE,+CAA+C;KAC1D,CAAC,CAAC;IAEH,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;QAChC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EACjC,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iIAAiI,CAClI,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_TX_QUEUE, SHIT_1170_TX_QUEUE_ACCOUNT_REQUEST } from "../types/shit_1170_tx_queue";
|
|
3
|
+
export declare function api_shit_1170_tx_queue_accounts_post(base_url: string, queue_id: string, body: SHIT_1170_TX_QUEUE_ACCOUNT_REQUEST, options?: REQUEST_OPTIONS): Promise<SHIT_1170_TX_QUEUE>;
|
|
4
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_accounts_post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_accounts_post.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_accounts_post.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,kCAAkC,EACnC,MAAM,6BAA6B,CAAC;AAErC,wBAAsB,oCAAoC,CACxD,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,kCAAkC,EACxC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAsC7B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_TX_QUEUE_ACCOUNTS_POST
|
|
3
|
+
// POST /api/shit-1170/tx-queue/{queue_id}/accounts — add YOUR OWN
|
|
4
|
+
// account to a queued batch.
|
|
5
|
+
//
|
|
6
|
+
// the body is one account id, and the rule is simple: the api key in
|
|
7
|
+
// the header must belong to that very account. you can only ever add
|
|
8
|
+
// YOURSELF. the backend answers a 403 when the two do not match.
|
|
9
|
+
//
|
|
10
|
+
// what it writes is an account row for every transaction of the batch,
|
|
11
|
+
// with `status = pending`. that is how an account says "I want this
|
|
12
|
+
// one" before it has signed it, and it puts the tx in that account's
|
|
13
|
+
// feed.
|
|
14
|
+
//
|
|
15
|
+
// --- WHY --- the path is built HERE and not read out of the endpoint
|
|
16
|
+
// map: the queue_id sits in the MIDDLE of the path.
|
|
17
|
+
//
|
|
18
|
+
// --- WHY --- the account id is checked HERE and not only on the
|
|
19
|
+
// server: an empty account id is a programming mistake, and catching it
|
|
20
|
+
// before the request means the caller gets a clear message instead of a
|
|
21
|
+
// 403 from the wire.
|
|
22
|
+
// ========================================
|
|
23
|
+
import { api_call } from "../stuff/api_call";
|
|
24
|
+
export async function api_shit_1170_tx_queue_accounts_post(base_url, queue_id, body, options = {}) {
|
|
25
|
+
const queue_id_trimmed = queue_id.trim();
|
|
26
|
+
if (queue_id_trimmed.length === 0) {
|
|
27
|
+
throw new Error("api_shit_1170_tx_queue_accounts_post failed: invalid_request: a queue id is required");
|
|
28
|
+
}
|
|
29
|
+
const account_id = body.accountId?.trim();
|
|
30
|
+
if (!account_id) {
|
|
31
|
+
throw new Error("api_shit_1170_tx_queue_accounts_post failed: invalid_request: an account id is required");
|
|
32
|
+
}
|
|
33
|
+
const json = await api_call({
|
|
34
|
+
base_url,
|
|
35
|
+
key: "api_shit_1170_tx_queue",
|
|
36
|
+
path: `/api/shit-1170/tx-queue/${encodeURIComponent(queue_id_trimmed)}/accounts`,
|
|
37
|
+
method: "POST",
|
|
38
|
+
body: { accountId: account_id },
|
|
39
|
+
options,
|
|
40
|
+
label: "SHIT_1170 TX QUEUE ACCOUNTS POST",
|
|
41
|
+
fallback: "api_shit_1170_tx_queue_accounts_post failed",
|
|
42
|
+
});
|
|
43
|
+
if (typeof json !== "object" ||
|
|
44
|
+
json === null ||
|
|
45
|
+
Array.isArray(json) ||
|
|
46
|
+
typeof json.queueId !== "string" ||
|
|
47
|
+
!Array.isArray(json.transactions)) {
|
|
48
|
+
throw new Error("api_shit_1170_tx_queue_accounts_post failed: invalid_response: expected a json object with a queueId and a transactions array");
|
|
49
|
+
}
|
|
50
|
+
return json;
|
|
51
|
+
}
|
|
52
|
+
// ========================================
|
|
53
|
+
// copyright 2026 by sleet.near
|
|
54
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_accounts_post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_accounts_post.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_accounts_post.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,uCAAuC;AACvC,kEAAkE;AAClE,6BAA6B;AAC7B,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,oEAAoE;AACpE,qEAAqE;AACrE,QAAQ;AACR,EAAE;A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;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_TX_QUEUE_FACETS } from "../types/shit_1170_tx_queue_facets";
|
|
3
|
+
import type { SHIT_1170_TX_QUEUE_FACETS_QUERY } from "../types/shit_1170_tx_queue_query";
|
|
4
|
+
export declare function api_shit_1170_tx_queue_facets_get(base_url: string, query?: SHIT_1170_TX_QUEUE_FACETS_QUERY, options?: REQUEST_OPTIONS): Promise<SHIT_1170_TX_QUEUE_FACETS>;
|
|
5
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_facets_get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_facets_get.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_facets_get.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEzF,wBAAsB,iCAAiC,CACrD,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,+BAAoC,EAC3C,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAwBpC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// ========================================
|
|
2
|
+
// API_SHIT_1170_TX_QUEUE_FACETS_GET
|
|
3
|
+
// GET /api/shit-1170/tx-queue/facets — the CONTRACTS and the ACCOUNTS
|
|
4
|
+
// the feed's filter bar offers.
|
|
5
|
+
//
|
|
6
|
+
// the answer:
|
|
7
|
+
// {
|
|
8
|
+
// "contracts": [ { "contractId": "ref.finance.near", "count": 12 } ],
|
|
9
|
+
// "accounts": [ { "accountId": "alice.near", "count": 3 } ]
|
|
10
|
+
// }
|
|
11
|
+
//
|
|
12
|
+
// a `limit` query param, default 40. the limit applies to BOTH lists.
|
|
13
|
+
//
|
|
14
|
+
// --- WHY --- THE ROUTE IS OPEN: the queue list is open, and the facets
|
|
15
|
+
// are a summary of the same thing. a reader who can read the feed can
|
|
16
|
+
// read what is in it. the api key is passed when there is one, and it
|
|
17
|
+
// is not demanded.
|
|
18
|
+
//
|
|
19
|
+
// --- WHY --- the two lists are checked TOGETHER and not one at a time:
|
|
20
|
+
// the route answers both or it answers neither, so an answer that holds
|
|
21
|
+
// one and misses the other is a broken answer.
|
|
22
|
+
// ========================================
|
|
23
|
+
import { api_call } from "../stuff/api_call";
|
|
24
|
+
export async function api_shit_1170_tx_queue_facets_get(base_url, query = {}, options = {}) {
|
|
25
|
+
const json = await api_call({
|
|
26
|
+
base_url,
|
|
27
|
+
key: "api_shit_1170_tx_queue_facets",
|
|
28
|
+
query: { limit: query.limit },
|
|
29
|
+
method: "GET",
|
|
30
|
+
options,
|
|
31
|
+
label: "SHIT_1170 TX QUEUE FACETS GET",
|
|
32
|
+
fallback: "api_shit_1170_tx_queue_facets_get failed",
|
|
33
|
+
});
|
|
34
|
+
if (typeof json !== "object" ||
|
|
35
|
+
json === null ||
|
|
36
|
+
Array.isArray(json) ||
|
|
37
|
+
!Array.isArray(json.contracts) ||
|
|
38
|
+
!Array.isArray(json.accounts)) {
|
|
39
|
+
throw new Error("api_shit_1170_tx_queue_facets_get failed: invalid_response: expected a json object with a contracts array and an accounts array");
|
|
40
|
+
}
|
|
41
|
+
return json;
|
|
42
|
+
}
|
|
43
|
+
// ========================================
|
|
44
|
+
// copyright 2026 by sleet.near
|
|
45
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_facets_get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_facets_get.js","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_facets_get.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,oCAAoC;AACpC,sEAAsE;AACtE,gCAAgC;AAChC,EAAE;AACF,cAAc;AACd,MAAM;AACN,0EAA0E;AAC1E,iEAAiE;AACjE,MAAM;AACN,EAAE;AACF,sEAAsE;AACtE,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,mBAAmB;AACnB,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,+CAA+C;AAC/C,2CAA2C;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,QAAgB,EAChB,KAAK,GAAoC,EAAE,EAC3C,OAAO,GAAoB,EAAE;IAE7B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAA4B;QACrD,QAAQ;QACR,GAAG,EAAE,+BAA+B;QACpC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE;QAC7B,MAAM,EAAE,KAAK;QACb,OAAO;QACP,KAAK,EAAE,+BAA+B;QACtC,QAAQ,EAAE,0CAA0C;KACrD,CAAC,CAAC;IAEH,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iIAAiI,CAClI,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,2CAA2C;AAC3C,+BAA+B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { REQUEST_OPTIONS } from "../stuff/request_options";
|
|
2
|
+
import type { SHIT_1170_TX_QUEUE_LIST } from "../types/shit_1170_tx_queue";
|
|
3
|
+
import type { SHIT_1170_TX_QUEUE_QUERY } from "../types/shit_1170_tx_queue_query";
|
|
4
|
+
export declare function api_shit_1170_tx_queue_get(base_url: string, query?: SHIT_1170_TX_QUEUE_QUERY, options?: REQUEST_OPTIONS): Promise<SHIT_1170_TX_QUEUE_LIST>;
|
|
5
|
+
//# sourceMappingURL=api_shit_1170_tx_queue_get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_shit_1170_tx_queue_get.d.ts","sourceRoot":"","sources":["../../src/fun/api_shit_1170_tx_queue_get.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAElF,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,wBAA6B,EACpC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAuClC"}
|