Skip to content

Commit d9a4b4e

Browse files
committed
"feat: finished integrating actions, wip fix for templates and examples"
1 parent bee1a3d commit d9a4b4e

23 files changed

+3339
-188
lines changed

packages/plugin-injective/injective-sdk-client-ts/src/modules/insurance.ts

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ import {
99
MsgCreateInsuranceFundParams,
1010
MsgRequestRedemptionParams,
1111
MsgUnderwriteParams,
12-
InsuranceModuleParamsResponse,
13-
GetInsuranceFundsResponse,
14-
GetInsuranceFundResponse,
15-
GetEstimatedRedemptionsResponse,
16-
GetPendingRedemptionsResponse,
1712
GetInsuranceFundParams,
1813
GetEstimatedRedemptionsParams,
1914
GetPendingRedemptionsParams,

packages/plugin-injective/injective-sdk-client-ts/src/modules/wasm.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { InjectiveGrpcBase } from "../grpc/grpc-base";
22
import {
3-
PaginationOption,
43
MsgStoreCode,
54
MsgUpdateAdmin,
65
MsgExecuteContract,
76
MsgMigrateContract,
87
MsgInstantiateContract,
98
MsgExecuteContractCompat,
109
MsgPrivilegedExecuteContract,
11-
TxResponse,
1210
} from "@injectivelabs/sdk-ts";
1311
import * as WasmTypes from "../types/wasm";
1412
import {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This query retrieves the current parameters of the Auction module. The Auction m
1717
\`\`\`
1818
1919
**Response Format**:
20-
\`\`\`json
20+
\`\`\`jso
2121
{
2222
"height": number,
2323
"txHash": string, // Empty string for queries

packages/plugin-injective/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"lint": "eslint --fix --cache .",
1212
"test": "jest",
1313
"test:watch": "jest --watch",
14+
"format": "prettier --write \"src/**/*.ts\"",
1415
"test:coverage": "jest --coverage"
1516
},
1617
"exports": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { createGenericAction } from "./base";
2+
import * as AuctionTemplates from "@injective/template/auction";
3+
import * as AuctionExamples from "@injective/examples/auction";
4+
5+
export const GetAuctionModuleParamsAction = createGenericAction({
6+
name: "GET_AUCTION_MODULE_PARAMS",
7+
description: "Fetches the auction module parameters",
8+
template: AuctionTemplates.getAuctionModuleParamsTemplate,
9+
examples: AuctionExamples.getAuctionModuleParamsExample,
10+
functionName: "getAuctionModuleParams",
11+
similes: ["view params", "get params", "check auction parameters"],
12+
validateContent: () => true,
13+
});
14+
15+
export const GetAuctionModuleStateAction = createGenericAction({
16+
name: "GET_AUCTION_MODULE_STATE",
17+
description: "Fetches the auction module state",
18+
template: AuctionTemplates.getAuctionModuleStateTemplate,
19+
examples: AuctionExamples.getAuctionModuleStateExample,
20+
functionName: "getAuctionModuleState",
21+
similes: ["view state", "get state", "check auction state"],
22+
validateContent: () => true,
23+
});
24+
25+
export const GetCurrentBasketAction = createGenericAction({
26+
name: "GET_CURRENT_BASKET",
27+
description: "Fetches the current auction basket",
28+
template: AuctionTemplates.getCurrentBasketTemplate,
29+
examples: AuctionExamples.getCurrentBasketExample,
30+
functionName: "getCurrentBasket",
31+
similes: ["view basket", "get basket", "check current basket"],
32+
validateContent: () => true,
33+
});
34+
35+
export const GetAuctionRoundAction = createGenericAction({
36+
name: "GET_AUCTION_ROUND",
37+
description: "Fetches details of a specific auction round",
38+
template: AuctionTemplates.getAuctionRoundTemplate,
39+
examples: AuctionExamples.getAuctionRoundExample,
40+
functionName: "getAuctionRound",
41+
similes: ["view round", "get round", "check auction round"],
42+
validateContent: () => true,
43+
});
44+
45+
export const GetAuctionsAction = createGenericAction({
46+
name: "GET_AUCTIONS",
47+
description: "Fetches a list of auctions",
48+
template: AuctionTemplates.getAuctionsTemplate,
49+
examples: AuctionExamples.getAuctionsExample,
50+
functionName: "getAuctions",
51+
similes: ["view auctions", "get auctions", "list auctions"],
52+
validateContent: () => true,
53+
});
54+
55+
export const MsgBidAction = createGenericAction({
56+
name: "MSG_BID",
57+
description: "Places a bid in an auction round",
58+
template: AuctionTemplates.msgBidTemplate,
59+
examples: AuctionExamples.msgBidExample,
60+
functionName: "msgBid",
61+
similes: ["place bid", "submit bid", "make bid", "bid on auction"],
62+
validateContent: () => true,
63+
});
64+
65+
export const AuctionActions = {
66+
GetAuctionModuleParamsAction,
67+
GetAuctionModuleStateAction,
68+
GetCurrentBasketAction,
69+
GetAuctionRoundAction,
70+
GetAuctionsAction,
71+
MsgBidAction,
72+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import { createGenericAction } from "./base";
2+
import * as AuthTemplates from "@injective/template/auth";
3+
import * as AuthExamples from "@injective/examples/auth";
4+
5+
// Auth Module Actions
6+
export const GetAuthModuleParamsAction = createGenericAction({
7+
name: "GET_AUTH_MODULE_PARAMS",
8+
description: "Fetches the authentication module parameters",
9+
template: AuthTemplates.getAuthModuleParamsTemplate,
10+
examples: AuthExamples.getAuthModuleParamsExample,
11+
functionName: "getAuthModuleParams",
12+
similes: ["view auth params", "get auth parameters", "check auth settings"],
13+
validateContent: () => true,
14+
});
15+
16+
export const GetAccountDetailsAction = createGenericAction({
17+
name: "GET_ACCOUNT_DETAILS",
18+
description: "Fetches the details of the current account",
19+
template: AuthTemplates.getAccountDetailsTemplate,
20+
examples: AuthExamples.getAccountDetailsExample,
21+
functionName: "getAccountDetails",
22+
similes: ["view account", "get account details", "check my account"],
23+
validateContent: () => true,
24+
});
25+
26+
export const GetAccountsAction = createGenericAction({
27+
name: "GET_ACCOUNTS",
28+
description: "Fetches all accounts associated with the current address",
29+
template: AuthTemplates.getAccountsTemplate,
30+
examples: AuthExamples.getAccountsExample,
31+
functionName: "getAccounts",
32+
similes: ["view accounts", "list accounts", "get all accounts"],
33+
validateContent: () => true,
34+
});
35+
36+
export const GetGrantsAction = createGenericAction({
37+
name: "GET_GRANTS",
38+
description: "Fetches all grants based on provided parameters",
39+
template: AuthTemplates.getGrantsTemplate,
40+
examples: AuthExamples.getGrantsExample,
41+
functionName: "getGrants",
42+
similes: ["view grants", "list grants", "check grants"],
43+
validateContent: () => true,
44+
});
45+
46+
export const GetGranterGrantsAction = createGenericAction({
47+
name: "GET_GRANTER_GRANTS",
48+
description: "Fetches all grants granted by a specific granter",
49+
template: AuthTemplates.getGranterGrantsTemplate,
50+
examples: AuthExamples.getGranterGrantsExample,
51+
functionName: "getGranterGrants",
52+
similes: [
53+
"view granter grants",
54+
"list granted permissions",
55+
"check given grants",
56+
],
57+
validateContent: () => true,
58+
});
59+
60+
export const GetGranteeGrantsAction = createGenericAction({
61+
name: "GET_GRANTEE_GRANTS",
62+
description: "Fetches all grants received by a specific grantee",
63+
template: AuthTemplates.getGranteeGrantsTemplate,
64+
examples: AuthExamples.getGranteeGrantsExample,
65+
functionName: "getGranteeGrants",
66+
similes: [
67+
"view grantee grants",
68+
"list received permissions",
69+
"check received grants",
70+
],
71+
validateContent: () => true,
72+
});
73+
74+
export const MsgGrantAction = createGenericAction({
75+
name: "MSG_GRANT",
76+
description:
77+
"Grants authorization to a grantee to perform specific actions",
78+
template: AuthTemplates.msgGrantTemplate,
79+
examples: AuthExamples.msgGrantExample,
80+
functionName: "msgGrant",
81+
similes: ["grant permission", "authorize action", "give access"],
82+
validateContent: () => true,
83+
});
84+
85+
export const MsgExecAction = createGenericAction({
86+
name: "MSG_EXEC",
87+
description: "Executes authorized messages on behalf of the grantee",
88+
template: AuthTemplates.msgExecTemplate,
89+
examples: AuthExamples.msgExecExample,
90+
functionName: "msgExec",
91+
similes: ["execute grant", "run authorized action", "use permission"],
92+
validateContent: () => true,
93+
});
94+
95+
export const MsgRevokeAction = createGenericAction({
96+
name: "MSG_REVOKE",
97+
description: "Revokes previously granted authorizations from a grantee",
98+
template: AuthTemplates.msgRevokeTemplate,
99+
examples: AuthExamples.msgRevokeExample,
100+
functionName: "msgRevoke",
101+
similes: ["revoke permission", "remove authorization", "cancel access"],
102+
validateContent: () => true,
103+
});
104+
105+
export const AuthActions = {
106+
GetAuthModuleParamsAction,
107+
GetAccountDetailsAction,
108+
GetAccountsAction,
109+
GetGrantsAction,
110+
GetGranterGrantsAction,
111+
GetGranteeGrantsAction,
112+
MsgGrantAction,
113+
MsgExecAction,
114+
MsgRevokeAction,
115+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import { createGenericAction } from "./base";
2+
import * as BankTemplates from "@injective/template/bank";
3+
import * as BankExamples from "@injective/examples/bank";
4+
5+
// Query Actions
6+
export const GetBankModuleParamsAction = createGenericAction({
7+
name: "GET_BANK_MODULE_PARAMS",
8+
description: "Fetches the bank module parameters",
9+
template: BankTemplates.getBankModuleParamsTemplate,
10+
examples: BankExamples.getBankModuleParamsExample,
11+
functionName: "getBankModuleParams",
12+
similes: ["view bank params", "get bank parameters", "check bank settings"],
13+
validateContent: () => true,
14+
});
15+
16+
export const GetBankBalanceAction = createGenericAction({
17+
name: "GET_BANK_BALANCE",
18+
description: "Fetches the balance of a specific account",
19+
template: BankTemplates.getBankBalanceTemplate,
20+
examples: BankExamples.getBankBalanceExample,
21+
functionName: "getBankBalance",
22+
similes: ["check balance", "view balance", "get token balance"],
23+
validateContent: () => true,
24+
});
25+
26+
export const GetBankBalancesAction = createGenericAction({
27+
name: "GET_BANK_BALANCES",
28+
description: "Fetches all balances for the current account",
29+
template: BankTemplates.getBankBalancesTemplate,
30+
examples: BankExamples.getBankBalancesExample,
31+
functionName: "getBankBalances",
32+
similes: ["check all balances", "view all balances", "list balances"],
33+
validateContent: () => true,
34+
});
35+
36+
export const GetTotalSupplyAction = createGenericAction({
37+
name: "GET_TOTAL_SUPPLY",
38+
description: "Fetches the total supply of all denominations",
39+
template: BankTemplates.getTotalSupplyTemplate,
40+
examples: BankExamples.getTotalSupplyExample,
41+
functionName: "getTotalSupply",
42+
similes: ["view total supply", "check total supply", "get supply"],
43+
validateContent: () => true,
44+
});
45+
46+
export const GetAllTotalSupplyAction = createGenericAction({
47+
name: "GET_ALL_TOTAL_SUPPLY",
48+
description: "Fetches the total supply for all denominations",
49+
template: BankTemplates.getAllTotalSupplyTemplate,
50+
examples: BankExamples.getAllTotalSupplyExample,
51+
functionName: "getAllTotalSupply",
52+
similes: ["view all supplies", "check all supplies", "list total supplies"],
53+
validateContent: () => true,
54+
});
55+
56+
export const GetSupplyOfAction = createGenericAction({
57+
name: "GET_SUPPLY_OF",
58+
description: "Fetches the supply of a specific denomination",
59+
template: BankTemplates.getSupplyOfTemplate,
60+
examples: BankExamples.getSupplyOfExample,
61+
functionName: "getSupplyOf",
62+
similes: ["check denom supply", "view token supply", "get token total"],
63+
validateContent: () => true,
64+
});
65+
66+
export const GetDenomsMetadataAction = createGenericAction({
67+
name: "GET_DENOMS_METADATA",
68+
description: "Fetches metadata for all denominations",
69+
template: BankTemplates.getDenomsMetadataTemplate,
70+
examples: BankExamples.getDenomsMetadataExample,
71+
functionName: "getDenomsMetadata",
72+
similes: ["view all denoms", "list denominations", "check token metadata"],
73+
validateContent: () => true,
74+
});
75+
76+
export const GetDenomMetadataAction = createGenericAction({
77+
name: "GET_DENOM_METADATA",
78+
description: "Fetches metadata for a specific denomination",
79+
template: BankTemplates.getDenomMetadataTemplate,
80+
examples: BankExamples.getDenomMetadataExample,
81+
functionName: "getDenomMetadata",
82+
similes: ["view denom info", "check token metadata", "get token info"],
83+
validateContent: () => true,
84+
});
85+
86+
export const GetDenomOwnersAction = createGenericAction({
87+
name: "GET_DENOM_OWNERS",
88+
description: "Fetches the owners of a specific denomination",
89+
template: BankTemplates.getDenomOwnersTemplate,
90+
examples: BankExamples.getDenomOwnersExample,
91+
functionName: "getDenomOwners",
92+
similes: ["view token holders", "list denom owners", "check token owners"],
93+
validateContent: () => true,
94+
});
95+
96+
// Transaction Actions
97+
export const MsgSendAction = createGenericAction({
98+
name: "MSG_SEND",
99+
description: "Sends tokens from one account to another",
100+
template: BankTemplates.msgSendTemplate,
101+
examples: BankExamples.msgSendExample,
102+
functionName: "msgSend",
103+
similes: ["send tokens", "transfer funds", "send money"],
104+
validateContent: () => true,
105+
});
106+
107+
export const MsgMultiSendAction = createGenericAction({
108+
name: "MSG_MULTI_SEND",
109+
description: "Sends tokens from multiple senders to multiple receivers",
110+
template: BankTemplates.msgMultiSendTemplate,
111+
examples: BankExamples.msgMultiSendExample,
112+
functionName: "msgMultiSend",
113+
similes: ["batch transfer", "multi send", "send to many"],
114+
validateContent: () => true,
115+
});
116+
117+
export const BankActions = {
118+
GetBankModuleParamsAction,
119+
GetBankBalanceAction,
120+
GetBankBalancesAction,
121+
GetTotalSupplyAction,
122+
GetAllTotalSupplyAction,
123+
GetSupplyOfAction,
124+
GetDenomsMetadataAction,
125+
GetDenomMetadataAction,
126+
GetDenomOwnersAction,
127+
MsgSendAction,
128+
MsgMultiSendAction,
129+
};

0 commit comments

Comments
 (0)