@silvana-one/api 0.2.8 → 0.2.9

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.
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
 
3
3
  import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
4
- import type { LaunchNftCollectionData, LaunchNftCollectionResponse, LaunchNftCollectionError, LaunchTokenData, LaunchTokenResponse, LaunchTokenError, GetContractInfoData, GetContractInfoResponse, GetContractInfoError, GetNftInfoData, GetNftInfoResponse, GetNftInfoError, GetNftV2InfoData, GetNftV2InfoResponse, GetNftV2InfoError, FaucetData, FaucetResponse2, FaucetError, GetTokenInfoData, GetTokenInfoResponse, GetTokenInfoError, GetTokenBalanceData, GetTokenBalanceResponse, GetTokenBalanceError, GetNonceData, GetNonceResponse, GetNonceError, ProveData, ProveResponse, ProveError, GetProofData, GetProofResponse, GetProofError, SendTransactionData, SendTransactionResponse, SendTransactionError, TxStatusData, TxStatusResponse, TxStatusError, MintTokensData, MintTokensResponse, MintTokensError, MintNftData, MintNftResponse, MintNftError, TransferNftData, TransferNftResponse, TransferNftError, ApproveNftData, ApproveNftResponse, ApproveNftError, SellNftData, SellNftResponse, SellNftError, BuyNftData, BuyNftResponse, BuyNftError, TransferTokensData, TransferTokensResponse, TransferTokensError, AirdropTokensData, AirdropTokensResponse, AirdropTokensError, RedeemTokensData, RedeemTokensResponse, RedeemTokensError, BurnTokensData, BurnTokensResponse, BurnTokensError, TokenBidData, TokenBidResponse, TokenBidError, TokenOfferData, TokenOfferResponse, TokenOfferError, BuyTokensData, BuyTokensResponse, BuyTokensError, SellTokensData, SellTokensResponse, SellTokensError, WithdrawTokenBidData, WithdrawTokenBidResponse, WithdrawTokenBidError, WithdrawTokenOfferData, WithdrawTokenOfferResponse, WithdrawTokenOfferError, UpdateTokenBidWhitelistData, UpdateTokenBidWhitelistResponse, UpdateTokenBidWhitelistError, UpdateTokenOfferWhitelistData, UpdateTokenOfferWhitelistResponse, UpdateTokenOfferWhitelistError, UpdateTokenAdminWhitelistData, UpdateTokenAdminWhitelistResponse, UpdateTokenAdminWhitelistError } from './types.gen.js';
4
+ import type { LaunchNftCollectionData, LaunchNftCollectionResponse, LaunchNftCollectionError, LaunchTokenData, LaunchTokenResponse, LaunchTokenError, GetContractInfoData, GetContractInfoResponse, GetContractInfoError, GetNftInfoData, GetNftInfoResponse, GetNftInfoError, GetNftV2InfoData, GetNftV2InfoResponse, GetNftV2InfoError, FaucetData, FaucetResponse2, FaucetError, GetTokenInfoData, GetTokenInfoResponse, GetTokenInfoError, GetTokenBalanceData, GetTokenBalanceResponse, GetTokenBalanceError, GetNonceData, GetNonceResponse, GetNonceError, GetTokenHoldersData, GetTokenHoldersResponse, GetTokenHoldersError, GetTransactionsData, GetTransactionsResponse, GetTransactionsError, ProveData, ProveResponse, ProveError, GetProofData, GetProofResponse, GetProofError, SendTransactionData, SendTransactionResponse, SendTransactionError, TxStatusData, TxStatusResponse, TxStatusError, MintTokensData, MintTokensResponse, MintTokensError, MintNftData, MintNftResponse, MintNftError, TransferNftData, TransferNftResponse, TransferNftError, ApproveNftData, ApproveNftResponse, ApproveNftError, SellNftData, SellNftResponse, SellNftError, BuyNftData, BuyNftResponse, BuyNftError, TransferTokensData, TransferTokensResponse, TransferTokensError, AirdropTokensData, AirdropTokensResponse, AirdropTokensError, RedeemTokensData, RedeemTokensResponse, RedeemTokensError, BurnTokensData, BurnTokensResponse, BurnTokensError, TokenBidData, TokenBidResponse, TokenBidError, TokenOfferData, TokenOfferResponse, TokenOfferError, BuyTokensData, BuyTokensResponse, BuyTokensError, SellTokensData, SellTokensResponse, SellTokensError, WithdrawTokenBidData, WithdrawTokenBidResponse, WithdrawTokenBidError, WithdrawTokenOfferData, WithdrawTokenOfferResponse, WithdrawTokenOfferError, UpdateTokenBidWhitelistData, UpdateTokenBidWhitelistResponse, UpdateTokenBidWhitelistError, UpdateTokenOfferWhitelistData, UpdateTokenOfferWhitelistResponse, UpdateTokenOfferWhitelistError, UpdateTokenAdminWhitelistData, UpdateTokenAdminWhitelistResponse, UpdateTokenAdminWhitelistError } from './types.gen.js';
5
5
  import { client as _heyApiClient } from './client.gen.js';
