@buildaureon/sdk 0.1.1 → 0.1.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.
@@ -1,72 +1,72 @@
1
- /**
2
- * @fileoverview Quickstart — control-plane calls with an issued developer API key.
3
- *
4
- * Env (required for integrators — nothing else):
5
- * AUREON_API_KEY issued key from https://app.aureonlabs.network → Developers
6
- * AUREON_API_URL optional (default https://api.aureonlabs.network)
7
- *
8
- * pnpm --filter @buildaureon/sdk example:quickstart
9
- */
10
-
11
- import {
12
- createAureonClient,
13
- DEFAULT_API_BASE_URL,
14
- formatWeight,
15
- isAureonError,
16
- } from "../../src/index.js";
17
-
18
- async function main(): Promise<void> {
19
- const apiKey = process.env.AUREON_API_KEY?.trim();
20
- if (!apiKey) {
21
- throw new Error(
22
- "Set AUREON_API_KEY to an issued developer key from the AUREON Developers page."
23
- );
24
- }
25
-
26
- const aureon = createAureonClient({
27
- baseUrl: process.env.AUREON_API_URL?.trim() || DEFAULT_API_BASE_URL,
28
- apiKey,
29
- });
30
-
31
- const ping = await aureon.ping();
32
- console.log("connected", ping);
33
-
34
- const me = await aureon.me();
35
- console.log("wallet", me.walletAddress);
36
-
37
- const synced = await aureon.syncPortfolio();
38
- console.log("synced", {
39
- chainId: synced.chainId,
40
- positions: synced.portfolio.positions.length,
41
- stableWeight: formatWeight(synced.portfolio.stableWeight),
42
- });
43
-
44
- const vault = await aureon.getVaultStatus();
45
- console.log("vault", {
46
- empty: vault.empty,
47
- canRestore: vault.canRestore,
48
- totalNotionalUsd: vault.totalNotionalUsd,
49
- });
50
-
51
- const objectives = await aureon.listObjectives();
52
- console.log(
53
- "objectives",
54
- objectives.map((o) => ({
55
- name: o.name,
56
- automationMode: o.automationMode,
57
- }))
58
- );
59
-
60
- console.log(
61
- "hint: private key is only needed later to broadcast prepare-deposit / prepare-withdraw steps"
62
- );
63
- }
64
-
65
- main().catch((error) => {
66
- if (isAureonError(error)) {
67
- console.error(`${error.code}: ${error.message}`);
68
- } else {
69
- console.error(error instanceof Error ? error.message : error);
70
- }
71
- process.exitCode = 1;
72
- });
1
+ /**
2
+ * @fileoverview Quickstart — control-plane calls with an issued developer API key.
3
+ *
4
+ * Env (required for integrators — nothing else):
5
+ * AUREON_API_KEY issued key from https://app.aureonlabs.network → Developers
6
+ * AUREON_API_URL optional (default https://api.aureonlabs.network)
7
+ *
8
+ * pnpm --filter @buildaureon/sdk example:quickstart
9
+ */
10
+
11
+ import {
12
+ createAureonClient,
13
+ DEFAULT_API_BASE_URL,
14
+ formatWeight,
15
+ isAureonError,
16
+ } from "../../src/index.js";
17
+
18
+ async function main(): Promise<void> {
19
+ const apiKey = process.env.AUREON_API_KEY?.trim();
20
+ if (!apiKey) {
21
+ throw new Error(
22
+ "Set AUREON_API_KEY to an issued developer key from the AUREON Developers page."
23
+ );
24
+ }
25
+
26
+ const aureon = createAureonClient({
27
+ baseUrl: process.env.AUREON_API_URL?.trim() || DEFAULT_API_BASE_URL,
28
+ apiKey,
29
+ });
30
+
31
+ const ping = await aureon.ping();
32
+ console.log("connected", ping);
33
+
34
+ const me = await aureon.me();
35
+ console.log("wallet", me.walletAddress);
36
+
37
+ const synced = await aureon.syncPortfolio();
38
+ console.log("synced", {
39
+ chainId: synced.chainId,
40
+ positions: synced.portfolio.positions.length,
41
+ stableWeight: formatWeight(synced.portfolio.stableWeight),
42
+ });
43
+
44
+ const vault = await aureon.getVaultStatus();
45
+ console.log("vault", {
46
+ empty: vault.empty,
47
+ canRestore: vault.canRestore,
48
+ totalNotionalUsd: vault.totalNotionalUsd,
49
+ });
50
+
51
+ const objectives = await aureon.listObjectives();
52
+ console.log(
53
+ "objectives",
54
+ objectives.map((o) => ({
55
+ name: o.name,
56
+ automationMode: o.automationMode,
57
+ }))
58
+ );
59
+
60
+ console.log(
61
+ "hint: private key is only needed later to broadcast prepare-deposit / prepare-withdraw steps"
62
+ );
63
+ }
64
+
65
+ main().catch((error) => {
66
+ if (isAureonError(error)) {
67
+ console.error(`${error.code}: ${error.message}`);
68
+ } else {
69
+ console.error(error instanceof Error ? error.message : error);
70
+ }
71
+ process.exitCode = 1;
72
+ });
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Phase 2 — prepare on-chain objective registration (wallet signs broadcast).
3
+ *
4
+ * Usage:
5
+ * AUREON_API_KEY=aur_... npx tsx examples/registry-register/main.ts
6
+ */
7
+ import { createAureonClient } from "../../src/client/factory.js";
8
+
9
+ async function main() {
10
+ const apiKey = process.env.AUREON_API_KEY?.trim();
11
+ if (!apiKey) {
12
+ console.error("Set AUREON_API_KEY");
13
+ process.exit(1);
14
+ }
15
+
16
+ const client = createAureonClient({ apiKey });
17
+ const status = await client.getRegistryStatus();
18
+ console.log("registry status", status);
19
+
20
+ const { objectives } = await client.listObjectives();
21
+ const target = objectives[0];
22
+ if (!target) {
23
+ console.error("Create an objective first");
24
+ process.exit(1);
25
+ }
26
+
27
+ const lookup = await client.getObjectiveRegistry(target.id);
28
+ if (lookup.registered) {
29
+ console.log("already registered", lookup.record);
30
+ return;
31
+ }
32
+
33
+ const prepared = await client.prepareObjectiveRegistry(target.id);
34
+ console.log("Sign and broadcast this tx from your wallet:");
35
+ console.log(JSON.stringify(prepared, null, 2));
36
+ console.log(
37
+ "Then: client.confirmObjectiveRegistry(objectiveId, transactionHash)"
38
+ );
39
+ }
40
+
41
+ main().catch((err) => {
42
+ console.error(err);
43
+ process.exit(1);
44
+ });
@@ -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,61 @@
1
- {
2
- "name": "@buildaureon/sdk",
3
- "version": "0.1.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
- "scripts": {
25
- "build": "tsup",
26
- "dev": "tsup --watch",
27
- "typecheck": "tsc -p tsconfig.json --noEmit",
28
- "test": "tsx --test tests/**/*.test.ts",
29
- "bench": "tsx benchmarks/client-throughput.ts",
30
- "example:quickstart": "tsx examples/quickstart/main.ts",
31
- "example:market": "tsx examples/market-event/main.ts",
32
- "example:sdk-demo-terminal": "tsx examples/sdk-demo-terminal/main.ts",
33
- "example:e2e": "tsx examples/e2e-vault-flow/main.ts",
34
- "example:e2e-policy": "tsx examples/e2e-policy-rebalance/main.ts",
35
- "cli": "tsx cli/aureon-cli.ts",
36
- "prepublishOnly": "pnpm build"
37
- },
38
- "keywords": [
39
- "aureon",
40
- "robinhood-chain",
41
- "fco",
42
- "financial-compass",
43
- "sdk",
44
- "typescript"
45
- ],
46
- "repository": {
47
- "type": "git",
48
- "url": "https://github.com/buildaureon/aureon-sdk"
49
- },
50
- "license": "MIT",
51
- "engines": {
52
- "node": ">=20"
53
- },
54
- "devDependencies": {
55
- "@types/node": "^22.13.10",
56
- "tsup": "^8.4.0",
57
- "tsx": "^4.19.3",
58
- "typescript": "^5.8.2",
59
- "viem": "^2.55.1"
60
- }
61
- }
1
+ {
2
+ "name": "@buildaureon/sdk",
3
+ "version": "0.1.2",
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
+ "scripts": {
25
+ "build": "tsup",
26
+ "dev": "tsup --watch",
27
+ "typecheck": "tsc -p tsconfig.json --noEmit",
28
+ "test": "tsx --test tests/**/*.test.ts",
29
+ "bench": "tsx benchmarks/client-throughput.ts",
30
+ "example:quickstart": "tsx examples/quickstart/main.ts",
31
+ "example:market": "tsx examples/market-event/main.ts",
32
+ "example:sdk-demo-terminal": "tsx examples/sdk-demo-terminal/main.ts",
33
+ "example:e2e": "tsx examples/e2e-vault-flow/main.ts",
34
+ "example:e2e-policy": "tsx examples/e2e-policy-rebalance/main.ts",
35
+ "cli": "tsx cli/aureon-cli.ts",
36
+ "prepublishOnly": "pnpm build"
37
+ },
38
+ "keywords": [
39
+ "aureon",
40
+ "robinhood-chain",
41
+ "fco",
42
+ "financial-compass",
43
+ "sdk",
44
+ "typescript"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/buildaureon/aureon-sdk"
49
+ },
50
+ "license": "MIT",
51
+ "engines": {
52
+ "node": ">=20"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^22.13.10",
56
+ "tsup": "^8.4.0",
57
+ "tsx": "^4.19.3",
58
+ "typescript": "^5.8.2",
59
+ "viem": "^2.55.1"
60
+ }
61
+ }