@augustdigital/sdk 8.15.0 → 8.16.1
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/lib/adapters/solana/constants.d.ts +12 -4
- package/lib/adapters/solana/constants.js +23 -6
- package/lib/adapters/solana/idl/vault-idl.d.ts +103 -169
- package/lib/adapters/solana/idl/vault-idl.js +461 -475
- package/lib/adapters/solana/index.d.ts +40 -5
- package/lib/adapters/solana/index.js +47 -3
- package/lib/adapters/solana/utils.d.ts +1 -4
- package/lib/adapters/solana/utils.js +24 -10
- package/lib/core/analytics/method-taxonomy.js +4 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/modules/vaults/getters.d.ts +34 -0
- package/lib/modules/vaults/getters.js +57 -41
- package/lib/modules/vaults/utils.d.ts +19 -1
- package/lib/modules/vaults/utils.js +30 -0
- package/lib/sdk.d.ts +1645 -1474
- package/lib/types/vaults.d.ts +88 -0
- package/lib/types/webserver.d.ts +47 -0
- package/package.json +2 -1
|
@@ -15,11 +15,19 @@ declare const programIds: {
|
|
|
15
15
|
"mainnet-beta": {
|
|
16
16
|
vault: string;
|
|
17
17
|
};
|
|
18
|
-
testnet: {
|
|
19
|
-
vault: string;
|
|
20
|
-
};
|
|
21
18
|
localnet: {
|
|
22
19
|
vault: string;
|
|
23
20
|
};
|
|
24
21
|
};
|
|
25
|
-
|
|
22
|
+
/** Solana networks the canonical august_vault program is actually deployed on. */
|
|
23
|
+
type ISolanaDeployedNetwork = keyof typeof programIds;
|
|
24
|
+
/**
|
|
25
|
+
* Program ids for `network`, or `undefined` when the canonical program has no
|
|
26
|
+
* deployment there (currently `testnet`). Callers must handle `undefined` —
|
|
27
|
+
* silently substituting a default would hand back a dead address.
|
|
28
|
+
*/
|
|
29
|
+
declare function getDeployedProgramIds(network: ISolanaNetwork): {
|
|
30
|
+
vault: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
export { fallbackDecimals, fallbackNetwork, fallbackRpcEndpoints, getDeployedProgramIds, programIds, vaultIdl, };
|
|
33
|
+
export type { ISolanaDeployedNetwork };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultIdl = exports.programIds = exports.fallbackRpcEndpoints = exports.fallbackNetwork = exports.fallbackDecimals = void 0;
|
|
4
|
+
exports.getDeployedProgramIds = getDeployedProgramIds;
|
|
4
5
|
const vault_idl_1 = require("./idl/vault-idl");
|
|
5
6
|
Object.defineProperty(exports, "vaultIdl", { enumerable: true, get: function () { return vault_idl_1.vaultIdl; } });
|
|
6
7
|
const fallbackDecimals = 8;
|
|
@@ -17,19 +18,35 @@ const fallbackRpcEndpoints = {
|
|
|
17
18
|
localnet: 'http://127.0.0.1:8899',
|
|
18
19
|
};
|
|
19
20
|
exports.fallbackRpcEndpoints = fallbackRpcEndpoints;
|
|
21
|
+
// The shared, canonical august_vault program (multi-vault), deployed under the
|
|
22
|
+
// same id (`up12…`) on devnet and mainnet-beta. Per-vault program deploys (e.g.
|
|
23
|
+
// the legacy SyrupBTC `7B8n…`, and the interim devnet `C8B1…`) are retired. At
|
|
24
|
+
// runtime the program id is resolved from backend vault metadata; this map is
|
|
25
|
+
// the default/fallback.
|
|
26
|
+
//
|
|
27
|
+
// Deliberately partial: no `testnet` entry — the program isn't deployed there,
|
|
28
|
+
// and mapping it would hand callers a dead address that only fails deep inside a
|
|
29
|
+
// transaction. Unmapped networks throw from `getProgram`/`getProgramId` instead.
|
|
30
|
+
// `satisfies` keeps the literal ids in the generated docs while checking keys
|
|
31
|
+
// against ISolanaNetwork, so `testnet` is absent from the type, not optional.
|
|
20
32
|
const programIds = {
|
|
21
33
|
devnet: {
|
|
22
|
-
vault: '
|
|
34
|
+
vault: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
|
|
23
35
|
},
|
|
24
36
|
['mainnet-beta']: {
|
|
25
|
-
vault: '
|
|
26
|
-
},
|
|
27
|
-
testnet: {
|
|
28
|
-
vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
|
|
37
|
+
vault: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
|
|
29
38
|
},
|
|
30
39
|
localnet: {
|
|
31
|
-
vault: '
|
|
40
|
+
vault: 'up12bytoZBmwofqsySf2uqKQ7zpfeKiAWwfvqzJjtRt',
|
|
32
41
|
},
|
|
33
42
|
};
|
|
34
43
|
exports.programIds = programIds;
|
|
44
|
+
/**
|
|
45
|
+
* Program ids for `network`, or `undefined` when the canonical program has no
|
|
46
|
+
* deployment there (currently `testnet`). Callers must handle `undefined` —
|
|
47
|
+
* silently substituting a default would hand back a dead address.
|
|
48
|
+
*/
|
|
49
|
+
function getDeployedProgramIds(network) {
|
|
50
|
+
return programIds[network];
|
|
51
|
+
}
|
|
35
52
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,88 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* august_vault program IDL (Anchor).
|
|
3
|
+
*
|
|
4
|
+
* GENERATED — do not edit by hand. The versioned multi-vault interface the SDK
|
|
5
|
+
* targets, generated from the devnet on-chain IDL of `C8B1…` — the only
|
|
6
|
+
* deployment that publishes one matching this file. Refresh with
|
|
7
|
+
* `anchor idl fetch C8B1… -u devnet`.
|
|
8
|
+
*
|
|
9
|
+
* At runtime the SDK targets the canonical `up12…` instead, whose own published
|
|
10
|
+
* IDL is STALE (an Anchor IDL upload is not refreshed by a program upgrade), so
|
|
11
|
+
* it can't be used as the generation source. The solana-idl-drift check (CI)
|
|
12
|
+
* therefore validates `up12…` by pinning its deployed binary and by decoding
|
|
13
|
+
* live VaultState accounts against this file — see
|
|
14
|
+
* tests/vaults/solana-idl-drift.test.ts.
|
|
15
|
+
*
|
|
16
|
+
* `address` is a build stamp (the mainnet id), NOT network-aware. Never rely on
|
|
17
|
+
* it: SolanaAdapter/getProgram resolve the real program id per network from
|
|
18
|
+
* programIds, or from an explicit `programId` override.
|
|
19
|
+
*/
|
|
1
20
|
export declare const vaultIdl: {
|
|
2
|
-
|
|
3
|
-
|
|
21
|
+
accounts: {
|
|
22
|
+
discriminator: number[];
|
|
4
23
|
name: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
24
|
+
}[];
|
|
25
|
+
address: string;
|
|
26
|
+
errors: {
|
|
27
|
+
code: number;
|
|
28
|
+
msg: string;
|
|
10
29
|
name: string;
|
|
11
|
-
|
|
30
|
+
}[];
|
|
31
|
+
events: {
|
|
12
32
|
discriminator: number[];
|
|
13
|
-
accounts: ({
|
|
14
|
-
name: string;
|
|
15
|
-
writable: boolean;
|
|
16
|
-
pda: {
|
|
17
|
-
seeds: {
|
|
18
|
-
kind: string;
|
|
19
|
-
value: number[];
|
|
20
|
-
}[];
|
|
21
|
-
};
|
|
22
|
-
signer?: undefined;
|
|
23
|
-
address?: undefined;
|
|
24
|
-
} | {
|
|
25
|
-
name: string;
|
|
26
|
-
signer: boolean;
|
|
27
|
-
writable?: undefined;
|
|
28
|
-
pda?: undefined;
|
|
29
|
-
address?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
name: string;
|
|
32
|
-
writable: boolean;
|
|
33
|
-
pda?: undefined;
|
|
34
|
-
signer?: undefined;
|
|
35
|
-
address?: undefined;
|
|
36
|
-
} | {
|
|
37
|
-
name: string;
|
|
38
|
-
address: string;
|
|
39
|
-
writable?: undefined;
|
|
40
|
-
pda?: undefined;
|
|
41
|
-
signer?: undefined;
|
|
42
|
-
})[];
|
|
43
|
-
args: any[];
|
|
44
|
-
} | {
|
|
45
33
|
name: string;
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
}[];
|
|
35
|
+
instructions: ({
|
|
48
36
|
accounts: ({
|
|
49
37
|
name: string;
|
|
50
|
-
writable: boolean;
|
|
51
38
|
signer: boolean;
|
|
39
|
+
writable: boolean;
|
|
52
40
|
docs?: undefined;
|
|
53
41
|
pda?: undefined;
|
|
54
42
|
address?: undefined;
|
|
55
43
|
} | {
|
|
56
|
-
name: string;
|
|
57
44
|
docs: string[];
|
|
58
|
-
|
|
45
|
+
name: string;
|
|
59
46
|
signer: boolean;
|
|
47
|
+
writable: boolean;
|
|
60
48
|
pda?: undefined;
|
|
61
49
|
address?: undefined;
|
|
62
50
|
} | {
|
|
63
|
-
name: string;
|
|
64
51
|
docs: string[];
|
|
52
|
+
name: string;
|
|
65
53
|
writable: boolean;
|
|
66
|
-
pda: {
|
|
67
|
-
seeds: {
|
|
68
|
-
kind: string;
|
|
69
|
-
value: number[];
|
|
70
|
-
}[];
|
|
71
|
-
program?: undefined;
|
|
72
|
-
};
|
|
73
54
|
signer?: undefined;
|
|
55
|
+
pda?: undefined;
|
|
74
56
|
address?: undefined;
|
|
75
57
|
} | {
|
|
76
|
-
name: string;
|
|
77
58
|
docs: string[];
|
|
78
|
-
|
|
59
|
+
name: string;
|
|
79
60
|
signer?: undefined;
|
|
61
|
+
writable?: undefined;
|
|
80
62
|
pda?: undefined;
|
|
81
63
|
address?: undefined;
|
|
82
64
|
} | {
|
|
83
65
|
name: string;
|
|
84
|
-
writable: boolean;
|
|
85
66
|
pda: {
|
|
67
|
+
program: {
|
|
68
|
+
kind: string;
|
|
69
|
+
value: number[];
|
|
70
|
+
};
|
|
86
71
|
seeds: ({
|
|
87
72
|
kind: string;
|
|
88
73
|
value: number[];
|
|
@@ -92,19 +77,16 @@ export declare const vaultIdl: {
|
|
|
92
77
|
path: string;
|
|
93
78
|
value?: undefined;
|
|
94
79
|
})[];
|
|
95
|
-
program: {
|
|
96
|
-
kind: string;
|
|
97
|
-
value: number[];
|
|
98
|
-
};
|
|
99
80
|
};
|
|
81
|
+
writable: boolean;
|
|
100
82
|
signer?: undefined;
|
|
101
83
|
docs?: undefined;
|
|
102
84
|
address?: undefined;
|
|
103
85
|
} | {
|
|
104
|
-
name: string;
|
|
105
86
|
address: string;
|
|
106
|
-
|
|
87
|
+
name: string;
|
|
107
88
|
signer?: undefined;
|
|
89
|
+
writable?: undefined;
|
|
108
90
|
docs?: undefined;
|
|
109
91
|
pda?: undefined;
|
|
110
92
|
})[];
|
|
@@ -112,80 +94,75 @@ export declare const vaultIdl: {
|
|
|
112
94
|
name: string;
|
|
113
95
|
type: string;
|
|
114
96
|
}[];
|
|
115
|
-
} | {
|
|
116
|
-
name: string;
|
|
117
|
-
docs: string[];
|
|
118
97
|
discriminator: number[];
|
|
98
|
+
docs: string[];
|
|
99
|
+
name: string;
|
|
100
|
+
} | {
|
|
119
101
|
accounts: ({
|
|
120
102
|
name: string;
|
|
121
103
|
writable: boolean;
|
|
122
|
-
pda: {
|
|
123
|
-
seeds: ({
|
|
124
|
-
kind: string;
|
|
125
|
-
value: number[];
|
|
126
|
-
path?: undefined;
|
|
127
|
-
} | {
|
|
128
|
-
kind: string;
|
|
129
|
-
path: string;
|
|
130
|
-
value?: undefined;
|
|
131
|
-
})[];
|
|
132
|
-
};
|
|
133
104
|
signer?: undefined;
|
|
105
|
+
address?: undefined;
|
|
134
106
|
} | {
|
|
135
107
|
name: string;
|
|
136
|
-
writable
|
|
137
|
-
pda?: undefined;
|
|
108
|
+
writable?: undefined;
|
|
138
109
|
signer?: undefined;
|
|
110
|
+
address?: undefined;
|
|
139
111
|
} | {
|
|
140
112
|
name: string;
|
|
141
|
-
writable: boolean;
|
|
142
113
|
signer: boolean;
|
|
143
|
-
|
|
114
|
+
writable?: undefined;
|
|
115
|
+
address?: undefined;
|
|
144
116
|
} | {
|
|
117
|
+
name: string;
|
|
118
|
+
signer: boolean;
|
|
119
|
+
writable: boolean;
|
|
120
|
+
address?: undefined;
|
|
121
|
+
} | {
|
|
122
|
+
address: string;
|
|
145
123
|
name: string;
|
|
146
124
|
writable?: undefined;
|
|
147
|
-
pda?: undefined;
|
|
148
125
|
signer?: undefined;
|
|
149
126
|
})[];
|
|
150
127
|
args: {
|
|
151
128
|
name: string;
|
|
152
129
|
type: string;
|
|
153
130
|
}[];
|
|
154
|
-
} | {
|
|
155
|
-
name: string;
|
|
156
|
-
docs: string[];
|
|
157
131
|
discriminator: number[];
|
|
132
|
+
docs: string[];
|
|
133
|
+
name: string;
|
|
134
|
+
} | {
|
|
158
135
|
accounts: ({
|
|
159
136
|
name: string;
|
|
160
137
|
writable: boolean;
|
|
138
|
+
pda?: undefined;
|
|
139
|
+
signer?: undefined;
|
|
140
|
+
} | {
|
|
141
|
+
name: string;
|
|
161
142
|
pda: {
|
|
162
|
-
|
|
143
|
+
program: {
|
|
163
144
|
kind: string;
|
|
164
145
|
value: number[];
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
};
|
|
147
|
+
seeds: ({
|
|
167
148
|
kind: string;
|
|
168
149
|
path: string;
|
|
169
150
|
value?: undefined;
|
|
151
|
+
} | {
|
|
152
|
+
kind: string;
|
|
153
|
+
value: number[];
|
|
154
|
+
path?: undefined;
|
|
170
155
|
})[];
|
|
171
156
|
};
|
|
157
|
+
writable: boolean;
|
|
172
158
|
signer?: undefined;
|
|
173
|
-
address?: undefined;
|
|
174
|
-
} | {
|
|
175
|
-
name: string;
|
|
176
|
-
writable?: undefined;
|
|
177
|
-
pda?: undefined;
|
|
178
|
-
signer?: undefined;
|
|
179
|
-
address?: undefined;
|
|
180
159
|
} | {
|
|
181
160
|
name: string;
|
|
182
|
-
writable: boolean;
|
|
183
161
|
signer: boolean;
|
|
162
|
+
writable?: undefined;
|
|
184
163
|
pda?: undefined;
|
|
185
|
-
address?: undefined;
|
|
186
164
|
} | {
|
|
187
165
|
name: string;
|
|
188
|
-
address: string;
|
|
189
166
|
writable?: undefined;
|
|
190
167
|
pda?: undefined;
|
|
191
168
|
signer?: undefined;
|
|
@@ -194,52 +171,38 @@ export declare const vaultIdl: {
|
|
|
194
171
|
name: string;
|
|
195
172
|
type: string;
|
|
196
173
|
}[];
|
|
197
|
-
} | {
|
|
198
|
-
name: string;
|
|
199
|
-
docs: string[];
|
|
200
174
|
discriminator: number[];
|
|
175
|
+
docs: string[];
|
|
176
|
+
name: string;
|
|
177
|
+
} | {
|
|
201
178
|
accounts: ({
|
|
202
|
-
|
|
203
|
-
writable: boolean;
|
|
204
|
-
pda: {
|
|
205
|
-
seeds: {
|
|
206
|
-
kind: string;
|
|
207
|
-
value: number[];
|
|
208
|
-
}[];
|
|
209
|
-
};
|
|
210
|
-
signer?: undefined;
|
|
211
|
-
address?: undefined;
|
|
212
|
-
} | {
|
|
179
|
+
docs: string[];
|
|
213
180
|
name: string;
|
|
214
181
|
signer: boolean;
|
|
215
182
|
writable?: undefined;
|
|
216
183
|
pda?: undefined;
|
|
217
184
|
address?: undefined;
|
|
218
185
|
} | {
|
|
186
|
+
docs: string[];
|
|
219
187
|
name: string;
|
|
220
188
|
writable: boolean;
|
|
221
|
-
signer
|
|
189
|
+
signer?: undefined;
|
|
222
190
|
pda?: undefined;
|
|
223
191
|
address?: undefined;
|
|
224
192
|
} | {
|
|
193
|
+
docs: string[];
|
|
225
194
|
name: string;
|
|
226
|
-
|
|
195
|
+
signer?: undefined;
|
|
227
196
|
writable?: undefined;
|
|
228
197
|
pda?: undefined;
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
args: {
|
|
232
|
-
name: string;
|
|
233
|
-
type: string;
|
|
234
|
-
}[];
|
|
235
|
-
} | {
|
|
236
|
-
name: string;
|
|
237
|
-
docs: string[];
|
|
238
|
-
discriminator: number[];
|
|
239
|
-
accounts: ({
|
|
198
|
+
address?: undefined;
|
|
199
|
+
} | {
|
|
240
200
|
name: string;
|
|
241
|
-
writable: boolean;
|
|
242
201
|
pda: {
|
|
202
|
+
program: {
|
|
203
|
+
kind: string;
|
|
204
|
+
value: number[];
|
|
205
|
+
};
|
|
243
206
|
seeds: ({
|
|
244
207
|
kind: string;
|
|
245
208
|
value: number[];
|
|
@@ -249,79 +212,49 @@ export declare const vaultIdl: {
|
|
|
249
212
|
path: string;
|
|
250
213
|
value?: undefined;
|
|
251
214
|
})[];
|
|
252
|
-
program?: undefined;
|
|
253
215
|
};
|
|
254
|
-
signer?: undefined;
|
|
255
|
-
} | {
|
|
256
|
-
name: string;
|
|
257
216
|
writable: boolean;
|
|
258
|
-
|
|
259
|
-
seeds: ({
|
|
260
|
-
kind: string;
|
|
261
|
-
path: string;
|
|
262
|
-
value?: undefined;
|
|
263
|
-
} | {
|
|
264
|
-
kind: string;
|
|
265
|
-
value: number[];
|
|
266
|
-
path?: undefined;
|
|
267
|
-
})[];
|
|
268
|
-
program: {
|
|
269
|
-
kind: string;
|
|
270
|
-
value: number[];
|
|
271
|
-
};
|
|
272
|
-
};
|
|
217
|
+
docs?: undefined;
|
|
273
218
|
signer?: undefined;
|
|
219
|
+
address?: undefined;
|
|
274
220
|
} | {
|
|
221
|
+
address: string;
|
|
275
222
|
name: string;
|
|
276
|
-
|
|
277
|
-
pda?: undefined;
|
|
223
|
+
docs?: undefined;
|
|
278
224
|
signer?: undefined;
|
|
279
|
-
} | {
|
|
280
|
-
name: string;
|
|
281
|
-
signer: boolean;
|
|
282
225
|
writable?: undefined;
|
|
283
226
|
pda?: undefined;
|
|
284
|
-
} | {
|
|
285
|
-
name: string;
|
|
286
|
-
writable?: undefined;
|
|
287
|
-
pda?: undefined;
|
|
288
|
-
signer?: undefined;
|
|
289
227
|
})[];
|
|
290
228
|
args: {
|
|
291
229
|
name: string;
|
|
292
230
|
type: string;
|
|
293
231
|
}[];
|
|
294
|
-
})[];
|
|
295
|
-
accounts: {
|
|
296
|
-
name: string;
|
|
297
232
|
discriminator: number[];
|
|
298
|
-
|
|
299
|
-
events: {
|
|
233
|
+
docs: string[];
|
|
300
234
|
name: string;
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
code: number;
|
|
235
|
+
})[];
|
|
236
|
+
metadata: {
|
|
237
|
+
description: string;
|
|
305
238
|
name: string;
|
|
306
|
-
|
|
307
|
-
|
|
239
|
+
spec: string;
|
|
240
|
+
version: string;
|
|
241
|
+
};
|
|
308
242
|
types: ({
|
|
309
243
|
name: string;
|
|
310
|
-
serialization: string;
|
|
311
244
|
repr: {
|
|
312
245
|
kind: string;
|
|
313
246
|
};
|
|
247
|
+
serialization: string;
|
|
314
248
|
type: {
|
|
315
|
-
kind: string;
|
|
316
249
|
fields: {
|
|
317
250
|
name: string;
|
|
318
251
|
type: string;
|
|
319
252
|
}[];
|
|
253
|
+
kind: string;
|
|
320
254
|
};
|
|
321
255
|
} | {
|
|
322
256
|
name: string;
|
|
323
257
|
type: {
|
|
324
|
-
kind: string;
|
|
325
258
|
fields: ({
|
|
326
259
|
name: string;
|
|
327
260
|
type: string;
|
|
@@ -331,8 +264,9 @@ export declare const vaultIdl: {
|
|
|
331
264
|
array: (string | number)[];
|
|
332
265
|
};
|
|
333
266
|
})[];
|
|
267
|
+
kind: string;
|
|
334
268
|
};
|
|
335
|
-
serialization?: undefined;
|
|
336
269
|
repr?: undefined;
|
|
270
|
+
serialization?: undefined;
|
|
337
271
|
})[];
|
|
338
272
|
};
|