@coinbase-sample/prime-sdk-ts 0.2.0 → 0.2.1
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/model/AcceptQuoteRequest.d.ts +32 -0
- package/dist/model/AcceptQuoteRequest.js +21 -0
- package/dist/model/AcceptQuoteResponse.d.ts +22 -0
- package/dist/model/AcceptQuoteResponse.js +21 -0
- package/dist/model/AddressEntry.d.ts +3 -0
- package/dist/model/AddressGroup.d.ts +0 -1
- package/dist/model/CreateAddressGroup.d.ts +26 -0
- package/dist/model/CreateAddressGroup.js +21 -0
- package/dist/model/QuoteResponse.d.ts +26 -0
- package/dist/model/QuoteResponse.js +21 -0
- package/dist/model/RFQ.d.ts +34 -0
- package/dist/model/RFQ.js +21 -0
- package/dist/model/enums/NetworkType.d.ts +0 -1
- package/dist/model/enums/NetworkType.js +0 -1
- package/dist/orders/index.d.ts +5 -1
- package/dist/orders/index.js +22 -0
- package/dist/orders/types.d.ts +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
import { OrderSide } from './enums/OrderSide';
|
|
21
|
+
export type AcceptQuoteRequest = {
|
|
22
|
+
productId: string;
|
|
23
|
+
side: OrderSide;
|
|
24
|
+
/**
|
|
25
|
+
* A client-generated ID used for reference purposes (note: order will be rejected if this ID is not unique among all currently active orders)
|
|
26
|
+
*/
|
|
27
|
+
clientOrderId: string;
|
|
28
|
+
/**
|
|
29
|
+
* A quote id that was returned from the quote request
|
|
30
|
+
*/
|
|
31
|
+
quoteId: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
export type AcceptQuoteResponse = {
|
|
21
|
+
orderId?: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -20,5 +20,8 @@
|
|
|
20
20
|
export type AddressEntry = {
|
|
21
21
|
name?: string;
|
|
22
22
|
address?: string;
|
|
23
|
+
/**
|
|
24
|
+
* List of compatible chain IDs for a given address, empty for Solana. Ex: 1 for ETH Mainnet or 8453 for Base. Find more [here](https://chainlist.org/).
|
|
25
|
+
*/
|
|
23
26
|
chainIds?: Array<string>;
|
|
24
27
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
import { AddressEntry } from './AddressEntry';
|
|
21
|
+
import { NetworkType } from './enums/NetworkType';
|
|
22
|
+
export type CreateAddressGroup = {
|
|
23
|
+
name?: string;
|
|
24
|
+
networkType?: NetworkType;
|
|
25
|
+
addresses?: Array<AddressEntry>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
export type QuoteResponse = {
|
|
21
|
+
quoteId?: string;
|
|
22
|
+
expirationTime?: Date;
|
|
23
|
+
bestPrice?: string;
|
|
24
|
+
orderTotal?: string;
|
|
25
|
+
priceInclusiveOfFees?: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
* Do not edit the class manually.
|
|
19
|
+
*/
|
|
20
|
+
import { OrderSide } from './enums/OrderSide';
|
|
21
|
+
/**
|
|
22
|
+
* based off PostOrderPreviewRequest
|
|
23
|
+
*/
|
|
24
|
+
export type RFQ = {
|
|
25
|
+
productId: string;
|
|
26
|
+
side: OrderSide;
|
|
27
|
+
/**
|
|
28
|
+
* A client-generated order ID used for reference purposes (note: order will be rejected if this ID is not unique among all currently active orders)
|
|
29
|
+
*/
|
|
30
|
+
clientQuoteId: string;
|
|
31
|
+
baseQuantity?: string;
|
|
32
|
+
quoteValue?: string;
|
|
33
|
+
limitPrice: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.NetworkType = void 0;
|
|
23
23
|
var NetworkType;
|
|
24
24
|
(function (NetworkType) {
|
|
25
|
-
NetworkType["Unspecified"] = "NETWORK_TYPE_UNSPECIFIED";
|
|
26
25
|
NetworkType["Evm"] = "NETWORK_TYPE_EVM";
|
|
27
26
|
NetworkType["Solana"] = "NETWORK_TYPE_SOLANA";
|
|
28
27
|
})(NetworkType || (exports.NetworkType = NetworkType = {}));
|
package/dist/orders/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
17
17
|
import { CoinbasePrimeClient } from '../client';
|
|
18
18
|
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
19
|
-
import { ListOpenOrdersResponse, ListOpenOrdersRequest, ListOrderFillsRequest, ListOrderFillsResponse, ListPortfolioOrdersResponse, ListPortfolioOrdersRequest, GetOrderResponse, GetOrderRequest, ListPortfolioFillsRequest, ListPortfolioFillsResponse, CreateOrderPreviewRequest, CreateOrderPreviewResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse } from './types';
|
|
19
|
+
import { ListOpenOrdersResponse, ListOpenOrdersRequest, ListOrderFillsRequest, ListOrderFillsResponse, ListPortfolioOrdersResponse, ListPortfolioOrdersRequest, GetOrderResponse, GetOrderRequest, ListPortfolioFillsRequest, ListPortfolioFillsResponse, CreateOrderPreviewRequest, CreateOrderPreviewResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse, CreateQuoteRequest, CreateQuoteResponse, AcceptQuoteRequest, AcceptQuoteResponse } from './types';
|
|
20
20
|
export interface IOrdersService {
|
|
21
21
|
getOrder(request: GetOrderRequest, options?: CoinbaseCallOptions): Promise<GetOrderResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
22
22
|
listPortfolioFills(request: ListPortfolioFillsRequest, options?: CoinbaseCallOptions): Promise<ListPortfolioFillsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
@@ -26,6 +26,8 @@ export interface IOrdersService {
|
|
|
26
26
|
createOrderPreview(request: CreateOrderPreviewRequest, options?: CoinbaseCallOptions): Promise<CreateOrderPreviewResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
27
27
|
cancelOrder(request: CancelOrderRequest, options?: CoinbaseCallOptions): Promise<CancelOrderResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
28
28
|
createOrder(request: CreateOrderRequest, options?: CoinbaseCallOptions): Promise<CreateOrderResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
29
|
+
createQuote(request: CreateQuoteRequest, options?: CoinbaseCallOptions): Promise<CreateQuoteResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
30
|
+
acceptQuote(request: AcceptQuoteRequest, options?: CoinbaseCallOptions): Promise<AcceptQuoteResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
29
31
|
}
|
|
30
32
|
export declare class OrdersService implements IOrdersService {
|
|
31
33
|
private client;
|
|
@@ -38,4 +40,6 @@ export declare class OrdersService implements IOrdersService {
|
|
|
38
40
|
createOrderPreview(request: CreateOrderPreviewRequest, options?: CoinbaseCallOptions): Promise<CreateOrderPreviewResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
39
41
|
cancelOrder(request: CancelOrderRequest, options?: CoinbaseCallOptions): Promise<CancelOrderResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
40
42
|
createOrder(request: CreateOrderRequest, options?: CoinbaseCallOptions): Promise<CreateOrderResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
43
|
+
createQuote(request: CreateQuoteRequest, options?: CoinbaseCallOptions): Promise<CreateQuoteResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
44
|
+
acceptQuote(request: AcceptQuoteRequest, options?: CoinbaseCallOptions): Promise<AcceptQuoteResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
41
45
|
}
|
package/dist/orders/index.js
CHANGED
|
@@ -115,5 +115,27 @@ class OrdersService {
|
|
|
115
115
|
return response.data;
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
+
createQuote(request, options) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const response = yield this.client.request({
|
|
121
|
+
url: `portfolios/${request.portfolioId}/rfq`,
|
|
122
|
+
method: core_ts_1.Method.POST,
|
|
123
|
+
bodyParams: request,
|
|
124
|
+
callOptions: options,
|
|
125
|
+
});
|
|
126
|
+
return response.data;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
acceptQuote(request, options) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const response = yield this.client.request({
|
|
132
|
+
url: `portfolios/${request.portfolioId}/accept_quote`,
|
|
133
|
+
method: core_ts_1.Method.POST,
|
|
134
|
+
bodyParams: request,
|
|
135
|
+
callOptions: options,
|
|
136
|
+
});
|
|
137
|
+
return response.data;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
118
140
|
}
|
|
119
141
|
exports.OrdersService = OrdersService;
|
package/dist/orders/types.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ import { CancelOrderResponse as internalCancel } from '../model/CancelOrderRespo
|
|
|
27
27
|
import { CreateOrderResponse as internalCreateResp } from '../model/CreateOrderResponse';
|
|
28
28
|
import { CreateOrderRequest as internalCreate } from '../model/CreateOrderRequest';
|
|
29
29
|
import { Pagination } from '../shared/pagination';
|
|
30
|
+
import { QuoteResponse } from '../model/QuoteResponse';
|
|
31
|
+
import { AcceptQuoteRequest as internalAcceptQuoteReq } from '../model/AcceptQuoteRequest';
|
|
32
|
+
import { AcceptQuoteResponse as internalAcceptQuoteResp } from '../model/AcceptQuoteResponse';
|
|
30
33
|
export type GetOrderRequest = {
|
|
31
34
|
portfolioId: string;
|
|
32
35
|
orderId: string;
|
|
@@ -75,3 +78,11 @@ export type CreateOrderRequest = internalCreate & {
|
|
|
75
78
|
portfolioId: string;
|
|
76
79
|
};
|
|
77
80
|
export type CreateOrderResponse = internalCreateResp;
|
|
81
|
+
export type CreateQuoteRequest = internalCreate & {
|
|
82
|
+
portfolioId: string;
|
|
83
|
+
};
|
|
84
|
+
export type CreateQuoteResponse = QuoteResponse;
|
|
85
|
+
export type AcceptQuoteRequest = internalAcceptQuoteReq & {
|
|
86
|
+
portfolioId: string;
|
|
87
|
+
};
|
|
88
|
+
export type AcceptQuoteResponse = internalAcceptQuoteResp;
|