Skip to content

Commit 9545b43

Browse files
authored
Engine SDK updates (#8238)
1 parent 869bbcf commit 9545b43

File tree

3 files changed

+1065
-17
lines changed

3 files changed

+1065
-17
lines changed

.changeset/small-mails-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/engine": minor
3+
---
4+
5+
Add Solana endpoints

packages/engine/src/client/sdk.gen.ts

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ import type {
1111
CancelTransactionResponses,
1212
CreateAccountData,
1313
CreateAccountResponses,
14+
CreateSolanaAccountData,
15+
CreateSolanaAccountResponses,
1416
EncodeContractData,
1517
EncodeContractResponses,
1618
GetActivityLogsData,
1719
GetActivityLogsErrors,
1820
GetActivityLogsResponses,
21+
GetSolanaActivityLogsData,
22+
GetSolanaActivityLogsErrors,
23+
GetSolanaActivityLogsResponses,
24+
GetSolanaTransactionsData,
25+
GetSolanaTransactionsResponses,
1926
GetTransactionAnalyticsData,
2027
GetTransactionAnalyticsResponses,
2128
GetTransactionAnalyticsSummaryData,
@@ -25,17 +32,30 @@ import type {
2532
GetTransactionsResponses,
2633
ListAccountsData,
2734
ListAccountsResponses,
35+
ListSolanaAccountsData,
36+
ListSolanaAccountsResponses,
2837
ReadContractData,
2938
ReadContractResponses,
3039
SearchActivityLogsData,
3140
SearchActivityLogsErrors,
3241
SearchActivityLogsResponses,
42+
SearchSolanaActivityLogsData,
43+
SearchSolanaActivityLogsErrors,
44+
SearchSolanaActivityLogsResponses,
45+
SearchSolanaTransactionsData,
46+
SearchSolanaTransactionsResponses,
3347
SearchTransactionsData,
3448
SearchTransactionsResponses,
49+
SendSolanaTransactionData,
50+
SendSolanaTransactionResponses,
3551
SendTransactionData,
3652
SendTransactionResponses,
3753
SignMessageData,
3854
SignMessageResponses,
55+
SignSolanaMessageData,
56+
SignSolanaMessageResponses,
57+
SignSolanaTransactionData,
58+
SignSolanaTransactionResponses,
3959
SignTypedDataData,
4060
SignTypedDataResponses,
4161
WriteContractData,
@@ -227,6 +247,33 @@ export const encodeContract = <ThrowOnError extends boolean = false>(
227247
});
228248
};
229249

250+
/**
251+
* Send Solana Transaction
252+
* Execute a Solana transaction with custom instructions
253+
*/
254+
export const sendSolanaTransaction = <ThrowOnError extends boolean = false>(
255+
options: Options<SendSolanaTransactionData, ThrowOnError>,
256+
) => {
257+
return (options.client ?? _heyApiClient).post<
258+
SendSolanaTransactionResponses,
259+
unknown,
260+
ThrowOnError
261+
>({
262+
security: [
263+
{
264+
name: "x-secret-key",
265+
type: "apiKey",
266+
},
267+
],
268+
url: "/v1/solana/transaction",
269+
...options,
270+
headers: {
271+
"Content-Type": "application/json",
272+
...options.headers,
273+
},
274+
});
275+
};
276+
230277
/**
231278
* Cancel Transaction
232279
* Attempt to cancel a queued transaction. Transactions that have been sent and are waiting for mine cannot be cancelled.
@@ -300,6 +347,110 @@ export const createAccount = <ThrowOnError extends boolean = false>(
300347
});
301348
};
302349

350+
/**
351+
* List Solana Accounts
352+
* List all Solana wallets provisioned for the project.
353+
*/
354+
export const listSolanaAccounts = <ThrowOnError extends boolean = false>(
355+
options?: Options<ListSolanaAccountsData, ThrowOnError>,
356+
) => {
357+
return (options?.client ?? _heyApiClient).get<
358+
ListSolanaAccountsResponses,
359+
unknown,
360+
ThrowOnError
361+
>({
362+
security: [
363+
{
364+
name: "x-secret-key",
365+
type: "apiKey",
366+
},
367+
],
368+
url: "/v1/solana/accounts",
369+
...options,
370+
});
371+
};
372+
373+
/**
374+
* Get or Create Solana Account
375+
* Create a new solana wallet in the vault or return the existing wallet for a given label.
376+
*/
377+
export const createSolanaAccount = <ThrowOnError extends boolean = false>(
378+
options?: Options<CreateSolanaAccountData, ThrowOnError>,
379+
) => {
380+
return (options?.client ?? _heyApiClient).post<
381+
CreateSolanaAccountResponses,
382+
unknown,
383+
ThrowOnError
384+
>({
385+
security: [
386+
{
387+
name: "x-secret-key",
388+
type: "apiKey",
389+
},
390+
],
391+
url: "/v1/solana/accounts",
392+
...options,
393+
headers: {
394+
"Content-Type": "application/json",
395+
...options?.headers,
396+
},
397+
});
398+
};
399+
400+
/**
401+
* Sign Solana Message
402+
* Sign an arbitrary message with a Solana wallet.
403+
*/
404+
export const signSolanaMessage = <ThrowOnError extends boolean = false>(
405+
options?: Options<SignSolanaMessageData, ThrowOnError>,
406+
) => {
407+
return (options?.client ?? _heyApiClient).post<
408+
SignSolanaMessageResponses,
409+
unknown,
410+
ThrowOnError
411+
>({
412+
security: [
413+
{
414+
name: "x-secret-key",
415+
type: "apiKey",
416+
},
417+
],
418+
url: "/v1/solana/sign-message",
419+
...options,
420+
headers: {
421+
"Content-Type": "application/json",
422+
...options?.headers,
423+
},
424+
});
425+
};
426+
427+
/**
428+
* Sign Solana Transaction
429+
* Sign a serialized Solana transaction.
430+
*/
431+
export const signSolanaTransaction = <ThrowOnError extends boolean = false>(
432+
options?: Options<SignSolanaTransactionData, ThrowOnError>,
433+
) => {
434+
return (options?.client ?? _heyApiClient).post<
435+
SignSolanaTransactionResponses,
436+
unknown,
437+
ThrowOnError
438+
>({
439+
security: [
440+
{
441+
name: "x-secret-key",
442+
type: "apiKey",
443+
},
444+
],
445+
url: "/v1/solana/sign-transaction",
446+
...options,
447+
headers: {
448+
"Content-Type": "application/json",
449+
...options?.headers,
450+
},
451+
});
452+
};
453+
303454
/**
304455
* Get Transactions
305456
* Search transactions with various filters and pagination
@@ -455,3 +606,103 @@ export const searchActivityLogs = <ThrowOnError extends boolean = false>(
455606
},
456607
});
457608
};
609+
610+
/**
611+
* Get Solana Transactions
612+
* Search Solana transactions with various filters and pagination
613+
*/
614+
export const getSolanaTransactions = <ThrowOnError extends boolean = false>(
615+
options?: Options<GetSolanaTransactionsData, ThrowOnError>,
616+
) => {
617+
return (options?.client ?? _heyApiClient).get<
618+
GetSolanaTransactionsResponses,
619+
unknown,
620+
ThrowOnError
621+
>({
622+
security: [
623+
{
624+
name: "x-secret-key",
625+
type: "apiKey",
626+
},
627+
],
628+
url: "/v1/solana/transactions",
629+
...options,
630+
});
631+
};
632+
633+
/**
634+
* Search Solana Transactions
635+
* Advanced search for Solana transactions with complex nested filters
636+
*/
637+
export const searchSolanaTransactions = <ThrowOnError extends boolean = false>(
638+
options?: Options<SearchSolanaTransactionsData, ThrowOnError>,
639+
) => {
640+
return (options?.client ?? _heyApiClient).post<
641+
SearchSolanaTransactionsResponses,
642+
unknown,
643+
ThrowOnError
644+
>({
645+
security: [
646+
{
647+
name: "x-secret-key",
648+
type: "apiKey",
649+
},
650+
],
651+
url: "/v1/solana/transactions/search",
652+
...options,
653+
headers: {
654+
"Content-Type": "application/json",
655+
...options?.headers,
656+
},
657+
});
658+
};
659+
660+
/**
661+
* Get Solana Activity Logs
662+
* Get paginated activity logs for a specific Solana transaction with tenancy enforcement
663+
*/
664+
export const getSolanaActivityLogs = <ThrowOnError extends boolean = false>(
665+
options: Options<GetSolanaActivityLogsData, ThrowOnError>,
666+
) => {
667+
return (options.client ?? _heyApiClient).get<
668+
GetSolanaActivityLogsResponses,
669+
GetSolanaActivityLogsErrors,
670+
ThrowOnError
671+
>({
672+
security: [
673+
{
674+
name: "x-secret-key",
675+
type: "apiKey",
676+
},
677+
],
678+
url: "/v1/solana/transactions/activity-logs",
679+
...options,
680+
});
681+
};
682+
683+
/**
684+
* Search Solana Activity Logs
685+
* Search Solana activity logs across transactions with advanced filtering and tenancy enforcement
686+
*/
687+
export const searchSolanaActivityLogs = <ThrowOnError extends boolean = false>(
688+
options?: Options<SearchSolanaActivityLogsData, ThrowOnError>,
689+
) => {
690+
return (options?.client ?? _heyApiClient).post<
691+
SearchSolanaActivityLogsResponses,
692+
SearchSolanaActivityLogsErrors,
693+
ThrowOnError
694+
>({
695+
security: [
696+
{
697+
name: "x-secret-key",
698+
type: "apiKey",
699+
},
700+
],
701+
url: "/v1/solana/transactions/activity-logs/search",
702+
...options,
703+
headers: {
704+
"Content-Type": "application/json",
705+
...options?.headers,
706+
},
707+
});
708+
};

0 commit comments

Comments
 (0)