Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b133b7

Browse files
committedJan 10, 2025·
"wip : almost done refactoring all the templates to add both the request, response"
1 parent b5c5567 commit 8b133b7

File tree

16 files changed

+5590
-1129
lines changed

16 files changed

+5590
-1129
lines changed
 

‎packages/plugin-injective/injective-sdk-client-ts/src/template/auction.ts

+295-82
Large diffs are not rendered by default.

‎packages/plugin-injective/injective-sdk-client-ts/src/template/auth.ts

+423-179
Large diffs are not rendered by default.

‎packages/plugin-injective/injective-sdk-client-ts/src/template/bank.ts

+555-212
Large diffs are not rendered by default.

‎packages/plugin-injective/injective-sdk-client-ts/src/template/distribution.ts

+393-19
Large diffs are not rendered by default.

‎packages/plugin-injective/injective-sdk-client-ts/src/template/governance.ts

-145
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,190 @@
1-
// ibc-templates.ts
1+
// IBC Module Templates
2+
23
export const getDenomTraceTemplate = `
3-
Extract denom trace query parameters:
4-
- Hash: {{hash}} (string) - Hash of the denomination trace
4+
### Get Denomination Trace
5+
6+
**Description**:
7+
This query retrieves the denomination trace for a specific hash within the IBC (Inter-Blockchain Communication) module. Denomination traces are essential for tracking the origin and path of tokens as they move across different blockchain networks. Understanding denomination traces helps in verifying token authenticity, preventing double-spending, and ensuring seamless cross-chain operations.
8+
9+
**Request Format**:
10+
\`\`\`json
11+
{
12+
"hash": string // Denomination trace hash (e.g., "transfer/channel-0/uatom")
13+
}
14+
\`\`\`
15+
16+
**Example Request**:
17+
\`\`\`json
18+
{
19+
"hash": "transfer/channel-0/uatom"
20+
}
21+
\`\`\`
22+
23+
**Response Format**:
24+
\`\`\`json
25+
{
26+
"height": number,
27+
"txHash": string,
28+
"codespace": string,
29+
"code": number,
30+
"data": string, // Optional: Base64 encoded data containing denomination trace details
31+
"rawLog": string,
32+
"logs": [], // Optional
33+
"info": string, // Optional
34+
"gasWanted": number,
35+
"gasUsed": number,
36+
"timestamp": string,
37+
"events": [] // Optional
38+
}
39+
\`\`\`
40+
41+
**Example Response**:
42+
\`\`\`json
43+
{
44+
"height": 123700,
45+
"txHash": "ABC123denomtrace...",
46+
"codespace": "",
47+
"code": 0,
48+
"data": "CgdkZXRvaW5fdHJhY2UAA==",
49+
"rawLog": "[{\"events\": [{\"type\": \"get_denom_trace\", \"attributes\": [{\"key\": \"hash\", \"value\": \"transfer/channel-0/uatom\"}]}]}]",
50+
"logs": [],
51+
"info": "",
52+
"gasWanted": 80000,
53+
"gasUsed": 60000,
54+
"timestamp": "2025-05-01T10:00:00Z",
55+
"events": []
56+
}
57+
\`\`\`
558
`;
659

760
export const getDenomsTraceTemplate = `
8-
Extract denoms trace query parameters:
9-
- Pagination: {{pagination}} (PaginationOption?) - Optional pagination parameters
61+
### Get List of Denomination Traces
62+
63+
**Description**:
64+
This query fetches a list of all denomination traces within the IBC module, with optional pagination parameters. Denomination traces track the movement and origin of tokens across different chains, ensuring transparency and security in cross-chain transactions. Monitoring denomination traces helps in auditing token flows, identifying token sources, and maintaining the integrity of the token ecosystem.
65+
66+
**Request Format**:
67+
\`\`\`json
68+
{
69+
"pagination": {
70+
"limit": number, // (Optional) Number of denomination traces to retrieve
71+
"offset": number // (Optional) Starting point for retrieval
72+
}
73+
}
74+
\`\`\`
75+
76+
**Example Request**:
77+
\`\`\`json
78+
{
79+
"pagination": {
80+
"limit": 10,
81+
"offset": 0
82+
}
83+
}
84+
\`\`\`
85+
86+
**Response Format**:
87+
\`\`\`json
88+
{
89+
"height": number,
90+
"txHash": string,
91+
"codespace": string,
92+
"code": number,
93+
"data": string, // Optional: Base64 encoded data containing list of denomination traces
94+
"rawLog": string,
95+
"logs": [], // Optional
96+
"info": string, // Optional
97+
"gasWanted": number,
98+
"gasUsed": number,
99+
"timestamp": string,
100+
"events": [] // Optional
101+
}
102+
\`\`\`
103+
104+
**Example Response**:
105+
\`\`\`json
106+
{
107+
"height": 123701,
108+
"txHash": "DEF456denomsxyz...",
109+
"codespace": "",
110+
"code": 0,
111+
"data": "W3siaGFzaCI6ICJ0cmFuc2Zlci9jaGFubmVsLTAvdWF0b20iLCAibmFtZSI6ICJ1YXRvbSJ9LCB7Imhhc2giOiAidHJhbnNmZXIvY2hhbm5lbC0xL3VhdG9tIiwgIm5hbWUiOiAidWF0b20ifV0=",
112+
"rawLog": "[{\"events\": [{\"type\": \"get_denoms_trace\", \"attributes\": []}]}]",
113+
"logs": [],
114+
"info": "",
115+
"gasWanted": 100000,
116+
"gasUsed": 85000,
117+
"timestamp": "2025-05-02T11:15:30Z",
118+
"events": []
119+
}
120+
\`\`\`
10121
`;
11122

