|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Stacks 2.0 Blockchain API |
| 5 | + * This is the documentation for the Stacks 2.0 Blockchain API. It is comprised of two parts; the Stacks Blockchain API and the Stacks Core API. [](https://app.getpostman.com/run-collection/614feab5c108d292bffa#?env%5BStacks%20Blockchain%20API%5D=W3sia2V5Ijoic3R4X2FkZHJlc3MiLCJ2YWx1ZSI6IlNUMlRKUkhESE1ZQlE0MTdIRkIwQkRYNDMwVFFBNVBYUlg2NDk1RzFWIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJibG9ja19pZCIsInZhbHVlIjoiMHgiLCJlbmFibGVkIjp0cnVlfSx7ImtleSI6Im9mZnNldCIsInZhbHVlIjoiMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfdHgiLCJ2YWx1ZSI6IjIwMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfYmxvY2siLCJ2YWx1ZSI6IjMwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJ0eF9pZCIsInZhbHVlIjoiMHg1NDA5MGMxNmE3MDJiNzUzYjQzMTE0ZTg4NGJjMTlhODBhNzk2MzhmZDQ0OWE0MGY4MDY4Y2RmMDAzY2RlNmUwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9pZCIsInZhbHVlIjoiU1RKVFhFSlBKUFBWRE5BOUIwNTJOU1JSQkdRQ0ZOS1ZTMTc4VkdIMS5oZWxsb193b3JsZFxuIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJidGNfYWRkcmVzcyIsInZhbHVlIjoiYWJjIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9hZGRyZXNzIiwidmFsdWUiOiJTVEpUWEVKUEpQUFZETkE5QjA1Mk5TUlJCR1FDRk5LVlMxNzhWR0gxIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9uYW1lIiwidmFsdWUiOiJoZWxsb193b3JsZCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWFwIiwidmFsdWUiOiJzdG9yZSIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWV0aG9kIiwidmFsdWUiOiJnZXQtdmFsdWUiLCJlbmFibGVkIjp0cnVlfV0=) ## Design ### Stacks Core API vs Stacks Blockchain API The blockchain\'s Rust implementation exposes a JSON RPC endpoint (\"Stacks Core API\"), which can be used to interface with the blockchain. It can be used directly. [See the documentation for the `stacks-blockchain` in its Github repository](https://github.com/blockstack/stacks-blockchain/) All `/v2/` routes a proxied to a Blockstack PBC-hosted Stacks Node. For a trustless architecture, you should make these requests to a self-hosted node. All `/extended/` routes are provided by the Stacks 2.0 Blockchain API directly. They extend the Stacks Core API capabilities to make it easier to integrate with. ### Pagination To make API responses more compact, lists returned by the API are paginated. For lists, the response body includes: - `limit`: the number of list items return per response - `offset`: the number of elements to skip (starting from `0`) - `total`: the number of all available list items - `results`: the array of list items (length of array equals the set limit) Using the `limit` and `offset` properties, you can paginate through the entire list by increasing the offset by the limit until you reach the total. ## Client Library A generated JS Client is available for consumption of this API. The client enables typesafe REST and WebSocket communication. Please review the [client documentation](https://blockstack.github.io/stacks-blockchain-api/client/index.html) for more details. |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.0.0 |
| 8 | + * |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | +import { exists, mapValues } from '../runtime'; |
| 16 | +import { |
| 17 | + NetworkIdentifier, |
| 18 | + NetworkIdentifierFromJSON, |
| 19 | + NetworkIdentifierFromJSONTyped, |
| 20 | + NetworkIdentifierToJSON, |
| 21 | + RosettaAccount, |
| 22 | + RosettaAccountFromJSON, |
| 23 | + RosettaAccountFromJSONTyped, |
| 24 | + RosettaAccountToJSON, |
| 25 | +} from './'; |
| 26 | + |
| 27 | +/** |
| 28 | + * An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed. |
| 29 | + * @export |
| 30 | + * @interface RosettaAccountBalanceRequest |
| 31 | + */ |
| 32 | +export interface RosettaAccountBalanceRequest { |
| 33 | + /** |
| 34 | + * |
| 35 | + * @type {NetworkIdentifier} |
| 36 | + * @memberof RosettaAccountBalanceRequest |
| 37 | + */ |
| 38 | + network_identifier: NetworkIdentifier; |
| 39 | + /** |
| 40 | + * |
| 41 | + * @type {RosettaAccount} |
| 42 | + * @memberof RosettaAccountBalanceRequest |
| 43 | + */ |
| 44 | + account_identifier: RosettaAccount; |
| 45 | + /** |
| 46 | + * When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block. |
| 47 | + * @type {object} |
| 48 | + * @memberof RosettaAccountBalanceRequest |
| 49 | + */ |
| 50 | + block_identifier?: object; |
| 51 | +} |
| 52 | + |
| 53 | +export function RosettaAccountBalanceRequestFromJSON(json: any): RosettaAccountBalanceRequest { |
| 54 | + return RosettaAccountBalanceRequestFromJSONTyped(json, false); |
| 55 | +} |
| 56 | + |
| 57 | +export function RosettaAccountBalanceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RosettaAccountBalanceRequest { |
| 58 | + if ((json === undefined) || (json === null)) { |
| 59 | + return json; |
| 60 | + } |
| 61 | + return { |
| 62 | + |
| 63 | + 'network_identifier': NetworkIdentifierFromJSON(json['network_identifier']), |
| 64 | + 'account_identifier': RosettaAccountFromJSON(json['account_identifier']), |
| 65 | + 'block_identifier': !exists(json, 'block_identifier') ? undefined : json['block_identifier'], |
| 66 | + }; |
| 67 | +} |
| 68 | + |
| 69 | +export function RosettaAccountBalanceRequestToJSON(value?: RosettaAccountBalanceRequest | null): any { |
| 70 | + if (value === undefined) { |
| 71 | + return undefined; |
| 72 | + } |
| 73 | + if (value === null) { |
| 74 | + return null; |
| 75 | + } |
| 76 | + return { |
| 77 | + |
| 78 | + 'network_identifier': NetworkIdentifierToJSON(value.network_identifier), |
| 79 | + 'account_identifier': RosettaAccountToJSON(value.account_identifier), |
| 80 | + 'block_identifier': value.block_identifier, |
| 81 | + }; |
| 82 | +} |
| 83 | + |
| 84 | + |
0 commit comments