@monaco-protocol/client-v2 0.0.95 → 0.0.96
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/apis/WalletsApi.d.ts +16 -1
- package/dist/apis/WalletsApi.js +41 -0
- package/dist/models/AppPermissionRequest.d.ts +1 -0
- package/dist/models/AppPermissionRequest.js +2 -1
- package/dist/models/BalanceUpdateRequest.d.ts +64 -0
- package/dist/models/BalanceUpdateRequest.js +74 -0
- package/dist/models/Transaction.d.ts +2 -0
- package/dist/models/Transaction.js +3 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/package.json +1 -1
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { CreateWalletRequest, DepositAddressResponse, DepositRequestResponse, PagedMarketPositionResponse, PagedTransactionResponse, PagedWalletResponse, TransferResponse, UpdateWalletOverdraftRequest, WalletMetricsResponse, WalletResponse, WithdrawalRequestRequest, WithdrawalRequestResponse } from '../models/index';
|
|
13
|
+
import type { BalanceUpdateRequest, CreateWalletRequest, DepositAddressResponse, DepositRequestResponse, PagedMarketPositionResponse, PagedTransactionResponse, PagedWalletResponse, TransferResponse, UpdateWalletOverdraftRequest, WalletMetricsResponse, WalletResponse, WithdrawalRequestRequest, WithdrawalRequestResponse } from '../models/index';
|
|
14
|
+
export interface WalletsApiBalanceUpdateOperationRequest {
|
|
15
|
+
authorization: string;
|
|
16
|
+
id: string;
|
|
17
|
+
balanceUpdateRequest: BalanceUpdateRequest;
|
|
18
|
+
}
|
|
14
19
|
export interface WalletsApiCreateWalletOperationRequest {
|
|
15
20
|
authorization: string;
|
|
16
21
|
createWalletRequest: CreateWalletRequest;
|
|
@@ -77,6 +82,16 @@ export interface WalletsApiUpdateWalletOverdraftOperationRequest {
|
|
|
77
82
|
*
|
|
78
83
|
*/
|
|
79
84
|
export declare class WalletsApi extends runtime.BaseAPI {
|
|
85
|
+
/**
|
|
86
|
+
* Manually credit or debit wallet balance
|
|
87
|
+
* Adjust wallet balance
|
|
88
|
+
*/
|
|
89
|
+
balanceUpdateRaw(requestParameters: WalletsApiBalanceUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WalletResponse>>;
|
|
90
|
+
/**
|
|
91
|
+
* Manually credit or debit wallet balance
|
|
92
|
+
* Adjust wallet balance
|
|
93
|
+
*/
|
|
94
|
+
balanceUpdate(requestParameters: WalletsApiBalanceUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WalletResponse>;
|
|
80
95
|
/**
|
|
81
96
|
* Creates a wallet that can be used to create orders and receive winnings
|
|
82
97
|
* Create a wallet
|
package/dist/apis/WalletsApi.js
CHANGED
|
@@ -29,6 +29,47 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class WalletsApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Manually credit or debit wallet balance
|
|
34
|
+
* Adjust wallet balance
|
|
35
|
+
*/
|
|
36
|
+
balanceUpdateRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters['authorization'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('authorization', 'Required parameter "authorization" was null or undefined when calling balanceUpdate().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['id'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling balanceUpdate().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['balanceUpdateRequest'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('balanceUpdateRequest', 'Required parameter "balanceUpdateRequest" was null or undefined when calling balanceUpdate().');
|
|
46
|
+
}
|
|
47
|
+
const queryParameters = {};
|
|
48
|
+
const headerParameters = {};
|
|
49
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
50
|
+
if (requestParameters['authorization'] != null) {
|
|
51
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
52
|
+
}
|
|
53
|
+
const response = yield this.request({
|
|
54
|
+
path: `/wallets/{id}/balance-update`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: headerParameters,
|
|
57
|
+
query: queryParameters,
|
|
58
|
+
body: (0, index_1.BalanceUpdateRequestToJSON)(requestParameters['balanceUpdateRequest']),
|
|
59
|
+
}, initOverrides);
|
|
60
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WalletResponseFromJSON)(jsonValue));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Manually credit or debit wallet balance
|
|
65
|
+
* Adjust wallet balance
|
|
66
|
+
*/
|
|
67
|
+
balanceUpdate(requestParameters, initOverrides) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const response = yield this.balanceUpdateRaw(requestParameters, initOverrides);
|
|
70
|
+
return yield response.value();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
32
73
|
/**
|
|
33
74
|
* Creates a wallet that can be used to create orders and receive winnings
|
|
34
75
|
* Create a wallet
|
|
@@ -39,6 +39,7 @@ export declare const AppPermissionRequestPermissionEnum: {
|
|
|
39
39
|
readonly TradeCanViewAll: "TradeCanViewAll";
|
|
40
40
|
readonly WalletCanUpdateOverdraft: "WalletCanUpdateOverdraft";
|
|
41
41
|
readonly WalletCanViewAll: "WalletCanViewAll";
|
|
42
|
+
readonly WalletCanAdjustBalance: "WalletCanAdjustBalance";
|
|
42
43
|
};
|
|
43
44
|
export type AppPermissionRequestPermissionEnum = typeof AppPermissionRequestPermissionEnum[keyof typeof AppPermissionRequestPermissionEnum];
|
|
44
45
|
/**
|
|
@@ -35,7 +35,8 @@ exports.AppPermissionRequestPermissionEnum = {
|
|
|
35
35
|
OrderCanViewAll: 'OrderCanViewAll',
|
|
36
36
|
TradeCanViewAll: 'TradeCanViewAll',
|
|
37
37
|
WalletCanUpdateOverdraft: 'WalletCanUpdateOverdraft',
|
|
38
|
-
WalletCanViewAll: 'WalletCanViewAll'
|
|
38
|
+
WalletCanViewAll: 'WalletCanViewAll',
|
|
39
|
+
WalletCanAdjustBalance: 'WalletCanAdjustBalance'
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
41
42
|
* Check if a given object implements the AppPermissionRequest interface.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monaco API
|
|
3
|
+
* A RESTful API that allows you to interact with the Monaco Exchange. Provides endpoints for managing Events, Markets, Sessions, Wallets and Orders. To interact with the API, a client must have an App Id and an API Key to authenticate and create a session.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface BalanceUpdateRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface BalanceUpdateRequest {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof BalanceUpdateRequest
|
|
22
|
+
*/
|
|
23
|
+
currencyId: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof BalanceUpdateRequest
|
|
28
|
+
*/
|
|
29
|
+
type: BalanceUpdateRequestTypeEnum;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof BalanceUpdateRequest
|
|
34
|
+
*/
|
|
35
|
+
amount: number;
|
|
36
|
+
/**
|
|
37
|
+
* Required: a unique identifier for this transaction, such as a Solana transaction id
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof BalanceUpdateRequest
|
|
40
|
+
*/
|
|
41
|
+
transactionUniqueIdentifier: string;
|
|
42
|
+
/**
|
|
43
|
+
* Required: a description for this transaction, such as the reason for the update
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof BalanceUpdateRequest
|
|
46
|
+
*/
|
|
47
|
+
transactionDescription: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export declare const BalanceUpdateRequestTypeEnum: {
|
|
53
|
+
readonly Credit: "Credit";
|
|
54
|
+
readonly Debit: "Debit";
|
|
55
|
+
};
|
|
56
|
+
export type BalanceUpdateRequestTypeEnum = typeof BalanceUpdateRequestTypeEnum[keyof typeof BalanceUpdateRequestTypeEnum];
|
|
57
|
+
/**
|
|
58
|
+
* Check if a given object implements the BalanceUpdateRequest interface.
|
|
59
|
+
*/
|
|
60
|
+
export declare function instanceOfBalanceUpdateRequest(value: object): value is BalanceUpdateRequest;
|
|
61
|
+
export declare function BalanceUpdateRequestFromJSON(json: any): BalanceUpdateRequest;
|
|
62
|
+
export declare function BalanceUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BalanceUpdateRequest;
|
|
63
|
+
export declare function BalanceUpdateRequestToJSON(json: any): BalanceUpdateRequest;
|
|
64
|
+
export declare function BalanceUpdateRequestToJSONTyped(value?: BalanceUpdateRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Monaco API
|
|
6
|
+
* A RESTful API that allows you to interact with the Monaco Exchange. Provides endpoints for managing Events, Markets, Sessions, Wallets and Orders. To interact with the API, a client must have an App Id and an API Key to authenticate and create a session.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.BalanceUpdateRequestTypeEnum = void 0;
|
|
17
|
+
exports.instanceOfBalanceUpdateRequest = instanceOfBalanceUpdateRequest;
|
|
18
|
+
exports.BalanceUpdateRequestFromJSON = BalanceUpdateRequestFromJSON;
|
|
19
|
+
exports.BalanceUpdateRequestFromJSONTyped = BalanceUpdateRequestFromJSONTyped;
|
|
20
|
+
exports.BalanceUpdateRequestToJSON = BalanceUpdateRequestToJSON;
|
|
21
|
+
exports.BalanceUpdateRequestToJSONTyped = BalanceUpdateRequestToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.BalanceUpdateRequestTypeEnum = {
|
|
26
|
+
Credit: 'Credit',
|
|
27
|
+
Debit: 'Debit'
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Check if a given object implements the BalanceUpdateRequest interface.
|
|
31
|
+
*/
|
|
32
|
+
function instanceOfBalanceUpdateRequest(value) {
|
|
33
|
+
if (!('currencyId' in value) || value['currencyId'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (!('type' in value) || value['type'] === undefined)
|
|
36
|
+
return false;
|
|
37
|
+
if (!('amount' in value) || value['amount'] === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
if (!('transactionUniqueIdentifier' in value) || value['transactionUniqueIdentifier'] === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (!('transactionDescription' in value) || value['transactionDescription'] === undefined)
|
|
42
|
+
return false;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
function BalanceUpdateRequestFromJSON(json) {
|
|
46
|
+
return BalanceUpdateRequestFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
function BalanceUpdateRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
49
|
+
if (json == null) {
|
|
50
|
+
return json;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'currencyId': json['currencyId'],
|
|
54
|
+
'type': json['type'],
|
|
55
|
+
'amount': json['amount'],
|
|
56
|
+
'transactionUniqueIdentifier': json['transactionUniqueIdentifier'],
|
|
57
|
+
'transactionDescription': json['transactionDescription'],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function BalanceUpdateRequestToJSON(json) {
|
|
61
|
+
return BalanceUpdateRequestToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
function BalanceUpdateRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
64
|
+
if (value == null) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
'currencyId': value['currencyId'],
|
|
69
|
+
'type': value['type'],
|
|
70
|
+
'amount': value['amount'],
|
|
71
|
+
'transactionUniqueIdentifier': value['transactionUniqueIdentifier'],
|
|
72
|
+
'transactionDescription': value['transactionDescription'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -70,6 +70,8 @@ export declare const TransactionCodeEnum: {
|
|
|
70
70
|
readonly WalletToWallet: "WalletToWallet";
|
|
71
71
|
readonly Commission: "Commission";
|
|
72
72
|
readonly MarketPositionVoid: "MarketPositionVoid";
|
|
73
|
+
readonly ManualDebit: "ManualDebit";
|
|
74
|
+
readonly ManualCredit: "ManualCredit";
|
|
73
75
|
};
|
|
74
76
|
export type TransactionCodeEnum = typeof TransactionCodeEnum[keyof typeof TransactionCodeEnum];
|
|
75
77
|
/**
|
|
@@ -30,7 +30,9 @@ exports.TransactionCodeEnum = {
|
|
|
30
30
|
TradeWin: 'TradeWin',
|
|
31
31
|
WalletToWallet: 'WalletToWallet',
|
|
32
32
|
Commission: 'Commission',
|
|
33
|
-
MarketPositionVoid: 'MarketPositionVoid'
|
|
33
|
+
MarketPositionVoid: 'MarketPositionVoid',
|
|
34
|
+
ManualDebit: 'ManualDebit',
|
|
35
|
+
ManualCredit: 'ManualCredit'
|
|
34
36
|
};
|
|
35
37
|
/**
|
|
36
38
|
* Check if a given object implements the Transaction interface.
|
package/dist/models/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './AppPermissionResponse';
|
|
|
10
10
|
export * from './AppResponse';
|
|
11
11
|
export * from './AppStatus';
|
|
12
12
|
export * from './AppStatusResponse';
|
|
13
|
+
export * from './BalanceUpdateRequest';
|
|
13
14
|
export * from './BatchCancelOrdersRequest';
|
|
14
15
|
export * from './BatchCreateOrderRequest';
|
|
15
16
|
export * from './BatchIDResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./AppPermissionResponse"), exports);
|
|
|
28
28
|
__exportStar(require("./AppResponse"), exports);
|
|
29
29
|
__exportStar(require("./AppStatus"), exports);
|
|
30
30
|
__exportStar(require("./AppStatusResponse"), exports);
|
|
31
|
+
__exportStar(require("./BalanceUpdateRequest"), exports);
|
|
31
32
|
__exportStar(require("./BatchCancelOrdersRequest"), exports);
|
|
32
33
|
__exportStar(require("./BatchCreateOrderRequest"), exports);
|
|
33
34
|
__exportStar(require("./BatchIDResponse"), exports);
|