@buildaureon/sdk 0.1.7 → 0.1.9

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,75 @@
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 Developers
6
+ * AUREON_NETWORK optional; omit for official API / testnet 46630; set mainnet for chain 4663
7
+ * AUREON_API_URL optional override (must match network if both set)
8
+ *
9
+ * pnpm --filter @buildaureon/sdk example:quickstart
10
+ */
11
+
12
+ import {
13
+ createAureonClient,
14
+ formatWeight,
15
+ isAureonError,
16
+ resolveAureonNetworkFromEnv,
17
+ } from "../../src/index.js";
18
+
19
+ async function main(): Promise<void> {
20
+ const apiKey = process.env.AUREON_API_KEY?.trim();
21
+ if (!apiKey) {
22
+ throw new Error(
23
+ "Set AUREON_API_KEY to an issued developer key from the AUREON Developers page."
24
+ );
25
+ }
26
+
27
+ const resolved = resolveAureonNetworkFromEnv();
28
+ const aureon = createAureonClient({
29
+ network: resolved.network,
30
+ baseUrl: resolved.baseUrl,
31
+ apiKey,
32
+ });
33
+
34
+ const ping = await aureon.ping();
35
+ console.log("connected", ping);
36
+
37
+ const me = await aureon.me();
38
+ console.log("wallet", me.walletAddress);
39
+
40
+ const synced = await aureon.syncPortfolio();
41
+ console.log("synced", {
42
+ chainId: synced.chainId,
43
+ positions: synced.portfolio.positions.length,
44
+ stableWeight: formatWeight(synced.portfolio.stableWeight),
45
+ });
46
+
47
+ const vault = await aureon.getVaultStatus();
48
+ console.log("vault", {
49
+ empty: vault.empty,
50
+ canRestore: vault.canRestore,
51
+ totalNotionalUsd: vault.totalNotionalUsd,
52
+ });
53
+
54
+ const objectives = await aureon.listObjectives();
55
+ console.log(
56
+ "objectives",
57
+ objectives.map((o) => ({
58
+ name: o.name,
59
+ automationMode: o.automationMode,
60
+ }))
61
+ );
62
+
63
+ console.log(
64
+ "hint: empty vault restore is 409. prepare-deposit is unsigned — the user broadcasts when they fund. Agents do not."
65
+ );
66
+ }
67
+
68
+ main().catch((error) => {
69
+ if (isAureonError(error)) {
70
+ console.error(`${error.code}: ${error.message}`);
71
+ } else {
72
+ console.error(error instanceof Error ? error.message : error);
73
+ }
74
+ process.exitCode = 1;
75
+ });
@@ -5,14 +5,15 @@
5
5
  *
6
6
  * Env:
7
7
  * AUREON_API_KEY issued developer key (required)
