@dorafactory/maci-sdk 0.0.31 → 0.0.32

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.
@@ -2082,128 +2082,126 @@ declare class MaciClient {
2082
2082
  logs: readonly _cosmjs_stargate_build_logs.Log[];
2083
2083
  height: number;
2084
2084
  transactionHash: string;
2085
- events: readonly _cosmjs_stargate.Event[];
2085
+ events: readonly _cosmjs_cosmwasm_stargate.Event[];
2086
2086
  gasWanted: bigint;
2087
2087
  gasUsed: bigint;
2088
2088
  }>;
2089
2089
  createMaciRound(params: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
2090
2090
  createOracleMaciRound(params: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
2091
- /**
2092
- * @method balanceOf
2093
- * @description Get the balance of a specific address.
2094
- * @param {string} address - The address to check the balance for.
2095
- * @returns {Promise<BalanceResponse>} The balance response.
2096
- */
2097
- balanceOf(address: string): Promise<BalanceResponse>;
2098
- /**
2099
- * @method getRoundById
2100
- * @description Get a round by its ID.
2101
- * @param {string} id - The ID of the round.
2102
- * @returns {Promise<RoundResponse>} The round response.
2103
- */
2104
- getRoundById(id: string): Promise<RoundResponse>;
2105
- /**
2106
- * @method getRoundWithFields
2107
- * @description Get a round by its address with selective fields.
2108
- * @param {string} address - The address of the round.
2109
- * @param {string[]} [fields] - The fields to retrieve.
2110
- * @returns {Promise<SelectiveRoundResponse>} The round response.
2111
- */
2112
- getRoundWithFields(address: string, fields?: string[]): Promise<SelectiveRoundResponse>;
2113
- /**
2114
- * @method getRounds
2115
- * @description Get multiple rounds.
2116
- * @param {string} after - The cursor to start after.
2117
- * @param {number} [limit] - The number of rounds to retrieve.
2118
- * @returns {Promise<RoundsResponse>} The rounds response.
2119
- */
2120
- getRounds(after: string, limit?: number): Promise<RoundsResponse>;
2121
- /**
2122
- * @method getRoundsByStatus
2123
- * @description Get rounds by their status.
2124
- * @param {string} status - The status of the rounds to retrieve.
2125
- * @param {string} after - The cursor to start after.
2126
- * @param {number} [limit] - The number of rounds to retrieve.
2127
- * @returns {Promise<RoundsResponse>} The rounds response.
2128
- */
2129
- getRoundsByStatus(status: string, after: string, limit?: number): Promise<RoundsResponse>;
2130
- /**
2131
- * @method getRoundsByCircuitName
2132
- * @description Get rounds by their circuit name.
2133
- * @param {string} name - The name of the circuit.
2134
- * @param {string} after - The cursor to start after.
2135
- * @param {number} [limit] - The number of rounds to retrieve.
2136
- * @returns {Promise<RoundsResponse>} The rounds response.
2137
- */
2138
- getRoundsByCircuitName(name: string, after: string, limit?: number): Promise<RoundsResponse>;
2139
- /**
2140
- * @method getRoundsByOperator
2141
- * @description Get rounds by their operator address.
2142
- * @param {string} address - The address of the operator.
2143
- * @param {string} after - The cursor to start after.
2144
- * @param {number} [limit] - The number of rounds to retrieve.
2145
- * @returns {Promise<RoundsResponse>} The rounds response.
2146
- */
2147
- getRoundsByOperator(address: string, after: string, limit?: number): Promise<RoundsResponse>;
2148
- /**
2149
- * @method getOperatorByAddress
2150
- * @description Get an operator by their address.
2151
- * @param {string} address - The address of the operator.
2152
- * @returns {Promise<OperatorResponse>} The operator response.
2153
- */
2154
- getOperatorByAddress(address: string): Promise<OperatorResponse>;
2155
- /**
2156
- * @method getOperators
2157
- * @description Get multiple operators.
2158
- * @param {string} after - The cursor to start after.
2159
- * @param {number} [limit] - The number of operators to retrieve.
2160
- * @returns {Promise<OperatorsResponse>} The operators response.
2161
- */
2162
- getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
2163
- /**
2164
- * @method getCircuitByName
2165
- * @description Get a circuit by its name.
2166
- * @param {string} name - The name of the circuit.
2167
- * @returns {Promise<CircuitResponse>} The circuit response.
2168
- */
2169
- getCircuitByName(name: string): Promise<CircuitResponse>;
2170
- /**
2171
- * @method getCircuits
2172
- * @description Get all available circuits.
2173
- * @returns {Promise<CircuitsResponse>} The circuits response.
2174
- */
2175
- getCircuits(): Promise<CircuitsResponse>;
2176
- /**
2177
- * @method getTransactionByHash
2178
- * @description Get a transaction by its hash.
2179
- * @param {string} hash - The hash of the transaction.
2180
- * @returns {Promise<TransactionResponse>} The transaction response.
2181
- */
2182
- getTransactionByHash(hash: string): Promise<TransactionResponse>;
2183
- /**
2184
- * @method getTransactions
2185
- * @description Get multiple transactions.
2186
- * @param {string} after - The cursor to start after.
2187
- * @param {number} [limit] - The number of transactions to retrieve.
2188
- * @returns {Promise<TransactionsResponse>} The transactions response.
2189
- */
2190
- getTransactions(after: string, limit?: number): Promise<TransactionsResponse>;
2191
- /**
2192
- * @method getTransactionsByContractAddress
2193
- * @description Get transactions by contract address.
2194
- * @param {string} address - The contract address.
2195
- * @param {string} after - The cursor to start after.
2196
- * @param {number} [limit] - The number of transactions to retrieve.
2197
- * @returns {Promise<TransactionsResponse>} The transactions response.
2198
- */
2199
- getTransactionsByContractAddress(address: string, after: string, limit?: number): Promise<TransactionsResponse>;
2200
- /**
2201
- * @method getProofByContractAddress
2202
- * @description Get proof data by contract address.
2203
- * @param {string} address - The contract address.
2204
- * @returns {Promise<ProofResponse>} The proof response.
2205
- */
2206
- getProofByContractAddress(address: string): Promise<ProofResponse>;
2091
+ getStateIdxInc({ signer, address, contractAddress, }: {
2092
+ signer: OfflineSigner;
2093
+ address: string;
2094
+ contractAddress: string;
2095
+ }): Promise<string>;
2096
+ getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
2097
+ signer: OfflineSigner;
2098
+ stateIdx: number;
2099
+ contractAddress: string;
2100
+ }): Promise<string>;
2101
+ getStateIdxByPubKey({ contractAddress, pubKey, }: {
2102
+ contractAddress: string;
2103
+ pubKey: bigint[];
2104
+ }): Promise<number>;
2105
+ feegrantAllowance({ address, contractAddress, }: {
2106
+ address: string;
2107
+ contractAddress: string;
2108
+ }): Promise<FeegrantAllowanceResponse>;
2109
+ hasFeegrant({ address, contractAddress, }: {
2110
+ address: string;
2111
+ contractAddress: string;
2112
+ }): Promise<boolean>;
2113
+ queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
2114
+ signer: OfflineSigner;
2115
+ address: string;
2116
+ contractAddress: string;
2117
+ certificate?: string;
2118
+ mode?: 'maci' | 'amaci';
2119
+ }): Promise<string>;
2120
+ isWhitelisted({ signer, address, contractAddress, }: {
2121
+ signer: OfflineSigner;
2122
+ address: string;
2123
+ contractAddress: string;
2124
+ }): Promise<boolean>;
2125
+ getOracleWhitelistConfig({ signer, contractAddress, }: {
2126
+ signer: OfflineSigner;
2127
+ contractAddress: string;
2128
+ }): Promise<OracleWhitelistConfig>;
2129
+ getRoundInfo({ contractAddress }: {
2130
+ contractAddress: string;
2131
+ }): Promise<RoundType>;
2132
+ getRoundCircuitType({ contractAddress }: {
2133
+ contractAddress: string;
2134
+ }): Promise<string>;
2135
+ queryRoundIsQv({ contractAddress }: {
2136
+ contractAddress: string;
2137
+ }): Promise<boolean>;
2138
+ queryRoundClaimable({ contractAddress, }: {
2139
+ contractAddress: string;
2140
+ }): Promise<{
2141
+ claimable: boolean | null;
2142
+ balance: string | null;
2143
+ }>;
2144
+ queryAMaciChargeFee({ maxVoter, maxOption, }: {
2145
+ maxVoter: number;
2146
+ maxOption: number;
2147
+ }): Promise<{
2148
+ denom: string;
2149
+ amount: string;
2150
+ }>;
2151
+ queryRoundGasStation({ contractAddress }: {
2152
+ contractAddress: string;
2153
+ }): Promise<boolean>;
2154
+ parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
2155
+ queryRoundBalance({ contractAddress }: {
2156
+ contractAddress: string;
2157
+ }): Promise<string>;
2158
+ requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
2159
+ signer: OfflineSigner;
2160
+ ecosystem: CertificateEcosystem;
2161
+ address: string;
2162
+ contractAddress: string;
2163
+ }): Promise<SignatureResponse>;
2164
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
2165
+ signer: OfflineSigner;
2166
+ address: string;
2167
+ contractAddress: string;
2168
+ maciAccount?: Account;
2169
+ oracleCertificate?: {
2170
+ amount: string;
2171
+ signature: string;
2172
+ };
2173
+ gasStation?: boolean;
2174
+ }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2175
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
2176
+ signer: OfflineSigner;
2177
+ address: string;
2178
+ stateIdx: number;
2179
+ contractAddress: string;
2180
+ selectedOptions: {
2181
+ idx: number;
2182
+ vc: number;
2183
+ }[];
2184
+ operatorCoordPubKey: PublicKey;
2185
+ maciAccount?: Account;
2186
+ gasStation?: boolean;
2187
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2188
+ publishMessage({ client, address, payload, contractAddress, gasStation, }: {
2189
+ client: SigningCosmWasmClient;
2190
+ address: string;
2191
+ payload: {
2192
+ msg: bigint[];
2193
+ encPubkeys: PublicKey;
2194
+ }[];
2195
+ contractAddress: string;
2196
+ gasStation: boolean;
2197
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2198
+ claimAMaciRound({ signer, contractAddress, }: {
2199
+ signer: OfflineSigner;
2200
+ contractAddress: string;
2201
+ }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2202
+ getOracleCertificateConfig(): Promise<EcosystemsResponse>;
2203
+ batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2204
+ batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2207
2205
  }
2208
2206
 
2209
2207
  declare function isValidAddress(address: string): boolean;
package/dist/browser.d.ts CHANGED
@@ -2082,128 +2082,126 @@ declare class MaciClient {
2082
2082
  logs: readonly _cosmjs_stargate_build_logs.Log[];
2083
2083
  height: number;
2084
2084
  transactionHash: string;
2085
- events: readonly _cosmjs_stargate.Event[];
2085
+ events: readonly _cosmjs_cosmwasm_stargate.Event[];
2086
2086
  gasWanted: bigint;
2087
2087
  gasUsed: bigint;
2088
2088
  }>;
2089
2089
  createMaciRound(params: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
2090
2090
  createOracleMaciRound(params: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
2091
- /**
2092
- * @method balanceOf
2093
- * @description Get the balance of a specific address.
2094
- * @param {string} address - The address to check the balance for.
2095
- * @returns {Promise<BalanceResponse>} The balance response.
2096
- */
2097
- balanceOf(address: string): Promise<BalanceResponse>;
2098
- /**
2099
- * @method getRoundById
2100
- * @description Get a round by its ID.
2101
- * @param {string} id - The ID of the round.
2102
- * @returns {Promise<RoundResponse>} The round response.
2103
- */
2104
- getRoundById(id: string): Promise<RoundResponse>;
2105
- /**
2106
- * @method getRoundWithFields
2107
- * @description Get a round by its address with selective fields.
2108
- * @param {string} address - The address of the round.
2109
- * @param {string[]} [fields] - The fields to retrieve.
2110
- * @returns {Promise<SelectiveRoundResponse>} The round response.
2111
- */
2112
- getRoundWithFields(address: string, fields?: string[]): Promise<SelectiveRoundResponse>;
2113
- /**
2114
- * @method getRounds
2115
- * @description Get multiple rounds.
2116
- * @param {string} after - The cursor to start after.
2117
- * @param {number} [limit] - The number of rounds to retrieve.
2118
- * @returns {Promise<RoundsResponse>} The rounds response.
2119
- */
2120
- getRounds(after: string, limit?: number): Promise<RoundsResponse>;
2121
- /**
2122
- * @method getRoundsByStatus
2123
- * @description Get rounds by their status.
2124
- * @param {string} status - The status of the rounds to retrieve.
2125
- * @param {string} after - The cursor to start after.
2126
- * @param {number} [limit] - The number of rounds to retrieve.
2127
- * @returns {Promise<RoundsResponse>} The rounds response.
2128
- */
2129
- getRoundsByStatus(status: string, after: string, limit?: number): Promise<RoundsResponse>;
2130
- /**
2131
- * @method getRoundsByCircuitName
2132
- * @description Get rounds by their circuit name.
2133
- * @param {string} name - The name of the circuit.
2134
- * @param {string} after - The cursor to start after.
2135
- * @param {number} [limit] - The number of rounds to retrieve.
2136
- * @returns {Promise<RoundsResponse>} The rounds response.
2137
- */
2138
- getRoundsByCircuitName(name: string, after: string, limit?: number): Promise<RoundsResponse>;
2139
- /**
2140
- * @method getRoundsByOperator
2141
- * @description Get rounds by their operator address.
2142
- * @param {string} address - The address of the operator.
2143
- * @param {string} after - The cursor to start after.
2144
- * @param {number} [limit] - The number of rounds to retrieve.
2145
- * @returns {Promise<RoundsResponse>} The rounds response.
2146
- */
2147
- getRoundsByOperator(address: string, after: string, limit?: number): Promise<RoundsResponse>;
2148
- /**
2149
- * @method getOperatorByAddress
2150
- * @description Get an operator by their address.
2151
- * @param {string} address - The address of the operator.
2152
- * @returns {Promise<OperatorResponse>} The operator response.
2153
- */
2154
- getOperatorByAddress(address: string): Promise<OperatorResponse>;
2155
- /**
2156
- * @method getOperators
2157
- * @description Get multiple operators.
2158
- * @param {string} after - The cursor to start after.
2159
- * @param {number} [limit] - The number of operators to retrieve.
2160
- * @returns {Promise<OperatorsResponse>} The operators response.
2161
- */
2162
- getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
2163
- /**
2164
- * @method getCircuitByName
2165
- * @description Get a circuit by its name.
2166
- * @param {string} name - The name of the circuit.
2167
- * @returns {Promise<CircuitResponse>} The circuit response.
2168
- */
2169
- getCircuitByName(name: string): Promise<CircuitResponse>;
2170
- /**
2171
- * @method getCircuits
2172
- * @description Get all available circuits.
2173
- * @returns {Promise<CircuitsResponse>} The circuits response.
2174
- */
2175
- getCircuits(): Promise<CircuitsResponse>;
2176
- /**
2177
- * @method getTransactionByHash
2178
- * @description Get a transaction by its hash.
2179
- * @param {string} hash - The hash of the transaction.
2180
- * @returns {Promise<TransactionResponse>} The transaction response.
2181
- */
2182
- getTransactionByHash(hash: string): Promise<TransactionResponse>;
2183
- /**
2184
- * @method getTransactions
2185
- * @description Get multiple transactions.
2186
- * @param {string} after - The cursor to start after.
2187
- * @param {number} [limit] - The number of transactions to retrieve.
2188
- * @returns {Promise<TransactionsResponse>} The transactions response.
2189
- */
2190
- getTransactions(after: string, limit?: number): Promise<TransactionsResponse>;
2191
- /**
2192
- * @method getTransactionsByContractAddress
2193
- * @description Get transactions by contract address.
2194
- * @param {string} address - The contract address.
2195
- * @param {string} after - The cursor to start after.
2196
- * @param {number} [limit] - The number of transactions to retrieve.
2197
- * @returns {Promise<TransactionsResponse>} The transactions response.
2198
- */
2199
- getTransactionsByContractAddress(address: string, after: string, limit?: number): Promise<TransactionsResponse>;
2200
- /**
2201
- * @method getProofByContractAddress
2202
- * @description Get proof data by contract address.
2203
- * @param {string} address - The contract address.
2204
- * @returns {Promise<ProofResponse>} The proof response.
2205
- */
2206
- getProofByContractAddress(address: string): Promise<ProofResponse>;
2091
+ getStateIdxInc({ signer, address, contractAddress, }: {
2092
+ signer: OfflineSigner;
2093
+ address: string;
2094
+ contractAddress: string;
2095
+ }): Promise<string>;
2096
+ getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
2097
+ signer: OfflineSigner;
2098
+ stateIdx: number;
2099
+ contractAddress: string;
2100
+ }): Promise<string>;
2101
+ getStateIdxByPubKey({ contractAddress, pubKey, }: {
2102
+ contractAddress: string;
2103
+ pubKey: bigint[];
2104
+ }): Promise<number>;
2105
+ feegrantAllowance({ address, contractAddress, }: {
2106
+ address: string;
2107
+ contractAddress: string;
2108
+ }): Promise<FeegrantAllowanceResponse>;
2109
+ hasFeegrant({ address, contractAddress, }: {
2110
+ address: string;
2111
+ contractAddress: string;
2112
+ }): Promise<boolean>;
2113
+ queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
2114
+ signer: OfflineSigner;
2115
+ address: string;
2116
+ contractAddress: string;
2117
+ certificate?: string;
2118
+ mode?: 'maci' | 'amaci';
2119
+ }): Promise<string>;
2120
+ isWhitelisted({ signer, address, contractAddress, }: {
2121
+ signer: OfflineSigner;
2122
+ address: string;
2123
+ contractAddress: string;
2124
+ }): Promise<boolean>;
2125
+ getOracleWhitelistConfig({ signer, contractAddress, }: {
2126
+ signer: OfflineSigner;
2127
+ contractAddress: string;
2128
+ }): Promise<OracleWhitelistConfig>;
2129
+ getRoundInfo({ contractAddress }: {
2130
+ contractAddress: string;
2131
+ }): Promise<RoundType>;
2132
+ getRoundCircuitType({ contractAddress }: {
2133
+ contractAddress: string;
2134
+ }): Promise<string>;
2135
+ queryRoundIsQv({ contractAddress }: {
2136
+ contractAddress: string;
2137
+ }): Promise<boolean>;
2138
+ queryRoundClaimable({ contractAddress, }: {
2139
+ contractAddress: string;
2140
+ }): Promise<{
2141
+ claimable: boolean | null;
2142
+ balance: string | null;
2143
+ }>;
2144
+ queryAMaciChargeFee({ maxVoter, maxOption, }: {
2145
+ maxVoter: number;
2146
+ maxOption: number;
2147
+ }): Promise<{
2148
+ denom: string;
2149
+ amount: string;
2150
+ }>;
2151
+ queryRoundGasStation({ contractAddress }: {
2152
+ contractAddress: string;
2153
+ }): Promise<boolean>;
2154
+ parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
2155
+ queryRoundBalance({ contractAddress }: {
2156
+ contractAddress: string;
2157
+ }): Promise<string>;
2158
+ requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
2159
+ signer: OfflineSigner;
2160
+ ecosystem: CertificateEcosystem;
2161
+ address: string;
2162
+ contractAddress: string;
2163
+ }): Promise<SignatureResponse>;
2164
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
2165
+ signer: OfflineSigner;
2166
+ address: string;
2167
+ contractAddress: string;
2168
+ maciAccount?: Account;
2169
+ oracleCertificate?: {
2170
+ amount: string;
2171
+ signature: string;
2172
+ };
2173
+ gasStation?: boolean;
2174
+ }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2175
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
2176
+ signer: OfflineSigner;
2177
+ address: string;
2178
+ stateIdx: number;
2179
+ contractAddress: string;
2180
+ selectedOptions: {
2181
+ idx: number;
2182
+ vc: number;
2183
+ }[];
2184
+ operatorCoordPubKey: PublicKey;
2185
+ maciAccount?: Account;
2186
+ gasStation?: boolean;
2187
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2188
+ publishMessage({ client, address, payload, contractAddress, gasStation, }: {
2189
+ client: SigningCosmWasmClient;
2190
+ address: string;
2191
+ payload: {
2192
+ msg: bigint[];
2193
+ encPubkeys: PublicKey;
2194
+ }[];
2195
+ contractAddress: string;
2196
+ gasStation: boolean;
2197
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2198
+ claimAMaciRound({ signer, contractAddress, }: {
2199
+ signer: OfflineSigner;
2200
+ contractAddress: string;
2201
+ }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2202
+ getOracleCertificateConfig(): Promise<EcosystemsResponse>;
2203
+ batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2204
+ batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2207
2205
  }
2208
2206
 
2209
2207
  declare function isValidAddress(address: string): boolean;