@star-factory/sdk-vault 1.0.1 → 1.0.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.
- package/dist/core/idl/vault.json +400 -3
- package/dist/core/types/index.d.ts +297 -4
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +112 -1
- package/dist/core/types/index.js.map +1 -1
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +1 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/relay/index.d.ts +141 -0
- package/dist/features/relay/index.d.ts.map +1 -0
- package/dist/features/relay/index.js +270 -0
- package/dist/features/relay/index.js.map +1 -0
- package/dist/features/vault/StarVault.d.ts +41 -19
- package/dist/features/vault/StarVault.d.ts.map +1 -1
- package/dist/features/vault/StarVault.js +98 -16
- package/dist/features/vault/StarVault.js.map +1 -1
- package/dist/features/vault/make/presets.d.ts +10 -0
- package/dist/features/vault/make/presets.d.ts.map +1 -1
- package/dist/features/vault/make/presets.js +18 -0
- package/dist/features/vault/make/presets.js.map +1 -1
- package/dist/idl/vault.json +400 -3
- package/package.json +1 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction Relay Utilities for Gasless/Sponsored Transactions
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for implementing a transaction relay service
|
|
5
|
+
* that sponsors transaction fees for depositor actions (deposit, claim refund,
|
|
6
|
+
* claim excess refund, upgrade tier, claim dust).
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* 1. Frontend builds transaction with feePayer = sponsorPubkey
|
|
10
|
+
* 2. User signs the transaction (authorizes their action)
|
|
11
|
+
* 3. Frontend sends partially-signed tx to relay backend
|
|
12
|
+
* 4. Relay validates, signs with sponsor keypair, submits to Solana
|
|
13
|
+
*
|
|
14
|
+
* Security Considerations:
|
|
15
|
+
* - Always validate that only allowed programs are being called
|
|
16
|
+
* - Implement rate limiting to prevent abuse
|
|
17
|
+
* - Consider allowlisting users/vaults for sponsorship
|
|
18
|
+
* - Monitor sponsor wallet balance and alert on low funds
|
|
19
|
+
*/
|
|
20
|
+
import { Connection, Keypair, PublicKey, Transaction } from '@solana/web3.js';
|
|
21
|
+
/**
|
|
22
|
+
* Default vault program ID (v4 on devnet).
|
|
23
|
+
* Override with your program ID in production.
|
|
24
|
+
*/
|
|
25
|
+
export declare const VAULT_PROGRAM_ID: PublicKey;
|
|
26
|
+
/**
|
|
27
|
+
* Programs allowed in sponsored transactions (besides the vault program).
|
|
28
|
+
*/
|
|
29
|
+
export declare const ALLOWED_ANCILLARY_PROGRAMS: PublicKey[];
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for the relay service.
|
|
32
|
+
*/
|
|
33
|
+
export interface RelayConfig {
|
|
34
|
+
/** Solana RPC connection */
|
|
35
|
+
connection: Connection;
|
|
36
|
+
/** Sponsor keypair that pays transaction fees */
|
|
37
|
+
sponsorKeypair: Keypair;
|
|
38
|
+
/** Vault program ID to allow */
|
|
39
|
+
vaultProgramId?: PublicKey;
|
|
40
|
+
/** Additional program IDs to allow (default: system, token, ATA, compute budget) */
|
|
41
|
+
additionalAllowedPrograms?: PublicKey[];
|
|
42
|
+
/** Optional rate limit (max txs per user per minute) */
|
|
43
|
+
rateLimitPerMinute?: number;
|
|
44
|
+
/** Optional vault allowlist (only sponsor txs for these vaults) */
|
|
45
|
+
vaultAllowlist?: PublicKey[];
|
|
46
|
+
/** Optional user allowlist (only sponsor txs for these users) */
|
|
47
|
+
userAllowlist?: PublicKey[];
|
|
48
|
+
/** Skip preflight simulation (default: false) */
|
|
49
|
+
skipPreflight?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Result of relay submission.
|
|
53
|
+
*/
|
|
54
|
+
export interface RelayResult {
|
|
55
|
+
success: boolean;
|
|
56
|
+
signature?: string;
|
|
57
|
+
error?: string;
|
|
58
|
+
/** Simulation logs if available */
|
|
59
|
+
logs?: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Validation result for a sponsored transaction.
|
|
63
|
+
*/
|
|
64
|
+
export interface ValidationResult {
|
|
65
|
+
valid: boolean;
|
|
66
|
+
error?: string;
|
|
67
|
+
/** Extracted vault pubkey from the transaction (if found) */
|
|
68
|
+
vault?: PublicKey;
|
|
69
|
+
/** Extracted user pubkey from the transaction (if found) */
|
|
70
|
+
user?: PublicKey;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Validate that a transaction is safe to sponsor.
|
|
74
|
+
*
|
|
75
|
+
* Checks:
|
|
76
|
+
* 1. Fee payer matches sponsor
|
|
77
|
+
* 2. Only allowed programs are called
|
|
78
|
+
* 3. Transaction is not expired
|
|
79
|
+
*
|
|
80
|
+
* @param tx - The partially-signed transaction
|
|
81
|
+
* @param config - Relay configuration
|
|
82
|
+
* @returns Validation result
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateSponsoredTransaction(tx: Transaction, config: RelayConfig): ValidationResult;
|
|
85
|
+
/**
|
|
86
|
+
* Sign and submit a sponsored transaction.
|
|
87
|
+
*
|
|
88
|
+
* @param tx - The partially-signed transaction (user has signed)
|
|
89
|
+
* @param config - Relay configuration
|
|
90
|
+
* @returns Result with signature or error
|
|
91
|
+
*/
|
|
92
|
+
export declare function submitSponsoredTransaction(tx: Transaction, config: RelayConfig): Promise<RelayResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Deserialize a base64-encoded transaction.
|
|
95
|
+
*
|
|
96
|
+
* @param txBase64 - Base64-encoded serialized transaction
|
|
97
|
+
* @returns Deserialized transaction
|
|
98
|
+
*/
|
|
99
|
+
export declare function deserializeTransaction(txBase64: string): Transaction;
|
|
100
|
+
/**
|
|
101
|
+
* Create a relay handler function for use in API routes.
|
|
102
|
+
*
|
|
103
|
+
* Example usage in Next.js API route:
|
|
104
|
+
* ```ts
|
|
105
|
+
* // pages/api/relay/submit.ts
|
|
106
|
+
* import { createRelayHandler } from '@star-vault/sdk';
|
|
107
|
+
*
|
|
108
|
+
* const handler = createRelayHandler({
|
|
109
|
+
* connection: new Connection(process.env.RPC_URL!),
|
|
110
|
+
* sponsorKeypair: Keypair.fromSecretKey(Buffer.from(process.env.SPONSOR_SECRET!, 'base64')),
|
|
111
|
+
* rateLimitPerMinute: 10,
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* export default handler;
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @param config - Relay configuration
|
|
118
|
+
* @returns Handler function for HTTP requests
|
|
119
|
+
*/
|
|
120
|
+
export declare function createRelayHandler(config: RelayConfig): (request: {
|
|
121
|
+
body: {
|
|
122
|
+
transaction: string;
|
|
123
|
+
};
|
|
124
|
+
headers?: {
|
|
125
|
+
"x-user-pubkey"?: string;
|
|
126
|
+
};
|
|
127
|
+
}) => Promise<RelayResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Check sponsor wallet balance and return warning if low.
|
|
130
|
+
*
|
|
131
|
+
* @param connection - Solana connection
|
|
132
|
+
* @param sponsorPubkey - Sponsor wallet public key
|
|
133
|
+
* @param minBalanceSol - Minimum balance in SOL to consider "healthy" (default: 1 SOL)
|
|
134
|
+
* @returns Object with balance info and warning if applicable
|
|
135
|
+
*/
|
|
136
|
+
export declare function checkSponsorBalance(connection: Connection, sponsorPubkey: PublicKey, minBalanceSol?: number): Promise<{
|
|
137
|
+
balanceLamports: number;
|
|
138
|
+
balanceSol: number;
|
|
139
|
+
warning?: string;
|
|
140
|
+
}>;
|
|
141
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/relay/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EAET,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AAQzB;;;GA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BAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAGpE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,IAItC,SAAS;IACrB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC,KAAG,OAAO,CAAC,WAAW,CAAC,CA6CzB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,SAAS,EACxB,aAAa,GAAE,MAAU,GACxB,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAe5E"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Transaction Relay Utilities for Gasless/Sponsored Transactions
|
|
4
|
+
*
|
|
5
|
+
* This module provides utilities for implementing a transaction relay service
|
|
6
|
+
* that sponsors transaction fees for depositor actions (deposit, claim refund,
|
|
7
|
+
* claim excess refund, upgrade tier, claim dust).
|
|
8
|
+
*
|
|
9
|
+
* Architecture:
|
|
10
|
+
* 1. Frontend builds transaction with feePayer = sponsorPubkey
|
|
11
|
+
* 2. User signs the transaction (authorizes their action)
|
|
12
|
+
* 3. Frontend sends partially-signed tx to relay backend
|
|
13
|
+
* 4. Relay validates, signs with sponsor keypair, submits to Solana
|
|
14
|
+
*
|
|
15
|
+
* Security Considerations:
|
|
16
|
+
* - Always validate that only allowed programs are being called
|
|
17
|
+
* - Implement rate limiting to prevent abuse
|
|
18
|
+
* - Consider allowlisting users/vaults for sponsorship
|
|
19
|
+
* - Monitor sponsor wallet balance and alert on low funds
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ALLOWED_ANCILLARY_PROGRAMS = exports.VAULT_PROGRAM_ID = void 0;
|
|
23
|
+
exports.validateSponsoredTransaction = validateSponsoredTransaction;
|
|
24
|
+
exports.submitSponsoredTransaction = submitSponsoredTransaction;
|
|
25
|
+
exports.deserializeTransaction = deserializeTransaction;
|
|
26
|
+
exports.createRelayHandler = createRelayHandler;
|
|
27
|
+
exports.checkSponsorBalance = checkSponsorBalance;
|
|
28
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
29
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
30
|
+
const web3_js_2 = require("@solana/web3.js");
|
|
31
|
+
/**
|
|
32
|
+
* Default vault program ID (v4 on devnet).
|
|
33
|
+
* Override with your program ID in production.
|
|
34
|
+
*/
|
|
35
|
+
exports.VAULT_PROGRAM_ID = new web3_js_1.PublicKey('2izCb6E5VNBa8NMFnKZhDmBptMCv7TyUNjkwFwrvf44B');
|
|
36
|
+
/**
|
|
37
|
+
* Programs allowed in sponsored transactions (besides the vault program).
|
|
38
|
+
*/
|
|
39
|
+
exports.ALLOWED_ANCILLARY_PROGRAMS = [
|
|
40
|
+
web3_js_1.SystemProgram.programId,
|
|
41
|
+
spl_token_1.TOKEN_PROGRAM_ID,
|
|
42
|
+
spl_token_1.TOKEN_2022_PROGRAM_ID,
|
|
43
|
+
spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
44
|
+
web3_js_2.ComputeBudgetProgram.programId,
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* Validate that a transaction is safe to sponsor.
|
|
48
|
+
*
|
|
49
|
+
* Checks:
|
|
50
|
+
* 1. Fee payer matches sponsor
|
|
51
|
+
* 2. Only allowed programs are called
|
|
52
|
+
* 3. Transaction is not expired
|
|
53
|
+
*
|
|
54
|
+
* @param tx - The partially-signed transaction
|
|
55
|
+
* @param config - Relay configuration
|
|
56
|
+
* @returns Validation result
|
|
57
|
+
*/
|
|
58
|
+
function validateSponsoredTransaction(tx, config) {
|
|
59
|
+
const vaultProgramId = config.vaultProgramId ?? exports.VAULT_PROGRAM_ID;
|
|
60
|
+
const allowedPrograms = [
|
|
61
|
+
vaultProgramId,
|
|
62
|
+
...exports.ALLOWED_ANCILLARY_PROGRAMS,
|
|
63
|
+
...(config.additionalAllowedPrograms ?? []),
|
|
64
|
+
];
|
|
65
|
+
// 1. Verify fee payer matches sponsor
|
|
66
|
+
if (!tx.feePayer?.equals(config.sponsorKeypair.publicKey)) {
|
|
67
|
+
return {
|
|
68
|
+
valid: false,
|
|
69
|
+
error: `Invalid fee payer. Expected ${config.sponsorKeypair.publicKey.toBase58()}, got ${tx.feePayer?.toBase58() ?? 'none'}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// 2. Verify only allowed programs are being called
|
|
73
|
+
let vaultPubkey;
|
|
74
|
+
let userPubkey;
|
|
75
|
+
for (const ix of tx.instructions) {
|
|
76
|
+
const isAllowed = allowedPrograms.some((p) => p.equals(ix.programId));
|
|
77
|
+
if (!isAllowed) {
|
|
78
|
+
return {
|
|
79
|
+
valid: false,
|
|
80
|
+
error: `Unauthorized program: ${ix.programId.toBase58()}`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Extract vault and user from vault program instructions
|
|
84
|
+
if (ix.programId.equals(vaultProgramId)) {
|
|
85
|
+
// In vault instructions, vault is typically the 2nd account (index 1)
|
|
86
|
+
// and user is the 1st account (index 0)
|
|
87
|
+
// This is a heuristic - adjust based on your instruction layout
|
|
88
|
+
if (ix.keys.length >= 2) {
|
|
89
|
+
userPubkey = ix.keys[0].pubkey;
|
|
90
|
+
vaultPubkey = ix.keys[1].pubkey;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// 3. Check vault allowlist if configured
|
|
95
|
+
if (config.vaultAllowlist && config.vaultAllowlist.length > 0 && vaultPubkey) {
|
|
96
|
+
const isVaultAllowed = config.vaultAllowlist.some((v) => v.equals(vaultPubkey));
|
|
97
|
+
if (!isVaultAllowed) {
|
|
98
|
+
return {
|
|
99
|
+
valid: false,
|
|
100
|
+
error: `Vault ${vaultPubkey.toBase58()} is not in sponsorship allowlist`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 4. Check user allowlist if configured
|
|
105
|
+
if (config.userAllowlist && config.userAllowlist.length > 0 && userPubkey) {
|
|
106
|
+
const isUserAllowed = config.userAllowlist.some((u) => u.equals(userPubkey));
|
|
107
|
+
if (!isUserAllowed) {
|
|
108
|
+
return {
|
|
109
|
+
valid: false,
|
|
110
|
+
error: `User ${userPubkey.toBase58()} is not in sponsorship allowlist`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
valid: true,
|
|
116
|
+
vault: vaultPubkey,
|
|
117
|
+
user: userPubkey,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Sign and submit a sponsored transaction.
|
|
122
|
+
*
|
|
123
|
+
* @param tx - The partially-signed transaction (user has signed)
|
|
124
|
+
* @param config - Relay configuration
|
|
125
|
+
* @returns Result with signature or error
|
|
126
|
+
*/
|
|
127
|
+
async function submitSponsoredTransaction(tx, config) {
|
|
128
|
+
// Validate first
|
|
129
|
+
const validation = validateSponsoredTransaction(tx, config);
|
|
130
|
+
if (!validation.valid) {
|
|
131
|
+
return {
|
|
132
|
+
success: false,
|
|
133
|
+
error: validation.error,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
// Sign with sponsor keypair
|
|
138
|
+
tx.partialSign(config.sponsorKeypair);
|
|
139
|
+
// Get fresh blockhash if not set
|
|
140
|
+
if (!tx.recentBlockhash) {
|
|
141
|
+
const { blockhash } = await config.connection.getLatestBlockhash();
|
|
142
|
+
tx.recentBlockhash = blockhash;
|
|
143
|
+
}
|
|
144
|
+
// Submit to Solana
|
|
145
|
+
const signature = await config.connection.sendRawTransaction(tx.serialize(), {
|
|
146
|
+
skipPreflight: config.skipPreflight ?? false,
|
|
147
|
+
preflightCommitment: 'confirmed',
|
|
148
|
+
});
|
|
149
|
+
// Optionally wait for confirmation
|
|
150
|
+
const confirmation = await config.connection.confirmTransaction(signature, 'confirmed');
|
|
151
|
+
if (confirmation.value.err) {
|
|
152
|
+
return {
|
|
153
|
+
success: false,
|
|
154
|
+
signature,
|
|
155
|
+
error: `Transaction failed: ${JSON.stringify(confirmation.value.err)}`,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
success: true,
|
|
160
|
+
signature,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
const err = error;
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
error: err.message ?? String(error),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Deserialize a base64-encoded transaction.
|
|
173
|
+
*
|
|
174
|
+
* @param txBase64 - Base64-encoded serialized transaction
|
|
175
|
+
* @returns Deserialized transaction
|
|
176
|
+
*/
|
|
177
|
+
function deserializeTransaction(txBase64) {
|
|
178
|
+
const buffer = Buffer.from(txBase64, 'base64');
|
|
179
|
+
return web3_js_1.Transaction.from(buffer);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Create a relay handler function for use in API routes.
|
|
183
|
+
*
|
|
184
|
+
* Example usage in Next.js API route:
|
|
185
|
+
* ```ts
|
|
186
|
+
* // pages/api/relay/submit.ts
|
|
187
|
+
* import { createRelayHandler } from '@star-vault/sdk';
|
|
188
|
+
*
|
|
189
|
+
* const handler = createRelayHandler({
|
|
190
|
+
* connection: new Connection(process.env.RPC_URL!),
|
|
191
|
+
* sponsorKeypair: Keypair.fromSecretKey(Buffer.from(process.env.SPONSOR_SECRET!, 'base64')),
|
|
192
|
+
* rateLimitPerMinute: 10,
|
|
193
|
+
* });
|
|
194
|
+
*
|
|
195
|
+
* export default handler;
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @param config - Relay configuration
|
|
199
|
+
* @returns Handler function for HTTP requests
|
|
200
|
+
*/
|
|
201
|
+
function createRelayHandler(config) {
|
|
202
|
+
// Simple in-memory rate limiter (use Redis in production)
|
|
203
|
+
const rateLimitMap = new Map();
|
|
204
|
+
return async (request) => {
|
|
205
|
+
const { transaction: txBase64 } = request.body;
|
|
206
|
+
if (!txBase64) {
|
|
207
|
+
return {
|
|
208
|
+
success: false,
|
|
209
|
+
error: 'Missing transaction in request body',
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
// Rate limiting
|
|
213
|
+
if (config.rateLimitPerMinute) {
|
|
214
|
+
const userKey = request.headers?.['x-user-pubkey'] ?? 'anonymous';
|
|
215
|
+
const now = Date.now();
|
|
216
|
+
const entry = rateLimitMap.get(userKey);
|
|
217
|
+
if (entry) {
|
|
218
|
+
if (now < entry.resetTime) {
|
|
219
|
+
if (entry.count >= config.rateLimitPerMinute) {
|
|
220
|
+
return {
|
|
221
|
+
success: false,
|
|
222
|
+
error: 'Rate limit exceeded. Please try again later.',
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
entry.count++;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
// Reset window
|
|
229
|
+
rateLimitMap.set(userKey, { count: 1, resetTime: now + 60_000 });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
rateLimitMap.set(userKey, { count: 1, resetTime: now + 60_000 });
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
const tx = deserializeTransaction(txBase64);
|
|
238
|
+
return await submitSponsoredTransaction(tx, config);
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
const err = error;
|
|
242
|
+
return {
|
|
243
|
+
success: false,
|
|
244
|
+
error: `Failed to process transaction: ${err.message ?? String(error)}`,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Check sponsor wallet balance and return warning if low.
|
|
251
|
+
*
|
|
252
|
+
* @param connection - Solana connection
|
|
253
|
+
* @param sponsorPubkey - Sponsor wallet public key
|
|
254
|
+
* @param minBalanceSol - Minimum balance in SOL to consider "healthy" (default: 1 SOL)
|
|
255
|
+
* @returns Object with balance info and warning if applicable
|
|
256
|
+
*/
|
|
257
|
+
async function checkSponsorBalance(connection, sponsorPubkey, minBalanceSol = 1) {
|
|
258
|
+
const balanceLamports = await connection.getBalance(sponsorPubkey);
|
|
259
|
+
const balanceSol = balanceLamports / 1e9;
|
|
260
|
+
const result = {
|
|
261
|
+
balanceLamports,
|
|
262
|
+
balanceSol,
|
|
263
|
+
};
|
|
264
|
+
if (balanceSol < minBalanceSol) {
|
|
265
|
+
result.warning = `Sponsor wallet balance is low: ${balanceSol.toFixed(4)} SOL. ` +
|
|
266
|
+
`Consider topping up ${sponsorPubkey.toBase58()}`;
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/relay/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AA2FH,oEAuEC;AASD,gEAmDC;AAQD,wDAGC;AAsBD,gDAoDC;AAUD,kDAmBC;AA9UD,6CAOyB;AACzB,iDAI2B;AAC3B,6CAAuD;AAEvD;;;GAGG;AACU,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAAC,8CAA8C,CAAC,CAAC;AAE9F;;GAEG;AACU,QAAA,0BAA0B,GAAG;IACxC,uBAAa,CAAC,SAAS;IACvB,4BAAgB;IAChB,iCAAqB;IACrB,uCAA2B;IAC3B,8BAAoB,CAAC,SAAS;CAC/B,CAAC;AA+CF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mint is not wSOL or USDC (mainnet/devnet)
|
|
51
51
|
*/
|
|
52
52
|
export declare function validateQuoteMint(mint: PublicKey): void;
|
|
53
|
-
import type { DepositorRecordAccount, Lamports, MakeArgs, StarVaultAccount, TgeConfigAccount, VaultEvent } from '../../core';
|
|
53
|
+
import type { ClaimDustOptions, ClaimExcessRefundOptions, ClaimRefundOptions, DepositOptions, DepositorRecordAccount, Lamports, MakeArgs, StarVaultAccount, TgeConfigAccount, UpgradeTierOptions, VaultEvent } from '../../core';
|
|
54
54
|
type VaultIdl = Idl & {
|
|
55
55
|
address: string;
|
|
56
56
|
};
|
|
@@ -100,20 +100,41 @@ export declare class StarVault {
|
|
|
100
100
|
* Deposit into the vault (returns unsigned transaction).
|
|
101
101
|
*
|
|
102
102
|
* Options:
|
|
103
|
+
* - tier: Vesting tier (0-6). Higher tier = longer lockup = higher allocation priority.
|
|
104
|
+
* - 0: immediate (no lockup)
|
|
105
|
+
* - 1: 2 weeks, 2: 4 weeks, 3: 6 weeks
|
|
106
|
+
* - 4: 8 weeks, 5: 10 weeks, 6: 12 weeks
|
|
103
107
|
* - ensureAtas: Create ATAs if they don't exist
|
|
104
108
|
* - wrapWsol: Wrap SOL into WSOL before deposit
|
|
105
109
|
* - referrer: Optional referrer for rewards
|
|
110
|
+
* - feePayer: Optional sponsor pubkey for gasless transactions (requires relay submission)
|
|
106
111
|
*/
|
|
107
|
-
deposit(amount: Lamports | number, user: PublicKey, opts?:
|
|
108
|
-
quoteTokenProgramId?: PublicKey;
|
|
109
|
-
ensureAtas?: boolean;
|
|
110
|
-
wrapWsol?: boolean;
|
|
111
|
-
referrer?: PublicKey;
|
|
112
|
-
}): Promise<Transaction>;
|
|
112
|
+
deposit(amount: Lamports | number, user: PublicKey, opts?: DepositOptions): Promise<Transaction>;
|
|
113
113
|
/**
|
|
114
114
|
* Close the vault early when minimum is met (returns unsigned transaction).
|
|
115
115
|
*/
|
|
116
116
|
closeEarly(maker: PublicKey): Promise<Transaction>;
|
|
117
|
+
/**
|
|
118
|
+
* Upgrade vesting tier commitment (returns unsigned transaction).
|
|
119
|
+
*
|
|
120
|
+
* Users can only upgrade to a higher tier, not downgrade.
|
|
121
|
+
* Higher tier = longer lockup = higher allocation priority in oversubscribed sales.
|
|
122
|
+
* - tier 0: immediate (no lockup)
|
|
123
|
+
* - tier 1: 2 weeks, tier 2: 4 weeks, tier 3: 6 weeks
|
|
124
|
+
* - tier 4: 8 weeks, tier 5: 10 weeks, tier 6: 12 weeks
|
|
125
|
+
*
|
|
126
|
+
* Options:
|
|
127
|
+
* - feePayer: Optional sponsor pubkey for gasless transactions (requires relay submission)
|
|
128
|
+
*/
|
|
129
|
+
upgradeTier(user: PublicKey, newTier: number, opts?: UpgradeTierOptions): Promise<Transaction>;
|
|
130
|
+
/**
|
|
131
|
+
* Admin calculates tier allocations after TGE acceptance (static method).
|
|
132
|
+
*
|
|
133
|
+
* Uses priority-fill algorithm: tier 6 (12wk) fills first, then 5, 4, 3, 2, 1, 0.
|
|
134
|
+
* Higher tiers (longer lockup commitment) get priority in allocation.
|
|
135
|
+
* Can only be called once after TGE is accepted.
|
|
136
|
+
*/
|
|
137
|
+
static calculateAllocations(connection: Connection, admin: PublicKey, vault: PublicKey, seed: InstanceType<typeof BN> | number, programId?: PublicKey): Promise<Transaction>;
|
|
117
138
|
/**
|
|
118
139
|
* Creator requests TGE (returns unsigned transaction).
|
|
119
140
|
*/
|
|
@@ -172,16 +193,20 @@ export declare class StarVault {
|
|
|
172
193
|
}): Promise<Transaction>;
|
|
173
194
|
/**
|
|
174
195
|
* User claims full refund when vault is in Refunding status (returns unsigned transaction).
|
|
196
|
+
*
|
|
197
|
+
* Options:
|
|
198
|
+
* - tokenProgramId: Override token program (default: TOKEN_PROGRAM_ID)
|
|
199
|
+
* - feePayer: Optional sponsor pubkey for gasless transactions (requires relay submission)
|
|
175
200
|
*/
|
|
176
|
-
claimRefund(user: PublicKey, opts?:
|
|
177
|
-
tokenProgramId?: PublicKey;
|
|
178
|
-
}): Promise<Transaction>;
|
|
201
|
+
claimRefund(user: PublicKey, opts?: ClaimRefundOptions): Promise<Transaction>;
|
|
179
202
|
/**
|
|
180
203
|
* User claims pro-rata excess refund when vault is oversubscribed (returns unsigned transaction).
|
|
204
|
+
*
|
|
205
|
+
* Options:
|
|
206
|
+
* - tokenProgramId: Override token program (default: TOKEN_PROGRAM_ID)
|
|
207
|
+
* - feePayer: Optional sponsor pubkey for gasless transactions (requires relay submission)
|
|
181
208
|
*/
|
|
182
|
-
claimExcessRefund(user: PublicKey, opts?:
|
|
183
|
-
tokenProgramId?: PublicKey;
|
|
184
|
-
}): Promise<Transaction>;
|
|
209
|
+
claimExcessRefund(user: PublicKey, opts?: ClaimExcessRefundOptions): Promise<Transaction>;
|
|
185
210
|
/**
|
|
186
211
|
* User claims uncredited dust after the raise ends using merkle proof (returns unsigned transaction).
|
|
187
212
|
*
|
|
@@ -189,15 +214,12 @@ export declare class StarVault {
|
|
|
189
214
|
* threshold and weren't credited on-chain. Uses merkle proof verification
|
|
190
215
|
* against a root published by admin - no expiry, claim anytime.
|
|
191
216
|
*
|
|
192
|
-
* @param user - User claiming the dust
|
|
217
|
+
* @param user - User claiming the dust
|
|
193
218
|
* @param amount - Amount of dust to claim (must be in merkle tree)
|
|
194
219
|
* @param proof - Array of 32-byte hashes forming the merkle proof
|
|
195
|
-
* @param opts -
|
|
220
|
+
* @param opts - Options including tokenProgramId, ensureAtas, and feePayer for gasless txs
|
|
196
221
|
*/
|
|
197
|
-
claimDust(user: PublicKey, amount: InstanceType<typeof BN> | number, proof: Buffer[], opts?:
|
|
198
|
-
tokenProgramId?: PublicKey;
|
|
199
|
-
ensureAtas?: boolean;
|
|
200
|
-
}): Promise<Transaction>;
|
|
222
|
+
claimDust(user: PublicKey, amount: InstanceType<typeof BN> | number, proof: Buffer[], opts?: ClaimDustOptions): Promise<Transaction>;
|
|
201
223
|
/**
|
|
202
224
|
* Admin publishes merkle root for dust claims (static method for admin use).
|
|
203
225
|
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