Skip to content

Commit

Permalink
Regenerate Nexus bindings using type mappings to match response types
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Dec 19, 2024
1 parent 63bdf6b commit 78ef057
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 96 deletions.
1 change: 1 addition & 0 deletions .changelog/2107.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Nexus API bindings
32 changes: 16 additions & 16 deletions src/vendors/nexus/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export interface ConsensusBlocksGetRequest {
offset?: number;
from?: number;
to?: number;
after?: Date;
before?: Date;
after?: string;
before?: string;
hash?: string;
}

Expand Down Expand Up @@ -264,8 +264,8 @@ export interface ConsensusTransactionsGetRequest {
method?: ConsensusTxMethod;
sender?: string;
rel?: string;
after?: Date;
before?: Date;
after?: string;
before?: string;
}

export interface ConsensusTransactionsTxHashGetRequest {
Expand Down Expand Up @@ -324,8 +324,8 @@ export interface RuntimeBlocksGetRequest {
offset?: number;
from?: number;
to?: number;
after?: Date;
before?: Date;
after?: string;
before?: string;
hash?: string;
}

Expand Down Expand Up @@ -384,8 +384,8 @@ export interface RuntimeTransactionsGetRequest {
limit?: number;
offset?: number;
block?: number;
after?: Date;
before?: Date;
after?: string;
before?: string;
rel?: string;
}

Expand Down Expand Up @@ -653,11 +653,11 @@ export class DefaultApi extends runtime.BaseAPI {
}

if (requestParameters['after'] != null) {
queryParameters['after'] = (requestParameters['after'] as any).toISOString();
queryParameters['after'] = requestParameters['after'];
}

if (requestParameters['before'] != null) {
queryParameters['before'] = (requestParameters['before'] as any).toISOString();
queryParameters['before'] = requestParameters['before'];
}

if (requestParameters['hash'] != null) {
Expand Down Expand Up @@ -1188,11 +1188,11 @@ export class DefaultApi extends runtime.BaseAPI {
}

if (requestParameters['after'] != null) {
queryParameters['after'] = (requestParameters['after'] as any).toISOString();
queryParameters['after'] = requestParameters['after'];
}

if (requestParameters['before'] != null) {
queryParameters['before'] = (requestParameters['before'] as any).toISOString();
queryParameters['before'] = requestParameters['before'];
}

const headerParameters: runtime.HTTPHeaders = {};
Expand Down Expand Up @@ -1610,11 +1610,11 @@ export class DefaultApi extends runtime.BaseAPI {
}

if (requestParameters['after'] != null) {
queryParameters['after'] = (requestParameters['after'] as any).toISOString();
queryParameters['after'] = requestParameters['after'];
}

if (requestParameters['before'] != null) {
queryParameters['before'] = (requestParameters['before'] as any).toISOString();
queryParameters['before'] = requestParameters['before'];
}

if (requestParameters['hash'] != null) {
Expand Down Expand Up @@ -2001,11 +2001,11 @@ export class DefaultApi extends runtime.BaseAPI {
}

if (requestParameters['after'] != null) {
queryParameters['after'] = (requestParameters['after'] as any).toISOString();
queryParameters['after'] = requestParameters['after'];
}

if (requestParameters['before'] != null) {
queryParameters['before'] = (requestParameters['before'] as any).toISOString();
queryParameters['before'] = requestParameters['before'];
}

if (requestParameters['rel'] != null) {
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export interface Account {
* The second-granular consensus time of the block in which this account was first active.
* Dates before Cobalt (2021-04-28) are approximate.
*
* @type {Date}
* @type {string}
* @memberof Account
*/
first_activity?: Date;
first_activity?: string;
/**
* The allowances made by this account.
* This field is omitted when listing multiple accounts.
Expand Down Expand Up @@ -134,7 +134,7 @@ export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): A
'debonding': json['debonding'],
'delegations_balance': json['delegations_balance'],
'debonding_delegations_balance': json['debonding_delegations_balance'],
'first_activity': json['first_activity'] == null ? undefined : (new Date(json['first_activity'])),
'first_activity': json['first_activity'] == null ? undefined : json['first_activity'],
'allowances': ((json['allowances'] as Array<any>).map(AllowanceFromJSON)),
'stats': AccountStatsFromJSON(json['stats']),
};
Expand All @@ -158,7 +158,7 @@ export function AccountToJSONTyped(value?: Account | null, ignoreDiscriminator:
'debonding': value['debonding'],
'delegations_balance': value['delegations_balance'],
'debonding_delegations_balance': value['debonding_delegations_balance'],
'first_activity': value['first_activity'] == null ? undefined : ((value['first_activity']).toISOString()),
'first_activity': value['first_activity'],
'allowances': ((value['allowances'] as Array<any>).map(AllowanceToJSON)),
'stats': AccountStatsToJSON(value['stats']),
};
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/AccountListAllOfAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export interface AccountListAllOfAccounts {
* The second-granular consensus time of the block in which this account was first active.
* Dates before Cobalt (2021-04-28) are approximate.
*
* @type {Date}
* @type {string}
* @memberof AccountListAllOfAccounts
*/
first_activity?: Date;
first_activity?: string;
/**
* The allowances made by this account.
* This field is omitted when listing multiple accounts.
Expand Down Expand Up @@ -133,7 +133,7 @@ export function AccountListAllOfAccountsFromJSONTyped(json: any, ignoreDiscrimin
'debonding': json['debonding'],
'delegations_balance': json['delegations_balance'],
'debonding_delegations_balance': json['debonding_delegations_balance'],
'first_activity': json['first_activity'] == null ? undefined : (new Date(json['first_activity'])),
'first_activity': json['first_activity'] == null ? undefined : json['first_activity'],
'allowances': ((json['allowances'] as Array<any>).map(AllowanceFromJSON)),
'stats': AccountStatsFromJSON(json['stats']),
};
Expand All @@ -157,7 +157,7 @@ export function AccountListAllOfAccountsToJSONTyped(value?: AccountListAllOfAcco
'debonding': value['debonding'],
'delegations_balance': value['delegations_balance'],
'debonding_delegations_balance': value['debonding_delegations_balance'],
'first_activity': value['first_activity'] == null ? undefined : ((value['first_activity']).toISOString()),
'first_activity': value['first_activity'],
'allowances': ((value['allowances'] as Array<any>).map(AllowanceToJSON)),
'stats': AccountStatsToJSON(value['stats']),
};
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/ActiveAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import { mapValues } from '../runtime';
export interface ActiveAccounts {
/**
* The date for the end of the daily active accounts measurement window.
* @type {Date}
* @type {string}
* @memberof ActiveAccounts
*/
window_end: Date;
window_end: string;
/**
* The number of active accounts for the 24hour window ending at window_end.
* @type {number}
Expand Down Expand Up @@ -52,7 +52,7 @@ export function ActiveAccountsFromJSONTyped(json: any, ignoreDiscriminator: bool
}
return {

'window_end': (new Date(json['window_end'])),
'window_end': json['window_end'],
'active_accounts': json['active_accounts'],
};
}
Expand All @@ -68,7 +68,7 @@ export function ActiveAccountsToJSONTyped(value?: ActiveAccounts | null, ignoreD

return {

'window_end': ((value['window_end']).toISOString()),
'window_end': value['window_end'],
'active_accounts': value['active_accounts'],
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export interface Block {
hash: string;
/**
* The second-granular consensus time.
* @type {Date}
* @type {string}
* @memberof Block
*/
timestamp: Date;
timestamp: string;
/**
* Number of transactions in the block.
* @type {number}
Expand Down Expand Up @@ -100,7 +100,7 @@ export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Blo

'height': json['height'],
'hash': json['hash'],
'timestamp': (new Date(json['timestamp'])),
'timestamp': json['timestamp'],
'num_transactions': json['num_transactions'],
'gas_limit': json['gas_limit'],
'size_limit': json['size_limit'] == null ? undefined : json['size_limit'],
Expand All @@ -122,7 +122,7 @@ export function BlockToJSONTyped(value?: Block | null, ignoreDiscriminator: bool

'height': value['height'],
'hash': value['hash'],
'timestamp': ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
'num_transactions': value['num_transactions'],
'gas_limit': value['gas_limit'],
'size_limit': value['size_limit'],
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/BlockListAllOfBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export interface BlockListAllOfBlocks {
hash: string;
/**
* The second-granular consensus time.
* @type {Date}
* @type {string}
* @memberof BlockListAllOfBlocks
*/
timestamp: Date;
timestamp: string;
/**
* Number of transactions in the block.
* @type {number}
Expand Down Expand Up @@ -99,7 +99,7 @@ export function BlockListAllOfBlocksFromJSONTyped(json: any, ignoreDiscriminator

'height': json['height'],
'hash': json['hash'],
'timestamp': (new Date(json['timestamp'])),
'timestamp': json['timestamp'],
'num_transactions': json['num_transactions'],
'gas_limit': json['gas_limit'],
'size_limit': json['size_limit'] == null ? undefined : json['size_limit'],
Expand All @@ -121,7 +121,7 @@ export function BlockListAllOfBlocksToJSONTyped(value?: BlockListAllOfBlocks | n

'height': value['height'],
'hash': value['hash'],
'timestamp': ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
'num_transactions': value['num_transactions'],
'gas_limit': value['gas_limit'],
'size_limit': value['size_limit'],
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/ProposalVote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export interface ProposalVote {
height?: number;
/**
* The second-granular consensus time of the block in which this vote was cast.
* @type {Date}
* @type {string}
* @memberof ProposalVote
*/
timestamp?: Date;
timestamp?: string;
}

/**
Expand All @@ -67,7 +67,7 @@ export function ProposalVoteFromJSONTyped(json: any, ignoreDiscriminator: boolea
'address': json['address'],
'vote': json['vote'],
'height': json['height'] == null ? undefined : json['height'],
'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
'timestamp': json['timestamp'] == null ? undefined : json['timestamp'],
};
}

Expand All @@ -85,7 +85,7 @@ export function ProposalVoteToJSONTyped(value?: ProposalVote | null, ignoreDiscr
'address': value['address'],
'vote': value['vote'],
'height': value['height'],
'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
};
}

8 changes: 4 additions & 4 deletions src/vendors/nexus/models/ProposalVotesAllOfVotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export interface ProposalVotesAllOfVotes {
height?: number;
/**
* The second-granular consensus time of the block in which this vote was cast.
* @type {Date}
* @type {string}
* @memberof ProposalVotesAllOfVotes
*/
timestamp?: Date;
timestamp?: string;
}

/**
Expand All @@ -67,7 +67,7 @@ export function ProposalVotesAllOfVotesFromJSONTyped(json: any, ignoreDiscrimina
'address': json['address'],
'vote': json['vote'],
'height': json['height'] == null ? undefined : json['height'],
'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
'timestamp': json['timestamp'] == null ? undefined : json['timestamp'],
};
}

Expand All @@ -85,7 +85,7 @@ export function ProposalVotesAllOfVotesToJSONTyped(value?: ProposalVotesAllOfVot
'address': value['address'],
'vote': value['vote'],
'height': value['height'],
'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
};
}

8 changes: 4 additions & 4 deletions src/vendors/nexus/models/RuntimeBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export interface RuntimeBlock {
hash: string;
/**
* The second-granular consensus time.
* @type {Date}
* @type {string}
* @memberof RuntimeBlock
*/
timestamp: Date;
timestamp: string;
/**
* The number of transactions in the block.
* @type {number}
Expand Down Expand Up @@ -83,7 +83,7 @@ export function RuntimeBlockFromJSONTyped(json: any, ignoreDiscriminator: boolea

'round': json['round'],
'hash': json['hash'],
'timestamp': (new Date(json['timestamp'])),
'timestamp': json['timestamp'],
'num_transactions': json['num_transactions'],
'size': json['size'],
'gas_used': json['gas_used'],
Expand All @@ -103,7 +103,7 @@ export function RuntimeBlockToJSONTyped(value?: RuntimeBlock | null, ignoreDiscr

'round': value['round'],
'hash': value['hash'],
'timestamp': ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
'num_transactions': value['num_transactions'],
'size': value['size'],
'gas_used': value['gas_used'],
Expand Down
8 changes: 4 additions & 4 deletions src/vendors/nexus/models/RuntimeBlockListAllOfBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export interface RuntimeBlockListAllOfBlocks {
hash: string;
/**
* The second-granular consensus time.
* @type {Date}
* @type {string}
* @memberof RuntimeBlockListAllOfBlocks
*/
timestamp: Date;
timestamp: string;
/**
* The number of transactions in the block.
* @type {number}
Expand Down Expand Up @@ -82,7 +82,7 @@ export function RuntimeBlockListAllOfBlocksFromJSONTyped(json: any, ignoreDiscri

'round': json['round'],
'hash': json['hash'],
'timestamp': (new Date(json['timestamp'])),
'timestamp': json['timestamp'],
'num_transactions': json['num_transactions'],
'size': json['size'],
'gas_used': json['gas_used'],
Expand All @@ -102,7 +102,7 @@ export function RuntimeBlockListAllOfBlocksToJSONTyped(value?: RuntimeBlockListA

'round': value['round'],
'hash': value['hash'],
'timestamp': ((value['timestamp']).toISOString()),
'timestamp': value['timestamp'],
'num_transactions': value['num_transactions'],
'size': value['size'],
'gas_used': value['gas_used'],
Expand Down
Loading

0 comments on commit 78ef057

Please sign in to comment.