@agi-cli/sdk 0.1.141 → 0.1.142
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/README.md +1 -1
- package/package.json +1 -1
- package/src/config/src/index.ts +1 -1
- package/src/core/src/providers/resolver.ts +8 -8
- package/src/index.ts +6 -6
- package/src/prompts/src/providers.ts +2 -2
- package/src/providers/src/catalog-manual.ts +17 -17
- package/src/providers/src/env.ts +1 -1
- package/src/providers/src/index.ts +9 -9
- package/src/providers/src/pricing.ts +1 -1
- package/src/providers/src/{solforge-client.ts → setu-client.ts} +34 -38
- package/src/providers/src/utils.ts +1 -1
- package/src/types/src/provider.ts +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
} from '@agi-cli/sdk';
|
|
73
73
|
|
|
74
74
|
// Check available providers
|
|
75
|
-
console.log(providerIds); // ['openai', 'anthropic', 'google', 'openrouter', 'opencode', '
|
|
75
|
+
console.log(providerIds); // ['openai', 'anthropic', 'google', 'openrouter', 'opencode', 'setu']
|
|
76
76
|
|
|
77
77
|
// Get model information
|
|
78
78
|
const models = catalog.anthropic.models;
|
package/package.json
CHANGED
package/src/config/src/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ const DEFAULTS: {
|
|
|
25
25
|
google: { enabled: true },
|
|
26
26
|
openrouter: { enabled: false },
|
|
27
27
|
opencode: { enabled: false },
|
|
28
|
-
|
|
28
|
+
setu: { enabled: false },
|
|
29
29
|
zai: { enabled: false },
|
|
30
30
|
'zai-coding': { enabled: false },
|
|
31
31
|
moonshot: { enabled: false },
|
|
@@ -5,7 +5,7 @@ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
|
|
|
5
5
|
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
6
6
|
import {
|
|
7
7
|
catalog,
|
|
8
|
-
|
|
8
|
+
createSetuModel,
|
|
9
9
|
createOpenAIOAuthModel,
|
|
10
10
|
} from '../../../providers/src/index.ts';
|
|
11
11
|
import type { OAuth } from '../../../types/src/index.ts';
|
|
@@ -33,7 +33,7 @@ export type ProviderName =
|
|
|
33
33
|
| 'google'
|
|
34
34
|
| 'openrouter'
|
|
35
35
|
| 'opencode'
|
|
36
|
-
| '
|
|
36
|
+
| 'setu'
|
|
37
37
|
| 'zai'
|
|
38
38
|
| 'zai-coding'
|
|
39
39
|
| 'moonshot';
|
|
@@ -152,16 +152,16 @@ export async function resolveModel(
|
|
|
152
152
|
return ocOpenAI(resolvedModelId);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
if (provider === '
|
|
156
|
-
const privateKey = config.apiKey || process.env.
|
|
155
|
+
if (provider === 'setu') {
|
|
156
|
+
const privateKey = config.apiKey || process.env.SETU_PRIVATE_KEY || '';
|
|
157
157
|
if (!privateKey) {
|
|
158
158
|
throw new Error(
|
|
159
|
-
'
|
|
159
|
+
'Setu provider requires SETU_PRIVATE_KEY (base58 Solana secret).',
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
|
-
const baseURL = config.baseURL || process.env.
|
|
163
|
-
const rpcURL = process.env.
|
|
164
|
-
return
|
|
162
|
+
const baseURL = config.baseURL || process.env.SETU_BASE_URL;
|
|
163
|
+
const rpcURL = process.env.SETU_SOLANA_RPC_URL;
|
|
164
|
+
return createSetuModel(
|
|
165
165
|
model,
|
|
166
166
|
{ privateKey },
|
|
167
167
|
{
|
package/src/index.ts
CHANGED
|
@@ -61,16 +61,16 @@ export {
|
|
|
61
61
|
setEnvKey,
|
|
62
62
|
} from './providers/src/index.ts';
|
|
63
63
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
createSetuFetch,
|
|
65
|
+
createSetuModel,
|
|
66
|
+
fetchSetuBalance,
|
|
67
67
|
getPublicKeyFromPrivate,
|
|
68
68
|
fetchSolanaUsdcBalance,
|
|
69
69
|
} from './providers/src/index.ts';
|
|
70
70
|
export type {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
SetuAuth,
|
|
72
|
+
SetuProviderOptions,
|
|
73
|
+
SetuBalanceResponse,
|
|
74
74
|
SolanaUsdcBalanceResponse,
|
|
75
75
|
} from './providers/src/index.ts';
|
|
76
76
|
export {
|
|
@@ -62,12 +62,12 @@ export async function providerBasePrompt(
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// 2) Provider-family fallback for openrouter/opencode/
|
|
65
|
+
// 2) Provider-family fallback for openrouter/opencode/setu using embedded defaults
|
|
66
66
|
if (
|
|
67
67
|
isProviderId(id) &&
|
|
68
68
|
(id === 'openrouter' ||
|
|
69
69
|
id === 'opencode' ||
|
|
70
|
-
id === '
|
|
70
|
+
id === 'setu' ||
|
|
71
71
|
id === 'zai' ||
|
|
72
72
|
id === 'zai-coding') &&
|
|
73
73
|
modelId
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
|
|
7
7
|
type CatalogMap = Partial<Record<ProviderId, ProviderCatalogEntry>>;
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const SETU_ID: ProviderId = 'setu';
|
|
10
10
|
|
|
11
11
|
const isAllowedOpenAIModel = (id: string): boolean => {
|
|
12
12
|
if (id === 'codex-mini-latest') return true;
|
|
@@ -23,7 +23,7 @@ const isAllowedAnthropicModel = (id: string): boolean => {
|
|
|
23
23
|
return false;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const SETU_SOURCES: Array<{ id: ProviderId; npm: string }> = [
|
|
27
27
|
{
|
|
28
28
|
id: 'openai',
|
|
29
29
|
npm: '@ai-sdk/openai',
|
|
@@ -53,8 +53,8 @@ function cloneModel(model: ModelInfo): ModelInfo {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function
|
|
57
|
-
const
|
|
56
|
+
function buildSetuEntry(base: CatalogMap): ProviderCatalogEntry | null {
|
|
57
|
+
const setuModels = SETU_SOURCES.flatMap(({ id, npm }) => {
|
|
58
58
|
const allModels = base[id]?.models ?? [];
|
|
59
59
|
const sourceModels = allModels.filter((model) => {
|
|
60
60
|
if (id === 'openai') return isAllowedOpenAIModel(model.id);
|
|
@@ -68,10 +68,10 @@ function buildSolforgeEntry(base: CatalogMap): ProviderCatalogEntry | null {
|
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
if (!
|
|
71
|
+
if (!setuModels.length) return null;
|
|
72
72
|
|
|
73
73
|
// Prefer OpenAI-family models first so defaults are stable
|
|
74
|
-
|
|
74
|
+
setuModels.sort((a, b) => {
|
|
75
75
|
const providerA = a.provider?.npm ?? '';
|
|
76
76
|
const providerB = b.provider?.npm ?? '';
|
|
77
77
|
if (providerA === providerB) {
|
|
@@ -83,31 +83,31 @@ function buildSolforgeEntry(base: CatalogMap): ProviderCatalogEntry | null {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
const defaultModelId = 'codex-mini-latest';
|
|
86
|
-
const defaultIdx =
|
|
86
|
+
const defaultIdx = setuModels.findIndex((m) => m.id === defaultModelId);
|
|
87
87
|
if (defaultIdx > 0) {
|
|
88
|
-
const [picked] =
|
|
89
|
-
|
|
88
|
+
const [picked] = setuModels.splice(defaultIdx, 1);
|
|
89
|
+
setuModels.unshift(picked);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
return {
|
|
93
|
-
id:
|
|
94
|
-
label: '
|
|
95
|
-
env: ['
|
|
96
|
-
api: 'https://
|
|
97
|
-
doc: 'https://
|
|
98
|
-
models:
|
|
93
|
+
id: SETU_ID,
|
|
94
|
+
label: 'Setu',
|
|
95
|
+
env: ['SETU_PRIVATE_KEY'],
|
|
96
|
+
api: 'https://setu.agi.nitish.sh/v1',
|
|
97
|
+
doc: 'https://setu.agi.nitish.sh/docs',
|
|
98
|
+
models: setuModels,
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export function mergeManualCatalog(
|
|
103
103
|
base: CatalogMap,
|
|
104
104
|
): Record<ProviderId, ProviderCatalogEntry> {
|
|
105
|
-
const manualEntry =
|
|
105
|
+
const manualEntry = buildSetuEntry(base);
|
|
106
106
|
const merged: Record<ProviderId, ProviderCatalogEntry> = {
|
|
107
107
|
...(base as Record<ProviderId, ProviderCatalogEntry>),
|
|
108
108
|
};
|
|
109
109
|
if (manualEntry) {
|
|
110
|
-
merged[
|
|
110
|
+
merged[SETU_ID] = manualEntry;
|
|
111
111
|
}
|
|
112
112
|
return merged;
|
|
113
113
|
}
|
package/src/providers/src/env.ts
CHANGED
|
@@ -6,7 +6,7 @@ const ENV_VARS: Record<ProviderId, string> = {
|
|
|
6
6
|
google: 'GOOGLE_GENERATIVE_AI_API_KEY',
|
|
7
7
|
openrouter: 'OPENROUTER_API_KEY',
|
|
8
8
|
opencode: 'OPENCODE_API_KEY',
|
|
9
|
-
|
|
9
|
+
setu: 'SETU_PRIVATE_KEY',
|
|
10
10
|
zai: 'ZAI_API_KEY',
|
|
11
11
|
'zai-coding': 'ZAI_API_KEY',
|
|
12
12
|
moonshot: 'MOONSHOT_API_KEY',
|
|
@@ -24,19 +24,19 @@ export { validateProviderModel } from './validate.ts';
|
|
|
24
24
|
export { estimateModelCostUsd } from './pricing.ts';
|
|
25
25
|
export { providerEnvVar, readEnvKey, setEnvKey } from './env.ts';
|
|
26
26
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
createSetuFetch,
|
|
28
|
+
createSetuModel,
|
|
29
|
+
fetchSetuBalance,
|
|
30
30
|
getPublicKeyFromPrivate,
|
|
31
31
|
fetchSolanaUsdcBalance,
|
|
32
|
-
} from './
|
|
32
|
+
} from './setu-client.ts';
|
|
33
33
|
export type {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
SetuAuth,
|
|
35
|
+
SetuProviderOptions,
|
|
36
|
+
SetuPaymentCallbacks,
|
|
37
|
+
SetuBalanceResponse,
|
|
38
38
|
SolanaUsdcBalanceResponse,
|
|
39
|
-
} from './
|
|
39
|
+
} from './setu-client.ts';
|
|
40
40
|
export {
|
|
41
41
|
createOpenAIOAuthFetch,
|
|
42
42
|
createOpenAIOAuthModel,
|
|
@@ -37,12 +37,12 @@ function simplifyPaymentError(errMsg: string): string {
|
|
|
37
37
|
return short.length < errMsg.length ? `${short}...` : errMsg;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const DEFAULT_BASE_URL = 'https://
|
|
40
|
+
const DEFAULT_BASE_URL = 'https://setu.agi.nitish.sh';
|
|
41
41
|
const DEFAULT_RPC_URL = 'https://api.mainnet-beta.solana.com';
|
|
42
42
|
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
43
43
|
const DEFAULT_MAX_PAYMENT_ATTEMPTS = 20;
|
|
44
44
|
|
|
45
|
-
export type
|
|
45
|
+
export type SetuPaymentCallbacks = {
|
|
46
46
|
onPaymentRequired?: (amountUsd: number) => void;
|
|
47
47
|
onPaymentSigning?: () => void;
|
|
48
48
|
onPaymentComplete?: (data: {
|
|
@@ -53,19 +53,19 @@ export type SolforgePaymentCallbacks = {
|
|
|
53
53
|
onPaymentError?: (error: string) => void;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export type
|
|
56
|
+
export type SetuProviderOptions = {
|
|
57
57
|
baseURL?: string;
|
|
58
58
|
rpcURL?: string;
|
|
59
59
|
network?: string;
|
|
60
60
|
maxRequestAttempts?: number;
|
|
61
61
|
maxPaymentAttempts?: number;
|
|
62
|
-
callbacks?:
|
|
62
|
+
callbacks?: SetuPaymentCallbacks;
|
|
63
63
|
providerNpm?: string;
|
|
64
64
|
promptCacheKey?: string;
|
|
65
65
|
promptCacheRetention?: 'in_memory' | '24h';
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
export type
|
|
68
|
+
export type SetuAuth = {
|
|
69
69
|
privateKey: string;
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -120,7 +120,7 @@ async function acquirePaymentLock(walletAddress: string): Promise<() => void> {
|
|
|
120
120
|
paymentQueues.set(walletAddress, entry);
|
|
121
121
|
|
|
122
122
|
if (existing) {
|
|
123
|
-
console.log('[
|
|
123
|
+
console.log('[Setu] Waiting for pending payment to complete...');
|
|
124
124
|
await existing.promise;
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -132,9 +132,9 @@ async function acquirePaymentLock(walletAddress: string): Promise<() => void> {
|
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
export function
|
|
136
|
-
auth:
|
|
137
|
-
options:
|
|
135
|
+
export function createSetuFetch(
|
|
136
|
+
auth: SetuAuth,
|
|
137
|
+
options: SetuProviderOptions = {},
|
|
138
138
|
): typeof fetch {
|
|
139
139
|
const privateKeyBytes = bs58.decode(auth.privateKey);
|
|
140
140
|
const keypair = Keypair.fromSecretKey(privateKeyBytes);
|
|
@@ -196,20 +196,18 @@ export function createSolforgeFetch(
|
|
|
196
196
|
const requirement = pickPaymentRequirement(payload);
|
|
197
197
|
if (!requirement) {
|
|
198
198
|
callbacks.onPaymentError?.('Unsupported payment requirement');
|
|
199
|
-
throw new Error('
|
|
199
|
+
throw new Error('Setu: unsupported payment requirement');
|
|
200
200
|
}
|
|
201
201
|
if (attempt >= maxAttempts) {
|
|
202
202
|
callbacks.onPaymentError?.('Payment failed after multiple attempts');
|
|
203
|
-
throw new Error('
|
|
203
|
+
throw new Error('Setu: payment failed after multiple attempts');
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
const currentAttempts = globalPaymentAttempts.get(walletAddress) ?? 0;
|
|
207
207
|
const remainingPayments = maxPaymentAttempts - currentAttempts;
|
|
208
208
|
if (remainingPayments <= 0) {
|
|
209
209
|
callbacks.onPaymentError?.('Maximum payment attempts exceeded');
|
|
210
|
-
throw new Error(
|
|
211
|
-
'Solforge: payment failed after maximum payment attempts.',
|
|
212
|
-
);
|
|
210
|
+
throw new Error('Setu: payment failed after maximum payment attempts.');
|
|
213
211
|
}
|
|
214
212
|
|
|
215
213
|
const releaseLock = await acquirePaymentLock(walletAddress);
|
|
@@ -237,12 +235,12 @@ export function createSolforgeFetch(
|
|
|
237
235
|
}
|
|
238
236
|
}
|
|
239
237
|
|
|
240
|
-
throw new Error('
|
|
238
|
+
throw new Error('Setu: max attempts exceeded');
|
|
241
239
|
};
|
|
242
240
|
}
|
|
243
241
|
|
|
244
242
|
/**
|
|
245
|
-
* Create a
|
|
243
|
+
* Create a Setu-backed AI model.
|
|
246
244
|
*
|
|
247
245
|
* Uses native AI SDK providers:
|
|
248
246
|
* - OpenAI models → /v1/responses (via @ai-sdk/openai)
|
|
@@ -250,21 +248,21 @@ export function createSolforgeFetch(
|
|
|
250
248
|
*
|
|
251
249
|
* Provider is determined by options.providerNpm from catalog.
|
|
252
250
|
*/
|
|
253
|
-
export function
|
|
251
|
+
export function createSetuModel(
|
|
254
252
|
model: string,
|
|
255
|
-
auth:
|
|
256
|
-
options:
|
|
253
|
+
auth: SetuAuth,
|
|
254
|
+
options: SetuProviderOptions = {},
|
|
257
255
|
) {
|
|
258
256
|
const baseURL = `${trimTrailingSlash(
|
|
259
257
|
options.baseURL ?? DEFAULT_BASE_URL,
|
|
260
258
|
)}/v1`;
|
|
261
|
-
const customFetch =
|
|
259
|
+
const customFetch = createSetuFetch(auth, options);
|
|
262
260
|
const providerNpm = options.providerNpm ?? '@ai-sdk/openai';
|
|
263
261
|
|
|
264
262
|
if (providerNpm === '@ai-sdk/anthropic') {
|
|
265
263
|
const anthropic = createAnthropic({
|
|
266
264
|
baseURL,
|
|
267
|
-
apiKey: '
|
|
265
|
+
apiKey: 'setu-wallet-auth',
|
|
268
266
|
fetch: customFetch,
|
|
269
267
|
});
|
|
270
268
|
return anthropic(model);
|
|
@@ -273,7 +271,7 @@ export function createSolforgeModel(
|
|
|
273
271
|
// Default to OpenAI
|
|
274
272
|
const openai = createOpenAI({
|
|
275
273
|
baseURL,
|
|
276
|
-
apiKey: '
|
|
274
|
+
apiKey: 'setu-wallet-auth',
|
|
277
275
|
fetch: customFetch,
|
|
278
276
|
});
|
|
279
277
|
return openai.responses(model);
|
|
@@ -314,7 +312,7 @@ async function handlePayment(args: {
|
|
|
314
312
|
baseFetch: typeof fetch;
|
|
315
313
|
buildWalletHeaders: () => Record<string, string>;
|
|
316
314
|
maxAttempts: number;
|
|
317
|
-
callbacks:
|
|
315
|
+
callbacks: SetuPaymentCallbacks;
|
|
318
316
|
}): Promise<{ attemptsUsed: number }> {
|
|
319
317
|
let attempts = 0;
|
|
320
318
|
while (attempts < args.maxAttempts) {
|
|
@@ -334,12 +332,10 @@ async function handlePayment(args: {
|
|
|
334
332
|
return { attemptsUsed: attempts };
|
|
335
333
|
}
|
|
336
334
|
console.log(
|
|
337
|
-
`
|
|
335
|
+
`Setu balance still negative (${balanceValue.toFixed(8)}). Sending another top-up...`,
|
|
338
336
|
);
|
|
339
337
|
}
|
|
340
|
-
throw new Error(
|
|
341
|
-
`Solforge: payment failed after ${attempts} additional top-ups.`,
|
|
342
|
-
);
|
|
338
|
+
throw new Error(`Setu: payment failed after ${attempts} additional top-ups.`);
|
|
343
339
|
}
|
|
344
340
|
|
|
345
341
|
async function processSinglePayment(args: {
|
|
@@ -349,7 +345,7 @@ async function processSinglePayment(args: {
|
|
|
349
345
|
baseURL: string;
|
|
350
346
|
baseFetch: typeof fetch;
|
|
351
347
|
buildWalletHeaders: () => Record<string, string>;
|
|
352
|
-
callbacks:
|
|
348
|
+
callbacks: SetuPaymentCallbacks;
|
|
353
349
|
}): Promise<{ attempts: number; balance?: number | string }> {
|
|
354
350
|
args.callbacks.onPaymentSigning?.();
|
|
355
351
|
|
|
@@ -360,7 +356,7 @@ async function processSinglePayment(args: {
|
|
|
360
356
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
361
357
|
const userMsg = `Payment failed: ${simplifyPaymentError(errMsg)}`;
|
|
362
358
|
args.callbacks.onPaymentError?.(userMsg);
|
|
363
|
-
throw new Error(`
|
|
359
|
+
throw new Error(`Setu: ${userMsg}`);
|
|
364
360
|
}
|
|
365
361
|
const walletHeaders = args.buildWalletHeaders();
|
|
366
362
|
const headers = {
|
|
@@ -382,11 +378,11 @@ async function processSinglePayment(args: {
|
|
|
382
378
|
response.status === 400 &&
|
|
383
379
|
rawBody.toLowerCase().includes('already processed')
|
|
384
380
|
) {
|
|
385
|
-
console.log('
|
|
381
|
+
console.log('Setu payment already processed; continuing.');
|
|
386
382
|
return { attempts: 1 };
|
|
387
383
|
}
|
|
388
384
|
args.callbacks.onPaymentError?.(`Topup failed: ${response.status}`);
|
|
389
|
-
throw new Error(`
|
|
385
|
+
throw new Error(`Setu topup failed (${response.status}): ${rawBody}`);
|
|
390
386
|
}
|
|
391
387
|
|
|
392
388
|
let parsed: PaymentResponse | undefined;
|
|
@@ -411,11 +407,11 @@ async function processSinglePayment(args: {
|
|
|
411
407
|
transactionId: parsed.transaction,
|
|
412
408
|
});
|
|
413
409
|
console.log(
|
|
414
|
-
`
|
|
410
|
+
`Setu payment complete: +$${amountUsd} (balance: $${newBalance})`,
|
|
415
411
|
);
|
|
416
412
|
return { attempts: 1, balance: newBalance };
|
|
417
413
|
}
|
|
418
|
-
console.log('
|
|
414
|
+
console.log('Setu payment complete.');
|
|
419
415
|
return { attempts: 1 };
|
|
420
416
|
}
|
|
421
417
|
|
|
@@ -452,7 +448,7 @@ async function createPaymentPayload(args: {
|
|
|
452
448
|
} as PaymentPayload;
|
|
453
449
|
}
|
|
454
450
|
|
|
455
|
-
export type
|
|
451
|
+
export type SetuBalanceResponse = {
|
|
456
452
|
walletAddress: string;
|
|
457
453
|
balance: number;
|
|
458
454
|
totalSpent: number;
|
|
@@ -462,10 +458,10 @@ export type SolforgeBalanceResponse = {
|
|
|
462
458
|
lastRequest?: string;
|
|
463
459
|
};
|
|
464
460
|
|
|
465
|
-
export async function
|
|
466
|
-
auth:
|
|
461
|
+
export async function fetchSetuBalance(
|
|
462
|
+
auth: SetuAuth,
|
|
467
463
|
baseURL?: string,
|
|
468
|
-
): Promise<
|
|
464
|
+
): Promise<SetuBalanceResponse | null> {
|
|
469
465
|
try {
|
|
470
466
|
const privateKeyBytes = bs58.decode(auth.privateKey);
|
|
471
467
|
const keypair = Keypair.fromSecretKey(privateKeyBytes);
|
|
@@ -531,7 +527,7 @@ export type SolanaUsdcBalanceResponse = {
|
|
|
531
527
|
};
|
|
532
528
|
|
|
533
529
|
export async function fetchSolanaUsdcBalance(
|
|
534
|
-
auth:
|
|
530
|
+
auth: SetuAuth,
|
|
535
531
|
network: 'mainnet' | 'devnet' = 'mainnet',
|
|
536
532
|
): Promise<SolanaUsdcBalanceResponse | null> {
|
|
537
533
|
try {
|
|
@@ -42,7 +42,7 @@ const PREFERRED_FAST_MODELS: Partial<Record<ProviderId, string[]>> = {
|
|
|
42
42
|
'google/gemini-2.0-flash-001',
|
|
43
43
|
],
|
|
44
44
|
opencode: ['claude-3-5-haiku', 'gpt-5-nano', 'gemini-3-flash'],
|
|
45
|
-
|
|
45
|
+
setu: [
|
|
46
46
|
'claude-3-5-haiku-latest',
|
|
47
47
|
'claude-3-5-haiku-20241022',
|
|
48
48
|
'codex-mini-latest',
|