@artblocks/abx-sdk 0.1.0-alpha.1 → 0.1.0-alpha.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/dist/chains.d.ts +5 -0
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +8 -3
- package/dist/chains.js.map +1 -1
- package/dist/env.d.ts +11 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +34 -2
- package/dist/env.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/service.d.ts +196 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +166 -0
- package/dist/service.js.map +1 -0
- package/package.json +1 -1
package/dist/chains.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export declare function chainById(chainId: number): Chain | undefined;
|
|
|
21
21
|
* to an explorer where the contract does not exist.
|
|
22
22
|
*/
|
|
23
23
|
export declare function explorerUrl(chainId: number): string;
|
|
24
|
+
/** Env-name suffix for a user-facing key: uppercased, any run of non-alphanumerics collapsed to
|
|
25
|
+
* one `_` (`base-sepolia` → `BASE_SEPOLIA`, `my.provider` → `MY_PROVIDER`). Shared by every
|
|
26
|
+
* `ABX_<FAMILY>_<NAME>_*` convention (`ABX_RPC_URLS_<CHAIN>`, `ABX_REMOTE_<NAME>_URL/_TOKEN`) so
|
|
27
|
+
* the conventions can't drift. Lossy — the normalized form is the canonical name. */
|
|
28
|
+
export declare function envSuffix(name: string): string;
|
|
24
29
|
/** The env var holding RPC endpoints for a chain: per-chain `ABX_RPC_URLS_<CHAIN>` (e.g.
|
|
25
30
|
* `ABX_RPC_URLS_SEPOLIA`) when set, else the bare `ABX_RPC_URLS` (the active `ABX_CHAIN`). */
|
|
26
31
|
export declare function rpcEnvVar(chainKey: string): string;
|
package/dist/chains.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAGhC;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAGxC,CAAC;AAEF,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAShD,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAA0B,GAAG,KAAK,CAInE;AAED;wFACwF;AACxF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;+FAC+F;AAC/F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAGhC;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAGxC,CAAC;AAEF,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAShD,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAA0B,GAAG,KAAK,CAInE;AAED;wFACwF;AACxF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;sFAGsF;AACtF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;+FAC+F;AAC/F,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAA0B,GAAG,MAAM,EAAE,CAY7E;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,QAAQ,GAAE,MAA0B,GAAG,MAAM,CAE1E;AAED,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAShD"}
|
package/dist/chains.js
CHANGED
|
@@ -40,12 +40,17 @@ export function chainById(chainId) {
|
|
|
40
40
|
export function explorerUrl(chainId) {
|
|
41
41
|
return chainById(chainId)?.blockExplorers?.default?.url ?? 'https://sepolia.etherscan.io';
|
|
42
42
|
}
|
|
43
|
+
/** Env-name suffix for a user-facing key: uppercased, any run of non-alphanumerics collapsed to
|
|
44
|
+
* one `_` (`base-sepolia` → `BASE_SEPOLIA`, `my.provider` → `MY_PROVIDER`). Shared by every
|
|
45
|
+
* `ABX_<FAMILY>_<NAME>_*` convention (`ABX_RPC_URLS_<CHAIN>`, `ABX_REMOTE_<NAME>_URL/_TOKEN`) so
|
|
46
|
+
* the conventions can't drift. Lossy — the normalized form is the canonical name. */
|
|
47
|
+
export function envSuffix(name) {
|
|
48
|
+
return name.toUpperCase().replace(/[^A-Z0-9]+/g, '_');
|
|
49
|
+
}
|
|
43
50
|
/** The env var holding RPC endpoints for a chain: per-chain `ABX_RPC_URLS_<CHAIN>` (e.g.
|
|
44
51
|
* `ABX_RPC_URLS_SEPOLIA`) when set, else the bare `ABX_RPC_URLS` (the active `ABX_CHAIN`). */
|
|
45
52
|
export function rpcEnvVar(chainKey) {
|
|
46
|
-
|
|
47
|
-
// `ABX_RPC_URLS_BASE_SEPOLIA` (any non-alphanumeric collapses to `_`).
|
|
48
|
-
return `ABX_RPC_URLS_${chainKey.toUpperCase().replace(/[^A-Z0-9]+/g, '_')}`;
|
|
53
|
+
return `ABX_RPC_URLS_${envSuffix(chainKey)}`;
|
|
49
54
|
}
|
|
50
55
|
/**
|
|
51
56
|
* The ordered, de-duplicated RPC endpoints for `chainKey`. **Network-scoped**: a
|
package/dist/chains.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAA0B;IAC3C,cAAc,EAAE,WAAW;IAC3B,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,mFAAmF;AACnF,6EAA6E;AAC7E,MAAM,gBAAgB,GAA2B;IAC/C,cAAc,EAAE,0BAA0B;IAC1C,OAAO,EAAE,6CAA6C;CACvD,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,MAAc,iBAAiB;IAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,aAAa,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,OAAO,KAAK,CAAC;AACf,CAAC;AAED;wFACwF;AACxF,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,8BAA8B,CAAC;AAC5F,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"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,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;QAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACxD,CAAC;AACH,CAAC"}
|
package/dist/env.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export declare function loadDotEnv(startDir?: string): void;
|
|
2
|
+
/**
|
|
3
|
+
* Parse `.env` text into ordered entries plus any keys the file sets MORE THAN ONCE (pure — the
|
|
4
|
+
* testable half of {@link loadDotEnv}). First occurrence wins, matching the loader; duplicates are
|
|
5
|
+
* returned rather than swallowed, because a stale duplicate (two `ABX_RPC_URLS_SEPOLIA` lines, one
|
|
6
|
+
* pointing at a different network) leaves every downstream check passing while the tool talks to
|
|
7
|
+
* somewhere unintended — and the symptom surfaces far away as "no contract at that address".
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseEnvContent(content: string): {
|
|
10
|
+
entries: Array<[string, string]>;
|
|
11
|
+
duplicates: string[];
|
|
12
|
+
};
|
|
2
13
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAWA,wBAAgB,UAAU,CAAC,QAAQ,GAAE,MAAsB,GAAG,IAAI,CAcjE"}
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAWA,wBAAgB,UAAU,CAAC,QAAQ,GAAE,MAAsB,GAAG,IAAI,CAcjE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAC,CA6BzG"}
|
package/dist/env.js
CHANGED
|
@@ -24,7 +24,17 @@ export function loadDotEnv(startDir = process.cwd()) {
|
|
|
24
24
|
dir = parent;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Parse `.env` text into ordered entries plus any keys the file sets MORE THAN ONCE (pure — the
|
|
29
|
+
* testable half of {@link loadDotEnv}). First occurrence wins, matching the loader; duplicates are
|
|
30
|
+
* returned rather than swallowed, because a stale duplicate (two `ABX_RPC_URLS_SEPOLIA` lines, one
|
|
31
|
+
* pointing at a different network) leaves every downstream check passing while the tool talks to
|
|
32
|
+
* somewhere unintended — and the symptom surfaces far away as "no contract at that address".
|
|
33
|
+
*/
|
|
34
|
+
export function parseEnvContent(content) {
|
|
35
|
+
const entries = [];
|
|
36
|
+
const seen = new Map();
|
|
37
|
+
const duplicates = [];
|
|
28
38
|
for (const rawLine of content.split('\n')) {
|
|
29
39
|
const line = rawLine.trim();
|
|
30
40
|
if (!line || line.startsWith('#'))
|
|
@@ -38,8 +48,30 @@ function parseInto(content) {
|
|
|
38
48
|
(value.startsWith("'") && value.endsWith("'"))) {
|
|
39
49
|
value = value.slice(1, -1);
|
|
40
50
|
}
|
|
41
|
-
if (key
|
|
51
|
+
if (!key)
|
|
52
|
+
continue;
|
|
53
|
+
if (seen.has(key)) {
|
|
54
|
+
// Only a duplicate with a DIFFERENT value is worth reporting. A repeated identical line is
|
|
55
|
+
// harmless, and warning on it turns a real signal into per-invocation noise (every `abx`
|
|
56
|
+
// command is its own process, so there is nowhere to throttle a genuine warning to "once").
|
|
57
|
+
if (seen.get(key) !== value && !duplicates.includes(key))
|
|
58
|
+
duplicates.push(key);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
seen.set(key, value);
|
|
62
|
+
entries.push([key, value]);
|
|
63
|
+
}
|
|
64
|
+
return { entries, duplicates };
|
|
65
|
+
}
|
|
66
|
+
function parseInto(content) {
|
|
67
|
+
const { entries, duplicates } = parseEnvContent(content);
|
|
68
|
+
for (const [key, value] of entries) {
|
|
69
|
+
if (process.env[key] === undefined)
|
|
42
70
|
process.env[key] = value;
|
|
43
71
|
}
|
|
72
|
+
if (duplicates.length) {
|
|
73
|
+
console.error(`⚠ .env sets ${duplicates.length === 1 ? 'this key' : 'these keys'} to CONFLICTING values: ${duplicates.join(', ')}. ` +
|
|
74
|
+
`The FIRST value wins and the later one is ignored — delete the stale line, or you may be pointed somewhere you didn't intend.`);
|
|
75
|
+
}
|
|
44
76
|
}
|
|
45
77
|
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAE3C;;;;;GAKG;AACH,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,UAAU,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IACzD,IAAI,MAAM;QAAE,OAAO;IACnB,MAAM,GAAG,IAAI,CAAC;IACd,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE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CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/E,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS,CAAC,OAAe;IAChC,MAAM,EAAC,OAAO,EAAE,UAAU,EAAC,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACvD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC/D,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CACX,eAAe,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,2BAA2B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACpH,+HAA+H,CAClI,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './create2.js';
|
|
|
26
26
|
export * from './deployments.js';
|
|
27
27
|
export * from './deps.js';
|
|
28
28
|
export * from './generator.js';
|
|
29
|
-
export
|
|
29
|
+
export * from './service.js';
|
|
30
|
+
export { loadDotEnv, parseEnvContent } from './env.js';
|
|
30
31
|
export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, spineEventAbi, } from './abi/index.js';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './create2.js';
|
|
|
15
15
|
export * from './deployments.js';
|
|
16
16
|
export * from './deps.js';
|
|
17
17
|
export * from './generator.js';
|
|
18
|
-
export
|
|
18
|
+
export * from './service.js';
|
|
19
|
+
export { loadDotEnv, parseEnvContent } from './env.js';
|
|
19
20
|
export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, spineEventAbi, } from './abi/index.js';
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The remote-service client — the SDK's one HTTP surface, speaking the provider-neutral
|
|
3
|
+
* control plane pinned by specs/self-host-toolkit/remote-services.md. A client is bound to an
|
|
4
|
+
* endpoint + an injected bearer token, never to a brand: the reference CLI, the effects runner,
|
|
5
|
+
* and any hosted agent drive a self-hosted node and a managed provider through this same class.
|
|
6
|
+
*
|
|
7
|
+
* The token authorizes index/metadata control only — never on-chain signing. No env reads here;
|
|
8
|
+
* credential resolution is the caller's concern (the CLI's named-remote convention lives in
|
|
9
|
+
* packages/cli/src/remote.ts).
|
|
10
|
+
*/
|
|
11
|
+
import type { Hex } from 'viem';
|
|
12
|
+
import type { OpenSeaAttribute } from './traits.js';
|
|
13
|
+
export declare const WELL_KNOWN_SERVICE_PATH = "/.well-known/abx-service";
|
|
14
|
+
/** Versioned interface ids a service declares in its descriptor. Versions ride these ids
|
|
15
|
+
* (they track the `/v1` path prefix); the descriptor has no separate format version. */
|
|
16
|
+
export declare const TOKEN_API_INTERFACE = "abx-token-api/v1";
|
|
17
|
+
export declare const CONTROL_PLANE_INTERFACE = "abx-control-plane/v1";
|
|
18
|
+
export declare const EFFECTS_PUBLISH_INTERFACE = "abx-effects-publish/v1";
|
|
19
|
+
/** Machine error codes every conforming service uses — clients key off these, never off prose. */
|
|
20
|
+
export type ServiceErrorCode = 'invalid_request' | 'unsupported_chain' | 'unauthorized' | 'forbidden' | 'not_registered' | 'disabled'
|
|
21
|
+
/** 500 — an unexpected server-side failure. Never carries internal detail (it could embed the
|
|
22
|
+
* operator's own credentials); the node logs the cause. Retryable. */
|
|
23
|
+
| 'internal_error';
|
|
24
|
+
/** `GET /.well-known/abx-service` — what a service supports, agent-readably. */
|
|
25
|
+
export interface ServiceDescriptor {
|
|
26
|
+
/** Display name + implementation version, for humans and directories — never dispatch. */
|
|
27
|
+
service?: {
|
|
28
|
+
name?: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
};
|
|
31
|
+
/** The load-bearing declaration: which interface families this endpoint serves. */
|
|
32
|
+
interfaces: string[];
|
|
33
|
+
/** EIP-155 chain ids served; the control plane rejects others with `unsupported_chain`. */
|
|
34
|
+
chains: number[];
|
|
35
|
+
/** Present iff the control plane is enabled. `signupUrl`/`docsUrl` are for humans —
|
|
36
|
+
* where a customer gets a key. */
|
|
37
|
+
auth?: {
|
|
38
|
+
scheme: 'bearer';
|
|
39
|
+
signupUrl?: string;
|
|
40
|
+
docsUrl?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Present when rendering runs behind this service (the resolver fronts its runner).
|
|
43
|
+
* `effects: null` = attached but unverified (the health probe didn't answer). */
|
|
44
|
+
render?: {
|
|
45
|
+
attached: boolean;
|
|
46
|
+
effects: Array<{
|
|
47
|
+
key: string;
|
|
48
|
+
outputs: Array<{
|
|
49
|
+
key: string;
|
|
50
|
+
mimeType: string;
|
|
51
|
+
}>;
|
|
52
|
+
}> | null;
|
|
53
|
+
};
|
|
54
|
+
/** The public base this node believes it serves — a sanity echo for misconfig detection. */
|
|
55
|
+
baseUrl?: string;
|
|
56
|
+
}
|
|
57
|
+
/** `POST /v1/projects` — the off-chain bridge: everything the host can't derive from chain. */
|
|
58
|
+
export interface RegisterProjectBody {
|
|
59
|
+
chainId: number;
|
|
60
|
+
address: string;
|
|
61
|
+
/** Scan floor — the deploy block. Omit on a re-POST (the nudge) to keep the stored floor + reindex incrementally. */
|
|
62
|
+
fromBlock?: string;
|
|
63
|
+
factory?: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
externalUrl?: string;
|
|
67
|
+
/** Off-chain operator traits (OpenSea attribute array) — stitched UNDER any on-chain `attributes`. */
|
|
68
|
+
attributes?: OpenSeaAttribute[];
|
|
69
|
+
/** Off-chain PER-TOKEN operator traits, `{ "<tokenId>": OpenSeaAttribute[] }` — a Series' editable
|
|
70
|
+
* traits (a token's entry wins over the collection-scope `attributes`; on-chain wins over both). */
|
|
71
|
+
tokenAttributes?: Record<string, OpenSeaAttribute[]>;
|
|
72
|
+
/** Durable locators keyed by on-chain hash, `{ "0x<keccak>": "ipfs://<cid>" }` — lets the resolver
|
|
73
|
+
* point `image` at IPFS/Arweave without holding the bytes. Merged over any already stored. */
|
|
74
|
+
contentLocators?: Record<string, string>;
|
|
75
|
+
/** Force a full replay even on a re-POST. */
|
|
76
|
+
full?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface RegisterProjectResult {
|
|
79
|
+
ok: boolean;
|
|
80
|
+
mode: 'full' | 'incremental';
|
|
81
|
+
elapsedMs: number;
|
|
82
|
+
project: {
|
|
83
|
+
address: string;
|
|
84
|
+
name: string | null;
|
|
85
|
+
eventCount: number;
|
|
86
|
+
tokenCount: number;
|
|
87
|
+
mintedCount: number;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** One row of `GET /v1/projects` — the projects visible to this token. */
|
|
91
|
+
export interface RemoteProjectSummary {
|
|
92
|
+
chainId: number;
|
|
93
|
+
address: string;
|
|
94
|
+
label?: string | null;
|
|
95
|
+
name?: string | null;
|
|
96
|
+
eventCount?: number;
|
|
97
|
+
tokenCount?: number;
|
|
98
|
+
mintedCount?: number;
|
|
99
|
+
reconstructedAt?: string | null;
|
|
100
|
+
}
|
|
101
|
+
/** `GET /v1/projects/{chainId}/{address}/status` — indexing freshness. */
|
|
102
|
+
export interface RemoteProjectStatus {
|
|
103
|
+
chainId: number;
|
|
104
|
+
address: string;
|
|
105
|
+
fromBlock: string;
|
|
106
|
+
toBlock: string | null;
|
|
107
|
+
eventCount: number;
|
|
108
|
+
tokenCount: number;
|
|
109
|
+
mintedCount: number;
|
|
110
|
+
reconstructedAt: string | null;
|
|
111
|
+
watcher?: {
|
|
112
|
+
watching: boolean;
|
|
113
|
+
pollAt: string | null;
|
|
114
|
+
head: string | null;
|
|
115
|
+
intervalMs?: number;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** `POST /v1/effect-artifacts` — a render producer publishes one output (locator or bytes). */
|
|
119
|
+
export interface PublishEffectArtifactBody {
|
|
120
|
+
chainId: number;
|
|
121
|
+
address: string;
|
|
122
|
+
tokenId: string;
|
|
123
|
+
/** The hash of the inputs this render depicts — the service never re-addresses to current state. */
|
|
124
|
+
inputsHash: Hex;
|
|
125
|
+
output?: string;
|
|
126
|
+
effectKey?: string;
|
|
127
|
+
contentType?: string;
|
|
128
|
+
/** A durable `ipfs://` / `ar://` / `https://` pointer — the service stores it and redirects. */
|
|
129
|
+
locator?: string;
|
|
130
|
+
/** The raw output, stored in the service's own byte custody (what traits use). */
|
|
131
|
+
bytes_base64?: string;
|
|
132
|
+
}
|
|
133
|
+
/** `POST /v1/effect-status` — a producer reports one run's transient state. */
|
|
134
|
+
export interface ReportEffectStatusBody {
|
|
135
|
+
chainId: number;
|
|
136
|
+
key: Hex;
|
|
137
|
+
address: string;
|
|
138
|
+
tokenId: string;
|
|
139
|
+
effectKey: string;
|
|
140
|
+
status: 'rendering' | 'failed' | 'done';
|
|
141
|
+
error?: string;
|
|
142
|
+
attempts?: number;
|
|
143
|
+
}
|
|
144
|
+
/** A non-2xx control-plane response (or an unreachable service, after retries). `code` is the
|
|
145
|
+
* spec's machine code when the service sent one — key behavior off it, never off `message`. */
|
|
146
|
+
export declare class AbxServiceError extends Error {
|
|
147
|
+
readonly status: number;
|
|
148
|
+
readonly code?: ServiceErrorCode;
|
|
149
|
+
readonly url: string;
|
|
150
|
+
constructor(message: string, opts: {
|
|
151
|
+
status: number;
|
|
152
|
+
code?: ServiceErrorCode;
|
|
153
|
+
url: string;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
export interface ServiceClientOptions {
|
|
157
|
+
baseUrl: string;
|
|
158
|
+
/** Bearer token for the control plane. Omit for descriptor-only use. */
|
|
159
|
+
token?: string;
|
|
160
|
+
/** Per-attempt timeout. A hung provider must not hang the caller. */
|
|
161
|
+
timeoutMs?: number;
|
|
162
|
+
/** Backoff unit between retries (`delay = retryDelayMs × attempt`). Tests shrink it. */
|
|
163
|
+
retryDelayMs?: number;
|
|
164
|
+
}
|
|
165
|
+
export declare class AbxServiceClient {
|
|
166
|
+
readonly baseUrl: string;
|
|
167
|
+
private readonly token?;
|
|
168
|
+
private readonly timeoutMs;
|
|
169
|
+
private readonly retryDelayMs;
|
|
170
|
+
constructor(opts: ServiceClientOptions);
|
|
171
|
+
/** The public service descriptor — no auth, safe to fetch before trusting a provider. */
|
|
172
|
+
descriptor(): Promise<ServiceDescriptor>;
|
|
173
|
+
/** Register + index a project (the HTTP form of `abx add`; a re-POST is the nudge). */
|
|
174
|
+
registerProject(body: RegisterProjectBody): Promise<RegisterProjectResult>;
|
|
175
|
+
/** The projects this token may see. */
|
|
176
|
+
listProjects(): Promise<RemoteProjectSummary[]>;
|
|
177
|
+
/** Deregister (remote `abx forget`). `not_registered` means "already gone" — reported, not
|
|
178
|
+
* thrown — but `disabled` still throws: a node that can't accept removals hasn't removed it. */
|
|
179
|
+
removeProject(chainId: number, address: string): Promise<{
|
|
180
|
+
removed: boolean;
|
|
181
|
+
}>;
|
|
182
|
+
/** Nudge a re-index. */
|
|
183
|
+
reindexProject(chainId: number, address: string): Promise<RegisterProjectResult>;
|
|
184
|
+
/** Indexing freshness for one project. */
|
|
185
|
+
projectStatus(chainId: number, address: string): Promise<RemoteProjectStatus>;
|
|
186
|
+
/** Publish a render output so a resolver that doesn't share the producer's disk can serve it. */
|
|
187
|
+
publishEffectArtifact(body: PublishEffectArtifactBody): Promise<{
|
|
188
|
+
ok: boolean;
|
|
189
|
+
mode: 'locator' | 'bytes';
|
|
190
|
+
key: Hex;
|
|
191
|
+
}>;
|
|
192
|
+
/** Report a run's transient state for the artifact key it is producing. */
|
|
193
|
+
reportEffectStatus(body: ReportEffectStatusBody): Promise<void>;
|
|
194
|
+
private request;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,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AqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;QAAC,GAAG,EAAE,GAAG,CAAA;KAAC,CAAC;IAIzH,2EAA2E;IACrE,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;YAIvD,OAAO;CAsDtB"}
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The remote-service client — the SDK's one HTTP surface, speaking the provider-neutral
|
|
3
|
+
* control plane pinned by specs/self-host-toolkit/remote-services.md. A client is bound to an
|
|
4
|
+
* endpoint + an injected bearer token, never to a brand: the reference CLI, the effects runner,
|
|
5
|
+
* and any hosted agent drive a self-hosted node and a managed provider through this same class.
|
|
6
|
+
*
|
|
7
|
+
* The token authorizes index/metadata control only — never on-chain signing. No env reads here;
|
|
8
|
+
* credential resolution is the caller's concern (the CLI's named-remote convention lives in
|
|
9
|
+
* packages/cli/src/remote.ts).
|
|
10
|
+
*/
|
|
11
|
+
export const WELL_KNOWN_SERVICE_PATH = '/.well-known/abx-service';
|
|
12
|
+
/** Versioned interface ids a service declares in its descriptor. Versions ride these ids
|
|
13
|
+
* (they track the `/v1` path prefix); the descriptor has no separate format version. */
|
|
14
|
+
export const TOKEN_API_INTERFACE = 'abx-token-api/v1';
|
|
15
|
+
export const CONTROL_PLANE_INTERFACE = 'abx-control-plane/v1';
|
|
16
|
+
export const EFFECTS_PUBLISH_INTERFACE = 'abx-effects-publish/v1';
|
|
17
|
+
/** A non-2xx control-plane response (or an unreachable service, after retries). `code` is the
|
|
18
|
+
* spec's machine code when the service sent one — key behavior off it, never off `message`. */
|
|
19
|
+
export class AbxServiceError extends Error {
|
|
20
|
+
status;
|
|
21
|
+
code;
|
|
22
|
+
url;
|
|
23
|
+
constructor(message, opts) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = 'AbxServiceError';
|
|
26
|
+
this.status = opts.status;
|
|
27
|
+
this.code = opts.code;
|
|
28
|
+
this.url = opts.url;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retry discipline (shared with the effects runner's read lane): a hosted node can cold-start or
|
|
33
|
+
* briefly 502, so network errors / 5xx / 429 get 4 attempts with linear backoff — but a genuine
|
|
34
|
+
* 4xx is an answer, not weather, and throws immediately with the parsed `{error, code}` body.
|
|
35
|
+
*/
|
|
36
|
+
const ATTEMPTS = 4;
|
|
37
|
+
/** The descriptor is a cheap PUBLIC read used to decide whether a URL is even a service — usually
|
|
38
|
+
* interactively, often against a typo. Grinding the full ladder there just makes a wrong URL take
|
|
39
|
+
* five seconds to say so, so it gets one retry for a blip and no more. */
|
|
40
|
+
const DESCRIPTOR_ATTEMPTS = 2;
|
|
41
|
+
export class AbxServiceClient {
|
|
42
|
+
baseUrl;
|
|
43
|
+
token;
|
|
44
|
+
timeoutMs;
|
|
45
|
+
retryDelayMs;
|
|
46
|
+
constructor(opts) {
|
|
47
|
+
this.baseUrl = opts.baseUrl.replace(/\/+$/, '');
|
|
48
|
+
this.token = opts.token;
|
|
49
|
+
this.timeoutMs = opts.timeoutMs ?? 30_000;
|
|
50
|
+
this.retryDelayMs = opts.retryDelayMs ?? 750;
|
|
51
|
+
}
|
|
52
|
+
/** The public service descriptor — no auth, safe to fetch before trusting a provider. */
|
|
53
|
+
async descriptor() {
|
|
54
|
+
return (await this.request('GET', WELL_KNOWN_SERVICE_PATH, undefined, DESCRIPTOR_ATTEMPTS));
|
|
55
|
+
}
|
|
56
|
+
/** Register + index a project (the HTTP form of `abx add`; a re-POST is the nudge). */
|
|
57
|
+
async registerProject(body) {
|
|
58
|
+
return (await this.request('POST', '/v1/projects', body));
|
|
59
|
+
}
|
|
60
|
+
/** The projects this token may see. */
|
|
61
|
+
async listProjects() {
|
|
62
|
+
const out = (await this.request('GET', '/v1/projects'));
|
|
63
|
+
return out.projects ?? [];
|
|
64
|
+
}
|
|
65
|
+
/** Deregister (remote `abx forget`). `not_registered` means "already gone" — reported, not
|
|
66
|
+
* thrown — but `disabled` still throws: a node that can't accept removals hasn't removed it. */
|
|
67
|
+
async removeProject(chainId, address) {
|
|
68
|
+
try {
|
|
69
|
+
await this.request('DELETE', `/v1/projects/${chainId}/${address}`);
|
|
70
|
+
return { removed: true };
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
if (err instanceof AbxServiceError && err.code === 'not_registered')
|
|
74
|
+
return { removed: false };
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Nudge a re-index. */
|
|
79
|
+
async reindexProject(chainId, address) {
|
|
80
|
+
return (await this.request('POST', `/v1/projects/${chainId}/${address}/reindex`));
|
|
81
|
+
}
|
|
82
|
+
/** Indexing freshness for one project. */
|
|
83
|
+
async projectStatus(chainId, address) {
|
|
84
|
+
return (await this.request('GET', `/v1/projects/${chainId}/${address}/status`));
|
|
85
|
+
}
|
|
86
|
+
/** Publish a render output so a resolver that doesn't share the producer's disk can serve it. */
|
|
87
|
+
async publishEffectArtifact(body) {
|
|
88
|
+
return (await this.request('POST', '/v1/effect-artifacts', body));
|
|
89
|
+
}
|
|
90
|
+
/** Report a run's transient state for the artifact key it is producing. */
|
|
91
|
+
async reportEffectStatus(body) {
|
|
92
|
+
await this.request('POST', '/v1/effect-status', body);
|
|
93
|
+
}
|
|
94
|
+
async request(method, path, body, attempts = ATTEMPTS) {
|
|
95
|
+
const url = this.baseUrl + path;
|
|
96
|
+
const headers = {};
|
|
97
|
+
if (this.token)
|
|
98
|
+
headers['authorization'] = `Bearer ${this.token}`;
|
|
99
|
+
if (body !== undefined)
|
|
100
|
+
headers['content-type'] = 'application/json';
|
|
101
|
+
let lastFailure = '';
|
|
102
|
+
let lastStatus = 0;
|
|
103
|
+
let lastCode;
|
|
104
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
105
|
+
let resp;
|
|
106
|
+
try {
|
|
107
|
+
resp = await fetch(url, {
|
|
108
|
+
method,
|
|
109
|
+
headers,
|
|
110
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
111
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
lastFailure = err.message;
|
|
116
|
+
lastStatus = 0;
|
|
117
|
+
if (attempt < attempts)
|
|
118
|
+
await sleep(this.retryDelayMs * attempt);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (resp.ok) {
|
|
122
|
+
const text = await resp.text();
|
|
123
|
+
return text ? JSON.parse(text) : {};
|
|
124
|
+
}
|
|
125
|
+
if (resp.status >= 500 || resp.status === 429) {
|
|
126
|
+
// Retryable — but KEEP the service's own words. A 5xx body carries the actual cause (an
|
|
127
|
+
// exhausted RPC, a misconfigured node); discarding it left the caller with a bare status and
|
|
128
|
+
// nothing to act on, which is the worst kind of error.
|
|
129
|
+
const said = await bodyMessage(resp);
|
|
130
|
+
lastStatus = resp.status;
|
|
131
|
+
lastCode = said.code;
|
|
132
|
+
lastFailure = said.error ? `${resp.status} ${said.error}` : `${resp.status} ${resp.statusText}`;
|
|
133
|
+
if (attempt < attempts)
|
|
134
|
+
await sleep(this.retryDelayMs * attempt);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
// A genuine 4xx is an answer, not weather — surface the service's own words + code.
|
|
138
|
+
const detail = await bodyMessage(resp);
|
|
139
|
+
throw new AbxServiceError(`${method} ${url}: ${resp.status} ${detail.error ?? resp.statusText}`, {
|
|
140
|
+
status: resp.status,
|
|
141
|
+
code: detail.code,
|
|
142
|
+
url,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// Retries exhausted. Distinguish "nothing answered" from "it answered, badly" — a 500 is not
|
|
146
|
+
// unreachable, and saying so sends the caller looking for a network problem that isn't there.
|
|
147
|
+
const summary = lastStatus
|
|
148
|
+
? `service failed after ${attempts} attempt(s) — last response ${lastFailure}`
|
|
149
|
+
: `nothing responded after ${attempts} attempt(s) (${lastFailure})`;
|
|
150
|
+
throw new AbxServiceError(`${method} ${url}: ${summary}`, { status: lastStatus, code: lastCode, url });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** The service's own `{error, code}` from a non-2xx body (never throws — a body may be empty/HTML). */
|
|
154
|
+
async function bodyMessage(resp) {
|
|
155
|
+
try {
|
|
156
|
+
const parsed = (await resp.json());
|
|
157
|
+
return { error: parsed.error, code: parsed.code };
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function sleep(ms) {
|
|
164
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAElE;yFACyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAC9D,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAkHlE;gGACgG;AAChG,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,MAAM,CAAS;IACf,IAAI,CAAoB;IACxB,GAAG,CAAS;IAErB,YAAY,OAAe,EAAE,IAA4D;QACvF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI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AAI,CAAC,IAAI,EAAE,CAAoC,CAAC;QACtE,OAAO,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,IAAoC,EAAC,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artblocks/abx-sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ABX SDK (Layer 2) — the neutral, low-level library that turns protocol operations into typed function calls. No provider, no chain, no UX baked in.",
|
|
6
6
|
"type": "module",
|