@crestal/nation-sdk 0.8.63 → 0.8.64
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/.openapi-generator/FILES +1 -0
- package/README.md +4 -2
- package/api.ts +79 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +46 -1
- package/dist/api.js +75 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/docs/X402Api.md +45 -0
- package/docs/X402TopupResponse.md +25 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @crestal/nation-sdk@0.8.
|
|
1
|
+
## @crestal/nation-sdk@0.8.64
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @crestal/nation-sdk@0.8.
|
|
39
|
+
npm install @crestal/nation-sdk@0.8.64 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -114,6 +114,7 @@ Class | Method | HTTP request | Description
|
|
|
114
114
|
*UserApi* | [**getUserAgents**](docs/UserApi.md#getuseragents) | **GET** /user/agents | Get User Agents
|
|
115
115
|
*UserApi* | [**uploadUserFile**](docs/UserApi.md#uploaduserfile) | **POST** /user/upload | Upload User File
|
|
116
116
|
*X402Api* | [**chatByX402**](docs/X402Api.md#chatbyx402) | **POST** /x/{aid} | Chat by x402
|
|
117
|
+
*X402Api* | [**x402Topup**](docs/X402Api.md#x402topup) | **POST** /x402/topup | Top up caps via x402
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
### Documentation For Models
|
|
@@ -173,6 +174,7 @@ Class | Method | HTTP request | Description
|
|
|
173
174
|
- [UserAgentListResponse](docs/UserAgentListResponse.md)
|
|
174
175
|
- [ValidationError](docs/ValidationError.md)
|
|
175
176
|
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
|
|
177
|
+
- [X402TopupResponse](docs/X402TopupResponse.md)
|
|
176
178
|
|
|
177
179
|
|
|
178
180
|
<a id="documentation-for-authorization"></a>
|
package/api.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Nation IntentKit API
|
|
5
5
|
* API for Nation IntentKit services
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.8.
|
|
7
|
+
* The version of the OpenAPI document: 0.8.64
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -1564,6 +1564,23 @@ export interface ValidationError {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
export interface ValidationErrorLocInner {
|
|
1566
1566
|
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Response payload for x402 top-up requests.
|
|
1569
|
+
*/
|
|
1570
|
+
export interface X402TopupResponse {
|
|
1571
|
+
/**
|
|
1572
|
+
* Identifier of the user who received the caps
|
|
1573
|
+
*/
|
|
1574
|
+
'user_id': string;
|
|
1575
|
+
/**
|
|
1576
|
+
* Total caps credited to the user
|
|
1577
|
+
*/
|
|
1578
|
+
'caps_added': string;
|
|
1579
|
+
/**
|
|
1580
|
+
* Settlement transaction hash returned by the facilitator
|
|
1581
|
+
*/
|
|
1582
|
+
'transaction_hash': string;
|
|
1583
|
+
}
|
|
1567
1584
|
|
|
1568
1585
|
/**
|
|
1569
1586
|
* AgentApi - axios parameter creator
|
|
@@ -6673,6 +6690,36 @@ export const X402ApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
6673
6690
|
|
|
6674
6691
|
|
|
6675
6692
|
|
|
6693
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6694
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6695
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
6696
|
+
|
|
6697
|
+
return {
|
|
6698
|
+
url: toPathString(localVarUrlObj),
|
|
6699
|
+
options: localVarRequestOptions,
|
|
6700
|
+
};
|
|
6701
|
+
},
|
|
6702
|
+
/**
|
|
6703
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6704
|
+
* @summary Top up caps via x402
|
|
6705
|
+
* @param {*} [options] Override http request option.
|
|
6706
|
+
* @throws {RequiredError}
|
|
6707
|
+
*/
|
|
6708
|
+
x402Topup: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
6709
|
+
const localVarPath = `/x402/topup`;
|
|
6710
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
6711
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6712
|
+
let baseOptions;
|
|
6713
|
+
if (configuration) {
|
|
6714
|
+
baseOptions = configuration.baseOptions;
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6717
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
6718
|
+
const localVarHeaderParameter = {} as any;
|
|
6719
|
+
const localVarQueryParameter = {} as any;
|
|
6720
|
+
|
|
6721
|
+
|
|
6722
|
+
|
|
6676
6723
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6677
6724
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6678
6725
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -6704,6 +6751,18 @@ export const X402ApiFp = function(configuration?: Configuration) {
|
|
|
6704
6751
|
const localVarOperationServerBasePath = operationServerMap['X402Api.chatByX402']?.[localVarOperationServerIndex]?.url;
|
|
6705
6752
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
6706
6753
|
},
|
|
6754
|
+
/**
|
|
6755
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6756
|
+
* @summary Top up caps via x402
|
|
6757
|
+
* @param {*} [options] Override http request option.
|
|
6758
|
+
* @throws {RequiredError}
|
|
6759
|
+
*/
|
|
6760
|
+
async x402Topup(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<X402TopupResponse>> {
|
|
6761
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.x402Topup(options);
|
|
6762
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
6763
|
+
const localVarOperationServerBasePath = operationServerMap['X402Api.x402Topup']?.[localVarOperationServerIndex]?.url;
|
|
6764
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
6765
|
+
},
|
|
6707
6766
|
}
|
|
6708
6767
|
};
|
|
6709
6768
|
|
|
@@ -6723,6 +6782,15 @@ export const X402ApiFactory = function (configuration?: Configuration, basePath?
|
|
|
6723
6782
|
chatByX402(aid: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>> {
|
|
6724
6783
|
return localVarFp.chatByX402(aid, options).then((request) => request(axios, basePath));
|
|
6725
6784
|
},
|
|
6785
|
+
/**
|
|
6786
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6787
|
+
* @summary Top up caps via x402
|
|
6788
|
+
* @param {*} [options] Override http request option.
|
|
6789
|
+
* @throws {RequiredError}
|
|
6790
|
+
*/
|
|
6791
|
+
x402Topup(options?: RawAxiosRequestConfig): AxiosPromise<X402TopupResponse> {
|
|
6792
|
+
return localVarFp.x402Topup(options).then((request) => request(axios, basePath));
|
|
6793
|
+
},
|
|
6726
6794
|
};
|
|
6727
6795
|
};
|
|
6728
6796
|
|
|
@@ -6740,6 +6808,16 @@ export class X402Api extends BaseAPI {
|
|
|
6740
6808
|
public chatByX402(aid: string, options?: RawAxiosRequestConfig) {
|
|
6741
6809
|
return X402ApiFp(this.configuration).chatByX402(aid, options).then((request) => request(this.axios, this.basePath));
|
|
6742
6810
|
}
|
|
6811
|
+
|
|
6812
|
+
/**
|
|
6813
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6814
|
+
* @summary Top up caps via x402
|
|
6815
|
+
* @param {*} [options] Override http request option.
|
|
6816
|
+
* @throws {RequiredError}
|
|
6817
|
+
*/
|
|
6818
|
+
public x402Topup(options?: RawAxiosRequestConfig) {
|
|
6819
|
+
return X402ApiFp(this.configuration).x402Topup(options).then((request) => request(this.axios, this.basePath));
|
|
6820
|
+
}
|
|
6743
6821
|
}
|
|
6744
6822
|
|
|
6745
6823
|
|
package/base.ts
CHANGED
package/common.ts
CHANGED
package/configuration.ts
CHANGED
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Nation IntentKit API
|
|
3
3
|
* API for Nation IntentKit services
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 0.8.
|
|
5
|
+
* The version of the OpenAPI document: 0.8.64
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -1521,6 +1521,23 @@ export interface ValidationError {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
export interface ValidationErrorLocInner {
|
|
1523
1523
|
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Response payload for x402 top-up requests.
|
|
1526
|
+
*/
|
|
1527
|
+
export interface X402TopupResponse {
|
|
1528
|
+
/**
|
|
1529
|
+
* Identifier of the user who received the caps
|
|
1530
|
+
*/
|
|
1531
|
+
'user_id': string;
|
|
1532
|
+
/**
|
|
1533
|
+
* Total caps credited to the user
|
|
1534
|
+
*/
|
|
1535
|
+
'caps_added': string;
|
|
1536
|
+
/**
|
|
1537
|
+
* Settlement transaction hash returned by the facilitator
|
|
1538
|
+
*/
|
|
1539
|
+
'transaction_hash': string;
|
|
1540
|
+
}
|
|
1524
1541
|
/**
|
|
1525
1542
|
* AgentApi - axios parameter creator
|
|
1526
1543
|
*/
|
|
@@ -3853,6 +3870,13 @@ export declare const X402ApiAxiosParamCreator: (configuration?: Configuration) =
|
|
|
3853
3870
|
* @throws {RequiredError}
|
|
3854
3871
|
*/
|
|
3855
3872
|
chatByX402: (aid: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
3873
|
+
/**
|
|
3874
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
3875
|
+
* @summary Top up caps via x402
|
|
3876
|
+
* @param {*} [options] Override http request option.
|
|
3877
|
+
* @throws {RequiredError}
|
|
3878
|
+
*/
|
|
3879
|
+
x402Topup: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
3856
3880
|
};
|
|
3857
3881
|
/**
|
|
3858
3882
|
* X402Api - functional programming interface
|
|
@@ -3866,6 +3890,13 @@ export declare const X402ApiFp: (configuration?: Configuration) => {
|
|
|
3866
3890
|
* @throws {RequiredError}
|
|
3867
3891
|
*/
|
|
3868
3892
|
chatByX402(aid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>>;
|
|
3893
|
+
/**
|
|
3894
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
3895
|
+
* @summary Top up caps via x402
|
|
3896
|
+
* @param {*} [options] Override http request option.
|
|
3897
|
+
* @throws {RequiredError}
|
|
3898
|
+
*/
|
|
3899
|
+
x402Topup(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<X402TopupResponse>>;
|
|
3869
3900
|
};
|
|
3870
3901
|
/**
|
|
3871
3902
|
* X402Api - factory interface
|
|
@@ -3879,6 +3910,13 @@ export declare const X402ApiFactory: (configuration?: Configuration, basePath?:
|
|
|
3879
3910
|
* @throws {RequiredError}
|
|
3880
3911
|
*/
|
|
3881
3912
|
chatByX402(aid: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>>;
|
|
3913
|
+
/**
|
|
3914
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
3915
|
+
* @summary Top up caps via x402
|
|
3916
|
+
* @param {*} [options] Override http request option.
|
|
3917
|
+
* @throws {RequiredError}
|
|
3918
|
+
*/
|
|
3919
|
+
x402Topup(options?: RawAxiosRequestConfig): AxiosPromise<X402TopupResponse>;
|
|
3882
3920
|
};
|
|
3883
3921
|
/**
|
|
3884
3922
|
* X402Api - object-oriented interface
|
|
@@ -3892,4 +3930,11 @@ export declare class X402Api extends BaseAPI {
|
|
|
3892
3930
|
* @throws {RequiredError}
|
|
3893
3931
|
*/
|
|
3894
3932
|
chatByX402(aid: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessage[], any, {}>>;
|
|
3933
|
+
/**
|
|
3934
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
3935
|
+
* @summary Top up caps via x402
|
|
3936
|
+
* @param {*} [options] Override http request option.
|
|
3937
|
+
* @throws {RequiredError}
|
|
3938
|
+
*/
|
|
3939
|
+
x402Topup(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<X402TopupResponse, any, {}>>;
|
|
3895
3940
|
}
|
package/dist/api.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.64
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -6551,6 +6551,39 @@ var X402ApiAxiosParamCreator = function (configuration) {
|
|
|
6551
6551
|
});
|
|
6552
6552
|
});
|
|
6553
6553
|
},
|
|
6554
|
+
/**
|
|
6555
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6556
|
+
* @summary Top up caps via x402
|
|
6557
|
+
* @param {*} [options] Override http request option.
|
|
6558
|
+
* @throws {RequiredError}
|
|
6559
|
+
*/
|
|
6560
|
+
x402Topup: function () {
|
|
6561
|
+
var args_1 = [];
|
|
6562
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6563
|
+
args_1[_i] = arguments[_i];
|
|
6564
|
+
}
|
|
6565
|
+
return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (options) {
|
|
6566
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
6567
|
+
if (options === void 0) { options = {}; }
|
|
6568
|
+
return __generator(this, function (_a) {
|
|
6569
|
+
localVarPath = "/x402/topup";
|
|
6570
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
6571
|
+
if (configuration) {
|
|
6572
|
+
baseOptions = configuration.baseOptions;
|
|
6573
|
+
}
|
|
6574
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
6575
|
+
localVarHeaderParameter = {};
|
|
6576
|
+
localVarQueryParameter = {};
|
|
6577
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
6578
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6579
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
6580
|
+
return [2 /*return*/, {
|
|
6581
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
6582
|
+
options: localVarRequestOptions,
|
|
6583
|
+
}];
|
|
6584
|
+
});
|
|
6585
|
+
});
|
|
6586
|
+
},
|
|
6554
6587
|
};
|
|
6555
6588
|
};
|
|
6556
6589
|
exports.X402ApiAxiosParamCreator = X402ApiAxiosParamCreator;
|
|
@@ -6583,6 +6616,28 @@ var X402ApiFp = function (configuration) {
|
|
|
6583
6616
|
});
|
|
6584
6617
|
});
|
|
6585
6618
|
},
|
|
6619
|
+
/**
|
|
6620
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6621
|
+
* @summary Top up caps via x402
|
|
6622
|
+
* @param {*} [options] Override http request option.
|
|
6623
|
+
* @throws {RequiredError}
|
|
6624
|
+
*/
|
|
6625
|
+
x402Topup: function (options) {
|
|
6626
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6627
|
+
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
|
|
6628
|
+
var _a, _b, _c;
|
|
6629
|
+
return __generator(this, function (_d) {
|
|
6630
|
+
switch (_d.label) {
|
|
6631
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.x402Topup(options)];
|
|
6632
|
+
case 1:
|
|
6633
|
+
localVarAxiosArgs = _d.sent();
|
|
6634
|
+
localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
6635
|
+
localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['X402Api.x402Topup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
6636
|
+
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
|
|
6637
|
+
}
|
|
6638
|
+
});
|
|
6639
|
+
});
|
|
6640
|
+
},
|
|
6586
6641
|
};
|
|
6587
6642
|
};
|
|
6588
6643
|
exports.X402ApiFp = X402ApiFp;
|
|
@@ -6602,6 +6657,15 @@ var X402ApiFactory = function (configuration, basePath, axios) {
|
|
|
6602
6657
|
chatByX402: function (aid, options) {
|
|
6603
6658
|
return localVarFp.chatByX402(aid, options).then(function (request) { return request(axios, basePath); });
|
|
6604
6659
|
},
|
|
6660
|
+
/**
|
|
6661
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6662
|
+
* @summary Top up caps via x402
|
|
6663
|
+
* @param {*} [options] Override http request option.
|
|
6664
|
+
* @throws {RequiredError}
|
|
6665
|
+
*/
|
|
6666
|
+
x402Topup: function (options) {
|
|
6667
|
+
return localVarFp.x402Topup(options).then(function (request) { return request(axios, basePath); });
|
|
6668
|
+
},
|
|
6605
6669
|
};
|
|
6606
6670
|
};
|
|
6607
6671
|
exports.X402ApiFactory = X402ApiFactory;
|
|
@@ -6624,6 +6688,16 @@ var X402Api = /** @class */ (function (_super) {
|
|
|
6624
6688
|
var _this = this;
|
|
6625
6689
|
return (0, exports.X402ApiFp)(this.configuration).chatByX402(aid, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
6626
6690
|
};
|
|
6691
|
+
/**
|
|
6692
|
+
* Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
6693
|
+
* @summary Top up caps via x402
|
|
6694
|
+
* @param {*} [options] Override http request option.
|
|
6695
|
+
* @throws {RequiredError}
|
|
6696
|
+
*/
|
|
6697
|
+
X402Api.prototype.x402Topup = function (options) {
|
|
6698
|
+
var _this = this;
|
|
6699
|
+
return (0, exports.X402ApiFp)(this.configuration).x402Topup(options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
6700
|
+
};
|
|
6627
6701
|
return X402Api;
|
|
6628
6702
|
}(base_1.BaseAPI));
|
|
6629
6703
|
exports.X402Api = X402Api;
|
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.64
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/common.d.ts
CHANGED
package/dist/common.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.64
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/configuration.d.ts
CHANGED
package/dist/configuration.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.64
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -27,8 +27,8 @@ Name | Type | Description | Notes
|
|
|
27
27
|
**supports_presence_penalty** | **boolean** | | [optional] [default to true]
|
|
28
28
|
**api_base** | **string** | | [optional] [default to undefined]
|
|
29
29
|
**timeout** | **number** | | [optional] [default to 180]
|
|
30
|
-
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-11-
|
|
31
|
-
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-11-
|
|
30
|
+
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-11-07T04:25:52.079+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-11-07T04:25:52.079+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/docs/X402Api.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost*
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
|[**chatByX402**](#chatbyx402) | **POST** /x/{aid} | Chat by x402|
|
|
8
|
+
|[**x402Topup**](#x402topup) | **POST** /x402/topup | Top up caps via x402|
|
|
8
9
|
|
|
9
10
|
# **chatByX402**
|
|
10
11
|
> Array<ChatMessage> chatByX402()
|
|
@@ -58,3 +59,47 @@ No authorization required
|
|
|
58
59
|
|
|
59
60
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
60
61
|
|
|
62
|
+
# **x402Topup**
|
|
63
|
+
> X402TopupResponse x402Topup()
|
|
64
|
+
|
|
65
|
+
Recharge a user\'s caps balance directly using an x402 payment. This endpoint verifies the $1.00 payment, settles it with the facilitator, and credits 1000 caps to the payer\'s account without triggering any chat or agent execution.
|
|
66
|
+
|
|
67
|
+
### Example
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import {
|
|
71
|
+
X402Api,
|
|
72
|
+
Configuration
|
|
73
|
+
} from '@crestal/nation-sdk';
|
|
74
|
+
|
|
75
|
+
const configuration = new Configuration();
|
|
76
|
+
const apiInstance = new X402Api(configuration);
|
|
77
|
+
|
|
78
|
+
const { status, data } = await apiInstance.x402Topup();
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Parameters
|
|
82
|
+
This endpoint does not have any parameters.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Return type
|
|
86
|
+
|
|
87
|
+
**X402TopupResponse**
|
|
88
|
+
|
|
89
|
+
### Authorization
|
|
90
|
+
|
|
91
|
+
No authorization required
|
|
92
|
+
|
|
93
|
+
### HTTP request headers
|
|
94
|
+
|
|
95
|
+
- **Content-Type**: Not defined
|
|
96
|
+
- **Accept**: application/json
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### HTTP response details
|
|
100
|
+
| Status code | Description | Response headers |
|
|
101
|
+
|-------------|-------------|------------------|
|
|
102
|
+
|**200** | Successful Response | - |
|
|
103
|
+
|
|
104
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
105
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# X402TopupResponse
|
|
2
|
+
|
|
3
|
+
Response payload for x402 top-up requests.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**user_id** | **string** | Identifier of the user who received the caps | [default to undefined]
|
|
10
|
+
**caps_added** | **string** | Total caps credited to the user | [default to undefined]
|
|
11
|
+
**transaction_hash** | **string** | Settlement transaction hash returned by the facilitator | [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { X402TopupResponse } from '@crestal/nation-sdk';
|
|
17
|
+
|
|
18
|
+
const instance: X402TopupResponse = {
|
|
19
|
+
user_id,
|
|
20
|
+
caps_added,
|
|
21
|
+
transaction_hash,
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED