@@ -16,92 +16,87 @@ import { TimestampedDatum, TimestampedDatums } from '../type';
16
16
* DatumApi - axios parameter creator
17
17
* @export
18
18
*/
19
- export const DatumApiAxiosParamCreator = function ( configuration : Configuration ) {
20
- return {
21
- /**
22
- * Returns the datum corresponding to the specified datum hash, if the datum has been seen on-chain
23
- * @summary Datum by datum hash
24
- * @param {string } datumHash Hex encoded datum hash
25
- * @param {* } [options] Override http request option.
26
- * @throws {RequiredError }
27
- */
28
- lookupDatum : async ( datumHash : string , options : AxiosRequestConfig = { } ) : Promise < RequestArgs > => {
29
- // verify required parameter 'datumHash' is not null or undefined
30
- assertParamExists ( 'lookupDatum' , 'datumHash' , datumHash ) ;
31
- const localVarPath = `/datums/{datum_hash}` . replace (
32
- `{${ 'datum_hash' } }` ,
33
- encodeURIComponent ( String ( datumHash ) ) ,
34
- ) ;
35
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
36
- const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
37
- const { baseOptions } = configuration ;
19
+ export const DatumApiAxiosParamCreator = ( configuration : Configuration ) => ( {
20
+ /**
21
+ * Returns the datum corresponding to the specified datum hash, if the datum has been seen on-chain
22
+ * @summary Datum by datum hash
23
+ * @param {string } datumHash Hex encoded datum hash
24
+ * @param {* } [options] Override http request option.
25
+ * @throws {RequiredError }
26
+ */
27
+ lookupDatum : async ( datumHash : string , options : AxiosRequestConfig = { } ) : Promise < RequestArgs > => {
28
+ // verify required parameter 'datumHash' is not null or undefined
29
+ assertParamExists ( 'lookupDatum' , 'datumHash' , datumHash ) ;
30
+ const localVarPath = `/datums/{datum_hash}` . replace ( `{${ 'datum_hash' } }` , encodeURIComponent ( String ( datumHash ) ) ) ;
31
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
32
+ const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
33
+ const { baseOptions } = configuration ;
38
34
39
- const localVarRequestOptions = { method : 'GET' , ...baseOptions , ...options } ;
40
- const localVarHeaderParameter = { } as any ;
41
- const localVarQueryParameter = { } as any ;
35
+ const localVarRequestOptions = { method : 'GET' , ...baseOptions , ...options } ;
36
+ const localVarHeaderParameter = { } as Record < string , string > ;
37
+ const localVarQueryParameter = { } as Record < string , string > ;
42
38
43
- // authentication api-key required
44
- setApiKeyToObject ( localVarHeaderParameter , 'api-key' , configuration ) ;
39
+ // authentication api-key required
40
+ setApiKeyToObject ( localVarHeaderParameter , 'api-key' , configuration ) ;
45
41
46
- setSearchParams ( localVarUrlObj , localVarQueryParameter ) ;
47
- const headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
48
- localVarRequestOptions . headers = {
49
- ...localVarHeaderParameter ,
50
- ...headersFromBaseOptions ,
51
- ...options . headers ,
52
- } ;
42
+ setSearchParams ( localVarUrlObj , localVarQueryParameter ) ;
43
+ const headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
44
+ localVarRequestOptions . headers = {
45
+ ...localVarHeaderParameter ,
46
+ ...headersFromBaseOptions ,
47
+ ...options . headers ,
48
+ } ;
53
49
54
- return {
55
- url : toPathString ( localVarUrlObj ) ,
56
- options : localVarRequestOptions ,
57
- } ;
58
- } ,
59
- /**
60
- * Returns the datums corresponding to the specified datum hashes, for the datums which have been seen on-chain
61
- * @summary Datums by datum hashes
62
- * @param {Array<string> } requestBody Array of hex encoded datum hashes
63
- * @param {* } [options] Override http request option.
64
- * @throws {RequiredError }
65
- */
66
- lookupDatums : async ( requestBody : Array < string > , options : AxiosRequestConfig = { } ) : Promise < RequestArgs > => {
67
- // verify required parameter 'requestBody' is not null or undefined
68
- assertParamExists ( 'lookupDatums' , 'requestBody' , requestBody ) ;
69
- const localVarPath = `/datums` ;
70
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
71
- const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
72
- const { baseOptions } = configuration ;
50
+ return {
51
+ url : toPathString ( localVarUrlObj ) ,
52
+ options : localVarRequestOptions ,
53
+ } ;
54
+ } ,
55
+ /**
56
+ * Returns the datums corresponding to the specified datum hashes, for the datums which have been seen on-chain
57
+ * @summary Datums by datum hashes
58
+ * @param {Array<string> } requestBody Array of hex encoded datum hashes
59
+ * @param {* } [options] Override http request option.
60
+ * @throws {RequiredError }
61
+ */
62
+ lookupDatums : async ( requestBody : Array < string > , options : AxiosRequestConfig = { } ) : Promise < RequestArgs > => {
63
+ // verify required parameter 'requestBody' is not null or undefined
64
+ assertParamExists ( 'lookupDatums' , 'requestBody' , requestBody ) ;
65
+ const localVarPath = `/datums` ;
66
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
67
+ const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ;
68
+ const { baseOptions } = configuration ;
73
69
74
- const localVarRequestOptions = { method : 'POST' , ...baseOptions , ...options } ;
75
- const localVarHeaderParameter = { } as any ;
76
- const localVarQueryParameter = { } as any ;
70
+ const localVarRequestOptions = { method : 'POST' , ...baseOptions , ...options } ;
71
+ const localVarHeaderParameter = { } as Record < string , string > ;
72
+ const localVarQueryParameter = { } as Record < string , string > ;
77
73
78
- // authentication api-key required
79
- setApiKeyToObject ( localVarHeaderParameter , 'api-key' , configuration ) ;
74
+ // authentication api-key required
75
+ setApiKeyToObject ( localVarHeaderParameter , 'api-key' , configuration ) ;
80
76
81
- localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ;
77
+ localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ;
82
78
83
- setSearchParams ( localVarUrlObj , localVarQueryParameter ) ;
84
- const headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
85
- localVarRequestOptions . headers = {
86
- ...localVarHeaderParameter ,
87
- ...headersFromBaseOptions ,
88
- ...options . headers ,
89
- } ;
90
- localVarRequestOptions . data = serializeDataIfNeeded ( requestBody , localVarRequestOptions , configuration ) ;
79
+ setSearchParams ( localVarUrlObj , localVarQueryParameter ) ;
80
+ const headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ;
81
+ localVarRequestOptions . headers = {
82
+ ...localVarHeaderParameter ,
83
+ ...headersFromBaseOptions ,
84
+ ...options . headers ,
85
+ } ;
86
+ localVarRequestOptions . data = serializeDataIfNeeded ( requestBody , localVarRequestOptions , configuration ) ;
91
87
92
- return {
93
- url : toPathString ( localVarUrlObj ) ,
94
- options : localVarRequestOptions ,
95
- } ;
96
- } ,
97
- } ;
98
- } ;
88
+ return {
89
+ url : toPathString ( localVarUrlObj ) ,
90
+ options : localVarRequestOptions ,
91
+ } ;
92
+ } ,
93
+ } ) ;
99
94
100
95
/**
101
96
* DatumApi - functional programming interface
102
97
* @export
103
98
*/
104
- export const DatumApiFp = function ( configuration : Configuration ) {
99
+ export const DatumApiFp = ( configuration : Configuration ) => {
105
100
const localVarAxiosParamCreator = DatumApiAxiosParamCreator ( configuration ) ;
106
101
return {
107
102
/**
@@ -134,23 +129,3 @@ export const DatumApiFp = function (configuration: Configuration) {
134
129
} ,
135
130
} ;
136
131
} ;
137
-
138
- // /**
139
- // * DatumApi - factory interface
140
- // * @export
141
- // */
142
- // export const DatumApiFactory = function (configuration: Configuration, basePath?: string, axios?: AxiosInstance) {
143
- // const localVarFp = DatumApiFp(configuration);
144
- // return {
145
- // /**
146
- // * Returns the datum corresponding to the specified datum hash, if the datum has been seen on-chain
147
- // * @summary Datum by datum hash
148
- // * @param {string } datumHash Hex encoded datum hash
149
- // * @param {* } [options] Override http request option.
150
- // * @throws {RequiredError }
151
- // */
152
- // lookupDatum(datumHash: string, options?: any): AxiosPromise<TimestampedDatum> {
153
- // return localVarFp.lookupDatum(datumHash, options).then((request) => request(axios, basePath));
154
- // },
155
- // };
156
- // };
0 commit comments