@buildaureon/sdk 0.1.2 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +21 -3
- package/config/network.json +20 -10
- package/dist/index.d.ts +706 -100
- package/dist/index.js +1813 -205
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +11 -9
- package/docs/auth.md +5 -3
- package/docs/client-api.md +187 -4
- package/docs/data-contracts.md +81 -6
- package/docs/error-model.md +2 -2
- package/docs/integration-guide.md +169 -26
- package/docs/receipt-validation.md +66 -0
- package/docs/security.md +1 -1
- package/docs/transport.md +2 -1
- package/examples/ai-to-objective-to-portfolio/main.ts +130 -0
- package/examples/audit-trail/main.ts +55 -0
- package/examples/drift-detect-restore/main.ts +99 -0
- package/examples/e2e-policy-rebalance/main.ts +13 -8
- package/examples/e2e-policy-rebalance/underrun.ts +13 -8
- package/examples/e2e-policy-rebalance/verify-sizing.ts +13 -8
- package/examples/e2e-vault-flow/main.ts +13 -8
- package/examples/full-aureon-loop/main.ts +86 -0
- package/examples/green-vs-plan/main.ts +142 -0
- package/examples/market-event/main.ts +8 -3
- package/examples/portfolio-watch/main.ts +87 -0
- package/examples/quickstart/main.ts +8 -5
- package/examples/receipt-verification/main.ts +90 -0
- package/examples/sdk-demo-terminal/main.ts +6 -4
- package/fixtures/reference-objectives.json +18 -18
- package/fixtures/reference-portfolio.json +10 -10
- package/package.json +70 -61
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Update 2 demo — green portfolio vs failing financial plan.
|
|
3
|
+
*
|
|
4
|
+
* Shows objective vs actual before and after a controlled NVDA rally with
|
|
5
|
+
* auto-restore disabled so the paradox stays visible.
|
|
6
|
+
*
|
|
7
|
+
* Env:
|
|
8
|
+
* AUREON_API_KEY issued developer key (required)
|
|
9
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
10
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
11
|
+
*
|
|
12
|
+
* pnpm example:green-vs-plan
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
createAureonClient,
|
|
17
|
+
resolveAureonNetworkFromEnv,
|
|
18
|
+
formatWeight,
|
|
19
|
+
isAureonError,
|
|
20
|
+
type AllocationComparisonRow,
|
|
21
|
+
type PortfolioPositionInput,
|
|
22
|
+
} from "../../src/index.js";
|
|
23
|
+
|
|
24
|
+
const DEMO_POSITIONS: PortfolioPositionInput[] = [
|
|
25
|
+
{
|
|
26
|
+
symbol: "USDG",
|
|
27
|
+
name: "Paxos USDG",
|
|
28
|
+
category: "stable",
|
|
29
|
+
quantity: 24_000,
|
|
30
|
+
markPriceUsd: 1,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
symbol: "NVDA",
|
|
34
|
+
name: "NVIDIA Stock Token",
|
|
35
|
+
category: "stock_token",
|
|
36
|
+
quantity: 45,
|
|
37
|
+
markPriceUsd: 920,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
symbol: "AAPL",
|
|
41
|
+
name: "Apple Stock Token",
|
|
42
|
+
category: "stock_token",
|
|
43
|
+
quantity: 80,
|
|
44
|
+
markPriceUsd: 210,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
symbol: "ETH",
|
|
48
|
+
name: "Ether",
|
|
49
|
+
category: "gas",
|
|
50
|
+
quantity: 8.5,
|
|
51
|
+
markPriceUsd: 3400,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
function printRows(rows: AllocationComparisonRow[]): void {
|
|
56
|
+
if (rows.length === 0) {
|
|
57
|
+
console.log(" (no active objectives)");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
const label = row.targetSymbol ?? row.name.slice(0, 20);
|
|
62
|
+
console.log(
|
|
63
|
+
` ${label.padEnd(16)} current ${formatWeight(row.currentMetric)} target ${formatWeight(row.targetWeight)} ${row.state}`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function main(): Promise<void> {
|
|
69
|
+
const apiKey = process.env.AUREON_API_KEY?.trim();
|
|
70
|
+
if (!apiKey) {
|
|
71
|
+
throw new Error("Set AUREON_API_KEY to an issued developer key.");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
75
|
+
const aureon = createAureonClient({
|
|
76
|
+
network: resolved.network,
|
|
77
|
+
baseUrl: resolved.baseUrl,
|
|
78
|
+
apiKey,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
console.log("\n=== AUREON Update 2 — Green vs plan ===\n");
|
|
82
|
+
|
|
83
|
+
console.log("1. Seed capital book (~20% stables)…");
|
|
84
|
+
await aureon.setPortfolio(DEMO_POSITIONS);
|
|
85
|
+
|
|
86
|
+
console.log("2. Create stable allocation objective (20% ± 2%)…");
|
|
87
|
+
const objective = await aureon.createObjective({
|
|
88
|
+
name: "Maintain 20% Stable Assets",
|
|
89
|
+
kind: "stable_allocation",
|
|
90
|
+
targetWeight: 0.2,
|
|
91
|
+
tolerance: 0.02,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
console.log("3. Baseline — objective vs actual:\n");
|
|
95
|
+
let snapshot = await aureon.getAllocationVsTarget();
|
|
96
|
+
printRows(snapshot.rows);
|
|
97
|
+
console.log(`\n Book: $${snapshot.overview.totalNotionalUsd.toLocaleString()}`);
|
|
98
|
+
console.log(` Paradox: ${snapshot.paradox.message}\n`);
|
|
99
|
+
|
|
100
|
+
console.log("4. Apply NVDA rally (+45%), autoRestore: false…");
|
|
101
|
+
const market = await aureon.applyMarketEvent({
|
|
102
|
+
name: "NVDA Stock Token Rally",
|
|
103
|
+
description: "Controlled mark move — Update 2 paradox demo",
|
|
104
|
+
symbol: "NVDA",
|
|
105
|
+
priceChangeRatio: 0.45,
|
|
106
|
+
autoRestore: false,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
console.log("5. After shock — objective vs actual:\n");
|
|
110
|
+
snapshot = await aureon.getAllocationVsTarget();
|
|
111
|
+
printRows(snapshot.rows);
|
|
112
|
+
|
|
113
|
+
const stable = snapshot.rows.find((r) => r.objectiveId === objective.id);
|
|
114
|
+
const bookBefore = snapshot.overview.totalNotionalUsd;
|
|
115
|
+
const bookAfter = market.portfolio.totalNotionalUsd;
|
|
116
|
+
|
|
117
|
+
console.log(`\n Book before shock: $${bookBefore.toLocaleString()}`);
|
|
118
|
+
console.log(` Book after shock: $${bookAfter.toLocaleString()}`);
|
|
119
|
+
console.log(` Book moved up: ${bookAfter >= bookBefore ? "yes" : "no"}`);
|
|
120
|
+
if (stable) {
|
|
121
|
+
console.log(
|
|
122
|
+
` Stable objective: ${formatWeight(stable.currentMetric)} vs ${formatWeight(stable.targetWeight)} target — ${stable.state}`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
console.log(`\n Paradox detected: ${snapshot.paradox.detected}`);
|
|
126
|
+
console.log(` ${snapshot.paradox.message}\n`);
|
|
127
|
+
|
|
128
|
+
if (!snapshot.paradox.detected && stable && stable.state !== "healthy") {
|
|
129
|
+
console.log(
|
|
130
|
+
" Note: paradox flag needs book-up signal; objective is still off-plan.\n"
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
main().catch((error) => {
|
|
136
|
+
if (isAureonError(error)) {
|
|
137
|
+
console.error(`${error.code}: ${error.message}`);
|
|
138
|
+
} else {
|
|
139
|
+
console.error(error);
|
|
140
|
+
}
|
|
141
|
+
process.exitCode = 1;
|
|
142
|
+
});
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Env:
|
|
5
5
|
* AUREON_API_KEY issued developer key (required)
|
|
6
|
-
*
|
|
6
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
7
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
7
8
|
*
|
|
8
9
|
* pnpm --filter @buildaureon/sdk example:market
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
createAureonClient,
|
|
13
|
-
|
|
14
|
+
resolveAureonNetworkFromEnv,
|
|
14
15
|
isAureonError,
|
|
15
16
|
} from "../../src/index.js";
|
|
16
17
|
|
|
@@ -20,8 +21,10 @@ async function main(): Promise<void> {
|
|
|
20
21
|
throw new Error("Set AUREON_API_KEY to an issued developer key.");
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
23
25
|
const aureon = createAureonClient({
|
|
24
|
-
|
|
26
|
+
network: resolved.network,
|
|
27
|
+
baseUrl: resolved.baseUrl,
|
|
25
28
|
apiKey,
|
|
26
29
|
});
|
|
27
30
|
|
|
@@ -37,6 +40,8 @@ async function main(): Promise<void> {
|
|
|
37
40
|
description: "Controlled mark appreciation on NVIDIA Stock Token",
|
|
38
41
|
symbol: "NVDA",
|
|
39
42
|
priceChangeRatio: 0.45,
|
|
43
|
+
// autoRestore: true runs restorative execution when objectives breach —
|
|
44
|
+
// use autoRestore: false for the green-vs-plan paradox demo (see example:green-vs-plan).
|
|
40
45
|
autoRestore: true,
|
|
41
46
|
});
|
|
42
47
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview demo — portfolio watch while away (agent-in-host).
|
|
3
|
+
*
|
|
4
|
+
* Env:
|
|
5
|
+
* AUREON_API_KEY issued developer key (required)
|
|
6
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
7
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
8
|
+
*
|
|
9
|
+
* pnpm example:portfolio-watch
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
createAureonClient,
|
|
14
|
+
resolveAureonNetworkFromEnv,
|
|
15
|
+
formatWeight,
|
|
16
|
+
isAureonError,
|
|
17
|
+
type PortfolioWatchFlow,
|
|
18
|
+
} from "../../src/index.js";
|
|
19
|
+
|
|
20
|
+
function printFlow(flow: PortfolioWatchFlow): void {
|
|
21
|
+
console.log("\n=== AUREON — Watch while away (Cursor / Claude + MCP) ===\n");
|
|
22
|
+
|
|
23
|
+
console.log(`User brief: "${flow.userBrief}"`);
|
|
24
|
+
console.log(`Agent host: ${flow.host}\n`);
|
|
25
|
+
|
|
26
|
+
console.log("1. Register watch — intent → Automatic objective");
|
|
27
|
+
console.log(` Objective: ${flow.phases.register.objectiveName}`);
|
|
28
|
+
console.log(` Mode: ${flow.phases.register.automationMode}`);
|
|
29
|
+
console.log(` Policy: ${flow.phases.register.policySummary}`);
|
|
30
|
+
console.log(
|
|
31
|
+
` Health: ${flow.phases.register.health.state} — ${formatWeight(flow.phases.register.health.currentMetric ?? 0)} vs ${formatWeight(flow.phases.register.health.targetMetric ?? 0.2)} target`
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (flow.phases.whileAway) {
|
|
35
|
+
console.log("\n2. While away — market moved, Automatic mode acted");
|
|
36
|
+
console.log(
|
|
37
|
+
` Event: ${flow.phases.whileAway.marketEventName} (${flow.phases.whileAway.symbol} ${(flow.phases.whileAway.priceChangeRatio * 100).toFixed(0)}%)`
|
|
38
|
+
);
|
|
39
|
+
console.log(
|
|
40
|
+
` Health: ${flow.phases.whileAway.healthBefore.state} → ${flow.phases.whileAway.healthAfter.state}`
|
|
41
|
+
);
|
|
42
|
+
console.log(
|
|
43
|
+
` Auto restore: ${flow.phases.whileAway.autoRestored ? "yes" : "no"}`
|
|
44
|
+
);
|
|
45
|
+
if (flow.phases.whileAway.receipt) {
|
|
46
|
+
console.log(
|
|
47
|
+
` Receipt: ${flow.phases.whileAway.receipt.settlement} — ${flow.phases.whileAway.receipt.id}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log("\n3. Return briefing — what to tell the user");
|
|
53
|
+
for (const line of flow.phases.briefing.summaryLines) {
|
|
54
|
+
console.log(` • ${line}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log(`\n${flow.message}`);
|
|
58
|
+
console.log(
|
|
59
|
+
"\nYou don't hand the agent a blank check — you register a rule, then read the briefing when you're back.\n"
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function main(): Promise<void> {
|
|
64
|
+
const apiKey = process.env.AUREON_API_KEY?.trim();
|
|
65
|
+
if (!apiKey) {
|
|
66
|
+
throw new Error("Set AUREON_API_KEY to an issued developer key.");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
70
|
+
const aureon = createAureonClient({
|
|
71
|
+
network: resolved.network,
|
|
72
|
+
baseUrl: resolved.baseUrl,
|
|
73
|
+
apiKey,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const flow = await aureon.runPortfolioWatchDemo({ host: "cursor" });
|
|
77
|
+
printFlow(flow);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
main().catch((error) => {
|
|
81
|
+
if (isAureonError(error)) {
|
|
82
|
+
console.error(`${error.code}: ${error.message}`);
|
|
83
|
+
} else {
|
|
84
|
+
console.error(error);
|
|
85
|
+
}
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
});
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
* @fileoverview Quickstart — control-plane calls with an issued developer API key.
|
|
3
3
|
*
|
|
4
4
|
* Env (required for integrators — nothing else):
|
|
5
|
-
* AUREON_API_KEY
|
|
6
|
-
*
|
|
5
|
+
* AUREON_API_KEY issued key from Developers
|
|
6
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
7
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
7
8
|
*
|
|
8
9
|
* pnpm --filter @buildaureon/sdk example:quickstart
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
createAureonClient,
|
|
13
|
-
DEFAULT_API_BASE_URL,
|
|
14
14
|
formatWeight,
|
|
15
15
|
isAureonError,
|
|
16
|
+
resolveAureonNetworkFromEnv,
|
|
16
17
|
} from "../../src/index.js";
|
|
17
18
|
|
|
18
19
|
async function main(): Promise<void> {
|
|
@@ -23,8 +24,10 @@ async function main(): Promise<void> {
|
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
26
28
|
const aureon = createAureonClient({
|
|
27
|
-
|
|
29
|
+
network: resolved.network,
|
|
30
|
+
baseUrl: resolved.baseUrl,
|
|
28
31
|
apiKey,
|
|
29
32
|
});
|
|
30
33
|
|
|
@@ -58,7 +61,7 @@ async function main(): Promise<void> {
|
|
|
58
61
|
);
|
|
59
62
|
|
|
60
63
|
console.log(
|
|
61
|
-
"hint:
|
|
64
|
+
"hint: empty vault restore is 409. prepare-deposit is unsigned — the user broadcasts when they fund. Agents do not."
|
|
62
65
|
);
|
|
63
66
|
}
|
|
64
67
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview receipt → verification.
|
|
3
|
+
*
|
|
4
|
+
* Shows claim vs validation vs settlement proof after a restore.
|
|
5
|
+
*
|
|
6
|
+
* Env:
|
|
7
|
+
* AUREON_API_KEY issued developer key (required)
|
|
8
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
9
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
10
|
+
*
|
|
11
|
+
* pnpm example:receipt-verification
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
createAureonClient,
|
|
16
|
+
resolveAureonNetworkFromEnv,
|
|
17
|
+
isAureonError,
|
|
18
|
+
type ReceiptVerificationFlow,
|
|
19
|
+
} from "../../src/index.js";
|
|
20
|
+
|
|
21
|
+
function printFlow(flow: ReceiptVerificationFlow): void {
|
|
22
|
+
console.log("\n=== AUREON — Receipt → verification ===\n");
|
|
23
|
+
|
|
24
|
+
console.log("1. Claim — what the API/agent would call 'success'");
|
|
25
|
+
console.log(` Status: ${flow.phases.claimed.status}`);
|
|
26
|
+
console.log(` Result: ${flow.phases.claimed.result}`);
|
|
27
|
+
console.log(` Settlement: ${flow.phases.claimed.settlement}`);
|
|
28
|
+
console.log(` Summary: ${flow.phases.claimed.summary}\n`);
|
|
29
|
+
|
|
30
|
+
console.log("2. Validate — local honesty check (schema + settlement rules)");
|
|
31
|
+
console.log(` Valid: ${flow.phases.validation.valid}`);
|
|
32
|
+
if (!flow.phases.validation.valid) {
|
|
33
|
+
for (const issue of flow.phases.validation.issues) {
|
|
34
|
+
console.log(` - ${issue.code}: ${issue.message}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
console.log(` Proof tier: ${flow.proofTier}\n`);
|
|
38
|
+
|
|
39
|
+
console.log("3. Verify — independent settlement lookup (vault only)");
|
|
40
|
+
const settlement = flow.phases.settlement;
|
|
41
|
+
if (settlement) {
|
|
42
|
+
console.log(` On-chain: ${settlement.verifiedOnChain ? "yes" : "no"}`);
|
|
43
|
+
if (settlement.settlement) {
|
|
44
|
+
console.log(` Block: ${settlement.settlement.blockNumber}`);
|
|
45
|
+
console.log(` Explorer: ${settlement.settlement.explorerUrl}`);
|
|
46
|
+
} else {
|
|
47
|
+
console.log(" Record: (none yet — vault submitted but not observed)");
|
|
48
|
+
}
|
|
49
|
+
} else if (flow.receipt.settlement === "staged") {
|
|
50
|
+
console.log(" Staged receipt — schema-valid, not chain-verified by design.");
|
|
51
|
+
} else {
|
|
52
|
+
console.log(" Settlement lookup unavailable for this receipt.");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const timelineCount = flow.phases.timelineEvents?.length ?? 0;
|
|
56
|
+
if (timelineCount > 0) {
|
|
57
|
+
console.log(`\n Timeline: ${timelineCount} linked event(s)`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.log(`\n${flow.message}`);
|
|
61
|
+
console.log(
|
|
62
|
+
"\nSuccess text is a claim. Validation and settlement records are how you verify it.\n"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function main(): Promise<void> {
|
|
67
|
+
const apiKey = process.env.AUREON_API_KEY?.trim();
|
|
68
|
+
if (!apiKey) {
|
|
69
|
+
throw new Error("Set AUREON_API_KEY to an issued developer key.");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
73
|
+
const aureon = createAureonClient({
|
|
74
|
+
network: resolved.network,
|
|
75
|
+
baseUrl: resolved.baseUrl,
|
|
76
|
+
apiKey,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const flow = await aureon.runReceiptVerificationDemo();
|
|
80
|
+
printFlow(flow);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
main().catch((error) => {
|
|
84
|
+
if (isAureonError(error)) {
|
|
85
|
+
console.error(`${error.code}: ${error.message}`);
|
|
86
|
+
} else {
|
|
87
|
+
console.error(error);
|
|
88
|
+
}
|
|
89
|
+
process.exitCode = 1;
|
|
90
|
+
});
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Env:
|
|
5
5
|
* AUREON_API_KEY issued developer key (required)
|
|
6
|
-
*
|
|
6
|
+
* AUREON_NETWORK optional; omit for mainnet (4663 / 8788); set testnet for public host (still 46630)
|
|
7
|
+
* AUREON_API_URL optional override (must match network if both set)
|
|
7
8
|
*
|
|
8
9
|
* pnpm --filter @buildaureon/sdk example:sdk-demo-terminal
|
|
9
10
|
* pnpm --filter @buildaureon/sdk example:sdk-demo-terminal -- --create-only
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
14
|
createAureonClient,
|
|
14
|
-
|
|
15
|
+
resolveAureonNetworkFromEnv,
|
|
15
16
|
formatWeight,
|
|
16
17
|
isAureonError,
|
|
17
18
|
type PortfolioPositionInput,
|
|
@@ -74,7 +75,8 @@ async function main(): Promise<void> {
|
|
|
74
75
|
throw new Error("Set AUREON_API_KEY to an issued developer key.");
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
const
|
|
78
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
79
|
+
const baseUrl = resolved.baseUrl;
|
|
78
80
|
line(
|
|
79
81
|
"meta",
|
|
80
82
|
CREATE_ONLY
|
|
@@ -82,7 +84,7 @@ async function main(): Promise<void> {
|
|
|
82
84
|
: `@buildaureon/sdk · Automatic demo loop · ${baseUrl}`
|
|
83
85
|
);
|
|
84
86
|
|
|
85
|
-
const aureon = createAureonClient({ baseUrl, apiKey });
|
|
87
|
+
const aureon = createAureonClient({ network: resolved.network, baseUrl, apiKey });
|
|
86
88
|
|
|
87
89
|
line("cmd", "aureon.ping()");
|
|
88
90
|
const ping = await aureon.ping();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"objectives": [
|
|
3
|
-
{
|
|
4
|
-
"name": "Maintain 20% Stable Assets",
|
|
5
|
-
"kind": "stable_allocation",
|
|
6
|
-
"targetWeight": 0.2,
|
|
7
|
-
"tolerance": 0.02,
|
|
8
|
-
"priority": "high"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "Balanced Stock Token Sleeve",
|
|
12
|
-
"kind": "balanced_portfolio",
|
|
13
|
-
"targetWeight": 0.55,
|
|
14
|
-
"tolerance": 0.05,
|
|
15
|
-
"priority": "medium"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"objectives": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Maintain 20% Stable Assets",
|
|
5
|
+
"kind": "stable_allocation",
|
|
6
|
+
"targetWeight": 0.2,
|
|
7
|
+
"tolerance": 0.02,
|
|
8
|
+
"priority": "high"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "Balanced Stock Token Sleeve",
|
|
12
|
+
"kind": "balanced_portfolio",
|
|
13
|
+
"targetWeight": 0.55,
|
|
14
|
+
"tolerance": 0.05,
|
|
15
|
+
"priority": "medium"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"portfolioId": "portfolio_operator_primary",
|
|
3
|
-
"positions": [
|
|
4
|
-
{ "symbol": "USDG", "category": "stable", "quantity": 24000, "markPriceUsd": 1 },
|
|
5
|
-
{ "symbol": "NVDA", "category": "stock_token", "quantity": 45, "markPriceUsd": 920 },
|
|
6
|
-
{ "symbol": "AAPL", "category": "stock_token", "quantity": 80, "markPriceUsd": 210 },
|
|
7
|
-
{ "symbol": "GOOGL", "category": "stock_token", "quantity": 60, "markPriceUsd": 175 },
|
|
8
|
-
{ "symbol": "ETH", "category": "gas", "quantity": 8.5, "markPriceUsd": 3400 }
|
|
9
|
-
]
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"portfolioId": "portfolio_operator_primary",
|
|
3
|
+
"positions": [
|
|
4
|
+
{ "symbol": "USDG", "category": "stable", "quantity": 24000, "markPriceUsd": 1 },
|
|
5
|
+
{ "symbol": "NVDA", "category": "stock_token", "quantity": 45, "markPriceUsd": 920 },
|
|
6
|
+
{ "symbol": "AAPL", "category": "stock_token", "quantity": 80, "markPriceUsd": 210 },
|
|
7
|
+
{ "symbol": "GOOGL", "category": "stock_token", "quantity": 60, "markPriceUsd": 175 },
|
|
8
|
+
{ "symbol": "ETH", "category": "gas", "quantity": 8.5, "markPriceUsd": 3400 }
|
|
9
|
+
]
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,61 +1,70 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@buildaureon/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Official TypeScript SDK for AUREON Financial Compass on Robinhood Chain",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"README.md",
|
|
18
|
-
"LICENSE",
|
|
19
|
-
"docs",
|
|
20
|
-
"examples",
|
|
21
|
-
"config",
|
|
22
|
-
"fixtures"
|
|
23
|
-
],
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@buildaureon/sdk",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Official TypeScript SDK for AUREON Financial Compass on Robinhood Chain",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"docs",
|
|
20
|
+
"examples",
|
|
21
|
+
"config",
|
|
22
|
+
"fixtures"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"aureon",
|
|
26
|
+
"robinhood-chain",
|
|
27
|
+
"fco",
|
|
28
|
+
"financial-compass",
|
|
29
|
+
"sdk",
|
|
30
|
+
"typescript"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/buildaureon/aureon-sdk"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^22.13.10",
|
|
45
|
+
"tsup": "^8.4.0",
|
|
46
|
+
"tsx": "^4.19.3",
|
|
47
|
+
"typescript": "^5.8.2",
|
|
48
|
+
"viem": "^2.55.1"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup",
|
|
52
|
+
"dev": "tsup --watch",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
54
|
+
"test": "tsx --test tests/**/*.test.ts",
|
|
55
|
+
"bench": "tsx benchmarks/client-throughput.ts",
|
|
56
|
+
"example:quickstart": "tsx examples/quickstart/main.ts",
|
|
57
|
+
"example:market": "tsx examples/market-event/main.ts",
|
|
58
|
+
"example:green-vs-plan": "tsx examples/green-vs-plan/main.ts",
|
|
59
|
+
"example:ai-to-objective-to-portfolio": "tsx examples/ai-to-objective-to-portfolio/main.ts",
|
|
60
|
+
"example:drift-detect-restore": "tsx examples/drift-detect-restore/main.ts",
|
|
61
|
+
"example:receipt-verification": "tsx examples/receipt-verification/main.ts",
|
|
62
|
+
"example:portfolio-watch": "tsx examples/portfolio-watch/main.ts",
|
|
63
|
+
"example:full-aureon-loop": "tsx examples/full-aureon-loop/main.ts",
|
|
64
|
+
"example:audit-trail": "tsx examples/audit-trail/main.ts",
|
|
65
|
+
"example:sdk-demo-terminal": "tsx examples/sdk-demo-terminal/main.ts",
|
|
66
|
+
"example:e2e": "tsx examples/e2e-vault-flow/main.ts",
|
|
67
|
+
"example:e2e-policy": "tsx examples/e2e-policy-rebalance/main.ts",
|
|
68
|
+
"cli": "tsx cli/aureon-cli.ts"
|
|
69
|
+
}
|
|
70
|
+
}
|