diff --git a/sdk/typescript/lib/index.ts b/sdk/typescript/lib/index.ts index f538da081..e97267ba2 100644 --- a/sdk/typescript/lib/index.ts +++ b/sdk/typescript/lib/index.ts @@ -1,13 +1,14 @@ import { RadixNetworkConfigById } from './helpers/networks' import { ConfigurationParameters, + ExtensionsApi, StateApi, StatisticsApi, StatusApi, StreamApi, TransactionApi, } from './generated' -import { State, Statistics, Status, Stream, Transaction } from './subapis' +import { Extensions, State, Statistics, Status, Stream, Transaction } from './subapis' import { RuntimeConfiguration } from './runtime' import { normalizeBasePath } from './helpers/normalize-base-path' import { SDK_VERSION } from './constants' @@ -88,6 +89,7 @@ export class GatewayApiClient { status: Status transaction: Transaction statistics: Statistics + extensions: Extensions private lowLevel: { state: StateApi @@ -95,6 +97,7 @@ export class GatewayApiClient { status: StatusApi transaction: TransactionApi statistics: StatisticsApi + extensions: ExtensionsApi } constructor(configuration: RuntimeConfiguration) { @@ -104,6 +107,7 @@ export class GatewayApiClient { status: new StatusApi(configuration), transaction: new TransactionApi(configuration), statistics: new StatisticsApi(configuration), + extensions: new ExtensionsApi(configuration), } this.state = new State(this.lowLevel.state, configuration) @@ -111,5 +115,6 @@ export class GatewayApiClient { this.status = new Status(this.lowLevel.status) this.transaction = new Transaction(this.lowLevel.transaction) this.statistics = new Statistics(this.lowLevel.statistics, configuration) + this.extensions = new Extensions(this.lowLevel.extensions) } } diff --git a/sdk/typescript/lib/subapis/extensions.ts b/sdk/typescript/lib/subapis/extensions.ts new file mode 100644 index 000000000..e936699f2 --- /dev/null +++ b/sdk/typescript/lib/subapis/extensions.ts @@ -0,0 +1,17 @@ +import { ExtensionsApi, ResourceHoldersResponse } from "../generated"; + +export class Extensions { + constructor(public innerClient: ExtensionsApi) { } + + /** + * Get holders of a specific resource + */ + getResourceHolders(resourceAddress: string, cursor?: string): Promise { + return this.innerClient.resourceHoldersPage({ + resourceHoldersRequest: { + resource_address: resourceAddress, + cursor + } + }) + } +} \ No newline at end of file diff --git a/sdk/typescript/lib/subapis/index.ts b/sdk/typescript/lib/subapis/index.ts index 7938a9552..86c9263bd 100644 --- a/sdk/typescript/lib/subapis/index.ts +++ b/sdk/typescript/lib/subapis/index.ts @@ -2,4 +2,5 @@ export * from './state' export * from './statistics' export * from './status' export * from './stream' -export * from './transaction' \ No newline at end of file +export * from './transaction' +export * from './extensions' \ No newline at end of file