@silvana-one/api 1.0.23 → 1.0.24

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.
Files changed (77) hide show
  1. package/dist/node/client/client/client.d.ts +2 -0
  2. package/dist/node/client/client/client.js +146 -0
  3. package/dist/node/client/client/client.js.map +1 -0
  4. package/dist/node/client/client/index.d.ts +7 -0
  5. package/dist/node/client/client/index.js +5 -0
  6. package/dist/node/client/client/index.js.map +1 -0
  7. package/dist/node/client/client/types.d.ts +119 -0
  8. package/dist/node/client/client/types.js +2 -0
  9. package/dist/node/client/client/types.js.map +1 -0
  10. package/dist/node/client/client/utils.d.ts +45 -0
  11. package/dist/node/client/client/utils.js +284 -0
  12. package/dist/node/client/client/utils.js.map +1 -0
  13. package/dist/node/client/client.gen.d.ts +2 -2
  14. package/dist/node/client/client.gen.js +1 -1
  15. package/dist/node/client/client.gen.js.map +1 -1
  16. package/dist/node/client/core/auth.d.ts +18 -0
  17. package/dist/node/client/core/auth.js +14 -0
  18. package/dist/node/client/core/auth.js.map +1 -0
  19. package/dist/node/client/core/bodySerializer.d.ts +17 -0
  20. package/dist/node/client/core/bodySerializer.js +54 -0
  21. package/dist/node/client/core/bodySerializer.js.map +1 -0
  22. package/dist/node/client/core/params.d.ts +23 -0
  23. package/dist/node/client/core/params.js +88 -0
  24. package/dist/node/client/core/params.js.map +1 -0
  25. package/dist/node/client/core/pathSerializer.d.ts +33 -0
  26. package/dist/node/client/core/pathSerializer.js +114 -0
  27. package/dist/node/client/core/pathSerializer.js.map +1 -0
  28. package/dist/node/client/core/types.d.ts +73 -0
  29. package/dist/node/client/core/types.js +2 -0
  30. package/dist/node/client/core/types.js.map +1 -0
  31. package/dist/node/client/sdk.gen.d.ts +38 -38
  32. package/dist/node/index.cjs +530 -2
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/dist/tsconfig.web.tsbuildinfo +1 -1
  35. package/dist/web/client/client/client.d.ts +2 -0
  36. package/dist/web/client/client/client.js +146 -0
  37. package/dist/web/client/client/client.js.map +1 -0
  38. package/dist/web/client/client/index.d.ts +7 -0
  39. package/dist/web/client/client/index.js +5 -0
  40. package/dist/web/client/client/index.js.map +1 -0
  41. package/dist/web/client/client/types.d.ts +119 -0
  42. package/dist/web/client/client/types.js +2 -0
  43. package/dist/web/client/client/types.js.map +1 -0
  44. package/dist/web/client/client/utils.d.ts +45 -0
  45. package/dist/web/client/client/utils.js +284 -0
  46. package/dist/web/client/client/utils.js.map +1 -0
  47. package/dist/web/client/client.gen.d.ts +2 -2
  48. package/dist/web/client/client.gen.js +1 -1
  49. package/dist/web/client/client.gen.js.map +1 -1
  50. package/dist/web/client/core/auth.d.ts +18 -0
  51. package/dist/web/client/core/auth.js +14 -0
  52. package/dist/web/client/core/auth.js.map +1 -0
  53. package/dist/web/client/core/bodySerializer.d.ts +17 -0
  54. package/dist/web/client/core/bodySerializer.js +54 -0
  55. package/dist/web/client/core/bodySerializer.js.map +1 -0
  56. package/dist/web/client/core/params.d.ts +23 -0
  57. package/dist/web/client/core/params.js +88 -0
  58. package/dist/web/client/core/params.js.map +1 -0
  59. package/dist/web/client/core/pathSerializer.d.ts +33 -0
  60. package/dist/web/client/core/pathSerializer.js +114 -0
  61. package/dist/web/client/core/pathSerializer.js.map +1 -0
  62. package/dist/web/client/core/types.d.ts +73 -0
  63. package/dist/web/client/core/types.js +2 -0
  64. package/dist/web/client/core/types.js.map +1 -0
  65. package/dist/web/client/sdk.gen.d.ts +38 -38
  66. package/package.json +4 -7
  67. package/src/client/client/client.ts +195 -0
  68. package/src/client/client/index.ts +22 -0
  69. package/src/client/client/types.ts +222 -0
  70. package/src/client/client/utils.ts +417 -0
  71. package/src/client/client.gen.ts +1 -1
  72. package/src/client/core/auth.ts +40 -0
  73. package/src/client/core/bodySerializer.ts +88 -0
  74. package/src/client/core/params.ts +141 -0
  75. package/src/client/core/pathSerializer.ts +179 -0
  76. package/src/client/core/types.ts +104 -0
  77. package/src/client/sdk.gen.ts +1 -1