8
- * AUREON_API_URL optional (default https://api.aureonlabs.network)
8
+ * AUREON_NETWORK optional; omit for official API / testnet 46630; set mainnet for chain 4663
9
+ * AUREON_API_URL optional override (must match network if both set)
9
10
  *
10
11
  * pnpm example:receipt-verification
11
12
  */
12
13
 
13
14
  import {
14
15
  createAureonClient,
15
- DEFAULT_API_BASE_URL,
16
+ resolveAureonNetworkFromEnv,
16
17
  isAureonError,
17
18
  type ReceiptVerificationFlow,
18
19
  } from "../../src/index.js";
@@ -68,8 +69,10 @@ async function main(): Promise<void> {
68
69
  throw new Error("Set AUREON_API_KEY to an issued developer key.");
69
70
  }
70
71
 
72
+ const resolved = resolveAureonNetworkFromEnv();
71
73
  const aureon = createAureonClient({
72
- baseUrl: process.env.AUREON_API_URL?.trim() || DEFAULT_API_BASE_URL,
74
+ network: resolved.network,
75
+ baseUrl: resolved.baseUrl,
73
76
  apiKey,
74
77
  });
75
78
 
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Env:
5
5
  * AUREON_API_KEY issued developer key (required)
6
- * AUREON_API_URL optional (default https://api.aureonlabs.network)
6
+ * AUREON_NETWORK optional; omit for official API / testnet 46630; set mainnet for chain 4663
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
- DEFAULT_API_BASE_URL,
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 baseUrl = process.env.AUREON_API_URL?.trim() || DEFAULT_API_BASE_URL;
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildaureon/sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Official TypeScript SDK for AUREON Financial Compass on Robinhood Chain",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,33 +15,13 @@
15
15
  "files": [
16
16
  "dist",
17
17
  "README.md",
18
+ "CHANGELOG.md",
18
19
  "LICENSE",
19
20
  "docs",
20
21
  "examples",
21
22
  "config",
22
23
  "fixtures"
23
24
  ],
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:green-vs-plan": "tsx examples/green-vs-plan/main.ts",
33
- "example:ai-to-objective-to-portfolio": "tsx examples/ai-to-objective-to-portfolio/main.ts",
34
- "example:drift-detect-restore": "tsx examples/drift-detect-restore/main.ts",
35
- "example:receipt-verification": "tsx examples/receipt-verification/main.ts",
36
- "example:portfolio-watch": "tsx examples/portfolio-watch/main.ts",
37
- "example:full-aureon-loop": "tsx examples/full-aureon-loop/main.ts",
38
- "example:audit-trail": "tsx examples/audit-trail/main.ts",
39
- "example:sdk-demo-terminal": "tsx examples/sdk-demo-terminal/main.ts",
40
- "example:e2e": "tsx examples/e2e-vault-flow/main.ts",
41
- "example:e2e-policy": "tsx examples/e2e-policy-rebalance/main.ts",
42
- "cli": "tsx cli/aureon-cli.ts",
43
- "prepublishOnly": "pnpm build"
44
- },
45
25
  "keywords": [
46
26
  "aureon",
47
27
  "robinhood-chain",
@@ -55,6 +35,9 @@
55
35
  "url": "https://github.com/buildaureon/aureon-sdk"
56
36
  },
57
37
  "license": "MIT",
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
58
41
  "engines": {
59
42
  "node": ">=20"
60
43
  },
@@ -64,5 +47,25 @@
64
47
  "tsx": "^4.19.3",
65
48
  "typescript": "^5.8.2",
66
49
  "viem": "^2.55.1"
50
+ },
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "dev": "tsup --watch",
54
+ "typecheck": "tsc -p tsconfig.json --noEmit",
55
+ "test": "tsx --test tests/**/*.test.ts",
56
+ "bench": "tsx benchmarks/client-throughput.ts",
57
+ "example:quickstart": "tsx examples/quickstart/main.ts",
58
+ "example:market": "tsx examples/market-event/main.ts",
59
+ "example:green-vs-plan": "tsx examples/green-vs-plan/main.ts",
60
+ "example:ai-to-objective-to-portfolio": "tsx examples/ai-to-objective-to-portfolio/main.ts",
61
+ "example:drift-detect-restore": "tsx examples/drift-detect-restore/main.ts",
62
+ "example:receipt-verification": "tsx examples/receipt-verification/main.ts",
63
+ "example:portfolio-watch": "tsx examples/portfolio-watch/main.ts",
64
+ "example:full-aureon-loop": "tsx examples/full-aureon-loop/main.ts",
65
+ "example:audit-trail": "tsx examples/audit-trail/main.ts",
66
+ "example:sdk-demo-terminal": "tsx examples/sdk-demo-terminal/main.ts",
67
+ "example:e2e": "tsx examples/e2e-vault-flow/main.ts",
68
+ "example:e2e-policy": "tsx examples/e2e-policy-rebalance/main.ts",
69
+ "cli": "tsx cli/aureon-cli.ts"
67
70
  }
68
- }
71
+ }