|
| 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