@manifest-network/manifestjs 2.4.1 → 3.0.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 +293 -170
- package/dist/codegen/liftedinit/billing/v1/query.d.ts +20 -16
- package/dist/codegen/liftedinit/billing/v1/query.js +28 -28
- package/dist/codegen/liftedinit/billing/v1/query.js.map +1 -1
- package/dist/codegen/liftedinit/billing/v1/query.lcd.js +2 -2
- package/dist/codegen/liftedinit/billing/v1/query.lcd.js.map +1 -1
- package/dist/codegen/liftedinit/billing/v1/query.lcd.mjs +2 -2
- package/dist/codegen/liftedinit/billing/v1/query.mjs +28 -28
- package/dist/codegen/liftedinit/billing/v1/tx.d.ts +30 -0
- package/dist/codegen/liftedinit/billing/v1/tx.js +38 -10
- package/dist/codegen/liftedinit/billing/v1/tx.js.map +1 -1
- package/dist/codegen/liftedinit/billing/v1/tx.mjs +38 -10
- package/dist/codegen/liftedinit/billing/v1/tx.registry.d.ts +1 -0
- package/dist/codegen/liftedinit/bundle.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,280 +4,403 @@
|
|
|
4
4
|
<img src="https://raw.githubusercontent.com/cosmos/chain-registry/00df6ff89abd382f9efe3d37306c353e2bd8d55c/manifest/images/manifest.png" alt="Manifest Network" width="100"/>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
TypeScript SDK for the Manifest Network — proto-generated message composers, query clients, signing-client factories, and amino converters for every module the chain ships.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
## Install
|
|
8
12
|
|
|
9
13
|
```sh
|
|
10
14
|
npm install @manifest-network/manifestjs
|
|
15
|
+
# or
|
|
16
|
+
yarn add @manifest-network/manifestjs
|
|
11
17
|
```
|
|
12
18
|
|
|
19
|
+
Compatibility:
|
|
20
|
+
|
|
21
|
+
- This release (`3.0.x`) targets [`manifest-ledger` v2.3.1](https://github.com/manifest-network/manifest-ledger/releases/tag/v2.3.1).
|
|
22
|
+
- CI builds and tests on Node 20.
|
|
23
|
+
|
|
13
24
|
## Table of contents
|
|
14
25
|
|
|
15
|
-
- [
|
|
16
|
-
|
|
17
|
-
- [Table of contents](#table-of-contents)
|
|
26
|
+
- [Install](#install)
|
|
27
|
+
- [What's in the box](#whats-in-the-box)
|
|
18
28
|
- [Usage](#usage)
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [
|
|
26
|
-
|
|
27
|
-
- [Creating Signers](#creating-signers)
|
|
28
|
-
- [Broadcasting Messages](#broadcasting-messages)
|
|
29
|
-
- [Advanced Usage](#advanced-usage)
|
|
29
|
+
- [Frontend (cosmos-kit)](#frontend-cosmos-kit)
|
|
30
|
+
- [Backend / scripts (raw signer)](#backend--scripts-raw-signer)
|
|
31
|
+
- [Querying state](#querying-state)
|
|
32
|
+
- [Composing messages](#composing-messages)
|
|
33
|
+
- [Typed Msg clients](#typed-msg-clients)
|
|
34
|
+
- [Module reference](#module-reference)
|
|
35
|
+
- [Advanced — building a multi-namespace signer](#advanced--building-a-multi-namespace-signer)
|
|
36
|
+
- [About the `@manifest-network/stargate` dependency](#about-the-manifest-networkstargate-dependency)
|
|
30
37
|
- [Developing](#developing)
|
|
38
|
+
- [Releasing](#releasing)
|
|
39
|
+
- [Related projects](#related-projects)
|
|
31
40
|
- [Credits](#credits)
|
|
41
|
+
- [Disclaimer](#disclaimer)
|
|
42
|
+
|
|
43
|
+
## What's in the box
|
|
44
|
+
|
|
45
|
+
Primary chain-module namespaces:
|
|
46
|
+
|
|
47
|
+
| Namespace | Modules | Notes |
|
|
48
|
+
| ----------------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------- |
|
|
49
|
+
| `cosmos` | bank, auth, authz, distribution, feegrant, gov (v1, v1beta1), group, mint, staking, upgrade, vesting, circuit, consensus | Standard Cosmos SDK modules, regenerated from upstream protos. |
|
|
50
|
+
| `cosmwasm` | wasm | CosmWasm Msg/Query clients. |
|
|
51
|
+
| `ibc` | applications.transfer, core.channel, core.client, core.connection, lightclients (tendermint, solomachine, localhost) | IBC v1. |
|
|
52
|
+
| `osmosis` | tokenfactory (v1beta1) | The Osmosis-style tokenfactory bundled with manifest-ledger. |
|
|
53
|
+
| `strangelove_ventures` | poa (v1) | Proof-of-Authority validator module. |
|
|
54
|
+
| `liftedinit` | manifest (v1), billing (v1), sku (v1) | Manifest-specific modules. **The chain's distinctive features live here.** |
|
|
55
|
+
| `tendermint`, `google` | — | Supporting types. |
|
|
56
|
+
|
|
57
|
+
The package also exports proto-plumbing namespaces — `amino`, `ics23`, `cosmos_proto`, `gogoproto` — which application code rarely needs to import directly.
|
|
58
|
+
|
|
59
|
+
For each namespace the package generates:
|
|
60
|
+
|
|
61
|
+
- `<namespace>.<module>.<version>` — message types, `MessageComposer`, `AminoConverter`, query/tx interfaces.
|
|
62
|
+
- `<namespace>.ClientFactory.createRPCQueryClient({ rpcEndpoint })` — typed RPC query client for that namespace.
|
|
63
|
+
- `<namespace>.ClientFactory.createLCDClient({ restEndpoint })` — typed LCD/REST query client (where supported).
|
|
64
|
+
- `getSigning<Namespace>Client({ rpcEndpoint, signer })` — `SigningStargateClient` pre-configured with that namespace's registry and amino converters.
|
|
65
|
+
- `<namespace>ProtoRegistry`, `<namespace>AminoConverters` — building blocks for composing your own multi-namespace registry (see [Advanced](#advanced--building-a-multi-namespace-signer)).
|
|
32
66
|
|
|
33
67
|
## Usage
|
|
34
68
|
|
|
35
|
-
|
|
69
|
+
> Replace `RPC_ENDPOINT` with your Manifest RPC URL throughout.
|
|
36
70
|
|
|
37
|
-
|
|
38
|
-
import { manifest } from "@manifest-network/manifestjs";
|
|
71
|
+
### Frontend (cosmos-kit)
|
|
39
72
|
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
For browser apps, use [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) for wallet connection and let it provide the signer. Once you have an `OfflineSigner`, hand it to one of the `getSigning*Client` factories:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { getSigningCosmosClient, cosmos } from '@manifest-network/manifestjs';
|
|
42
77
|
|
|
43
|
-
//
|
|
44
|
-
const
|
|
45
|
-
|
|
78
|
+
// `signer` comes from cosmos-kit (Keplr, Leap, etc.)
|
|
79
|
+
const client = await getSigningCosmosClient({
|
|
80
|
+
rpcEndpoint: RPC_ENDPOINT,
|
|
81
|
+
signer,
|
|
46
82
|
});
|
|
47
83
|
|
|
48
|
-
|
|
49
|
-
|
|
84
|
+
const { send } = cosmos.bank.v1beta1.MessageComposer.withTypeUrl;
|
|
85
|
+
|
|
86
|
+
const msg = send({
|
|
87
|
+
fromAddress: senderAddress,
|
|
88
|
+
toAddress: 'manifest1recipient...',
|
|
89
|
+
amount: [{ denom: 'umfx', amount: '1000000' }],
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const fee = { amount: [{ denom: 'umfx', amount: '220000' }], gas: '200000' };
|
|
93
|
+
const result = await client.signAndBroadcast(senderAddress, [msg], fee);
|
|
50
94
|
```
|
|
51
95
|
|
|
52
|
-
|
|
96
|
+
`getSigningCosmosClient` is the safest choice for cosmos-only transactions because its registry **and** amino converters cover every cosmos module bundled with this package — so the same code path works for Direct/proto signers and Amino signers (Ledger, Keplr's amino mode). For module-specific transactions, use the matching factory: `getSigningLiftedinitClient`, `getSigningOsmosisClient`, `getSigningStrangeloveVenturesClient`, `getSigningCosmwasmClient`, or `getSigningIbcClient`. Each is pre-wired (registry + amino) for its own namespace's messages — see the [Module reference](#module-reference) for examples. To send messages from multiple namespaces in a single transaction, see [Advanced](#advanced--building-a-multi-namespace-signer).
|
|
53
97
|
|
|
54
|
-
|
|
98
|
+
> **Authority-gated messages.** Several Manifest modules require the **module authority** as the signer — `liftedinit.manifest.v1.MsgPayout` / `MsgBurnHeldBalance`, every `MsgUpdateParams`, and the POA admin messages. On Manifest mainnet/testnet that authority is a `cosmos.group` policy address (no private key), so those messages can't be signed directly — they must be wrapped in a `cosmos.group.v1.MsgSubmitProposal`. See the per-module references ([manifest](docs/modules/manifest.md), [billing](docs/modules/billing.md#worked-example--tenant-lifecycle), [POA](docs/modules/poa.md#worked-example--admitting-a-pending-validator-via-group)) for the group-proposal flow.
|
|
55
99
|
|
|
56
|
-
|
|
57
|
-
import { manifest } from "@manifest-network/manifestjs";
|
|
100
|
+
### Backend / scripts (raw signer)
|
|
58
101
|
|
|
59
|
-
|
|
60
|
-
```
|
|
102
|
+
For Node scripts and tests, build a signer with `@cosmjs/proto-signing` (proto/Direct) or `@cosmjs/amino` (Amino — recommended for Ledger HW):
|
|
61
103
|
|
|
62
|
-
|
|
104
|
+
```ts
|
|
105
|
+
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
|
|
106
|
+
import { getSigningCosmosClient, cosmos } from '@manifest-network/manifestjs';
|
|
63
107
|
|
|
64
|
-
|
|
65
|
-
|
|
108
|
+
const signer = await DirectSecp256k1HdWallet.fromMnemonic(MNEMONIC, {
|
|
109
|
+
prefix: 'manifest',
|
|
110
|
+
});
|
|
111
|
+
const [{ address }] = await signer.getAccounts();
|
|
112
|
+
|
|
113
|
+
const client = await getSigningCosmosClient({
|
|
114
|
+
rpcEndpoint: RPC_ENDPOINT,
|
|
115
|
+
signer,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const { send } = cosmos.bank.v1beta1.MessageComposer.withTypeUrl;
|
|
119
|
+
const msg = send({
|
|
120
|
+
fromAddress: address,
|
|
121
|
+
toAddress: 'manifest1recipient...',
|
|
122
|
+
amount: [{ denom: 'umfx', amount: '1000' }],
|
|
123
|
+
});
|
|
66
124
|
|
|
67
|
-
const {
|
|
125
|
+
const fee = { amount: [{ denom: 'umfx', amount: '220000' }], gas: '200000' };
|
|
126
|
+
await client.signAndBroadcast(address, [msg], fee);
|
|
68
127
|
```
|
|
69
128
|
|
|
70
|
-
|
|
129
|
+
WARNING: never hard-code mnemonics in shipped code. The example above is fine for one-off scripts; use environment variables, AES encryption, or a wallet adapter in real applications.
|
|
71
130
|
|
|
72
|
-
|
|
73
|
-
import { ibc } from "@manifest-network/manifestjs";
|
|
131
|
+
For Amino signing, swap `DirectSecp256k1HdWallet` for `Secp256k1HdWallet`:
|
|
74
132
|
|
|
75
|
-
|
|
76
|
-
|
|
133
|
+
```ts
|
|
134
|
+
import { Secp256k1HdWallet } from '@cosmjs/amino';
|
|
77
135
|
|
|
78
|
-
|
|
136
|
+
const signer = await Secp256k1HdWallet.fromMnemonic(MNEMONIC, { prefix: 'manifest' });
|
|
137
|
+
```
|
|
79
138
|
|
|
80
|
-
|
|
81
|
-
import { cosmos } from "@manifest-network/manifestjs";
|
|
139
|
+
### Querying state
|
|
82
140
|
|
|
83
|
-
|
|
84
|
-
fundCommunityPool,
|
|
85
|
-
setWithdrawAddress,
|
|
86
|
-
withdrawDelegatorReward,
|
|
87
|
-
withdrawValidatorCommission,
|
|
88
|
-
} = cosmos.distribution.v1beta1.MessageComposer.fromPartial;
|
|
141
|
+
Each namespace exposes a query client factory under `ClientFactory.createRPCQueryClient`:
|
|
89
142
|
|
|
90
|
-
|
|
143
|
+
```ts
|
|
144
|
+
import { liftedinit } from '@manifest-network/manifestjs';
|
|
91
145
|
|
|
92
|
-
const {
|
|
93
|
-
|
|
94
|
-
createValidator,
|
|
95
|
-
delegate,
|
|
96
|
-
editValidator,
|
|
97
|
-
undelegate,
|
|
98
|
-
} = cosmos.staking.v1beta1.MessageComposer.fromPartial;
|
|
146
|
+
const { createRPCQueryClient } = liftedinit.ClientFactory;
|
|
147
|
+
const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT });
|
|
99
148
|
|
|
100
|
-
|
|
101
|
-
|
|
149
|
+
// cosmos modules are folded in (so you don't need a separate cosmos client)
|
|
150
|
+
const { balances } = await client.cosmos.bank.v1beta1.allBalances({
|
|
151
|
+
address: 'manifest1...',
|
|
152
|
+
});
|
|
102
153
|
|
|
103
|
-
|
|
104
|
-
|
|
154
|
+
// Manifest-specific modules
|
|
155
|
+
const params = await client.liftedinit.billing.v1.params({});
|
|
156
|
+
const lease = await client.liftedinit.billing.v1.lease({
|
|
157
|
+
leaseUuid: '0190000-aaaa-7bbb-cccc-ddddeeeeffff',
|
|
158
|
+
});
|
|
105
159
|
```
|
|
106
160
|
|
|
107
|
-
|
|
161
|
+
For POA / tokenfactory queries, use the matching namespace:
|
|
108
162
|
|
|
109
|
-
|
|
163
|
+
```ts
|
|
164
|
+
import { strangelove_ventures, osmosis } from '@manifest-network/manifestjs';
|
|
110
165
|
|
|
111
|
-
|
|
166
|
+
const poaClient = await strangelove_ventures.ClientFactory.createRPCQueryClient({
|
|
167
|
+
rpcEndpoint: RPC_ENDPOINT,
|
|
168
|
+
});
|
|
169
|
+
const { authority } = await poaClient.strangelove_ventures.poa.v1.poaAuthority();
|
|
112
170
|
|
|
113
|
-
|
|
171
|
+
const tfClient = await osmosis.ClientFactory.createRPCQueryClient({
|
|
172
|
+
rpcEndpoint: RPC_ENDPOINT,
|
|
173
|
+
});
|
|
174
|
+
const { params: tfParams } = await tfClient.osmosis.tokenfactory.v1beta1.params({});
|
|
175
|
+
```
|
|
114
176
|
|
|
115
|
-
|
|
177
|
+
LCD/REST clients are also generated where the proto opts in to `google.api.http`:
|
|
116
178
|
|
|
117
|
-
```
|
|
118
|
-
import {
|
|
179
|
+
```ts
|
|
180
|
+
import { liftedinit } from '@manifest-network/manifestjs';
|
|
119
181
|
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
signer, // OfflineSigner
|
|
182
|
+
const lcd = await liftedinit.ClientFactory.createLCDClient({
|
|
183
|
+
restEndpoint: REST_ENDPOINT,
|
|
123
184
|
});
|
|
185
|
+
const { params } = await lcd.liftedinit.billing.v1.params();
|
|
124
186
|
```
|
|
125
187
|
|
|
126
|
-
###
|
|
188
|
+
### Composing messages
|
|
127
189
|
|
|
128
|
-
|
|
190
|
+
Every module exports a `MessageComposer` with five flavors:
|
|
129
191
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
192
|
+
| Flavor | Returns | Use when |
|
|
193
|
+
| ----------------------- | --------------------------------------------- | ------------------------------------------------------------------- |
|
|
194
|
+
| `withTypeUrl.<method>` | `{ typeUrl, value: <Msg> }` | You'll pass `messages` straight to `signAndBroadcast`. **Default.** |
|
|
195
|
+
| `fromPartial.<method>` | `{ typeUrl, value: <Msg> with defaults }` | You only have a partial value object and want defaults filled. |
|
|
196
|
+
| `encoded.<method>` | `{ typeUrl, value: Uint8Array }` | You're wrapping in `google.protobuf.Any` (e.g., group proposals). |
|
|
197
|
+
| `toJSON` / `fromJSON` | JSON-safe forms | Serializing to disk / over a non-protobuf transport. |
|
|
133
198
|
|
|
134
|
-
|
|
199
|
+
```ts
|
|
200
|
+
import { cosmos, ibc, osmosis, liftedinit, strangelove_ventures } from '@manifest-network/manifestjs';
|
|
135
201
|
|
|
136
|
-
|
|
202
|
+
// Cosmos
|
|
203
|
+
const { send } = cosmos.bank.v1beta1.MessageComposer.withTypeUrl;
|
|
137
204
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```
|
|
205
|
+
// IBC
|
|
206
|
+
const { transfer } = ibc.applications.transfer.v1.MessageComposer.withTypeUrl;
|
|
141
207
|
|
|
142
|
-
|
|
208
|
+
// Osmosis tokenfactory (note: v1beta1, not v1)
|
|
209
|
+
const { createDenom, mint, burn } =
|
|
210
|
+
osmosis.tokenfactory.v1beta1.MessageComposer.withTypeUrl;
|
|
143
211
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
212
|
+
// Manifest
|
|
213
|
+
const { payout, burnHeldBalance } =
|
|
214
|
+
liftedinit.manifest.v1.MessageComposer.withTypeUrl;
|
|
147
215
|
|
|
148
|
-
|
|
216
|
+
// Billing
|
|
217
|
+
const { fundCredit, createLease, withdraw, setItemCustomDomain } =
|
|
218
|
+
liftedinit.billing.v1.MessageComposer.withTypeUrl;
|
|
149
219
|
|
|
150
|
-
|
|
151
|
-
|
|
220
|
+
// SKU
|
|
221
|
+
const { createProvider, createSKU } =
|
|
222
|
+
liftedinit.sku.v1.MessageComposer.withTypeUrl;
|
|
152
223
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const signer = await getOfflineSigner({
|
|
157
|
-
mnemonic,
|
|
158
|
-
chain,
|
|
159
|
-
});
|
|
224
|
+
// POA
|
|
225
|
+
const { setPower, removeValidator } =
|
|
226
|
+
strangelove_ventures.poa.v1.MessageComposer.withTypeUrl;
|
|
160
227
|
```
|
|
161
228
|
|
|
162
|
-
###
|
|
229
|
+
### Typed Msg clients
|
|
163
230
|
|
|
164
|
-
|
|
231
|
+
If you'd rather not hand-roll the `MessageComposer` + `signAndBroadcast` plumbing, every namespace also exposes a `createRPCMsgExtensions` factory that returns one `MsgClientImpl` per module. Each method has the signature `(signerAddress, message, fee?, memo?) => Promise<DeliverTxResponse>`:
|
|
165
232
|
|
|
166
|
-
```
|
|
167
|
-
|
|
233
|
+
```ts
|
|
234
|
+
import { liftedinit } from '@manifest-network/manifestjs';
|
|
168
235
|
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
denom: "coin",
|
|
173
|
-
amount: "1000",
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
toAddress: address,
|
|
177
|
-
fromAddress: address,
|
|
236
|
+
const tx = await liftedinit.ClientFactory.createRPCMsgExtensions({
|
|
237
|
+
rpcEndpoint: RPC_ENDPOINT,
|
|
238
|
+
signer,
|
|
178
239
|
});
|
|
179
240
|
|
|
180
|
-
const fee:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
241
|
+
const fee = { amount: [{ denom: 'umfx', amount: '330000' }], gas: '300000' };
|
|
242
|
+
|
|
243
|
+
await tx.liftedinit.billing.v1.fundCredit(
|
|
244
|
+
senderAddress,
|
|
245
|
+
{ sender: senderAddress, tenant: tenantAddress, amount: { denom: 'umfx', amount: '1000000' } },
|
|
246
|
+
fee,
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
await tx.cosmos.bank.v1beta1.send(
|
|
250
|
+
senderAddress,
|
|
251
|
+
{ fromAddress: senderAddress, toAddress: recipient, amount: [{ denom: 'umfx', amount: '500' }] },
|
|
252
|
+
fee,
|
|
253
|
+
);
|
|
190
254
|
```
|
|
191
255
|
|
|
192
|
-
|
|
256
|
+
The same pattern is available on `cosmos`, `osmosis`, `strangelove_ventures`, `cosmwasm`, and `ibc` namespaces.
|
|
257
|
+
|
|
258
|
+
> **Cross-namespace caveat.** The example above mixes `tx.liftedinit.*` with `tx.cosmos.bank.*` against a `liftedinit`-namespace client. That works for **Direct/proto** signers because `getSigningLiftedinitClient` adds `defaultRegistryTypes` to the Registry alongside `liftedinitProtoRegistry`, and `defaultRegistryTypes` covers cosmos protos. It will **not** work for **Amino** signers (Ledger, Keplr's amino mode): `liftedinitAminoConverters` only includes `billing`/`manifest`/`sku` converters, so Amino-signing `cosmos.bank.MsgSend` throws at `aminoTypes.toAmino()`. If you need Amino + cross-namespace messages, build a multi-namespace `SigningStargateClient` per the [Advanced section](#advanced--building-a-multi-namespace-signer).
|
|
193
259
|
|
|
194
|
-
|
|
260
|
+
> Each method accepts `fee: number | StdFee | "auto"`, but `"auto"` requires the underlying `SigningStargateClient` to be constructed with a `gasPrice` — and `getSigning<Namespace>Client` does not set one. Pass an explicit `StdFee` (as above), or build your own `SigningStargateClient` via the [Advanced section](#advanced--building-a-multi-namespace-signer) and supply `{ gasPrice: GasPrice.fromString('1.1umfx') }` if you want gas estimation. The current `umfx` gas-price tiers (fixed-min `1`, low `1.05`, average `1.1`, high `3`) come from the [chain-registry entry for manifest](https://github.com/cosmos/chain-registry/blob/master/manifest/chain.json); double-check before sending real value, since the registry is the source of truth.
|
|
195
261
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
262
|
+
## Module reference
|
|
263
|
+
|
|
264
|
+
Per-module references with every message, query, type URL, and worked example:
|
|
265
|
+
|
|
266
|
+
- [Manifest (`liftedinit.manifest.v1`)](docs/modules/manifest.md) — `payout`, `burnHeldBalance`.
|
|
267
|
+
- [Billing (`liftedinit.billing.v1`)](docs/modules/billing.md) — leases, credit accounts, withdrawals, custom domains.
|
|
268
|
+
- [SKU (`liftedinit.sku.v1`)](docs/modules/sku.md) — provider and SKU CRUD.
|
|
269
|
+
- [POA (`strangelove_ventures.poa.v1`)](docs/modules/poa.md) — validator power management.
|
|
270
|
+
- [Tokenfactory (`osmosis.tokenfactory.v1beta1`)](docs/modules/tokenfactory.md) — denom creation, mint, burn, admin transfer.
|
|
271
|
+
|
|
272
|
+
For the standard Cosmos SDK modules (`cosmos.bank`, `cosmos.gov`, `cosmos.group`, `cosmos.staking`, etc.) follow the upstream Cosmos SDK docs — message names and field shapes match.
|
|
273
|
+
|
|
274
|
+
## Advanced — building a multi-namespace signer
|
|
275
|
+
|
|
276
|
+
If a single transaction must include messages from several namespaces (say, `cosmos.group` proposing a `liftedinit.manifest` payout), compose your own registry:
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
import { OfflineSigner, GeneratedType, Registry } from '@cosmjs/proto-signing';
|
|
280
|
+
import { AminoTypes, SigningStargateClient, defaultRegistryTypes } from '@cosmjs/stargate';
|
|
199
281
|
|
|
200
282
|
import {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
283
|
+
cosmosAminoConverters,
|
|
284
|
+
cosmosProtoRegistry,
|
|
285
|
+
ibcAminoConverters,
|
|
286
|
+
ibcProtoRegistry,
|
|
287
|
+
liftedinitAminoConverters,
|
|
288
|
+
liftedinitProtoRegistry,
|
|
289
|
+
osmosisAminoConverters,
|
|
290
|
+
osmosisProtoRegistry,
|
|
291
|
+
strangeloveVenturesAminoConverters,
|
|
292
|
+
strangeloveVenturesProtoRegistry,
|
|
293
|
+
cosmwasmAminoConverters,
|
|
294
|
+
cosmwasmProtoRegistry,
|
|
295
|
+
} from '@manifest-network/manifestjs';
|
|
213
296
|
|
|
214
297
|
const protoRegistry: ReadonlyArray<[string, GeneratedType]> = [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
298
|
+
...defaultRegistryTypes,
|
|
299
|
+
...cosmosProtoRegistry,
|
|
300
|
+
...ibcProtoRegistry,
|
|
301
|
+
...liftedinitProtoRegistry,
|
|
302
|
+
...osmosisProtoRegistry,
|
|
303
|
+
...strangeloveVenturesProtoRegistry,
|
|
304
|
+
...cosmwasmProtoRegistry,
|
|
219
305
|
];
|
|
220
306
|
|
|
221
307
|
const aminoConverters = {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
308
|
+
...cosmosAminoConverters,
|
|
309
|
+
...ibcAminoConverters,
|
|
310
|
+
...liftedinitAminoConverters,
|
|
311
|
+
...osmosisAminoConverters,
|
|
312
|
+
...strangeloveVenturesAminoConverters,
|
|
313
|
+
...cosmwasmAminoConverters,
|
|
226
314
|
};
|
|
227
315
|
|
|
228
316
|
const registry = new Registry(protoRegistry);
|
|
229
317
|
const aminoTypes = new AminoTypes(aminoConverters);
|
|
230
318
|
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
319
|
+
const client = await SigningStargateClient.connectWithSigner(
|
|
320
|
+
RPC_ENDPOINT,
|
|
321
|
+
signer,
|
|
322
|
+
{ registry, aminoTypes },
|
|
323
|
+
);
|
|
235
324
|
```
|
|
236
325
|
|
|
237
|
-
|
|
326
|
+
Pick only the namespaces you actually use — registry size affects bundle size and amino-type lookup time.
|
|
327
|
+
|
|
328
|
+
## About the `@manifest-network/stargate` dependency
|
|
238
329
|
|
|
239
|
-
|
|
330
|
+
`package.json` pins `@cosmjs/stargate` to a Manifest-maintained fork:
|
|
240
331
|
|
|
332
|
+
```jsonc
|
|
333
|
+
"@cosmjs/stargate": "npm:@manifest-network/stargate@0.32.4-ll.3"
|
|
241
334
|
```
|
|
335
|
+
|
|
336
|
+
The fork's source and the patches it carries are tracked in [manifest-network/cosmjs#1](https://github.com/manifest-network/cosmjs/pull/1). Day-to-day usage is identical to upstream `@cosmjs/stargate@0.32.4`; the alias is needed because Manifest's stack relies on behaviors not yet upstreamed. If you depend on `@cosmjs/stargate` directly elsewhere in your project, the alias keeps a single resolution.
|
|
337
|
+
|
|
338
|
+
## Developing
|
|
339
|
+
|
|
340
|
+
Setup:
|
|
341
|
+
|
|
342
|
+
```sh
|
|
242
343
|
yarn
|
|
243
344
|
yarn build
|
|
244
345
|
```
|
|
245
346
|
|
|
347
|
+
Available scripts:
|
|
348
|
+
|
|
349
|
+
| Script | What it does |
|
|
350
|
+
| ------------------- | ---------------------------------------------------------------------------------- |
|
|
351
|
+
| `yarn build` | Cleans `dist/` and `mjs/`, then builds both CJS (`dist/`) and ESM (`dist/*.mjs`). |
|
|
352
|
+
| `yarn codegen` | Regenerates `src/codegen/**` from `proto/**` via `@cosmology/telescope`. |
|
|
353
|
+
| `yarn test` | Runs unit tests in `__tests__/` (Jest + ts-jest). |
|
|
354
|
+
| `yarn starship` | Brings up a local Starship cluster using `starship/configs/config.group.local.yaml`. |
|
|
355
|
+
| `yarn starship:test`| Runs the E2E suite in `starship/__tests__/` against a running Starship cluster. |
|
|
356
|
+
|
|
246
357
|
### Codegen
|
|
247
358
|
|
|
248
|
-
|
|
359
|
+
Proto files live in `proto/`. The codegen entry point is [`scripts/codegen.js`](scripts/codegen.js); it drives `@cosmology/telescope` to regenerate `src/codegen/**`.
|
|
249
360
|
|
|
250
|
-
|
|
251
|
-
yarn codegen
|
|
252
|
-
```
|
|
361
|
+
To add a new proto:
|
|
253
362
|
|
|
254
|
-
|
|
363
|
+
1. Drop the `.proto` files under `proto/<namespace>/<module>/<version>/`. If you're vendoring an external module, mirror that project's directory layout.
|
|
364
|
+
2. Run `yarn codegen`.
|
|
365
|
+
3. Spot-check generated output (`src/codegen/<namespace>/...`). New top-level namespaces are picked up automatically; new sub-modules are reflected in the matching `bundle.ts` and `client.ts`.
|
|
366
|
+
4. If telescope flags type errors in generated files, list the file in `tsDisable.files` in `scripts/codegen.js`.
|
|
255
367
|
|
|
256
|
-
|
|
368
|
+
To **exclude** a package from codegen (e.g., to avoid pulling in a cosmos-sdk module the chain doesn't ship), add it to `prototypes.excluded.packages` in the same script.
|
|
257
369
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
370
|
+
### Proto vendoring
|
|
371
|
+
|
|
372
|
+
Vendored protos under `proto/cosmos/`, `proto/ibc/`, `proto/cosmwasm/`, `proto/osmosis/`, `proto/strangelove_ventures/`, and `proto/google/` track upstream releases. When bumping `manifest-ledger` compatibility, sync the corresponding proto trees from the matching ledger commit so the SDK matches what the chain accepts on the wire.
|
|
373
|
+
|
|
374
|
+
### Tests
|
|
375
|
+
|
|
376
|
+
- `__tests__/` — fast unit tests over generated types (no chain required). Add tests here when you change codegen options or hand-touch generated logic.
|
|
377
|
+
- `starship/__tests__/` — E2E tests that spin up real Manifest + relayer chains via Starship. Cover authz, feegrant, group, manifest payouts/burns, POA, tokenfactory, and IBC paths.
|
|
378
|
+
|
|
379
|
+
E2E setup requires a Kubernetes cluster (kind/minikube/docker-desktop) and the [`starship`](https://github.com/cosmology-tech/starship) CLI. Once `yarn starship` is up, run `yarn starship:test` from another terminal.
|
|
380
|
+
|
|
381
|
+
## Releasing
|
|
382
|
+
|
|
383
|
+
Releases are tag-driven. The [`Release` workflow](.github/workflows/release.yaml) fires on tags matching `v[0-9]*.[0-9]*.[0-9]*`:
|
|
262
384
|
|
|
263
|
-
|
|
385
|
+
1. Bump `package.json#version` (e.g., `2.4.1 → 2.4.2`) and merge to `main`.
|
|
386
|
+
2. Tag: `git tag v2.4.2 && git push origin v2.4.2`. The tag must match `package.json#version` exactly (the workflow validates this).
|
|
387
|
+
3. CI typechecks, builds, runs `yarn test`, then `npm publish --provenance` via OIDC trusted publishing. Pre-release versions (e.g., `v2.5.0-rc.1`) are published under a dist-tag matching the prerelease label, so `npm install` won't pick them up by default.
|
|
388
|
+
4. A GitHub Release is created with auto-generated notes.
|
|
264
389
|
|
|
265
|
-
|
|
390
|
+
## Related projects
|
|
266
391
|
|
|
267
|
-
- [@cosmology/telescope](https://github.com/cosmology-tech/telescope)
|
|
268
|
-
- [
|
|
269
|
-
- [
|
|
270
|
-
- [
|
|
271
|
-
- [
|
|
272
|
-
- [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
|
|
273
|
-
- [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
|
|
392
|
+
- [@cosmology/telescope](https://github.com/cosmology-tech/telescope) — the codegen engine that produces `src/codegen/**`.
|
|
393
|
+
- [chain-registry](https://github.com/cosmology-tech/chain-registry) — chain metadata (assets, IBC denoms, RPC endpoints).
|
|
394
|
+
- [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) — wallet adapters for browser apps.
|
|
395
|
+
- [starship](https://github.com/cosmology-tech/starship) — the local devnet runner used by `yarn starship`.
|
|
396
|
+
- [manifest-ledger](https://github.com/manifest-network/manifest-ledger) — the chain itself.
|
|
274
397
|
|
|
275
398
|
## Credits
|
|
276
399
|
|
|
277
|
-
|
|
400
|
+
Built with [Telescope](https://github.com/cosmology-tech/telescope) by Cosmology.
|
|
278
401
|
|
|
279
402
|
## Disclaimer
|
|
280
403
|
|
|
281
|
-
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED
|
|
404
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
282
405
|
|
|
283
406
|
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|