6
6
 
7
7
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
@@ -215,6 +215,50 @@ export const getNonce = <ThrowOnError extends boolean = false>(options: Options<
215
215
  });
216
216
  };
217
217
 
218
+ /**
219
+ * Retrieve the holders of a token
220
+ * The `holders` endpoint retrieves the holders of a token.
221
+ *
222
+ */
223
+ export const getTokenHolders = <ThrowOnError extends boolean = false>(options: Options<GetTokenHoldersData, ThrowOnError>) => {
224
+ return (options.client ?? _heyApiClient).post<GetTokenHoldersResponse, GetTokenHoldersError, ThrowOnError>({
225
+ security: [
226
+ {
227
+ name: 'x-api-key',
228
+ type: 'apiKey'
229
+ }
230
+ ],
231
+ url: '/info/holders',
232
+ ...options,
233
+ headers: {
234
+ 'Content-Type': 'application/json',
235
+ ...options?.headers
236
+ }
237
+ });
238
+ };
239
+
240
+ /**
241
+ * Retrieve the transactions of a address
242
+ * The `transactions` endpoint retrieves the transactions of a address.
243
+ *
244
+ */
245
+ export const getTransactions = <ThrowOnError extends boolean = false>(options: Options<GetTransactionsData, ThrowOnError>) => {
246
+ return (options.client ?? _heyApiClient).post<GetTransactionsResponse, GetTransactionsError, ThrowOnError>({
247
+ security: [
248
+ {
249
+ name: 'x-api-key',
250
+ type: 'apiKey'
251
+ }
252
+ ],
253
+ url: '/info/transactions',
254
+ ...options,
255
+ headers: {
256
+ 'Content-Type': 'application/json',
257
+ ...options?.headers
258
+ }
259
+ });
260
+ };
261
+
218
262
  /**
219
263
  * Generate proofs for signed token transactions.
220
264
  * The `prove` endpoint initiates the proof generation process for a set of signed token transactions.
@@ -41,6 +41,21 @@ export type BalanceRequestParams = {
41
41
  address: string;
42
42
  };
43
43
 
44
+ export type TransactionsListRequestParams = {
45
+ /**
46
+ * The address of the token contract (optional).
47
+ */
48
+ tokenAddress?: string;
49
+ /**
50
+ * The token ID (optional).
51
+ */
52
+ tokenId?: string;
53
+ /**
54
+ * The Mina address for which to retrieve the balance.
55
+ */
56
+ address: string;
57
+ };
58
+
44
59
  export type BalanceResponse = {
45
60
  /**
46
61
  * The address of the token contract (optional).
@@ -86,6 +101,95 @@ export type NonceResponse = {
86
101
  hasAccount?: boolean;
87
102
  };
88
103
 
104
+ export type TokenHolder = {
105
+ /**
106
+ * The address of the token holder
107
+ */
108
+ address: string;
109
+ /**
110
+ * The total token balance held by this address
111
+ */
112
+ balance: number;
113
+ /**
114
+ * The percentage of total token supply held by this address
115
+ */
116
+ percentage: number;
117
+ /**
118
+ * Whether this holder is a zkApp account
119
+ */
120
+ isZkappAccount: boolean;
121
+ };
122
+
123
+ export type TokenHoldersRequestParams = {
124
+ /**
125
+ * The Mina address for which to retrieve the holders
126
+ */
127
+ address: string;
128
+ };
129
+
130
+ export type TokenHoldersResponse = {
131
+ /**
132
+ * Array of token holders and their balances
133
+ */
134
+ holders: Array<TokenHolder>;
135
+ };
136
+
137
+ export type TransactionData = {
138
+ /**
139
+ * Timestamp of the transaction
140
+ */
141
+ timestamp: number;
142
+ /**
143
+ * Status of the transaction
144
+ */
145
+ status: string;
146
+ updatedAccounts: Array<{
147
+ /**
148
+ * Address of the updated account
149
+ */
150
+ accountAddress: string;
151
+ /**
152
+ * Whether this is a zkApp account
153
+ */
154
+ isZkappAccount: boolean;
155
+ /**
156
+ * Hash of the verification key
157
+ */
158
+ verificationKeyHash?: string;
159
+ }>;
160
+ /**
161
+ * Number of account updates in the transaction
162
+ */
163
+ accountUpdatesCount: number;
164
+ /**
165
+ * Address of the prover
166
+ */
167
+ proverAddress: string;
168
+ /**
169
+ * Whether this is a zkApp account
170
+ */
171
+ isZkappAccount: boolean;
172
+ /**
173
+ * Transaction hash
174
+ */
175
+ hash: string;
176
+ /**
177
+ * Transaction fee
178
+ */
179
+ fee: number;
180
+ /**
181
+ * Transaction memo
182
+ */
183
+ memo: string;
184
+ };
185
+
186
+ export type TransactionsListResponse = {
187
+ /**
188
+ * Array of transactions
189
+ */
190
+ transactions: Array<TransactionData>;
191
+ };
192
+
89
193
  export type ErrorResponse = {
90
194
  /**
91
195
  * Error message detailing the issue.
@@ -2020,6 +2124,96 @@ export type GetNonceResponses = {
2020
2124
 
2021
2125
  export type GetNonceResponse = GetNonceResponses[keyof GetNonceResponses];
2022
2126
 
2127
+ export type GetTokenHoldersData = {
2128
+ body: TokenHoldersRequestParams;
2129
+ path?: never;
2130
+ query?: never;
2131
+ url: '/info/holders';
2132
+ };
2133
+
2134
+ export type GetTokenHoldersErrors = {
2135
+ /**
2136
+ * Bad request - invalid input parameters.
2137
+ */
2138
+ 400: ErrorResponse;
2139
+ /**
2140
+ * Unauthorized - user not authenticated.
2141
+ */
2142
+ 401: ErrorResponse;
2143
+ /**
2144
+ * Forbidden - user doesn't have permission.
2145
+ */
2146
+ 403: ErrorResponse;
2147
+ /**
2148
+ * Too many requests.
2149
+ */
2150
+ 429: ErrorResponse;
2151
+ /**
2152
+ * Internal server error - something went wrong during the request.
2153
+ */
2154
+ 500: ErrorResponse;
2155
+ /**
2156
+ * Service unavailable - blockchain or other external service is down.
2157
+ */
2158
+ 503: ErrorResponse;
2159
+ };
2160
+
2161
+ export type GetTokenHoldersError = GetTokenHoldersErrors[keyof GetTokenHoldersErrors];
2162
+
2163
+ export type GetTokenHoldersResponses = {
2164
+ /**
2165
+ * Successful retrieval of token holders.
2166
+ */
2167
+ 200: TokenHoldersResponse;
2168
+ };
2169
+
2170
+ export type GetTokenHoldersResponse = GetTokenHoldersResponses[keyof GetTokenHoldersResponses];
2171
+
2172
+ export type GetTransactionsData = {
2173
+ body: TransactionsListRequestParams;
2174
+ path?: never;
2175
+ query?: never;
2176
+ url: '/info/transactions';
2177
+ };
2178
+
2179
+ export type GetTransactionsErrors = {
2180
+ /**
2181
+ * Bad request - invalid input parameters.
2182
+ */
2183
+ 400: ErrorResponse;
2184
+ /**
2185
+ * Unauthorized - user not authenticated.
2186
+ */
2187
+ 401: ErrorResponse;
2188
+ /**
2189
+ * Forbidden - user doesn't have permission.
2190
+ */
2191
+ 403: ErrorResponse;
2192
+ /**
2193
+ * Too many requests.
2194
+ */
2195
+ 429: ErrorResponse;
2196
+ /**
2197
+ * Internal server error - something went wrong during the request.
2198
+ */
2199
+ 500: ErrorResponse;
2200
+ /**
2201
+ * Service unavailable - blockchain or other external service is down.
2202
+ */
2203
+ 503: ErrorResponse;
2204
+ };
2205
+
2206
+ export type GetTransactionsError = GetTransactionsErrors[keyof GetTransactionsErrors];
2207
+
2208
+ export type GetTransactionsResponses = {
2209
+ /**
2210
+ * Successful retrieval of transactions.
2211
+ */
2212
+ 200: TransactionsListResponse;
2213
+ };
2214
+
2215
+ export type GetTransactionsResponse = GetTransactionsResponses[keyof GetTransactionsResponses];
2216
+
2023
2217
  export type ProveData = {
2024
2218
  body: ProveTokenTransaction | ProveTokenTransactions | ProveNftTransaction | ProveNftTransactions;
2025
2219
  path?: never;