@buildaureon/sdk 0.1.8 → 0.1.10
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/CHANGELOG.md +81 -0
- package/README.md +673 -658
- package/config/network.json +5 -5
- package/dist/index.d.ts +31 -26
- package/dist/index.js +28 -18
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +210 -208
- package/docs/auth.md +176 -176
- package/docs/client-api.md +788 -788
- package/docs/data-contracts.md +6 -4
- package/docs/error-model.md +217 -217
- package/docs/integration-guide.md +400 -400
- package/docs/receipt-validation.md +66 -66
- package/docs/security.md +120 -120
- package/docs/transport.md +143 -143
- package/examples/ai-to-objective-to-portfolio/main.ts +1 -1
- package/examples/drift-detect-restore/main.ts +1 -1
- package/examples/e2e-policy-rebalance/main.ts +431 -431
- package/examples/e2e-policy-rebalance/underrun.ts +143 -143
- package/examples/e2e-policy-rebalance/verify-sizing.ts +155 -155
- package/examples/e2e-vault-flow/main.ts +221 -221
- package/examples/full-aureon-loop/main.ts +1 -1
- package/examples/green-vs-plan/main.ts +1 -1
- package/examples/market-event/main.ts +1 -1
- package/examples/portfolio-watch/main.ts +1 -1
- package/examples/quickstart/main.ts +75 -75
- package/examples/receipt-verification/main.ts +1 -1
- package/examples/sdk-demo-terminal/main.ts +2 -2
- package/package.json +2 -1
package/config/network.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"defaultNetwork": "mainnet",
|
|
3
|
-
"note": "
|
|
3
|
+
"note": "Default API is https://api.aureonlabs.network on mainnet. Pass network=testnet for testnet on the same official host. AUREON_API_URL overrides the host when set. Public Living Capital is still the testnet console.",
|
|
4
4
|
"mainnet": {
|
|
5
|
-
"baseUrl": "
|
|
5
|
+
"baseUrl": "https://api.aureonlabs.network",
|
|
6
6
|
"chainId": 4663,
|
|
7
7
|
"chain": "Robinhood Chain",
|
|
8
8
|
"explorer": "https://robinhoodchain.blockscout.com",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"testnet": {
|
|
12
12
|
"baseUrl": "https://api.aureonlabs.network",
|
|
13
|
-
"localBaseUrl": "http://127.0.0.1:8787",
|
|
14
13
|
"appUrl": "https://app.aureonlabs.network",
|
|
15
14
|
"chainId": 46630,
|
|
16
|
-
"chain": "Robinhood Chain Testnet"
|
|
15
|
+
"chain": "Robinhood Chain Testnet",
|
|
16
|
+
"explorer": "https://explorer.testnet.chain.robinhood.com"
|
|
17
17
|
},
|
|
18
18
|
"sdkPackage": "@buildaureon/sdk",
|
|
19
|
-
"sdkVersion": "0.1.
|
|
19
|
+
"sdkVersion": "0.1.10"
|
|
20
20
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Robinhood Chain network presets for the SDK and MCP.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* to that host.
|
|
4
|
+
* Users call the official API: https://api.aureonlabs.network
|
|
5
|
+
* `network` is a named parameter (`testnet` | `mainnet`), not a port.
|
|
6
|
+
* Set `baseUrl` / `AUREON_API_URL` only to override the official host.
|
|
8
7
|
*/
|
|
9
8
|
type AureonNetwork = "mainnet" | "testnet";
|
|
10
9
|
declare const MAINNET_CHAIN_ID = 4663;
|
|
11
10
|
declare const TESTNET_CHAIN_ID = 46630;
|
|
12
|
-
|
|
11
|
+
/** Official AUREON API. This is the default for integrators. */
|
|
12
|
+
declare const OFFICIAL_API_BASE_URL = "https://api.aureonlabs.network";
|
|
13
|
+
/** Same host as the official API (current public deployment). */
|
|
13
14
|
declare const TESTNET_API_BASE_URL = "https://api.aureonlabs.network";
|
|
15
|
+
/** Same official hostname. Chain id is selected with `network`, not a port. */
|
|
16
|
+
declare const MAINNET_API_BASE_URL = "https://api.aureonlabs.network";
|
|
14
17
|
type AureonNetworkPreset = {
|
|
15
18
|
network: AureonNetwork;
|
|
16
19
|
chainId: number;
|
|
@@ -19,23 +22,23 @@ type AureonNetworkPreset = {
|
|
|
19
22
|
};
|
|
20
23
|
declare const AUREON_NETWORKS: Record<AureonNetwork, AureonNetworkPreset>;
|
|
21
24
|
type ResolveAureonNetworkInput = {
|
|
22
|
-
/** Omit
|
|
25
|
+
/** Omit for the official API on mainnet. Pass `testnet` to stay on testnet on the same host. */
|
|
23
26
|
network?: string | null;
|
|
24
|
-
/**
|
|
27
|
+
/** Override the official API URL. Users should leave this unset. */
|
|
25
28
|
baseUrl?: string | null;
|
|
26
29
|
};
|
|
27
|
-
/** Infer preset from a
|
|
30
|
+
/** Infer preset from a non-official host. Official API is shared — not exclusive. */
|
|
28
31
|
declare function inferAureonNetworkFromUrl(url: string): AureonNetwork | null;
|
|
29
32
|
/**
|
|
30
33
|
* Resolve network + URL + chainId as one bundle.
|
|
31
34
|
*
|
|
32
|
-
* - Neither set →
|
|
33
|
-
* - Only `network` → that
|
|
34
|
-
* - Only `baseUrl` → that URL;
|
|
35
|
-
* - Both set
|
|
35
|
+
* - Neither set → official API, mainnet.
|
|
36
|
+
* - Only `network` → official API + that chain.
|
|
37
|
+
* - Only `baseUrl` → that URL; official host stays mainnet unless `network` is set.
|
|
38
|
+
* - Both set: official host is always allowed. Other known hosts must match.
|
|
36
39
|
*/
|
|
37
40
|
declare function resolveAureonNetwork(input?: ResolveAureonNetworkInput): AureonNetworkPreset;
|
|
38
|
-
/** MCP / CLI: `AUREON_NETWORK` optional, `AUREON_API_URL`
|
|
41
|
+
/** MCP / CLI: `AUREON_NETWORK` optional, `AUREON_API_URL` overrides the official host. */
|
|
39
42
|
declare function resolveAureonNetworkFromEnv(env?: NodeJS.Dict<string>): AureonNetworkPreset;
|
|
40
43
|
|
|
41
44
|
/**
|
|
@@ -818,14 +821,13 @@ declare function createConsoleLogger(prefix?: string): AureonLogger;
|
|
|
818
821
|
|
|
819
822
|
interface AureonClientOptions {
|
|
820
823
|
/**
|
|
821
|
-
*
|
|
822
|
-
* Pass `"testnet"`
|
|
824
|
+
* Chain selector. Omit for the official API on mainnet.
|
|
825
|
+
* Pass `"testnet"` to stay on testnet on the same official host.
|
|
823
826
|
*/
|
|
824
827
|
network?: "mainnet" | "testnet";
|
|
825
828
|
/**
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
* Must not disagree with an explicit `network` (fail closed).
|
|
829
|
+
* Override the official API URL. Leave unset so clients use
|
|
830
|
+
* https://api.aureonlabs.network.
|
|
829
831
|
*/
|
|
830
832
|
baseUrl?: string;
|
|
831
833
|
/**
|
|
@@ -1313,13 +1315,14 @@ declare class AureonClient {
|
|
|
1313
1315
|
*/
|
|
1314
1316
|
|
|
1315
1317
|
/**
|
|
1316
|
-
* Factory
|
|
1317
|
-
* Omit `network`
|
|
1318
|
-
*
|
|
1318
|
+
* Factory for integrators. Omit `baseUrl` to use the official API
|
|
1319
|
+
* (https://api.aureonlabs.network). Omit `network` for mainnet. Pass
|
|
1320
|
+
* `network: "testnet"` to stay on testnet on the same host.
|
|
1319
1321
|
*/
|
|
1320
1322
|
declare function createAureonClient(options?: AureonClientOptions): AureonClient;
|
|
1321
1323
|
/**
|
|
1322
|
-
*
|
|
1324
|
+
* Operator helper for a local API process. Integrators should use
|
|
1325
|
+
* createAureonClient() against the official API instead.
|
|
1323
1326
|
*/
|
|
1324
1327
|
declare function createLocalAureonClient(overrides?: Partial<AureonClientOptions>): AureonClient;
|
|
1325
1328
|
|
|
@@ -1425,17 +1428,19 @@ declare function withQuery(path: string, query: Record<string, string | undefine
|
|
|
1425
1428
|
/**
|
|
1426
1429
|
* @fileoverview Default runtime values for SDK clients and examples.
|
|
1427
1430
|
*/
|
|
1428
|
-
/**
|
|
1431
|
+
/** Official AUREON API (https://api.aureonlabs.network). */
|
|
1429
1432
|
declare const DEFAULT_API_BASE_URL = "https://api.aureonlabs.network";
|
|
1430
|
-
/**
|
|
1433
|
+
/** Operator-only local process. Users should not set this. */
|
|
1431
1434
|
declare const LOCAL_API_BASE_URL = "http://127.0.0.1:8788";
|
|
1432
1435
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
1433
|
-
declare const SDK_VERSION = "0.1.
|
|
1436
|
+
declare const SDK_VERSION = "0.1.10";
|
|
1434
1437
|
declare const SDK_NAME = "@buildaureon/sdk";
|
|
1435
1438
|
declare const PRODUCT_NAME = "AUREON";
|
|
1436
1439
|
declare const PRODUCT_TAGLINE = "Financial Compass for Robinhood Chain";
|
|
1437
1440
|
/** HTTP header for product API keys. */
|
|
1438
1441
|
declare const API_KEY_HEADER = "X-Aureon-Api-Key";
|
|
1442
|
+
/** Per-request chain selector. Omit or `mainnet` → 4663. `testnet` → 46630. */
|
|
1443
|
+
declare const NETWORK_HEADER = "X-Aureon-Network";
|
|
1439
1444
|
|
|
1440
1445
|
/**
|
|
1441
1446
|
* @fileoverview API path constants for AureonClient methods.
|
|
@@ -1474,4 +1479,4 @@ declare const ENDPOINTS: {
|
|
|
1474
1479
|
type FetchLike = typeof fetch;
|
|
1475
1480
|
declare function resolveFetch(custom?: FetchLike): FetchLike;
|
|
1476
1481
|
|
|
1477
|
-
export { API_KEY_HEADER, AUREON_NETWORKS, type AgentHost, type AllocationComparisonRow, type ApplyMarketEventInput, type AuditTrailGap, type AuditTrailGapCode, type AuditTrailReceiptRow, AureonClient, type AureonClientOptions, AureonConflictError, AureonError, type AureonErrorCode, type AureonNetwork, AureonNetworkError, type AureonNetworkPreset, AureonNotFoundError, AureonTimeoutError, AureonValidationError, type AuthMeResponse, type AuthNonceResponse, type AuthSessionResponse, type CreateObjectiveInput, type CreatedDeveloperApiKey, DEFAULT_API_BASE_URL, DEFAULT_FULL_LOOP_BRIEF, DEFAULT_PORTFOLIO_WATCH_BRIEF, DEFAULT_TIMEOUT_MS, type DashboardOverview, type DeveloperApiKey, type DriftRestoreFlow, type DriftRestorePhase, ENDPOINTS, type ExecutionReceipt, type ExecutionSettlementLookup, type FinancialAuditTrail, type FinancialIntent, type FullAureonLoopFlow, type FullAureonLoopPhase, type HealthState, LOCAL_API_BASE_URL, MAINNET_API_BASE_URL, MAINNET_CHAIN_ID, type MarkQuote, type MarkQuoteSource, type MarketEvent, type MarketPreset, OBJECTIVE_KINDS, OBJECTIVE_PRIORITIES, type Objective, type ObjectiveAutomationMode, type ObjectiveHealth, type ObjectiveKind, type ObjectivePolicy, type ObjectivePortfolioFlow, type ObjectivePriority, type ObjectiveRegistryLookup, type ObjectiveRegistryRecord, type ObjectiveStatus, PRODUCT_NAME, PRODUCT_TAGLINE, type PlanParadoxResult, type PortfolioPosition, type PortfolioPositionInput, type PortfolioSnapshot, type PortfolioWatchFlow, type PortfolioWatchPhase, type PrepareRegistryResult, type ReceiptProofTier, type ReceiptValidationCode, type ReceiptValidationIssue, type ReceiptValidationResult, type ReceiptVerificationFlow, type ReceiptVerificationPhase, type RegistryRef, type RegistryStatus, type ResolveAureonNetworkInput, type RestorePlan, type RestorePlanKind, type RestoreSuggestion, type RestoreSuggestionAction, SDK_NAME, SDK_VERSION, type SessionTokenProvider, type SettlementRecord, type SettlementStatus, type SyncPortfolioResult, TESTNET_API_BASE_URL, TESTNET_CHAIN_ID, TIMELINE_EVENT_TYPES, type TimelineEvent, type TimelineEventType, type UpdateObjectiveInput, type VaultBalance, type VaultDepositSymbol, type VaultOverview, type VaultPrepareResult, type VaultPreparedStep, type VaultStatus, type VaultToken, type VaultWithdrawSymbol, type WatchdogAlertResult, type WatchdogRefreshResult, assertBaseUrl, assertValidExecutionReceipt, buildAllocationComparison, buildDriftRestoreFlow, buildDriftRestoreFlowFromSnapshot, buildFinancialAuditTrail, buildFullAureonLoopFlow, buildFullAureonLoopFlowFromSnapshot, buildObjectivePortfolioFlow, buildPolicySummary, buildPortfolioWatchBriefingLines, buildPortfolioWatchFlow, buildPortfolioWatchFlowFromSnapshot, buildReceiptVerificationFlow, createAureonClient, createConsoleLogger, createLocalAureonClient, createSessionTokenProvider, detectPlanParadox, errorFromHttpStatus, findTimelineEventsForReceipt, formatAuditTrailLines, formatIsoTime, formatReceiptSummary, formatSettlementSummary, formatSignedPercent, formatUsd, formatWeight, healthTone, inferAureonNetworkFromUrl, inferDriftPhase, inferFullAureonLoopPhase, inferPortfolioWatchPhase, inferProofTier, isAureonError, isChainVerifiedReceipt, isHealthState, isObjectiveKind, isObjectivePriority, isTimelineEventType, isValidExecutionReceipt, isVaultSettlement, joinUrl, normalizeCreateObjectiveInput, normalizeUpdateObjectiveInput, parseFinancialIntent, pickWorstHealth, requestJson, resolveAureonNetwork, resolveAureonNetworkFromEnv, resolveFetch, resolveObjectiveFromIntent, silentLogger, validateExecutionReceipt, validateSettlementRecord, withQuery };
|
|
1482
|
+
export { API_KEY_HEADER, AUREON_NETWORKS, type AgentHost, type AllocationComparisonRow, type ApplyMarketEventInput, type AuditTrailGap, type AuditTrailGapCode, type AuditTrailReceiptRow, AureonClient, type AureonClientOptions, AureonConflictError, AureonError, type AureonErrorCode, type AureonNetwork, AureonNetworkError, type AureonNetworkPreset, AureonNotFoundError, AureonTimeoutError, AureonValidationError, type AuthMeResponse, type AuthNonceResponse, type AuthSessionResponse, type CreateObjectiveInput, type CreatedDeveloperApiKey, DEFAULT_API_BASE_URL, DEFAULT_FULL_LOOP_BRIEF, DEFAULT_PORTFOLIO_WATCH_BRIEF, DEFAULT_TIMEOUT_MS, type DashboardOverview, type DeveloperApiKey, type DriftRestoreFlow, type DriftRestorePhase, ENDPOINTS, type ExecutionReceipt, type ExecutionSettlementLookup, type FinancialAuditTrail, type FinancialIntent, type FullAureonLoopFlow, type FullAureonLoopPhase, type HealthState, LOCAL_API_BASE_URL, MAINNET_API_BASE_URL, MAINNET_CHAIN_ID, type MarkQuote, type MarkQuoteSource, type MarketEvent, type MarketPreset, NETWORK_HEADER, OBJECTIVE_KINDS, OBJECTIVE_PRIORITIES, OFFICIAL_API_BASE_URL, type Objective, type ObjectiveAutomationMode, type ObjectiveHealth, type ObjectiveKind, type ObjectivePolicy, type ObjectivePortfolioFlow, type ObjectivePriority, type ObjectiveRegistryLookup, type ObjectiveRegistryRecord, type ObjectiveStatus, PRODUCT_NAME, PRODUCT_TAGLINE, type PlanParadoxResult, type PortfolioPosition, type PortfolioPositionInput, type PortfolioSnapshot, type PortfolioWatchFlow, type PortfolioWatchPhase, type PrepareRegistryResult, type ReceiptProofTier, type ReceiptValidationCode, type ReceiptValidationIssue, type ReceiptValidationResult, type ReceiptVerificationFlow, type ReceiptVerificationPhase, type RegistryRef, type RegistryStatus, type ResolveAureonNetworkInput, type RestorePlan, type RestorePlanKind, type RestoreSuggestion, type RestoreSuggestionAction, SDK_NAME, SDK_VERSION, type SessionTokenProvider, type SettlementRecord, type SettlementStatus, type SyncPortfolioResult, TESTNET_API_BASE_URL, TESTNET_CHAIN_ID, TIMELINE_EVENT_TYPES, type TimelineEvent, type TimelineEventType, type UpdateObjectiveInput, type VaultBalance, type VaultDepositSymbol, type VaultOverview, type VaultPrepareResult, type VaultPreparedStep, type VaultStatus, type VaultToken, type VaultWithdrawSymbol, type WatchdogAlertResult, type WatchdogRefreshResult, assertBaseUrl, assertValidExecutionReceipt, buildAllocationComparison, buildDriftRestoreFlow, buildDriftRestoreFlowFromSnapshot, buildFinancialAuditTrail, buildFullAureonLoopFlow, buildFullAureonLoopFlowFromSnapshot, buildObjectivePortfolioFlow, buildPolicySummary, buildPortfolioWatchBriefingLines, buildPortfolioWatchFlow, buildPortfolioWatchFlowFromSnapshot, buildReceiptVerificationFlow, createAureonClient, createConsoleLogger, createLocalAureonClient, createSessionTokenProvider, detectPlanParadox, errorFromHttpStatus, findTimelineEventsForReceipt, formatAuditTrailLines, formatIsoTime, formatReceiptSummary, formatSettlementSummary, formatSignedPercent, formatUsd, formatWeight, healthTone, inferAureonNetworkFromUrl, inferDriftPhase, inferFullAureonLoopPhase, inferPortfolioWatchPhase, inferProofTier, isAureonError, isChainVerifiedReceipt, isHealthState, isObjectiveKind, isObjectivePriority, isTimelineEventType, isValidExecutionReceipt, isVaultSettlement, joinUrl, normalizeCreateObjectiveInput, normalizeUpdateObjectiveInput, parseFinancialIntent, pickWorstHealth, requestJson, resolveAureonNetwork, resolveAureonNetworkFromEnv, resolveFetch, resolveObjectiveFromIntent, silentLogger, validateExecutionReceipt, validateSettlementRecord, withQuery };
|
package/dist/index.js
CHANGED
|
@@ -13,21 +13,22 @@ function userAgentHeader(version) {
|
|
|
13
13
|
// src/constants/networks.ts
|
|
14
14
|
var MAINNET_CHAIN_ID = 4663;
|
|
15
15
|
var TESTNET_CHAIN_ID = 46630;
|
|
16
|
-
var
|
|
17
|
-
var TESTNET_API_BASE_URL =
|
|
16
|
+
var OFFICIAL_API_BASE_URL = "https://api.aureonlabs.network";
|
|
17
|
+
var TESTNET_API_BASE_URL = OFFICIAL_API_BASE_URL;
|
|
18
|
+
var MAINNET_API_BASE_URL = OFFICIAL_API_BASE_URL;
|
|
18
19
|
var MAINNET_EXPLORER = "https://robinhoodchain.blockscout.com";
|
|
19
20
|
var TESTNET_EXPLORER = "https://explorer.testnet.chain.robinhood.com";
|
|
20
21
|
var AUREON_NETWORKS = {
|
|
21
22
|
mainnet: {
|
|
22
23
|
network: "mainnet",
|
|
23
24
|
chainId: MAINNET_CHAIN_ID,
|
|
24
|
-
baseUrl:
|
|
25
|
+
baseUrl: OFFICIAL_API_BASE_URL,
|
|
25
26
|
explorer: MAINNET_EXPLORER
|
|
26
27
|
},
|
|
27
28
|
testnet: {
|
|
28
29
|
network: "testnet",
|
|
29
30
|
chainId: TESTNET_CHAIN_ID,
|
|
30
|
-
baseUrl:
|
|
31
|
+
baseUrl: OFFICIAL_API_BASE_URL,
|
|
31
32
|
explorer: TESTNET_EXPLORER
|
|
32
33
|
}
|
|
33
34
|
};
|
|
@@ -41,15 +42,18 @@ function parseNetwork(raw) {
|
|
|
41
42
|
function stripSlash(url) {
|
|
42
43
|
return url.replace(/\/+$/, "");
|
|
43
44
|
}
|
|
45
|
+
function isOfficialApi(url) {
|
|
46
|
+
return stripSlash(url).toLowerCase().includes("api.aureonlabs.network");
|
|
47
|
+
}
|
|
44
48
|
function inferAureonNetworkFromUrl(url) {
|
|
49
|
+
if (isOfficialApi(url)) return null;
|
|
45
50
|
const u = stripSlash(url).toLowerCase();
|
|
46
|
-
if (u.includes("api.aureonlabs.network")) return "testnet";
|
|
47
51
|
if (/:(8787)(\/|$)/.test(u) || u.endsWith(":8787")) return "testnet";
|
|
48
52
|
if (/:(8788)(\/|$)/.test(u) || u.endsWith(":8788")) return "mainnet";
|
|
49
53
|
return null;
|
|
50
54
|
}
|
|
51
55
|
function mismatchMessage(network, baseUrl) {
|
|
52
|
-
return `baseUrl "${baseUrl}" does not match network "${network}".
|
|
56
|
+
return `baseUrl "${baseUrl}" does not match network "${network}". The official API is ${OFFICIAL_API_BASE_URL}. Use the network parameter for chain selection, not a port.`;
|
|
53
57
|
}
|
|
54
58
|
function resolveAureonNetwork(input = {}) {
|
|
55
59
|
const networkRaw = input.network?.trim();
|
|
@@ -60,6 +64,16 @@ function resolveAureonNetwork(input = {}) {
|
|
|
60
64
|
return { ...AUREON_NETWORKS[network] };
|
|
61
65
|
}
|
|
62
66
|
const baseUrl = stripSlash(explicitUrl);
|
|
67
|
+
if (isOfficialApi(baseUrl)) {
|
|
68
|
+
const resolvedNetwork2 = networkSpecified ? network : "mainnet";
|
|
69
|
+
const preset2 = AUREON_NETWORKS[resolvedNetwork2];
|
|
70
|
+
return {
|
|
71
|
+
network: resolvedNetwork2,
|
|
72
|
+
chainId: preset2.chainId,
|
|
73
|
+
baseUrl: OFFICIAL_API_BASE_URL,
|
|
74
|
+
explorer: preset2.explorer
|
|
75
|
+
};
|
|
76
|
+
}
|
|
63
77
|
const inferred = inferAureonNetworkFromUrl(baseUrl);
|
|
64
78
|
if (networkSpecified && inferred && inferred !== network) {
|
|
65
79
|
throw new Error(mismatchMessage(network, baseUrl));
|
|
@@ -81,14 +95,15 @@ function resolveAureonNetworkFromEnv(env = process.env) {
|
|
|
81
95
|
}
|
|
82
96
|
|
|
83
97
|
// src/constants/defaults.ts
|
|
84
|
-
var DEFAULT_API_BASE_URL =
|
|
85
|
-
var LOCAL_API_BASE_URL =
|
|
98
|
+
var DEFAULT_API_BASE_URL = OFFICIAL_API_BASE_URL;
|
|
99
|
+
var LOCAL_API_BASE_URL = "http://127.0.0.1:8788";
|
|
86
100
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
87
|
-
var SDK_VERSION = "0.1.
|
|
101
|
+
var SDK_VERSION = "0.1.10";
|
|
88
102
|
var SDK_NAME = "@buildaureon/sdk";
|
|
89
103
|
var PRODUCT_NAME = "AUREON";
|
|
90
104
|
var PRODUCT_TAGLINE = "Financial Compass for Robinhood Chain";
|
|
91
105
|
var API_KEY_HEADER = "X-Aureon-Api-Key";
|
|
106
|
+
var NETWORK_HEADER = "X-Aureon-Network";
|
|
92
107
|
|
|
93
108
|
// src/constants/endpoints.ts
|
|
94
109
|
var ENDPOINTS = {
|
|
@@ -1628,7 +1643,8 @@ var AureonClient = class {
|
|
|
1628
1643
|
fetchImpl: resolveFetch(options.fetch),
|
|
1629
1644
|
headers: {
|
|
1630
1645
|
...userAgentHeader(SDK_VERSION),
|
|
1631
|
-
...resolveHeaders({ ...options})
|
|
1646
|
+
...resolveHeaders({ ...options}),
|
|
1647
|
+
[NETWORK_HEADER]: resolved.network
|
|
1632
1648
|
},
|
|
1633
1649
|
timeoutMs: resolveTimeoutMs(options),
|
|
1634
1650
|
maxRetries: resolveMaxRetries(options),
|
|
@@ -2531,15 +2547,9 @@ function createAureonClient(options = {}) {
|
|
|
2531
2547
|
return new AureonClient(options);
|
|
2532
2548
|
}
|
|
2533
2549
|
function createLocalAureonClient(overrides = {}) {
|
|
2534
|
-
if (overrides.network && overrides.network !== "mainnet") {
|
|
2535
|
-
throw new Error(
|
|
2536
|
-
'createLocalAureonClient is mainnet-only (8788 / 4663). Use createAureonClient({ network: "testnet" }) for the public host.'
|
|
2537
|
-
);
|
|
2538
|
-
}
|
|
2539
2550
|
return new AureonClient({
|
|
2540
2551
|
...overrides,
|
|
2541
|
-
|
|
2542
|
-
baseUrl: overrides.baseUrl ?? MAINNET_API_BASE_URL
|
|
2552
|
+
baseUrl: overrides.baseUrl ?? LOCAL_API_BASE_URL
|
|
2543
2553
|
});
|
|
2544
2554
|
}
|
|
2545
2555
|
|
|
@@ -2684,6 +2694,6 @@ function createConsoleLogger(prefix = "aureon-sdk") {
|
|
|
2684
2694
|
};
|
|
2685
2695
|
}
|
|
2686
2696
|
|
|
2687
|
-
export { API_KEY_HEADER, AUREON_NETWORKS, AureonClient, AureonConflictError, AureonError, AureonNetworkError, AureonNotFoundError, AureonTimeoutError, AureonValidationError, DEFAULT_API_BASE_URL, DEFAULT_FULL_LOOP_BRIEF, DEFAULT_PORTFOLIO_WATCH_BRIEF, DEFAULT_TIMEOUT_MS, ENDPOINTS, LOCAL_API_BASE_URL, MAINNET_API_BASE_URL, MAINNET_CHAIN_ID, OBJECTIVE_KINDS, OBJECTIVE_PRIORITIES, PRODUCT_NAME, PRODUCT_TAGLINE, SDK_NAME, SDK_VERSION, TESTNET_API_BASE_URL, TESTNET_CHAIN_ID, TIMELINE_EVENT_TYPES, assertBaseUrl, assertValidExecutionReceipt, buildAllocationComparison, buildDriftRestoreFlow, buildDriftRestoreFlowFromSnapshot, buildFinancialAuditTrail, buildFullAureonLoopFlow, buildFullAureonLoopFlowFromSnapshot, buildObjectivePortfolioFlow, buildPolicySummary, buildPortfolioWatchBriefingLines, buildPortfolioWatchFlow, buildPortfolioWatchFlowFromSnapshot, buildReceiptVerificationFlow, createAureonClient, createConsoleLogger, createLocalAureonClient, createSessionTokenProvider, detectPlanParadox, errorFromHttpStatus, findTimelineEventsForReceipt, formatAuditTrailLines, formatIsoTime, formatReceiptSummary, formatSettlementSummary, formatSignedPercent, formatUsd, formatWeight, healthTone, inferAureonNetworkFromUrl, inferDriftPhase, inferFullAureonLoopPhase, inferPortfolioWatchPhase, inferProofTier, isAureonError, isChainVerifiedReceipt, isHealthState, isObjectiveKind, isObjectivePriority, isTimelineEventType, isValidExecutionReceipt, isVaultSettlement, joinUrl, normalizeCreateObjectiveInput, normalizeUpdateObjectiveInput, parseFinancialIntent, pickWorstHealth, requestJson, resolveAureonNetwork, resolveAureonNetworkFromEnv, resolveFetch, resolveObjectiveFromIntent, silentLogger, validateExecutionReceipt, validateSettlementRecord, withQuery };
|
|
2697
|
+
export { API_KEY_HEADER, AUREON_NETWORKS, AureonClient, AureonConflictError, AureonError, AureonNetworkError, AureonNotFoundError, AureonTimeoutError, AureonValidationError, DEFAULT_API_BASE_URL, DEFAULT_FULL_LOOP_BRIEF, DEFAULT_PORTFOLIO_WATCH_BRIEF, DEFAULT_TIMEOUT_MS, ENDPOINTS, LOCAL_API_BASE_URL, MAINNET_API_BASE_URL, MAINNET_CHAIN_ID, NETWORK_HEADER, OBJECTIVE_KINDS, OBJECTIVE_PRIORITIES, OFFICIAL_API_BASE_URL, PRODUCT_NAME, PRODUCT_TAGLINE, SDK_NAME, SDK_VERSION, TESTNET_API_BASE_URL, TESTNET_CHAIN_ID, TIMELINE_EVENT_TYPES, assertBaseUrl, assertValidExecutionReceipt, buildAllocationComparison, buildDriftRestoreFlow, buildDriftRestoreFlowFromSnapshot, buildFinancialAuditTrail, buildFullAureonLoopFlow, buildFullAureonLoopFlowFromSnapshot, buildObjectivePortfolioFlow, buildPolicySummary, buildPortfolioWatchBriefingLines, buildPortfolioWatchFlow, buildPortfolioWatchFlowFromSnapshot, buildReceiptVerificationFlow, createAureonClient, createConsoleLogger, createLocalAureonClient, createSessionTokenProvider, detectPlanParadox, errorFromHttpStatus, findTimelineEventsForReceipt, formatAuditTrailLines, formatIsoTime, formatReceiptSummary, formatSettlementSummary, formatSignedPercent, formatUsd, formatWeight, healthTone, inferAureonNetworkFromUrl, inferDriftPhase, inferFullAureonLoopPhase, inferPortfolioWatchPhase, inferProofTier, isAureonError, isChainVerifiedReceipt, isHealthState, isObjectiveKind, isObjectivePriority, isTimelineEventType, isValidExecutionReceipt, isVaultSettlement, joinUrl, normalizeCreateObjectiveInput, normalizeUpdateObjectiveInput, parseFinancialIntent, pickWorstHealth, requestJson, resolveAureonNetwork, resolveAureonNetworkFromEnv, resolveFetch, resolveObjectiveFromIntent, silentLogger, validateExecutionReceipt, validateSettlementRecord, withQuery };
|
|
2688
2698
|
//# sourceMappingURL=index.js.map
|
|
2689
2699
|
//# sourceMappingURL=index.js.map
|