@@ -1,4 +1,4 @@
1
- import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
1
+ import type { Options as ClientOptions, TDataShape, Client } from './client/index.js';
2
2
  import type { LaunchNftCollectionData, LaunchNftCollectionResponses, LaunchNftCollectionErrors, LaunchTokenData, LaunchTokenResponses, LaunchTokenErrors, GetContractInfoData, GetContractInfoResponses, GetContractInfoErrors, GetNftInfoData, GetNftInfoResponses, GetNftInfoErrors, GetNftV2InfoData, GetNftV2InfoResponses, GetNftV2InfoErrors, FaucetData, FaucetResponses, FaucetErrors, GetTokenInfoData, GetTokenInfoResponses, GetTokenInfoErrors, GetTokenBalanceData, GetTokenBalanceResponses, GetTokenBalanceErrors, GetNonceData, GetNonceResponses, GetNonceErrors, GetTokenHoldersData, GetTokenHoldersResponses, GetTokenHoldersErrors, GetTransactionsData, GetTransactionsResponses, GetTransactionsErrors, ProveData, ProveResponses, ProveErrors, GetProofData, GetProofResponses, GetProofErrors, SendTransactionData, SendTransactionResponses, SendTransactionErrors, TxStatusData, TxStatusResponses, TxStatusErrors, MintTokensData, MintTokensResponses, MintTokensErrors, MintNftData, MintNftResponses, MintNftErrors, TransferNftData, TransferNftResponses, TransferNftErrors, CmsStoreNftData, CmsStoreNftResponses, CmsStoreNftErrors, CmsReadNftData, CmsReadNftResponses, CmsReadNftErrors, CmsReserveNftData, CmsReserveNftResponses, CmsReserveNftErrors, ApproveNftData, ApproveNftResponses, ApproveNftErrors, SellNftData, SellNftResponses, SellNftErrors, BuyNftData, BuyNftResponses, BuyNftErrors, TransferTokensData, TransferTokensResponses, TransferTokensErrors, AirdropTokensData, AirdropTokensResponses, AirdropTokensErrors, RedeemTokensData, RedeemTokensResponses, RedeemTokensErrors, BurnTokensData, BurnTokensResponses, BurnTokensErrors, TokenBidData, TokenBidResponses, TokenBidErrors, TokenOfferData, TokenOfferResponses, TokenOfferErrors, BuyTokensData, BuyTokensResponses, BuyTokensErrors, SellTokensData, SellTokensResponses, SellTokensErrors, WithdrawTokenBidData, WithdrawTokenBidResponses, WithdrawTokenBidErrors, WithdrawTokenOfferData, WithdrawTokenOfferResponses, WithdrawTokenOfferErrors, UpdateTokenBidWhitelistData, UpdateTokenBidWhitelistResponses, UpdateTokenBidWhitelistErrors, UpdateTokenOfferWhitelistData, UpdateTokenOfferWhitelistResponses, UpdateTokenOfferWhitelistErrors, UpdateTokenAdminWhitelistData, UpdateTokenAdminWhitelistResponses, UpdateTokenAdminWhitelistErrors } from './types.gen.js';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
4
  /**
@@ -19,7 +19,7 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
19
19
  * It allows users to create a new NFT Collection with customizable parameters.
20
20
  *
21
21
  */
