@shapeshiftoss/unchained-client 10.7.0 → 10.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cosmossdk/parser/index.d.ts +1 -0
- package/dist/cosmossdk/parser/index.js +11 -1
- package/dist/evm/index.d.ts +1 -0
- package/dist/evm/index.js +2 -1
- package/dist/evm/optimism/index.d.ts +2 -0
- package/dist/evm/optimism/index.js +18 -0
- package/dist/evm/optimism/parser/index.d.ts +5 -0
- package/dist/evm/optimism/parser/index.js +12 -0
- package/dist/evm/parser/index.js +13 -8
- package/dist/generated/avalanche/models/GasFees.d.ts +2 -2
- package/dist/generated/avalanche/models/GasFees.js +3 -4
- package/dist/generated/cosmos/apis/V1Api.d.ts +6 -2
- package/dist/generated/cosmos/apis/V1Api.js +9 -3
- package/dist/generated/cosmos/models/Validators.d.ts +6 -0
- package/dist/generated/cosmos/models/Validators.js +3 -0
- package/dist/generated/cosmos/models/ValidatorsAllOf.d.ts +32 -0
- package/dist/generated/cosmos/models/ValidatorsAllOf.js +52 -0
- package/dist/generated/cosmos/models/index.d.ts +1 -0
- package/dist/generated/cosmos/models/index.js +1 -0
- package/dist/generated/ethereum/models/GasFees.d.ts +2 -2
- package/dist/generated/ethereum/models/GasFees.js +3 -4
- package/dist/generated/optimism/apis/V1Api.d.ts +94 -0
- package/dist/generated/optimism/apis/V1Api.js +239 -0
- package/dist/generated/optimism/apis/index.d.ts +1 -0
- package/dist/generated/optimism/apis/index.js +20 -0
- package/dist/generated/optimism/index.d.ts +3 -0
- package/dist/generated/optimism/index.js +22 -0
- package/dist/generated/optimism/models/Account.d.ts +56 -0
- package/dist/generated/optimism/models/Account.js +64 -0
- package/dist/generated/optimism/models/BadRequestError.d.ts +31 -0
- package/dist/generated/optimism/models/BadRequestError.js +51 -0
- package/dist/generated/optimism/models/BaseInfo.d.ts +31 -0
- package/dist/generated/optimism/models/BaseInfo.js +51 -0
- package/dist/generated/optimism/models/BaseTxHistoryTx.d.ts +44 -0
- package/dist/generated/optimism/models/BaseTxHistoryTx.js +58 -0
- package/dist/generated/optimism/models/GasFees.d.ts +43 -0
- package/dist/generated/optimism/models/GasFees.js +56 -0
- package/dist/generated/optimism/models/InternalServerError.d.ts +31 -0
- package/dist/generated/optimism/models/InternalServerError.js +51 -0
- package/dist/generated/optimism/models/InternalTx.d.ts +43 -0
- package/dist/generated/optimism/models/InternalTx.js +57 -0
- package/dist/generated/optimism/models/SendTxBody.d.ts +31 -0
- package/dist/generated/optimism/models/SendTxBody.js +51 -0
- package/dist/generated/optimism/models/TokenBalance.d.ts +61 -0
- package/dist/generated/optimism/models/TokenBalance.js +66 -0
- package/dist/generated/optimism/models/TokenTransfer.d.ts +73 -0
- package/dist/generated/optimism/models/TokenTransfer.js +72 -0
- package/dist/generated/optimism/models/Tx.d.ts +123 -0
- package/dist/generated/optimism/models/Tx.js +94 -0
- package/dist/generated/optimism/models/ValidationError.d.ts +46 -0
- package/dist/generated/optimism/models/ValidationError.js +60 -0
- package/dist/generated/optimism/models/index.d.ts +12 -0
- package/dist/generated/optimism/models/index.js +31 -0
- package/dist/generated/optimism/runtime.d.ts +170 -0
- package/dist/generated/optimism/runtime.js +310 -0
- package/dist/generated/osmosis/apis/V1Api.d.ts +6 -2
- package/dist/generated/osmosis/apis/V1Api.js +9 -3
- package/dist/generated/osmosis/models/Validators.d.ts +6 -0
- package/dist/generated/osmosis/models/Validators.js +3 -0
- package/dist/generated/osmosis/models/ValidatorsAllOf.d.ts +32 -0
- package/dist/generated/osmosis/models/ValidatorsAllOf.js +52 -0
- package/dist/generated/osmosis/models/index.d.ts +1 -0
- package/dist/generated/osmosis/models/index.js +1 -0
- package/dist/generated/thorchain/models/Validators.d.ts +6 -0
- package/dist/generated/thorchain/models/Validators.js +3 -0
- package/dist/generated/thorchain/models/ValidatorsAllOf.d.ts +32 -0
- package/dist/generated/thorchain/models/ValidatorsAllOf.js +52 -0
- package/dist/generated/thorchain/models/index.d.ts +1 -0
- package/dist/generated/thorchain/models/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +2 -2
|
@@ -33,7 +33,7 @@ class BaseTransactionParser {
|
|
|
33
33
|
blockTime: (_b = tx.timestamp) !== null && _b !== void 0 ? _b : Math.floor(Date.now() / 1000),
|
|
34
34
|
chainId: this.chainId,
|
|
35
35
|
confirmations: tx.confirmations,
|
|
36
|
-
status: tx
|
|
36
|
+
status: this.getStatus(tx),
|
|
37
37
|
transfers: [],
|
|
38
38
|
txid: tx.txid,
|
|
39
39
|
};
|
|
@@ -63,5 +63,15 @@ class BaseTransactionParser {
|
|
|
63
63
|
});
|
|
64
64
|
return parsedTx;
|
|
65
65
|
}
|
|
66
|
+
getStatus(tx) {
|
|
67
|
+
var _a;
|
|
68
|
+
if ((_a = tx.events['0']) === null || _a === void 0 ? void 0 : _a.error)
|
|
69
|
+
return types_1.TxStatus.Failed;
|
|
70
|
+
if (tx.confirmations <= 0)
|
|
71
|
+
return types_1.TxStatus.Pending;
|
|
72
|
+
if (tx.confirmations > 0)
|
|
73
|
+
return types_1.TxStatus.Confirmed;
|
|
74
|
+
return types_1.TxStatus.Unknown;
|
|
75
|
+
}
|
|
66
76
|
}
|
|
67
77
|
exports.BaseTransactionParser = BaseTransactionParser;
|
package/dist/evm/index.d.ts
CHANGED
package/dist/evm/index.js
CHANGED
|
@@ -26,7 +26,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.avalanche = exports.ethereum = void 0;
|
|
29
|
+
exports.optimism = exports.avalanche = exports.ethereum = void 0;
|
|
30
30
|
__exportStar(require("./parser"), exports);
|
|
31
31
|
exports.ethereum = __importStar(require("./ethereum"));
|
|
32
32
|
exports.avalanche = __importStar(require("./avalanche"));
|
|
33
|
+
exports.optimism = __importStar(require("./optimism"));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("../../generated/optimism"), exports);
|
|
18
|
+
__exportStar(require("./parser"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionParser = void 0;
|
|
4
|
+
const caip_1 = require("@shapeshiftoss/caip");
|
|
5
|
+
const parser_1 = require("../../parser");
|
|
6
|
+
class TransactionParser extends parser_1.BaseTransactionParser {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
super(args);
|
|
9
|
+
this.assetId = caip_1.optimismAssetId;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.TransactionParser = TransactionParser;
|
package/dist/evm/parser/index.js
CHANGED
|
@@ -117,17 +117,22 @@ class BaseTransactionParser {
|
|
|
117
117
|
name: transfer.name,
|
|
118
118
|
symbol: transfer.symbol,
|
|
119
119
|
};
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const assetId = (() => {
|
|
121
|
+
// alias ether token on optimism to native asset as they are the same
|
|
122
|
+
if (transfer.contract === '0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000') {
|
|
123
|
+
return (0, caip_1.toAssetId)({
|
|
124
|
+
chainId: this.chainId,
|
|
125
|
+
assetNamespace: 'slip44',
|
|
126
|
+
assetReference: caip_1.ASSET_REFERENCE.Optimism,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return (0, caip_1.toAssetId)({
|
|
122
130
|
chainId: this.chainId,
|
|
123
131
|
assetNamespace: 'erc20',
|
|
124
132
|
assetReference: transfer.contract,
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
transfer.value,
|
|
129
|
-
token,
|
|
130
|
-
];
|
|
133
|
+
});
|
|
134
|
+
})();
|
|
135
|
+
const transferArgs = [assetId, transfer.from, transfer.to, transfer.value, token];
|
|
131
136
|
// token send amount
|
|
132
137
|
if (address === transfer.from) {
|
|
133
138
|
parsedTx.transfers = (0, utils_1.aggregateTransfer)(parsedTx.transfers, types_1.TransferType.Send, ...transferArgs);
|
|
@@ -26,13 +26,13 @@ export interface GasFees {
|
|
|
26
26
|
* @type {string}
|
|
27
27
|
* @memberof GasFees
|
|
28
28
|
*/
|
|
29
|
-
maxFeePerGas
|
|
29
|
+
maxFeePerGas?: string;
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
32
32
|
* @type {string}
|
|
33
33
|
* @memberof GasFees
|
|
34
34
|
*/
|
|
35
|
-
maxPriorityFeePerGas
|
|
35
|
+
maxPriorityFeePerGas?: string;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Check if a given object implements the GasFees interface.
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.GasFeesToJSON = exports.GasFeesFromJSONTyped = exports.GasFeesFromJSON = exports.instanceOfGasFees = void 0;
|
|
18
|
+
const runtime_1 = require("../runtime");
|
|
18
19
|
/**
|
|
19
20
|
* Check if a given object implements the GasFees interface.
|
|
20
21
|
*/
|
|
21
22
|
function instanceOfGasFees(value) {
|
|
22
23
|
let isInstance = true;
|
|
23
24
|
isInstance = isInstance && "gasPrice" in value;
|
|
24
|
-
isInstance = isInstance && "maxFeePerGas" in value;
|
|
25
|
-
isInstance = isInstance && "maxPriorityFeePerGas" in value;
|
|
26
25
|
return isInstance;
|
|
27
26
|
}
|
|
28
27
|
exports.instanceOfGasFees = instanceOfGasFees;
|
|
@@ -36,8 +35,8 @@ function GasFeesFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
36
35
|
}
|
|
37
36
|
return {
|
|
38
37
|
'gasPrice': json['gasPrice'],
|
|
39
|
-
'maxFeePerGas': json['maxFeePerGas'],
|
|
40
|
-
'maxPriorityFeePerGas': json['maxPriorityFeePerGas'],
|
|
38
|
+
'maxFeePerGas': !(0, runtime_1.exists)(json, 'maxFeePerGas') ? undefined : json['maxFeePerGas'],
|
|
39
|
+
'maxPriorityFeePerGas': !(0, runtime_1.exists)(json, 'maxPriorityFeePerGas') ? undefined : json['maxPriorityFeePerGas'],
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
exports.GasFeesFromJSONTyped = GasFeesFromJSONTyped;
|
|
@@ -28,6 +28,10 @@ export interface GetTxHistoryRequest {
|
|
|
28
28
|
export interface GetValidatorRequest {
|
|
29
29
|
pubkey: string;
|
|
30
30
|
}
|
|
31
|
+
export interface GetValidatorsRequest {
|
|
32
|
+
cursor?: string;
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
}
|
|
31
35
|
export interface SendTxRequest {
|
|
32
36
|
body?: EstimateGasRequest;
|
|
33
37
|
}
|
|
@@ -91,11 +95,11 @@ export declare class V1Api extends runtime.BaseAPI {
|
|
|
91
95
|
/**
|
|
92
96
|
* Get the list of current validators.
|
|
93
97
|
*/
|
|
94
|
-
getValidatorsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Validators>>;
|
|
98
|
+
getValidatorsRaw(requestParameters: GetValidatorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Validators>>;
|
|
95
99
|
/**
|
|
96
100
|
* Get the list of current validators.
|
|
97
101
|
*/
|
|
98
|
-
getValidators(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Validators>;
|
|
102
|
+
getValidators(requestParameters?: GetValidatorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Validators>;
|
|
99
103
|
/**
|
|
100
104
|
* Sends raw transaction to be broadcast to the node.
|
|
101
105
|
*/
|
|
@@ -193,8 +193,14 @@ class V1Api extends runtime.BaseAPI {
|
|
|
193
193
|
/**
|
|
194
194
|
* Get the list of current validators.
|
|
195
195
|
*/
|
|
196
|
-
async getValidatorsRaw(initOverrides) {
|
|
196
|
+
async getValidatorsRaw(requestParameters, initOverrides) {
|
|
197
197
|
const queryParameters = {};
|
|
198
|
+
if (requestParameters.cursor !== undefined) {
|
|
199
|
+
queryParameters['cursor'] = requestParameters.cursor;
|
|
200
|
+
}
|
|
201
|
+
if (requestParameters.pageSize !== undefined) {
|
|
202
|
+
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
203
|
+
}
|
|
198
204
|
const headerParameters = {};
|
|
199
205
|
const response = await this.request({
|
|
200
206
|
path: `/api/v1/validators`,
|
|
@@ -207,8 +213,8 @@ class V1Api extends runtime.BaseAPI {
|
|
|
207
213
|
/**
|
|
208
214
|
* Get the list of current validators.
|
|
209
215
|
*/
|
|
210
|
-
async getValidators(initOverrides) {
|
|
211
|
-
const response = await this.getValidatorsRaw(initOverrides);
|
|
216
|
+
async getValidators(requestParameters = {}, initOverrides) {
|
|
217
|
+
const response = await this.getValidatorsRaw(requestParameters, initOverrides);
|
|
212
218
|
return await response.value();
|
|
213
219
|
}
|
|
214
220
|
/**
|
|
@@ -16,6 +16,12 @@ import type { Validator } from './Validator';
|
|
|
16
16
|
* @interface Validators
|
|
17
17
|
*/
|
|
18
18
|
export interface Validators {
|
|
19
|
+
/**
|
|
20
|
+
* Base64 encoded string to fetch next page or undefined if no more data avaiable
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof Validators
|
|
23
|
+
*/
|
|
24
|
+
cursor: string;
|
|
19
25
|
/**
|
|
20
26
|
*
|
|
21
27
|
* @type {Array<Validator>}
|
|
@@ -21,6 +21,7 @@ const Validator_1 = require("./Validator");
|
|
|
21
21
|
*/
|
|
22
22
|
function instanceOfValidators(value) {
|
|
23
23
|
let isInstance = true;
|
|
24
|
+
isInstance = isInstance && "cursor" in value;
|
|
24
25
|
isInstance = isInstance && "validators" in value;
|
|
25
26
|
return isInstance;
|
|
26
27
|
}
|
|
@@ -34,6 +35,7 @@ function ValidatorsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
34
35
|
return json;
|
|
35
36
|
}
|
|
36
37
|
return {
|
|
38
|
+
'cursor': json['cursor'],
|
|
37
39
|
'validators': (json['validators'].map(Validator_1.ValidatorFromJSON)),
|
|
38
40
|
};
|
|
39
41
|
}
|
|
@@ -46,6 +48,7 @@ function ValidatorsToJSON(value) {
|
|
|
46
48
|
return null;
|
|
47
49
|
}
|
|
48
50
|
return {
|
|
51
|
+
'cursor': value.cursor,
|
|
49
52
|
'validators': (value.validators.map(Validator_1.ValidatorToJSON)),
|
|
50
53
|
};
|
|
51
54
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cosmos Unchained API
|
|
3
|
+
* Provides access to cosmos chain data.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Validator } from './Validator';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ValidatorsAllOf
|
|
17
|
+
*/
|
|
18
|
+
export interface ValidatorsAllOf {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<Validator>}
|
|
22
|
+
* @memberof ValidatorsAllOf
|
|
23
|
+
*/
|
|
24
|
+
validators: Array<Validator>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given object implements the ValidatorsAllOf interface.
|
|
28
|
+
*/
|
|
29
|
+
export declare function instanceOfValidatorsAllOf(value: object): boolean;
|
|
30
|
+
export declare function ValidatorsAllOfFromJSON(json: any): ValidatorsAllOf;
|
|
31
|
+
export declare function ValidatorsAllOfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorsAllOf;
|
|
32
|
+
export declare function ValidatorsAllOfToJSON(value?: ValidatorsAllOf | null): any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Cosmos Unchained API
|
|
7
|
+
* Provides access to cosmos chain data.
|
|
8
|
+
*
|
|
9
|
+
* The version of the OpenAPI document: 1.0.0
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13
|
+
* https://openapi-generator.tech
|
|
14
|
+
* Do not edit the class manually.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ValidatorsAllOfToJSON = exports.ValidatorsAllOfFromJSONTyped = exports.ValidatorsAllOfFromJSON = exports.instanceOfValidatorsAllOf = void 0;
|
|
18
|
+
const Validator_1 = require("./Validator");
|
|
19
|
+
/**
|
|
20
|
+
* Check if a given object implements the ValidatorsAllOf interface.
|
|
21
|
+
*/
|
|
22
|
+
function instanceOfValidatorsAllOf(value) {
|
|
23
|
+
let isInstance = true;
|
|
24
|
+
isInstance = isInstance && "validators" in value;
|
|
25
|
+
return isInstance;
|
|
26
|
+
}
|
|
27
|
+
exports.instanceOfValidatorsAllOf = instanceOfValidatorsAllOf;
|
|
28
|
+
function ValidatorsAllOfFromJSON(json) {
|
|
29
|
+
return ValidatorsAllOfFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
exports.ValidatorsAllOfFromJSON = ValidatorsAllOfFromJSON;
|
|
32
|
+
function ValidatorsAllOfFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if ((json === undefined) || (json === null)) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'validators': (json['validators'].map(Validator_1.ValidatorFromJSON)),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.ValidatorsAllOfFromJSONTyped = ValidatorsAllOfFromJSONTyped;
|
|
41
|
+
function ValidatorsAllOfToJSON(value) {
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
if (value === null) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'validators': (value.validators.map(Validator_1.ValidatorToJSON)),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.ValidatorsAllOfToJSON = ValidatorsAllOfToJSON;
|
|
@@ -52,4 +52,5 @@ __exportStar(require("./Validator"), exports);
|
|
|
52
52
|
__exportStar(require("./ValidatorCommission"), exports);
|
|
53
53
|
__exportStar(require("./ValidatorUnbonding"), exports);
|
|
54
54
|
__exportStar(require("./Validators"), exports);
|
|
55
|
+
__exportStar(require("./ValidatorsAllOf"), exports);
|
|
55
56
|
__exportStar(require("./Value"), exports);
|
|
@@ -26,13 +26,13 @@ export interface GasFees {
|
|
|
26
26
|
* @type {string}
|
|
27
27
|
* @memberof GasFees
|
|
28
28
|
*/
|
|
29
|
-
maxFeePerGas
|
|
29
|
+
maxFeePerGas?: string;
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
32
32
|
* @type {string}
|
|
33
33
|
* @memberof GasFees
|
|
34
34
|
*/
|
|
35
|
-
maxPriorityFeePerGas
|
|
35
|
+
maxPriorityFeePerGas?: string;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Check if a given object implements the GasFees interface.
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.GasFeesToJSON = exports.GasFeesFromJSONTyped = exports.GasFeesFromJSON = exports.instanceOfGasFees = void 0;
|
|
18
|
+
const runtime_1 = require("../runtime");
|
|
18
19
|
/**
|
|
19
20
|
* Check if a given object implements the GasFees interface.
|
|
20
21
|
*/
|
|
21
22
|
function instanceOfGasFees(value) {
|
|
22
23
|
let isInstance = true;
|
|
23
24
|
isInstance = isInstance && "gasPrice" in value;
|
|
24
|
-
isInstance = isInstance && "maxFeePerGas" in value;
|
|
25
|
-
isInstance = isInstance && "maxPriorityFeePerGas" in value;
|
|
26
25
|
return isInstance;
|
|
27
26
|
}
|
|
28
27
|
exports.instanceOfGasFees = instanceOfGasFees;
|
|
@@ -36,8 +35,8 @@ function GasFeesFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
36
35
|
}
|
|
37
36
|
return {
|
|
38
37
|
'gasPrice': json['gasPrice'],
|
|
39
|
-
'maxFeePerGas': json['maxFeePerGas'],
|
|
40
|
-
'maxPriorityFeePerGas': json['maxPriorityFeePerGas'],
|
|
38
|
+
'maxFeePerGas': !(0, runtime_1.exists)(json, 'maxFeePerGas') ? undefined : json['maxFeePerGas'],
|
|
39
|
+
'maxPriorityFeePerGas': !(0, runtime_1.exists)(json, 'maxPriorityFeePerGas') ? undefined : json['maxPriorityFeePerGas'],
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
exports.GasFeesFromJSONTyped = GasFeesFromJSONTyped;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @shapeshiftoss/optimism-api
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 8.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { Account, BaseInfo, BaseTxHistoryTx, GasFees, SendTxBody, Tx } from '../models';
|
|
14
|
+
export interface EstimateGasRequest {
|
|
15
|
+
data: string;
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetAccountRequest {
|
|
21
|
+
pubkey: string;
|
|
22
|
+
}
|
|
23
|
+
export interface GetTransactionRequest {
|
|
24
|
+
txid: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GetTxHistoryRequest {
|
|
27
|
+
pubkey: string;
|
|
28
|
+
cursor?: string;
|
|
29
|
+
pageSize?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface SendTxRequest {
|
|
32
|
+
sendTxBody: SendTxBody;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare class V1Api extends runtime.BaseAPI {
|
|
38
|
+
/**
|
|
39
|
+
* Get the estimated gas cost of a transaction
|
|
40
|
+
*/
|
|
41
|
+
estimateGasRaw(requestParameters: EstimateGasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the estimated gas cost of a transaction
|
|
44
|
+
*/
|
|
45
|
+
estimateGas(requestParameters: EstimateGasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Get account details by address
|
|
48
|
+
*/
|
|
49
|
+
getAccountRaw(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Account>>;
|
|
50
|
+
/**
|
|
51
|
+
* Get account details by address
|
|
52
|
+
*/
|
|
53
|
+
getAccount(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Account>;
|
|
54
|
+
/**
|
|
55
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
56
|
+
*/
|
|
57
|
+
getGasFeesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GasFees>>;
|
|
58
|
+
/**
|
|
59
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
60
|
+
*/
|
|
61
|
+
getGasFees(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GasFees>;
|
|
62
|
+
/**
|
|
63
|
+
* Get information about the running coinstack
|
|
64
|
+
*/
|
|
65
|
+
getInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BaseInfo>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get information about the running coinstack
|
|
68
|
+
*/
|
|
69
|
+
getInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseInfo>;
|
|
70
|
+
/**
|
|
71
|
+
* Get transaction details
|
|
72
|
+
*/
|
|
73
|
+
getTransactionRaw(requestParameters: GetTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Tx>>;
|
|
74
|
+
/**
|
|
75
|
+
* Get transaction details
|
|
76
|
+
*/
|
|
77
|
+
getTransaction(requestParameters: GetTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Tx>;
|
|
78
|
+
/**
|
|
79
|
+
* Get transaction history by address
|
|
80
|
+
*/
|
|
81
|
+
getTxHistoryRaw(requestParameters: GetTxHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BaseTxHistoryTx>>;
|
|
82
|
+
/**
|
|
83
|
+
* Get transaction history by address
|
|
84
|
+
*/
|
|
85
|
+
getTxHistory(requestParameters: GetTxHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseTxHistoryTx>;
|
|
86
|
+
/**
|
|
87
|
+
* Broadcast signed raw transaction
|
|
88
|
+
*/
|
|
89
|
+
sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
90
|
+
/**
|
|
91
|
+
* Broadcast signed raw transaction
|
|
92
|
+
*/
|
|
93
|
+
sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
94
|
+
}
|