-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperator.js
More file actions
160 lines (131 loc) · 5.16 KB
/
operator.js
File metadata and controls
160 lines (131 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
* Sentinel dVPN SDK — Operator Entry Point
*
* ~70 exports for operators, testers, plan managers, and auditing tools.
* Batch sessions, network audit, plan/provider/lease management, fee grants, authz.
*
* Usage:
* import { batchStartSessions, auditNetwork } from 'sentinel-dvpn-sdk/operator';
*
* For consumer VPN app functions (connect, disconnect, wallet, security):
* import { connect, disconnect, listNodes } from 'sentinel-dvpn-sdk/consumer';
*
* WARNING: These functions can cost real P2P tokens in bulk. They are NOT for
* end-user VPN apps. A consumer app accidentally using batchStartSessions
* will drain the wallet.
*/
// ─── Batch Session Operations ───────────────────────────────────────────────
export {
batchStartSessions,
waitForBatchSessions,
} from './batch.js';
export {
buildBatchStartSession,
extractAllSessionIds,
} from './cosmjs-setup.js';
// ─── Network Audit & Node Testing ──────────────────────────────────────────
export {
testNode,
auditNetwork,
loadTransportCache,
saveTransportCache,
recordTransportSuccess,
recordTransportFailure,
} from './audit.js';
// ─── Plan Management ────────────────────────────────────────────────────────
export {
encodeMsgCreatePlan,
encodeMsgUpdatePlanStatus,
encodeMsgLinkNode,
encodeMsgUnlinkNode,
encodeMsgPlanStartSession,
} from './plan-operations.js';
export {
encodeMsgUpdatePlanDetails,
} from './v3protocol.js';
// ─── Provider Management ────────────────────────────────────────────────────
export {
encodeMsgRegisterProvider,
encodeMsgUpdateProviderDetails,
encodeMsgUpdateProviderStatus,
} from './plan-operations.js';
// ─── Lease Management ───────────────────────────────────────────────────────
export {
encodeMsgStartLease,
encodeMsgEndLease,
} from './plan-operations.js';
// ─── Fee Grants ─────────────────────────────────────────────────────────────
export {
buildFeeGrantMsg,
buildRevokeFeeGrantMsg,
queryFeeGrants,
queryFeeGrantsIssued,
grantPlanSubscribers,
renewExpiringGrants,
monitorFeeGrants,
streamGrantPlanSubscribers,
computeFeeGrantGasCosts,
} from './cosmjs-setup.js';
export {
batchRevokeFeeGrants,
} from './operator/batch-revoke.js';
export {
queryFeeGrantHistory,
decodeFeeGrantEvent,
attr,
} from './operator/feegrant-history.js';
// ─── Authz ──────────────────────────────────────────────────────────────────
export {
buildAuthzGrantMsg,
buildAuthzRevokeMsg,
buildAuthzExecMsg,
encodeForExec,
queryAuthzGrants,
} from './cosmjs-setup.js';
// ─── Chain Direct (broadcast, registry, LCD) ────────────────────────────────
export {
broadcast,
broadcastWithFeeGrant,
createSafeBroadcaster,
createClient,
buildRegistry,
lcd,
MSG_TYPES,
} from './cosmjs-setup.js';
// ─── Address Conversion ─────────────────────────────────────────────────────
export {
sentToSentprov,
sentToSentnode,
sentprovToSent,
} from './cosmjs-setup.js';
// ─── Query Helpers (plans, subscriptions, network) ──────────────────────────
export {
discoverPlans,
queryPlanSubscribers,
getPlanStats,
queryPlanNodes,
getNetworkOverview,
} from './cosmjs-setup.js';
// ─── Session Encoders ───────────────────────────────────────────────────────
export {
encodeMsgStartSession,
encodeMsgEndSession,
encodeMsgStartSubscription,
encodeMsgSubStartSession,
encodeMsgCancelSubscription,
encodeMsgRenewSubscription,
encodeMsgShareSubscription,
encodeMsgUpdateSubscription,
encodeMsgUpdateSession,
} from './v3protocol.js';
// ─── Lease Batch Utilities ───────────────────────────────────────────────────
export {
autoLeaseNode,
batchLeaseNodes,
} from './operator/auto-lease.js';
// ─── Plan Ownership Pre-Flight ──────────────────────────────────────────────
export {
assertPlanOwnership,
PlanOwnershipError,
walletToProviderAddr,
} from './operator/plan-ownership.js';