22
- export declare const launchNftCollection: <ThrowOnError extends boolean = false>(options: Options<LaunchNftCollectionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<LaunchNftCollectionResponses, LaunchNftCollectionErrors, ThrowOnError, "fields">;
22
+ export declare const launchNftCollection: <ThrowOnError extends boolean = false>(options: Options<LaunchNftCollectionData, ThrowOnError>) => import("./client/types.js").RequestResult<LaunchNftCollectionResponses, LaunchNftCollectionErrors, ThrowOnError, "fields">;
23
23
  /**
24
24
  * Deploy a new fungible token contract.
25
25
  * The `launch` endpoint is used to deploy a new fungible token on the Mina blockchain.
@@ -27,83 +27,83 @@ export declare const launchNftCollection: <ThrowOnError extends boolean = false>
27
27
  * decimals, URI, and admin contract type (standard or advanced).
28
28
  *
29
29
  */
30
- export declare const launchToken: <ThrowOnError extends boolean = false>(options: Options<LaunchTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<LaunchTokenResponses, LaunchTokenErrors, ThrowOnError, "fields">;
30
+ export declare const launchToken: <ThrowOnError extends boolean = false>(options: Options<LaunchTokenData, ThrowOnError>) => import("./client/types.js").RequestResult<LaunchTokenResponses, LaunchTokenErrors, ThrowOnError, "fields">;
31
31
  /**
32
32
  * Retrieve contract info
33
33
  * Retrieves detailed information about a contract.
34
34
  */
35
- export declare const getContractInfo: <ThrowOnError extends boolean = false>(options: Options<GetContractInfoData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetContractInfoResponses, GetContractInfoErrors, ThrowOnError, "fields">;
35
+ export declare const getContractInfo: <ThrowOnError extends boolean = false>(options: Options<GetContractInfoData, ThrowOnError>) => import("./client/types.js").RequestResult<GetContractInfoResponses, GetContractInfoErrors, ThrowOnError, "fields">;
36
36
  /**
37
37
  * Retrieve NFT Info for Mina NFT V3
38
38
  * Retrieves detailed information about a Mina NFT V3 (NFT standard).
39
39
  */
40
- export declare const getNftInfo: <ThrowOnError extends boolean = false>(options: Options<GetNftInfoData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetNftInfoResponses, GetNftInfoErrors, ThrowOnError, "fields">;
40
+ export declare const getNftInfo: <ThrowOnError extends boolean = false>(options: Options<GetNftInfoData, ThrowOnError>) => import("./client/types.js").RequestResult<GetNftInfoResponses, GetNftInfoErrors, ThrowOnError, "fields">;
41
41
  /**
42
42
  * Retrieve NFT Info for Mina NFT V2
43
43
  * Retrieves detailed information about a Mina NFT V2.
44
44
  */
45
- export declare const getNftV2Info: <ThrowOnError extends boolean = false>(options: Options<GetNftV2InfoData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetNftV2InfoResponses, GetNftV2InfoErrors, ThrowOnError, "fields">;
45
+ export declare const getNftV2Info: <ThrowOnError extends boolean = false>(options: Options<GetNftV2InfoData, ThrowOnError>) => import("./client/types.js").RequestResult<GetNftV2InfoResponses, GetNftV2InfoErrors, ThrowOnError, "fields">;
46
46
  /**
47
47
  * Request Funds from Faucet
48
48
  * Requests funds from the faucet for testing purposes.
49
49
  */
50
- export declare const faucet: <ThrowOnError extends boolean = false>(options: Options<FaucetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<FaucetResponses, FaucetErrors, ThrowOnError, "fields">;
50
+ export declare const faucet: <ThrowOnError extends boolean = false>(options: Options<FaucetData, ThrowOnError>) => import("./client/types.js").RequestResult<FaucetResponses, FaucetErrors, ThrowOnError, "fields">;
51
51
  /**
52
52
  * Retrieve information about a fungible token.
53
53
  * The `info` endpoint retrieves detailed information about a specific fungible token deployed on the Mina blockchain.
54
54
  *
55
55
  */
56
- export declare const getTokenInfo: <ThrowOnError extends boolean = false>(options: Options<GetTokenInfoData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetTokenInfoResponses, GetTokenInfoErrors, ThrowOnError, "fields">;
56
+ export declare const getTokenInfo: <ThrowOnError extends boolean = false>(options: Options<GetTokenInfoData, ThrowOnError>) => import("./client/types.js").RequestResult<GetTokenInfoResponses, GetTokenInfoErrors, ThrowOnError, "fields">;
57
57
  /**
58
58
  * Retrieve the balance of a specific token for an address.
59
59
  * The `balance` endpoint retrieves the balance of a specific fungible token for a given Mina address.
60
60
  *
61
61
  */
62
- export declare const getTokenBalance: <ThrowOnError extends boolean = false>(options: Options<GetTokenBalanceData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetTokenBalanceResponses, GetTokenBalanceErrors, ThrowOnError, "fields">;
62
+ export declare const getTokenBalance: <ThrowOnError extends boolean = false>(options: Options<GetTokenBalanceData, ThrowOnError>) => import("./client/types.js").RequestResult<GetTokenBalanceResponses, GetTokenBalanceErrors, ThrowOnError, "fields">;
63
63
  /**
64
64
  * Retrieve the nonce for an address
65
65
  * The `nonce` endpoint retrieves the nonce for a given Mina address, taking into account the pending transactions.
66
66
  *
67
67
  */
68
- export declare const getNonce: <ThrowOnError extends boolean = false>(options: Options<GetNonceData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetNonceResponses, GetNonceErrors, ThrowOnError, "fields">;
68
+ export declare const getNonce: <ThrowOnError extends boolean = false>(options: Options<GetNonceData, ThrowOnError>) => import("./client/types.js").RequestResult<GetNonceResponses, GetNonceErrors, ThrowOnError, "fields">;
69
69
  /**
70
70
  * Retrieve the holders of a token
71
71
  * The `holders` endpoint retrieves the holders of a token.
72
72
  *
73
73
  */
74
- export declare const getTokenHolders: <ThrowOnError extends boolean = false>(options: Options<GetTokenHoldersData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetTokenHoldersResponses, GetTokenHoldersErrors, ThrowOnError, "fields">;
74
+ export declare const getTokenHolders: <ThrowOnError extends boolean = false>(options: Options<GetTokenHoldersData, ThrowOnError>) => import("./client/types.js").RequestResult<GetTokenHoldersResponses, GetTokenHoldersErrors, ThrowOnError, "fields">;
75
75
  /**
76
76
  * Retrieve the transactions of a address
77
77
  * The `transactions` endpoint retrieves the transactions of a address.
78
78
  *
79
79
  */
80
- export declare const getTransactions: <ThrowOnError extends boolean = false>(options: Options<GetTransactionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetTransactionsResponses, GetTransactionsErrors, ThrowOnError, "fields">;
80
+ export declare const getTransactions: <ThrowOnError extends boolean = false>(options: Options<GetTransactionsData, ThrowOnError>) => import("./client/types.js").RequestResult<GetTransactionsResponses, GetTransactionsErrors, ThrowOnError, "fields">;
81
81
  /**
82
82
  * Generate proofs for signed token transactions.
83
83
  * The `prove` endpoint initiates the proof generation process for a set of signed token transactions.
84
84
  * It returns a job ID which can be used to check the status and retrieve the proofs or tx hashes using the `/proof` endpoint.
85
85
  *
86
86
  */
87
- export declare const prove: <ThrowOnError extends boolean = false>(options: Options<ProveData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<ProveResponses, ProveErrors, ThrowOnError, "fields">;
87
+ export declare const prove: <ThrowOnError extends boolean = false>(options: Options<ProveData, ThrowOnError>) => import("./client/types.js").RequestResult<ProveResponses, ProveErrors, ThrowOnError, "fields">;
88
88
  /**
89
89
  * Check the status of a proof generation job and retrieve proofs.
90
90
  * The `proof` endpoint allows you to check the status of a proof generation job initiated via the `/prove` endpoint.
91
91
  * It returns the status of the job and the proofs or tx hashes if they are ready.
92
92
  *
93
93
  */
94
- export declare const getProof: <ThrowOnError extends boolean = false>(options: Options<GetProofData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<GetProofResponses, GetProofErrors, ThrowOnError, "fields">;
94
+ export declare const getProof: <ThrowOnError extends boolean = false>(options: Options<GetProofData, ThrowOnError>) => import("./client/types.js").RequestResult<GetProofResponses, GetProofErrors, ThrowOnError, "fields">;
95
95
  /**
96
96
  * Send a transaction to the Mina blockchain.
97
97
  * The `send` endpoint allows you to send a transaction to the Mina blockchain.
98
98
  *
99
99
  */
100
- export declare const sendTransaction: <ThrowOnError extends boolean = false>(options: Options<SendTransactionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<SendTransactionResponses, SendTransactionErrors, ThrowOnError, "fields">;
100
+ export declare const sendTransaction: <ThrowOnError extends boolean = false>(options: Options<SendTransactionData, ThrowOnError>) => import("./client/types.js").RequestResult<SendTransactionResponses, SendTransactionErrors, ThrowOnError, "fields">;
101
101
  /**
102
102
  * Retrieve the status of a transaction by its hash.
103
103
  * The `tx-status` endpoint allows you to check the current status of a transaction on the Mina blockchain by providing the transaction hash. It returns whether the transaction has been applied, failed, or is still pending.
104
104
  *
105
105
  */
106
- export declare const txStatus: <ThrowOnError extends boolean = false>(options: Options<TxStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<TxStatusResponses, TxStatusErrors, ThrowOnError, "fields">;
106
+ export declare const txStatus: <ThrowOnError extends boolean = false>(options: Options<TxStatusData, ThrowOnError>) => import("./client/types.js").RequestResult<TxStatusResponses, TxStatusErrors, ThrowOnError, "fields">;
107
107
  /**
108
108
  * Mint new tokens to a specified address.
109
109
  * The `mint` endpoint allows authorized users to mint new tokens of a fungible token on the Mina blockchain.
@@ -111,7 +111,7 @@ export declare const txStatus: <ThrowOnError extends boolean = false>(options: O
111
111
  * The sender must have the authority to mint tokens, typically the admin of the token contract.
112
112
  *
113
113
  */
114
- export declare const mintTokens: <ThrowOnError extends boolean = false>(options: Options<MintTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<MintTokensResponses, MintTokensErrors, ThrowOnError, "fields">;
114
+ export declare const mintTokens: <ThrowOnError extends boolean = false>(options: Options<MintTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<MintTokensResponses, MintTokensErrors, ThrowOnError, "fields">;
115
115
  /**
116
116
  * Mint new NFT to a specified address.
117
117
  * The `mint` endpoint allows authorized users to mint new NFT on the Mina blockchain.
@@ -119,136 +119,136 @@ export declare const mintTokens: <ThrowOnError extends boolean = false>(options:
119
119
  * The sender must have the authority to mint NFTs, typically the admin of the NFT contract.
120
120
  *
121
121
  */
122
- export declare const mintNft: <ThrowOnError extends boolean = false>(options: Options<MintNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<MintNftResponses, MintNftErrors, ThrowOnError, "fields">;
122
+ export declare const mintNft: <ThrowOnError extends boolean = false>(options: Options<MintNftData, ThrowOnError>) => import("./client/types.js").RequestResult<MintNftResponses, MintNftErrors, ThrowOnError, "fields">;
123
123
  /**
124
124
  * Transfer NFT to a specified address.
125
125
  * The `transfer` endpoint allows authorized users to transfer NFT on the Mina blockchain.
126
126
  * The sender must have the authority to transfer NFTs, being the owner or approved address of the NFT.
127
127
  *
128
128
  */
129
- export declare const transferNft: <ThrowOnError extends boolean = false>(options: Options<TransferNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<TransferNftResponses, TransferNftErrors, ThrowOnError, "fields">;
129
+ export declare const transferNft: <ThrowOnError extends boolean = false>(options: Options<TransferNftData, ThrowOnError>) => import("./client/types.js").RequestResult<TransferNftResponses, TransferNftErrors, ThrowOnError, "fields">;
130
130
  /**
131
131
  * Store on-demand NFT in CMS
132
132
  * The `store` endpoint allows collection creators to store on-demand NFT in CMS.
133
133
  *
134
134
  */
135
- export declare const cmsStoreNft: <ThrowOnError extends boolean = false>(options: Options<CmsStoreNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<CmsStoreNftResponses, CmsStoreNftErrors, ThrowOnError, "fields">;
135
+ export declare const cmsStoreNft: <ThrowOnError extends boolean = false>(options: Options<CmsStoreNftData, ThrowOnError>) => import("./client/types.js").RequestResult<CmsStoreNftResponses, CmsStoreNftErrors, ThrowOnError, "fields">;
136
136
  /**
137
137
  * Read on-demand NFT from CMS
138
138
  * The `read` endpoint allows collection creators to read on-demand NFT from CMS.
139
139
  *
140
140
  */
141
- export declare const cmsReadNft: <ThrowOnError extends boolean = false>(options: Options<CmsReadNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<CmsReadNftResponses, CmsReadNftErrors, ThrowOnError, "fields">;
141
+ export declare const cmsReadNft: <ThrowOnError extends boolean = false>(options: Options<CmsReadNftData, ThrowOnError>) => import("./client/types.js").RequestResult<CmsReadNftResponses, CmsReadNftErrors, ThrowOnError, "fields">;
142
142
  /**
143
143
  * Reserve or remove reserve of on-demand NFT in CMS
144
144
  * The `reserve` endpoint allows collection admins to reserve or remove reserve of on-demand NFT in CMS.
145
145
  *
146
146
  */
147
- export declare const cmsReserveNft: <ThrowOnError extends boolean = false>(options: Options<CmsReserveNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<CmsReserveNftResponses, CmsReserveNftErrors, ThrowOnError, "fields">;
147
+ export declare const cmsReserveNft: <ThrowOnError extends boolean = false>(options: Options<CmsReserveNftData, ThrowOnError>) => import("./client/types.js").RequestResult<CmsReserveNftResponses, CmsReserveNftErrors, ThrowOnError, "fields">;
148
148
  /**
149
149
  * Approve a specified address to transfer NFT.
150
150
  * The `approve` endpoint allows authorized users to approve a specified address to transfer NFT.
151
151
  * The sender must have the authority to approve NFTs, being the owner of the NFT.
152
152
  *
153
153
  */
154
- export declare const approveNft: <ThrowOnError extends boolean = false>(options: Options<ApproveNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<ApproveNftResponses, ApproveNftErrors, ThrowOnError, "fields">;
154
+ export declare const approveNft: <ThrowOnError extends boolean = false>(options: Options<ApproveNftData, ThrowOnError>) => import("./client/types.js").RequestResult<ApproveNftResponses, ApproveNftErrors, ThrowOnError, "fields">;
155
155
  /**
156
156
  * Sell NFT at a specified price by creating a Offer contract.
157
157
  * The `sell` endpoint allows authorized users to sell NFT on the Mina blockchain.
158
158
  * The sender must have the authority to sell NFTs, being the owner of the NFT or approved address.
159
159
  *
160
160
  */
161
- export declare const sellNft: <ThrowOnError extends boolean = false>(options: Options<SellNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<SellNftResponses, SellNftErrors, ThrowOnError, "fields">;
161
+ export declare const sellNft: <ThrowOnError extends boolean = false>(options: Options<SellNftData, ThrowOnError>) => import("./client/types.js").RequestResult<SellNftResponses, SellNftErrors, ThrowOnError, "fields">;
162
162
  /**
163
163
  * Buy NFT.
164
164
  * The `buy` endpoint allows authorized users to buy NFT on the Mina blockchain.
165
165
  *
166
166
  */
167
- export declare const buyNft: <ThrowOnError extends boolean = false>(options: Options<BuyNftData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<BuyNftResponses, BuyNftErrors, ThrowOnError, "fields">;
167
+ export declare const buyNft: <ThrowOnError extends boolean = false>(options: Options<BuyNftData, ThrowOnError>) => import("./client/types.js").RequestResult<BuyNftResponses, BuyNftErrors, ThrowOnError, "fields">;
168
168
  /**
169
169
  * Transfer tokens from one address to another.
170
170
  * The `transfer` endpoint allows users to transfer tokens of a fungible token on the Mina blockchain from one address to another.
171
171
  * The sender must have sufficient balance and appropriate permissions to perform the transfer.
172
172
  *
173
173
  */
174
- export declare const transferTokens: <ThrowOnError extends boolean = false>(options: Options<TransferTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<TransferTokensResponses, TransferTokensErrors, ThrowOnError, "fields">;
174
+ export declare const transferTokens: <ThrowOnError extends boolean = false>(options: Options<TransferTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<TransferTokensResponses, TransferTokensErrors, ThrowOnError, "fields">;
175
175
  /**
176
176
  * Distribute tokens to multiple addresses via airdrop.
177
177
  * Allows users to distribute tokens to multiple addresses in a single transaction.
178
178
  * This is efficient for distributing tokens during events like token launches or community rewards.
179
179
  *
180
180
  */
181
- export declare const airdropTokens: <ThrowOnError extends boolean = false>(options: Options<AirdropTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<AirdropTokensResponses, AirdropTokensErrors, ThrowOnError, "fields">;
181
+ export declare const airdropTokens: <ThrowOnError extends boolean = false>(options: Options<AirdropTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<AirdropTokensResponses, AirdropTokensErrors, ThrowOnError, "fields">;
182
182
  /**
183
183
  * Redeem tokens for a MINA (applicable for Fungible Tokens with Bonding Curve Admin)
184
184
  * The `redeem` endpoint allows users to redeem tokens of a fungible token on the Mina blockchain for a MINA.
185
185
  * The sender must have sufficient balance and appropriate permissions to perform the transfer.
186
186
  *
187
187
  */
188
- export declare const redeemTokens: <ThrowOnError extends boolean = false>(options: Options<RedeemTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<RedeemTokensResponses, RedeemTokensErrors, ThrowOnError, "fields">;
188
+ export declare const redeemTokens: <ThrowOnError extends boolean = false>(options: Options<RedeemTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<RedeemTokensResponses, RedeemTokensErrors, ThrowOnError, "fields">;
189
189
  /**
190
190
  * Burn tokens from one address.
191
191
  * The `burn` endpoint allows users to burn tokens of a fungible token on the Mina blockchain from one address.
192
192
  * The sender must have sufficient balance and appropriate permissions to perform the burn.
193
193
  *
194
194
  */
195
- export declare const burnTokens: <ThrowOnError extends boolean = false>(options: Options<BurnTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<BurnTokensResponses, BurnTokensErrors, ThrowOnError, "fields">;
195
+ export declare const burnTokens: <ThrowOnError extends boolean = false>(options: Options<BurnTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<BurnTokensResponses, BurnTokensErrors, ThrowOnError, "fields">;
196
196
  /**
197
197
  * Place a bid on a token
198
198
  * Allows users to place a bid on an token.
199
199
  *
200
200
  */
201
- export declare const tokenBid: <ThrowOnError extends boolean = false>(options: Options<TokenBidData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<TokenBidResponses, TokenBidErrors, ThrowOnError, "fields">;
201
+ export declare const tokenBid: <ThrowOnError extends boolean = false>(options: Options<TokenBidData, ThrowOnError>) => import("./client/types.js").RequestResult<TokenBidResponses, TokenBidErrors, ThrowOnError, "fields">;
202
202
  /**
203
203
  * Create an offer to sell tokens at a specified price.
204
204
  * Allows users to create an offer to sell a specified amount of tokens at a given price.
205
205
  *
206
206
  */
207
- export declare const tokenOffer: <ThrowOnError extends boolean = false>(options: Options<TokenOfferData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<TokenOfferResponses, TokenOfferErrors, ThrowOnError, "fields">;
207
+ export declare const tokenOffer: <ThrowOnError extends boolean = false>(options: Options<TokenOfferData, ThrowOnError>) => import("./client/types.js").RequestResult<TokenOfferResponses, TokenOfferErrors, ThrowOnError, "fields">;
208
208
  /**
209
209
  * Purchase tokens from an existing offer.
210
210
  * Allows users to purchase tokens from an existing offer on the Mina blockchain.
211
211
  * This endpoint facilitates the transaction where tokens are transferred from the offer address to the buyer's address in exchange for the specified price.
212
212
  *
213
213
  */
214
- export declare const buyTokens: <ThrowOnError extends boolean = false>(options: Options<BuyTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<BuyTokensResponses, BuyTokensErrors, ThrowOnError, "fields">;
214
+ export declare const buyTokens: <ThrowOnError extends boolean = false>(options: Options<BuyTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<BuyTokensResponses, BuyTokensErrors, ThrowOnError, "fields">;
215
215
  /**
216
216
  * Sell a token to the Bid contract.
217
217
  * Allows token owners to sell their tokens to the Bid contract.
218
218
  *
219
219
  */
220
- export declare const sellTokens: <ThrowOnError extends boolean = false>(options: Options<SellTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<SellTokensResponses, SellTokensErrors, ThrowOnError, "fields">;
220
+ export declare const sellTokens: <ThrowOnError extends boolean = false>(options: Options<SellTokensData, ThrowOnError>) => import("./client/types.js").RequestResult<SellTokensResponses, SellTokensErrors, ThrowOnError, "fields">;
221
221
  /**
222
222
  * Withdraw a previously placed bid on an token.
223
223
  * Allows users to withdraw a bid they have previously placed using the `/bid` endpoint.
224
224
  * This transaction cancels the active bid, releasing any locked funds.
225
225
  *
226
226
  */
227
- export declare const withdrawTokenBid: <ThrowOnError extends boolean = false>(options: Options<WithdrawTokenBidData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<WithdrawTokenBidResponses, WithdrawTokenBidErrors, ThrowOnError, "fields">;
227
+ export declare const withdrawTokenBid: <ThrowOnError extends boolean = false>(options: Options<WithdrawTokenBidData, ThrowOnError>) => import("./client/types.js").RequestResult<WithdrawTokenBidResponses, WithdrawTokenBidErrors, ThrowOnError, "fields">;
228
228
  /**
229
229
  * Withdraw a previously made offer to sell a token.
230
230
  * Allows users to withdraw an offer they have previously made using the `/offer` endpoint.
231
231
  * This transaction cancels the active offer, releasing any locked tokens.
232
232
  *
233
233
  */
234
- export declare const withdrawTokenOffer: <ThrowOnError extends boolean = false>(options: Options<WithdrawTokenOfferData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<WithdrawTokenOfferResponses, WithdrawTokenOfferErrors, ThrowOnError, "fields">;
234
+ export declare const withdrawTokenOffer: <ThrowOnError extends boolean = false>(options: Options<WithdrawTokenOfferData, ThrowOnError>) => import("./client/types.js").RequestResult<WithdrawTokenOfferResponses, WithdrawTokenOfferErrors, ThrowOnError, "fields">;
235
235
  /**
236
236
  * Update the bid whitelist
237
237
  * Allows administrators to update the whitelist of addresses permitted to interact with the Bid contract.
238
238
  * This is essential for managing participation in bidding processes, especially for controlled or private auctions.
239
239
  *
240
240
  */
241
- export declare const updateTokenBidWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenBidWhitelistData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<UpdateTokenBidWhitelistResponses, UpdateTokenBidWhitelistErrors, ThrowOnError, "fields">;
241
+ export declare const updateTokenBidWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenBidWhitelistData, ThrowOnError>) => import("./client/types.js").RequestResult<UpdateTokenBidWhitelistResponses, UpdateTokenBidWhitelistErrors, ThrowOnError, "fields">;
242
242
  /**
243
243
  * Update the offer whitelist
244
244
  * Allows administrators to update the whitelist of addresses permitted to interact with the Offer contract.
245
245
  * This is essential for managing participation in offer processes, especially for controlled or private sales.
246
246
  *
247
247
  */
248
- export declare const updateTokenOfferWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenOfferWhitelistData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<UpdateTokenOfferWhitelistResponses, UpdateTokenOfferWhitelistErrors, ThrowOnError, "fields">;
248
+ export declare const updateTokenOfferWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenOfferWhitelistData, ThrowOnError>) => import("./client/types.js").RequestResult<UpdateTokenOfferWhitelistResponses, UpdateTokenOfferWhitelistErrors, ThrowOnError, "fields">;
249
249
  /**
250
250
  * Update the advanced admin whitelist
251
251
  * Allows administrators to update the whitelist of admin contracts.
252
252
  *
253
253
  */
254
- export declare const updateTokenAdminWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenAdminWhitelistData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<UpdateTokenAdminWhitelistResponses, UpdateTokenAdminWhitelistErrors, ThrowOnError, "fields">;
254
+ export declare const updateTokenAdminWhitelist: <ThrowOnError extends boolean = false>(options: Options<UpdateTokenAdminWhitelistData, ThrowOnError>) => import("./client/types.js").RequestResult<UpdateTokenAdminWhitelistResponses, UpdateTokenAdminWhitelistErrors, ThrowOnError, "fields">;
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "@silvana-one/api",
3
3
  "description": "Silvana API",
4
- "version": "1.0.23",
4
+ "version": "1.0.24",
5
5
  "author": "DFST",
6
6
  "bugs": "https://github.com/SilvanaOne/silvana-lib/issues",
7
- "dependencies": {
8
- "@hey-api/client-fetch": "^0.13.0"
9
- },
10
7
  "devDependencies": {
11
- "@hey-api/openapi-ts": "^0.72.1",
12
- "@types/node": "^24.0.1",
13
- "esbuild": "^0.25.5",
8
+ "@hey-api/openapi-ts": "^0.78.3",
9
+ "@types/node": "^24.0.14",
10
+ "esbuild": "^0.25.6",
14
11
  "typescript": "^5.8.3"
15
12
  },
16
13
  "engines": {
@@ -0,0 +1,195 @@
1
+ import type { Client, Config, RequestOptions } from './types.js';
2
+ import {
3
+ buildUrl,
4
+ createConfig,
5
+ createInterceptors,
6
+ getParseAs,
7
+ mergeConfigs,
8
+ mergeHeaders,
9
+ setAuthParams,
10
+ } from './utils.js';
11
+
12
+ type ReqInit = Omit<RequestInit, 'body' | 'headers'> & {
13
+ body?: any;
14
+ headers: ReturnType<typeof mergeHeaders>;
15
+ };
16
+
17
+ export const createClient = (config: Config = {}): Client => {
18
+ let _config = mergeConfigs(createConfig(), config);
19
+
20
+ const getConfig = (): Config => ({ ..._config });
21
+
22
+ const setConfig = (config: Config): Config => {
23
+ _config = mergeConfigs(_config, config);
24
+ return getConfig();
25
+ };
26
+
27
+ const interceptors = createInterceptors<
28
+ Request,
29
+ Response,
30
+ unknown,
31
+ RequestOptions
32
+ >();
33
+
34
+ const request: Client['request'] = async (options) => {
35
+ const opts = {
36
+ ..._config,
37
+ ...options,
38
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
39
+ headers: mergeHeaders(_config.headers, options.headers),
40
+ };
41
+
42
+ if (opts.security) {
43
+ await setAuthParams({
44
+ ...opts,
45
+ security: opts.security,
46
+ });
47
+ }
48
+
49
+ if (opts.requestValidator) {
50
+ await opts.requestValidator(opts);
51
+ }
52
+
53
+ if (opts.body && opts.bodySerializer) {
54
+ opts.body = opts.bodySerializer(opts.body);
55
+ }
56
+
57
+ // remove Content-Type header if body is empty to avoid sending invalid requests
58
+ if (opts.body === undefined || opts.body === '') {
59
+ opts.headers.delete('Content-Type');
60
+ }
61
+
62
+ const url = buildUrl(opts);
63
+ const requestInit: ReqInit = {
64
+ redirect: 'follow',
65
+ ...opts,
66
+ };
67
+
68
+ let request = new Request(url, requestInit);
69
+
70
+ for (const fn of interceptors.request._fns) {
71
+ if (fn) {
72
+ request = await fn(request, opts);
73
+ }
74
+ }
75
+
76
+ // fetch must be assigned here, otherwise it would throw the error:
77
+ // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
78
+ const _fetch = opts.fetch!;
79
+ let response = await _fetch(request);
80
+
81
+ for (const fn of interceptors.response._fns) {
82
+ if (fn) {
83
+ response = await fn(response, request, opts);
84
+ }
85
+ }
86
+
87
+ const result = {
88
+ request,
89
+ response,
90
+ };
91
+
92
+ if (response.ok) {
93
+ if (
94
+ response.status === 204 ||
95
+ response.headers.get('Content-Length') === '0'
96
+ ) {
97
+ return opts.responseStyle === 'data'
98
+ ? {}
99
+ : {
100
+ data: {},
101
+ ...result,
102
+ };
103
+ }
104
+
105
+ const parseAs =
106
+ (opts.parseAs === 'auto'
107
+ ? getParseAs(response.headers.get('Content-Type'))
108
+ : opts.parseAs) ?? 'json';
109
+
110
+ let data: any;
111
+ switch (parseAs) {
112
+ case 'arrayBuffer':
113
+ case 'blob':
114
+ case 'formData':
115
+ case 'json':
116
+ case 'text':
117
+ data = await response[parseAs]();
118
+ break;
119
+ case 'stream':
120
+ return opts.responseStyle === 'data'
121
+ ? response.body
122
+ : {
123
+ data: response.body,
124
+ ...result,
125
+ };
126
+ }
127
+
128
+ if (parseAs === 'json') {
129
+ if (opts.responseValidator) {
130
+ await opts.responseValidator(data);
131
+ }
132
+
133
+ if (opts.responseTransformer) {
134
+ data = await opts.responseTransformer(data);
135
+ }
136
+ }
137
+
138
+ return opts.responseStyle === 'data'
139
+ ? data
140
+ : {
141
+ data,
142
+ ...result,
143
+ };
144
+ }
145
+
146
+ const textError = await response.text();
147
+ let jsonError: unknown;
148
+
149
+ try {
150
+ jsonError = JSON.parse(textError);
151
+ } catch {
152
+ // noop
153
+ }
154
+
155
+ const error = jsonError ?? textError;
156
+ let finalError = error;
157
+
158
+ for (const fn of interceptors.error._fns) {
159
+ if (fn) {
160
+ finalError = (await fn(error, response, request, opts)) as string;
161
+ }
162
+ }
163
+
164
+ finalError = finalError || ({} as string);
165
+
166
+ if (opts.throwOnError) {
167
+ throw finalError;
168
+ }
169
+
170
+ // TODO: we probably want to return error and improve types
171
+ return opts.responseStyle === 'data'
172
+ ? undefined
173
+ : {
174
+ error: finalError,
175
+ ...result,
176
+ };
177
+ };
178
+
179
+ return {
180
+ buildUrl,
181
+ connect: (options) => request({ ...options, method: 'CONNECT' }),
182
+ delete: (options) => request({ ...options, method: 'DELETE' }),
183
+ get: (options) => request({ ...options, method: 'GET' }),
184
+ getConfig,
185
+ head: (options) => request({ ...options, method: 'HEAD' }),
186
+ interceptors,
187
+ options: (options) => request({ ...options, method: 'OPTIONS' }),
188
+ patch: (options) => request({ ...options, method: 'PATCH' }),
189
+ post: (options) => request({ ...options, method: 'POST' }),
190
+ put: (options) => request({ ...options, method: 'PUT' }),
191
+ request,
192
+ setConfig,
193
+ trace: (options) => request({ ...options, method: 'TRACE' }),
194
+ };
195
+ };
@@ -0,0 +1,22 @@
1
+ export type { Auth } from '../core/auth.js';
2
+ export type { QuerySerializerOptions } from '../core/bodySerializer.js';
3
+ export {
4
+ formDataBodySerializer,
5
+ jsonBodySerializer,
6
+ urlSearchParamsBodySerializer,
7
+ } from '../core/bodySerializer.js';
8
+ export { buildClientParams } from '../core/params.js';
9
+ export { createClient } from './client.js';
10
+ export type {
11
+ Client,
12
+ ClientOptions,
13
+ Config,
14
+ CreateClientConfig,
15
+ Options,
16
+ OptionsLegacyParser,
17
+ RequestOptions,
18
+ RequestResult,
19
+ ResponseStyle,
20
+ TDataShape,
21
+ } from './types.js';
22
+ export { createConfig, mergeHeaders } from './utils.js';