12123
export const msgIBCTransferTemplate = `
13-
Extract IBC transfer parameters:
14-
- Amount: {{amount}} (object) - Amount to transfer
15-
- Denom: {{amount.denom}} (string) - Token denomination
16-
- Amount: {{amount.amount}} (string) - Transfer amount
17-
- Memo: {{memo}} (string?) - Optional transfer memo
18-
- Sender: {{sender}} (string) - Source address
19-
- Port: {{port}} (string) - Source port ID
20-
- Receiver: {{receiver}} (string) - Destination address
21-
- Channel ID: {{channelId}} (string) - Channel identifier
22-
- Timeout: {{timeout}} (number?) - Optional timeout in seconds
23-
- Height: {{height}} (object?) - Optional timeout height
24-
- Revision Height: {{height.revisionHeight}} (number) - Block height
25-
- Revision Number: {{height.revisionNumber}} (number) - Chain revision number
26-
`;
124+
### IBC Transfer
125+
126+
**Description**:
127+
This message broadcasts a transaction to perform an IBC (Inter-Blockchain Communication) transfer. IBC transfers enable the movement of tokens between different blockchain networks, facilitating interoperability and expanding the utility of assets across multiple ecosystems. Successfully executing an IBC transfer ensures that tokens are securely and accurately moved to the intended recipient on the target chain.
128+
129+
**Request Format**:
130+
\`\`\`json
131+
{
132+
"sender": string, // Address of the sender initiating the transfer (e.g., "inj1sender123...")
133+
"receiver": string, // Address of the receiver on the target chain (e.g., "cosmos1receiver...")
134+
"sourceChannel": string, // IBC source channel (e.g., "transfer/channel-0")
135+
"destinationChannel": string, // IBC destination channel on the target chain (e.g., "transfer/channel-1")
136+
"denom": string, // Denomination of the token to transfer (e.g., "uatom")
137+
"amount": string, // Amount of tokens to transfer (e.g., "1000")
138+
"timeoutTimestamp": string // (Optional) Timeout timestamp in nanoseconds since epoch
139+
}
140+
\`\`\`
141+
142+
**Example Request**:
143+
\`\`\`json
144+
{
145+
"sender": "inj1sender1234567890...",
146+
"receiver": "cosmos1receiver1234567890...",
147+
"sourceChannel": "transfer/channel-0",
148+
"destinationChannel": "transfer/channel-1",
149+
"denom": "uatom",
150+
"amount": "1000",
151+
"timeoutTimestamp": "1704067200000000000" // Represents a future timestamp
152+
}
153+
\`\`\`
154+
155+
**Response Format**:
156+
\`\`\`json
157+
{
158+
"height": number,
159+
"txHash": string,
160+
"codespace": string,
161+
"code": number,
162+
"data": string, // Optional: Base64 encoded data containing transaction details
163+
"rawLog": string,
164+
"logs": [], // Optional
165+
"info": string, // Optional
166+
"gasWanted": number,
167+
"gasUsed": number,
168+
"timestamp": string,
169+
"events": [] // Optional
170+
}
171+
\`\`\`
27172
28-
export const ibcTransferParamsTemplate = `
29-
Extract IBC transfer query parameters:
30-
- Sender: {{sender}} (string?) - Optional source address filter
31-
- Receiver: {{receiver}} (string?) - Optional destination address filter
32-
- Source Channel: {{srcChannel}} (string?) - Optional source channel filter
33-
- Source Port: {{srcPort}} (string?) - Optional source port filter
34-
- Destination Channel: {{destChannel}} (string?) - Optional destination channel filter
35-
- Destination Port: {{destPort}} (string?) - Optional destination port filter
36-
- Limit: {{limit}} (number?) - Optional result limit
37-
- Skip: {{skip}} (number?) - Optional number of results to skip
173+
**Example Response**:
174+
\`\`\`json
175+
{
176+
"height": 123702,
177+
"txHash": "GHI789ibctransfer...",
178+
"codespace": "",
179+
"code": 0,
180+
"data": "CgVtZ3NUcmFuc2ZlcgA=",
181+
"rawLog": "[{\"events\": [{\"type\": \"ibc_transfer\", \"attributes\": [{\"key\": \"sender\", \"value\": \"inj1sender1234567890...\"}, {\"key\": \"receiver\", \"value\": \"cosmos1receiver1234567890...\"}, {\"key\": \"amount\", \"value\": \"1000uatom\"}]}]}]",
182+
"logs": [],
183+
"info": "",
184+
"gasWanted": 200000,
185+
"gasUsed": 150000,
186+
"timestamp": "2025-05-03T12:20:40Z",
187+
"events": []
188+
}
189+
\`\`\`
38190
`;

‎packages/plugin-injective/injective-sdk-client-ts/src/template/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from "./auth";
33
export * from "./bank";
44
export * from "./distribution";
55
export * from "./exchange";
6-
export * from "./governance";
6+
export * from "./gov";
77
export * from "./ibc";
88
export * from "./insurance";
99
export * from "./mint";
@@ -13,4 +13,3 @@ export * from "./permissions";
1313
export * from "./staking";
1414
export * from "./token-factory";
1515
export * from "./wasm";
16-
export * from "./wasmx";

0 commit comments

Comments
 (0)
Please sign in to comment.