@burnt-labs/xion-types 19.0.2 → 21.0.0-alpha.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/README.md +111 -0
- package/index.d.ts +3 -0
- package/index.js +12 -0
- package/index.js.map +1 -0
- package/index.ts +15 -0
- package/package.json +29 -6
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# @burnt-labs/xion-types
|
|
2
|
+
|
|
3
|
+
TypeScript definitions for Xion Protobuf files. This package provides TypeScript type definitions generated from the Protobuf files used in the Xion project, enabling developers to work with Xion-related data structures in a type-safe way.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [@burnt-labs/xion-types](#burnt-labsxion-types)
|
|
8
|
+
- [Table of Contents](#table-of-contents)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Example](#example)
|
|
12
|
+
- [Development](#development)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install the **@burnt-labs/xion-types** package via npm or yarn:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Using npm
|
|
23
|
+
npm install @burnt-labs/xion-types
|
|
24
|
+
|
|
25
|
+
# Using yarn
|
|
26
|
+
yarn add @burnt-labs/xion-types
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
Once installed, you can import the type definitions in your TypeScript project. The types are generated from the Protobuf files used in the Xion project.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { MyProtobufType } from '@burnt-labs/xion-types/types/filename';
|
|
37
|
+
|
|
38
|
+
const myData: MyProtobufType = {
|
|
39
|
+
field1: 'value',
|
|
40
|
+
field2: 42
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Note:** Replace `filename` with the appropriate file name where the type is defined.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
Here is a full example of how you might use the **@burnt-labs/xion-types** package in a TypeScript project:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { MyProtobufType } from '@burnt-labs/xion-types/types/filename';
|
|
54
|
+
|
|
55
|
+
function processData(data: MyProtobufType): void {
|
|
56
|
+
console.log(`Field 1: ${data.field1}`);
|
|
57
|
+
console.log(`Field 2: ${data.field2}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const sampleData: MyProtobufType = {
|
|
61
|
+
field1: 'Hello, Xion!',
|
|
62
|
+
field2: 100
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
processData(sampleData);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
> This simple example illustrates how you can work with the types generated from Xion's Protobuf definitions.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
If you want to modify or regenerate the TypeScript definitions from Protobuf files, follow these steps:
|
|
75
|
+
|
|
76
|
+
1. **Clone the Repository**
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/burnt-labs/xion.git
|
|
79
|
+
cd xion
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
2. **Install Dependencies**
|
|
83
|
+
```bash
|
|
84
|
+
npm install
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. **Generate TypeScript Definitions**
|
|
88
|
+
```bash
|
|
89
|
+
npx protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
|
|
90
|
+
--ts_out=./generated \
|
|
91
|
+
--proto_path=./proto \
|
|
92
|
+
$(find ./proto -name '*.proto')
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
4. **Compile TypeScript Files**
|
|
96
|
+
```bash
|
|
97
|
+
tsc --noEmit
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> These steps will generate the TypeScript definitions from the Protobuf files located in the `proto` directory.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
This project is licensed under the MIT License. See the LICENSE file for details.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
For more information, check out [Xion's GitHub repository](https://github.com/burnt-labs/xion).
|
|
111
|
+
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Auto-generated index file
|
|
3
|
+
// This file is automatically generated by generate-index.js
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.protobufPackage = void 0;
|
|
6
|
+
// Export protobufPackage constant if needed
|
|
7
|
+
var coin_1 = require("./types/generated/cosmos/base/v1beta1/coin");
|
|
8
|
+
Object.defineProperty(exports, "protobufPackage", { enumerable: true, get: function () { return coin_1.protobufPackage; } });
|
|
9
|
+
// Users should import specific types directly from their paths:
|
|
10
|
+
// import { Coin } from "@burnt-labs/xion-types/cosmos/base/v1beta1/coin";
|
|
11
|
+
// import { QueryWebAuthNVerifyRegisterRequest } from "@burnt-labs/xion-types/xion/v1/query";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,4DAA4D;;;AAQ5D,4CAA4C;AAC5C,mEAA6E;AAApE,uGAAA,eAAe,OAAA;AAExB,gEAAgE;AAChE,0EAA0E;AAC1E,6FAA6F"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Auto-generated index file
|
|
2
|
+
// This file is automatically generated by generate-index.js
|
|
3
|
+
|
|
4
|
+
// Exports we want to provide at the root of the "@burnt-labs/xion-types" package
|
|
5
|
+
// Following the cosmjs-types pattern - only export helpers, not all types
|
|
6
|
+
|
|
7
|
+
// Export helper types from generated cosmos files
|
|
8
|
+
export type { DeepPartial, Exact } from "./types/generated/cosmos/base/v1beta1/coin";
|
|
9
|
+
|
|
10
|
+
// Export protobufPackage constant if needed
|
|
11
|
+
export { protobufPackage } from "./types/generated/cosmos/base/v1beta1/coin";
|
|
12
|
+
|
|
13
|
+
// Users should import specific types directly from their paths:
|
|
14
|
+
// import { Coin } from "@burnt-labs/xion-types/cosmos/base/v1beta1/coin";
|
|
15
|
+
// import { QueryWebAuthNVerifyRegisterRequest } from "@burnt-labs/xion-types/xion/v1/query";
|
package/package.json
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burnt-labs/xion-types",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "TypeScript definitions for Xion",
|
|
3
|
+
"version": "21.0.0-alpha.0",
|
|
4
|
+
"description": "TypeScript definitions for Xion Protobuf files",
|
|
5
|
+
"main": "index.js",
|
|
5
6
|
"types": "index.d.ts",
|
|
6
7
|
"files": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
8
|
+
"*/",
|
|
9
|
+
"!build/",
|
|
10
|
+
"!node_modules/",
|
|
11
|
+
"!types/",
|
|
12
|
+
"index.*",
|
|
13
|
+
"*.md"
|
|
9
14
|
],
|
|
10
|
-
"
|
|
11
|
-
"
|
|
15
|
+
"scripts": {
|
|
16
|
+
"codegen": "../../scripts/proto-gen.sh --ts && node generate-index.js",
|
|
17
|
+
"build": "rm -rf ./build && tsc && npm run prepare:dist",
|
|
18
|
+
"prepare:dist": "./prepare-dist.sh",
|
|
19
|
+
"prepack": "npm run codegen && npm run build",
|
|
20
|
+
"test": "jest"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@improbable-eng/grpc-web": "^0.14.1",
|
|
25
|
+
"browser-headers": "^0.4.1",
|
|
26
|
+
"google-protobuf": "^3.17.3",
|
|
27
|
+
"long": "^4.0.0",
|
|
28
|
+
"protobufjs": "~6.11.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^24.3.0",
|
|
32
|
+
"prettier": "^2.3.0",
|
|
33
|
+
"ts-proto": "^1.82.5",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
12
35
|
}
|
|
13
36
|
}
|