blue-js-sdk 2.0.0
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 +446 -0
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/ai-path/ADMIN-ELEVATION.md +116 -0
- package/ai-path/AI-MANIFESTO.md +185 -0
- package/ai-path/BREAKING.md +74 -0
- package/ai-path/CHECKLIST.md +619 -0
- package/ai-path/CONNECTION-STEPS.md +724 -0
- package/ai-path/DECISION-TREE.md +378 -0
- package/ai-path/DEPENDENCIES.md +459 -0
- package/ai-path/E2E-FLOW.md +1555 -0
- package/ai-path/FAILURES.md +403 -0
- package/ai-path/GUIDE.md +1217 -0
- package/ai-path/README.md +558 -0
- package/ai-path/SPLIT-TUNNEL.md +266 -0
- package/ai-path/cli.js +535 -0
- package/ai-path/connect.js +884 -0
- package/ai-path/discover.js +178 -0
- package/ai-path/environment.js +266 -0
- package/ai-path/errors.js +86 -0
- package/ai-path/examples/autonomous-agent.mjs +220 -0
- package/ai-path/examples/multi-region.mjs +174 -0
- package/ai-path/examples/one-shot.mjs +31 -0
- package/ai-path/index.js +60 -0
- package/ai-path/pricing.js +136 -0
- package/ai-path/recommend.js +413 -0
- package/ai-path/run-admin.vbs +25 -0
- package/ai-path/setup.js +291 -0
- package/ai-path/wallet.js +137 -0
- package/app-helpers.js +363 -0
- package/app-settings.js +95 -0
- package/app-types.js +267 -0
- package/audit.js +847 -0
- package/batch.js +293 -0
- package/bin/setup.js +376 -0
- package/chain/authz.js +109 -0
- package/chain/broadcast.js +472 -0
- package/chain/client.js +160 -0
- package/chain/fee-grants.js +305 -0
- package/chain/index.js +891 -0
- package/chain/lcd.js +313 -0
- package/chain/queries.js +547 -0
- package/chain/rpc.js +408 -0
- package/chain/wallet.js +141 -0
- package/cli/config.js +143 -0
- package/cli/index.js +463 -0
- package/cli/output.js +182 -0
- package/cli.js +491 -0
- package/client/index.js +251 -0
- package/client.js +271 -0
- package/config/index.js +255 -0
- package/connection/connect.js +849 -0
- package/connection/disconnect.js +180 -0
- package/connection/discovery.js +321 -0
- package/connection/index.js +76 -0
- package/connection/proxy.js +148 -0
- package/connection/resilience.js +428 -0
- package/connection/security.js +232 -0
- package/connection/state.js +369 -0
- package/connection/tunnel.js +691 -0
- package/consumer.js +132 -0
- package/cosmjs-setup.js +1884 -0
- package/defaults.js +366 -0
- package/disk-cache.js +107 -0
- package/dist/client.d.ts +108 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +400 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/errors/index.js +112 -0
- package/errors.js +218 -0
- package/examples/README.md +64 -0
- package/examples/connect-direct.mjs +106 -0
- package/examples/connect-plan.mjs +125 -0
- package/examples/error-handling.mjs +109 -0
- package/examples/query-nodes.mjs +94 -0
- package/examples/wallet-basics.mjs +61 -0
- package/generated/amino/amino.ts +9 -0
- package/generated/cosmos/base/v1beta1/coin.ts +365 -0
- package/generated/cosmos_proto/cosmos.ts +323 -0
- package/generated/gogoproto/gogo.ts +9 -0
- package/generated/google/protobuf/descriptor.ts +7601 -0
- package/generated/google/protobuf/duration.ts +208 -0
- package/generated/google/protobuf/timestamp.ts +238 -0
- package/generated/sentinel/lease/v1/events.ts +924 -0
- package/generated/sentinel/lease/v1/lease.ts +292 -0
- package/generated/sentinel/lease/v1/msg.ts +949 -0
- package/generated/sentinel/lease/v1/params.ts +164 -0
- package/generated/sentinel/node/v3/events.ts +881 -0
- package/generated/sentinel/node/v3/msg.ts +1002 -0
- package/generated/sentinel/node/v3/node.ts +263 -0
- package/generated/sentinel/node/v3/params.ts +183 -0
- package/generated/sentinel/plan/v3/events.ts +675 -0
- package/generated/sentinel/plan/v3/msg.ts +1191 -0
- package/generated/sentinel/plan/v3/plan.ts +283 -0
- package/generated/sentinel/provider/v2/events.ts +171 -0
- package/generated/sentinel/provider/v2/msg.ts +480 -0
- package/generated/sentinel/provider/v2/params.ts +131 -0
- package/generated/sentinel/provider/v2/provider.ts +246 -0
- package/generated/sentinel/session/v3/events.ts +480 -0
- package/generated/sentinel/session/v3/msg.ts +616 -0
- package/generated/sentinel/session/v3/params.ts +260 -0
- package/generated/sentinel/session/v3/proof.ts +180 -0
- package/generated/sentinel/session/v3/session.ts +384 -0
- package/generated/sentinel/subscription/v3/events.ts +1181 -0
- package/generated/sentinel/subscription/v3/msg.ts +1305 -0
- package/generated/sentinel/subscription/v3/params.ts +167 -0
- package/generated/sentinel/subscription/v3/subscription.ts +315 -0
- package/generated/sentinel/types/v1/bandwidth.ts +124 -0
- package/generated/sentinel/types/v1/price.ts +149 -0
- package/generated/sentinel/types/v1/renewal.ts +87 -0
- package/generated/sentinel/types/v1/status.ts +54 -0
- package/generated/typeRegistry.ts +27 -0
- package/index.js +486 -0
- package/node-connect.js +3015 -0
- package/operator.js +134 -0
- package/package.json +113 -0
- package/plan-operations.js +199 -0
- package/preflight.js +352 -0
- package/pricing/index.js +262 -0
- package/proto/amino/amino.proto +84 -0
- package/proto/cosmos/base/v1beta1/coin.proto +61 -0
- package/proto/cosmos_proto/cosmos.proto +112 -0
- package/proto/gogoproto/gogo.proto +145 -0
- package/proto/google/api/annotations.proto +31 -0
- package/proto/google/api/http.proto +370 -0
- package/proto/google/protobuf/any.proto +106 -0
- package/proto/google/protobuf/duration.proto +115 -0
- package/proto/google/protobuf/timestamp.proto +145 -0
- package/proto/sentinel/lease/v1/events.proto +52 -0
- package/proto/sentinel/lease/v1/genesis.proto +15 -0
- package/proto/sentinel/lease/v1/lease.proto +25 -0
- package/proto/sentinel/lease/v1/msg.proto +62 -0
- package/proto/sentinel/lease/v1/params.proto +17 -0
- package/proto/sentinel/node/v3/events.proto +50 -0
- package/proto/sentinel/node/v3/genesis.proto +15 -0
- package/proto/sentinel/node/v3/msg.proto +63 -0
- package/proto/sentinel/node/v3/node.proto +27 -0
- package/proto/sentinel/node/v3/params.proto +21 -0
- package/proto/sentinel/node/v3/querier.proto +63 -0
- package/proto/sentinel/plan/v3/events.proto +41 -0
- package/proto/sentinel/plan/v3/genesis.proto +21 -0
- package/proto/sentinel/plan/v3/msg.proto +83 -0
- package/proto/sentinel/plan/v3/plan.proto +32 -0
- package/proto/sentinel/plan/v3/querier.proto +53 -0
- package/proto/sentinel/provider/v2/events.proto +16 -0
- package/proto/sentinel/provider/v2/genesis.proto +15 -0
- package/proto/sentinel/provider/v2/msg.proto +35 -0
- package/proto/sentinel/provider/v2/params.proto +17 -0
- package/proto/sentinel/provider/v2/provider.proto +24 -0
- package/proto/sentinel/provider/v3/genesis.proto +15 -0
- package/proto/sentinel/provider/v3/params.proto +13 -0
- package/proto/sentinel/session/v3/events.proto +30 -0
- package/proto/sentinel/session/v3/genesis.proto +15 -0
- package/proto/sentinel/session/v3/msg.proto +50 -0
- package/proto/sentinel/session/v3/params.proto +25 -0
- package/proto/sentinel/session/v3/proof.proto +25 -0
- package/proto/sentinel/session/v3/querier.proto +100 -0
- package/proto/sentinel/session/v3/session.proto +50 -0
- package/proto/sentinel/subscription/v2/allocation.proto +21 -0
- package/proto/sentinel/subscription/v2/payout.proto +22 -0
- package/proto/sentinel/subscription/v3/events.proto +65 -0
- package/proto/sentinel/subscription/v3/genesis.proto +17 -0
- package/proto/sentinel/subscription/v3/msg.proto +83 -0
- package/proto/sentinel/subscription/v3/params.proto +21 -0
- package/proto/sentinel/subscription/v3/subscription.proto +33 -0
- package/proto/sentinel/types/v1/bandwidth.proto +19 -0
- package/proto/sentinel/types/v1/price.proto +21 -0
- package/proto/sentinel/types/v1/renewal.proto +21 -0
- package/proto/sentinel/types/v1/status.proto +16 -0
- package/protocol/encoding.js +341 -0
- package/protocol/events.js +361 -0
- package/protocol/handshake.js +297 -0
- package/protocol/index.js +15 -0
- package/protocol/messages.js +346 -0
- package/protocol/plans.js +199 -0
- package/protocol/v2ray.js +268 -0
- package/protocol/v3.js +723 -0
- package/protocol/wireguard.js +125 -0
- package/security/index.js +132 -0
- package/session-manager.js +329 -0
- package/session-tracker.js +80 -0
- package/setup.js +376 -0
- package/speedtest/index.js +528 -0
- package/speedtest.js +567 -0
- package/src/client.ts +502 -0
- package/src/index.ts +20 -0
- package/state/index.js +347 -0
- package/state.js +516 -0
- package/test-all-chain-ops.js +493 -0
- package/test-all-logic.js +199 -0
- package/test-all-msg-types.js +292 -0
- package/test-every-connection.js +208 -0
- package/test-feegrant-connect.js +98 -0
- package/test-logic.js +148 -0
- package/test-mainnet.js +176 -0
- package/test-plan-lifecycle.js +335 -0
- package/tls-trust.js +132 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +34 -0
- package/types/chain.d.ts +746 -0
- package/types/connection.d.ts +425 -0
- package/types/errors.d.ts +174 -0
- package/types/index.d.ts +1380 -0
- package/types/nodes.d.ts +187 -0
- package/types/pricing.d.ts +156 -0
- package/types/protocol.d.ts +332 -0
- package/types/session.d.ts +236 -0
- package/types/settings.d.ts +192 -0
- package/v3protocol.js +1053 -0
- package/wallet/index.js +153 -0
- package/wireguard.js +307 -0
package/consumer.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sentinel dVPN SDK — Consumer Entry Point
|
|
3
|
+
*
|
|
4
|
+
* ~50 exports for VPN app developers: connect, disconnect, wallet, security, settings.
|
|
5
|
+
* One session, one node, one user. No batch/audit/operator functions.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { connect, disconnect, listNodes, getBalance } from 'sentinel-dvpn-sdk/consumer';
|
|
9
|
+
*
|
|
10
|
+
* For operator/testing functions (batch sessions, audit, plan management):
|
|
11
|
+
* import { batchStartSessions, auditNetwork } from 'sentinel-dvpn-sdk/operator';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// ─── Connection ─────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
connectDirect as connect,
|
|
18
|
+
connectDirect,
|
|
19
|
+
connectAuto,
|
|
20
|
+
connectViaPlan,
|
|
21
|
+
connectViaSubscription,
|
|
22
|
+
disconnect,
|
|
23
|
+
isConnected,
|
|
24
|
+
getStatus,
|
|
25
|
+
quickConnect,
|
|
26
|
+
autoReconnect,
|
|
27
|
+
tryFastReconnect,
|
|
28
|
+
verifyConnection,
|
|
29
|
+
verifyDependencies,
|
|
30
|
+
registerCleanupHandlers,
|
|
31
|
+
recoverSession,
|
|
32
|
+
} from './node-connect.js';
|
|
33
|
+
|
|
34
|
+
// ─── Discovery ──────────────────────────────────────────────────────────────
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
queryOnlineNodes as listNodes,
|
|
38
|
+
queryOnlineNodes,
|
|
39
|
+
fetchAllNodes,
|
|
40
|
+
enrichNodes,
|
|
41
|
+
buildNodeIndex,
|
|
42
|
+
flushNodeCache,
|
|
43
|
+
} from './node-connect.js';
|
|
44
|
+
|
|
45
|
+
// ─── Wallet ─────────────────────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
createWallet,
|
|
49
|
+
generateWallet,
|
|
50
|
+
getBalance,
|
|
51
|
+
privKeyFromMnemonic,
|
|
52
|
+
isMnemonicValid,
|
|
53
|
+
} from './cosmjs-setup.js';
|
|
54
|
+
|
|
55
|
+
// ─── Security ───────────────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
enableKillSwitch,
|
|
59
|
+
disableKillSwitch,
|
|
60
|
+
isKillSwitchEnabled,
|
|
61
|
+
enableDnsLeakPrevention,
|
|
62
|
+
disableDnsLeakPrevention,
|
|
63
|
+
} from './node-connect.js';
|
|
64
|
+
|
|
65
|
+
// ─── Session ────────────────────────────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
export { SessionManager } from './session-manager.js';
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
findExistingSession,
|
|
71
|
+
} from './cosmjs-setup.js';
|
|
72
|
+
|
|
73
|
+
// ─── Settings ───────────────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
loadAppSettings,
|
|
77
|
+
saveAppSettings,
|
|
78
|
+
resetAppSettings,
|
|
79
|
+
APP_SETTINGS_DEFAULTS,
|
|
80
|
+
} from './app-settings.js';
|
|
81
|
+
|
|
82
|
+
// ─── Errors ─────────────────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
SentinelError,
|
|
86
|
+
ValidationError,
|
|
87
|
+
NodeError,
|
|
88
|
+
ChainError,
|
|
89
|
+
TunnelError,
|
|
90
|
+
SecurityError,
|
|
91
|
+
ErrorCodes,
|
|
92
|
+
ERROR_SEVERITY,
|
|
93
|
+
isRetryable,
|
|
94
|
+
userMessage,
|
|
95
|
+
} from './errors.js';
|
|
96
|
+
|
|
97
|
+
// ─── Helpers (country, pricing, display) ────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
countryNameToCode,
|
|
101
|
+
getFlagUrl,
|
|
102
|
+
getFlagEmoji,
|
|
103
|
+
formatPriceP2P,
|
|
104
|
+
formatNodePricing,
|
|
105
|
+
estimateSessionPrice,
|
|
106
|
+
buildNodeDisplay,
|
|
107
|
+
groupNodesByCountry,
|
|
108
|
+
computeSessionAllocation,
|
|
109
|
+
} from './app-helpers.js';
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
formatBytes,
|
|
113
|
+
} from './cosmjs-setup.js';
|
|
114
|
+
|
|
115
|
+
// ─── Speed Testing ──────────────────────────────────────────────────────────
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
speedtestDirect,
|
|
119
|
+
speedtestViaSocks5,
|
|
120
|
+
} from './speedtest.js';
|
|
121
|
+
|
|
122
|
+
// ─── Client ─────────────────────────────────────────────────────────────────
|
|
123
|
+
|
|
124
|
+
export { SentinelClient } from './client.js';
|
|
125
|
+
|
|
126
|
+
// ─── State Persistence ──────────────────────────────────────────────────────
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
saveState,
|
|
130
|
+
loadState,
|
|
131
|
+
clearState,
|
|
132
|
+
} from './state.js';
|