|
| 1 | +/* generated using openapi-typescript-codegen -- do no edit */ |
| 2 | +/* istanbul ignore file */ |
| 3 | +/* tslint:disable */ |
| 4 | +/* eslint-disable */ |
| 5 | +import type { CancelablePromise } from '../core/CancelablePromise'; |
| 6 | +import type { BaseHttpRequest } from '../core/BaseHttpRequest'; |
| 7 | + |
| 8 | +export class BalanceSubscriptionsService { |
| 9 | + |
| 10 | + constructor(public readonly httpRequest: BaseHttpRequest) {} |
| 11 | + |
| 12 | + /** |
| 13 | + * Get balance subscriptions |
| 14 | + * Get all balance subscriptions. |
| 15 | + * @returns any Default Response |
| 16 | + * @throws ApiError |
| 17 | + */ |
| 18 | + public getAllBalanceSubscriptions(): CancelablePromise<{ |
| 19 | + result: Array<{ |
| 20 | + id: string; |
| 21 | + /** |
| 22 | + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. |
| 23 | + */ |
| 24 | + chain: string; |
| 25 | + /** |
| 26 | + * A contract or wallet address |
| 27 | + */ |
| 28 | + contractAddress?: string; |
| 29 | + /** |
| 30 | + * A contract or wallet address |
| 31 | + */ |
| 32 | + walletAddress: string; |
| 33 | + config: { |
| 34 | + threshold?: { |
| 35 | + /** |
| 36 | + * Minimum balance threshold |
| 37 | + */ |
| 38 | + min?: string; |
| 39 | + /** |
| 40 | + * Maximum balance threshold |
| 41 | + */ |
| 42 | + max?: string; |
| 43 | + }; |
| 44 | + }; |
| 45 | + webhook?: { |
| 46 | + url: string; |
| 47 | + }; |
| 48 | + createdAt: string; |
| 49 | + updatedAt: string; |
| 50 | + }>; |
| 51 | + }> { |
| 52 | + return this.httpRequest.request({ |
| 53 | + method: 'GET', |
| 54 | + url: '/balance-subscriptions/get-all', |
| 55 | + errors: { |
| 56 | + 400: `Bad Request`, |
| 57 | + 404: `Not Found`, |
| 58 | + 500: `Internal Server Error`, |
| 59 | + }, |
| 60 | + }); |
| 61 | + } |
| 62 | + |
| 63 | + /** |
| 64 | + * Add balance subscription |
| 65 | + * Subscribe to balance changes for a wallet. |
| 66 | + * @param requestBody |
| 67 | + * @returns any Default Response |
| 68 | + * @throws ApiError |
| 69 | + */ |
| 70 | + public addBalanceSubscription( |
| 71 | + requestBody: { |
| 72 | + /** |
| 73 | + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. |
| 74 | + */ |
| 75 | + chain: string; |
| 76 | + /** |
| 77 | + * A contract or wallet address |
| 78 | + */ |
| 79 | + contractAddress?: string; |
| 80 | + /** |
| 81 | + * A contract or wallet address |
| 82 | + */ |
| 83 | + walletAddress: string; |
| 84 | + config: { |
| 85 | + threshold?: { |
| 86 | + /** |
| 87 | + * Minimum balance threshold |
| 88 | + */ |
| 89 | + min?: string; |
| 90 | + /** |
| 91 | + * Maximum balance threshold |
| 92 | + */ |
| 93 | + max?: string; |
| 94 | + }; |
| 95 | + }; |
| 96 | + /** |
| 97 | + * Webhook URL |
| 98 | + */ |
| 99 | + webhookUrl?: string; |
| 100 | + }, |
| 101 | + ): CancelablePromise<{ |
| 102 | + result: { |
| 103 | + id: string; |
| 104 | + /** |
| 105 | + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. |
| 106 | + */ |
| 107 | + chain: string; |
| 108 | + /** |
| 109 | + * A contract or wallet address |
| 110 | + */ |
| 111 | + contractAddress?: string; |
| 112 | + /** |
| 113 | + * A contract or wallet address |
| 114 | + */ |
| 115 | + walletAddress: string; |
| 116 | + config: { |
| 117 | + threshold?: { |
| 118 | + /** |
| 119 | + * Minimum balance threshold |
| 120 | + */ |
| 121 | + min?: string; |
| 122 | + /** |
| 123 | + * Maximum balance threshold |
| 124 | + */ |
| 125 | + max?: string; |
| 126 | + }; |
| 127 | + }; |
| 128 | + webhook?: { |
| 129 | + url: string; |
| 130 | + }; |
| 131 | + createdAt: string; |
| 132 | + updatedAt: string; |
| 133 | + }; |
| 134 | + }> { |
| 135 | + return this.httpRequest.request({ |
| 136 | + method: 'POST', |
| 137 | + url: '/balance-subscriptions/add', |
| 138 | + body: requestBody, |
| 139 | + mediaType: 'application/json', |
| 140 | + errors: { |
| 141 | + 400: `Bad Request`, |
| 142 | + 404: `Not Found`, |
| 143 | + 500: `Internal Server Error`, |
| 144 | + }, |
| 145 | + }); |
| 146 | + } |
| 147 | + |
| 148 | + /** |
| 149 | + * Update balance subscription |
| 150 | + * Update an existing balance subscription. |
| 151 | + * @param requestBody |
| 152 | + * @returns any Default Response |
| 153 | + * @throws ApiError |
| 154 | + */ |
| 155 | + public updateBalanceSubscription( |
| 156 | + requestBody: { |
| 157 | + /** |
| 158 | + * The ID of the balance subscription to update. |
| 159 | + */ |
| 160 | + balanceSubscriptionId: string; |
| 161 | + /** |
| 162 | + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. |
| 163 | + */ |
| 164 | + chain?: string; |
| 165 | + contractAddress?: (string | null); |
| 166 | + /** |
| 167 | + * A contract or wallet address |
| 168 | + */ |
| 169 | + walletAddress?: string; |
| 170 | + config?: { |
| 171 | + threshold?: { |
| 172 | + /** |
| 173 | + * Minimum balance threshold |
| 174 | + */ |
| 175 | + min?: string; |
| 176 | + /** |
| 177 | + * Maximum balance threshold |
| 178 | + */ |
| 179 | + max?: string; |
| 180 | + }; |
| 181 | + }; |
| 182 | + webhookId?: (number | null); |
| 183 | + }, |
| 184 | + ): CancelablePromise<{ |
| 185 | + result: { |
| 186 | + id: string; |
| 187 | + /** |
| 188 | + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. |
| 189 | + */ |
| 190 | + chain: string; |
| 191 | + /** |
| 192 | + * A contract or wallet address |
| 193 | + */ |
| 194 | + contractAddress?: string; |
| 195 | + /** |
| 196 | + * A contract or wallet address |
| 197 | + */ |
| 198 | + walletAddress: string; |
| 199 | + config: { |
| 200 | + threshold?: { |
| 201 | + /** |
| 202 | + * Minimum balance threshold |
| 203 | + */ |
| 204 | + min?: string; |
| 205 | + /** |
| 206 | + * Maximum balance threshold |
| 207 | + */ |
| 208 | + max?: string; |
| 209 | + }; |
| 210 | + }; |
| 211 | + webhook?: { |
| 212 | + url: string; |
| 213 | + }; |
| 214 | + createdAt: string; |
| 215 | + updatedAt: string; |
| 216 | + }; |
| 217 | + }> { |
| 218 | + return this.httpRequest.request({ |
| 219 | + method: 'POST', |
| 220 | + url: '/balance-subscriptions/update', |
| 221 | + body: requestBody, |
| 222 | + mediaType: 'application/json', |
| 223 | + errors: { |
| 224 | + 400: `Bad Request`, |
| 225 | + 404: `Not Found`, |
| 226 | + 500: `Internal Server Error`, |
| 227 | + }, |
| 228 | + }); |
| 229 | + } |
| 230 | + |
| 231 | + /** |
| 232 | + * Remove balance subscription |
| 233 | + * Remove an existing balance subscription |
| 234 | + * @param requestBody |
| 235 | + * @returns any Default Response |
| 236 | + * @throws ApiError |
| 237 | + */ |
| 238 | + public removeBalanceSubscription( |
| 239 | + requestBody: { |
| 240 | + /** |
| 241 | + * The ID for an existing balance subscription. |
| 242 | + */ |
| 243 | + balanceSubscriptionId: string; |
| 244 | + }, |
| 245 | + ): CancelablePromise<{ |
| 246 | + result: { |
| 247 | + status: string; |
| 248 | + }; |
| 249 | + }> { |
| 250 | + return this.httpRequest.request({ |
| 251 | + method: 'POST', |
| 252 | + url: '/balance-subscriptions/remove', |
| 253 | + body: requestBody, |
| 254 | + mediaType: 'application/json', |
| 255 | + errors: { |
| 256 | + 400: `Bad Request`, |
| 257 | + 404: `Not Found`, |
| 258 | + 500: `Internal Server Error`, |
| 259 | + }, |
| 260 | + }); |
| 261 | + } |
| 262 | + |
| 263 | +} |
0 commit comments