@dorafactory/maci-sdk 0.0.30 → 0.0.31

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/dist/browser.mjs CHANGED
@@ -31126,6 +31126,105 @@ var MACI = class {
31126
31126
  const ecosystems = await this.oracleCertificate.listEcosystems();
31127
31127
  return ecosystems;
31128
31128
  }
31129
+ /**
31130
+ * Batch grant with bond (for maci)
31131
+ * @param client
31132
+ * @param contractAddress
31133
+ * @param address
31134
+ * @param amount
31135
+ * @returns
31136
+ */
31137
+ async batchGrantWithBond(client, contractAddress, address, amount) {
31138
+ const msgs = [
31139
+ {
31140
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
31141
+ value: MsgExecuteContract.fromPartial({
31142
+ sender: address,
31143
+ contract: contractAddress,
31144
+ msg: new TextEncoder().encode(
31145
+ JSON.stringify(
31146
+ stringizing({
31147
+ grant: {
31148
+ max_amount: BigInt("100000000000000000000000")
31149
+ }
31150
+ })
31151
+ )
31152
+ )
31153
+ })
31154
+ },
31155
+ {
31156
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
31157
+ value: MsgExecuteContract.fromPartial({
31158
+ sender: address,
31159
+ contract: contractAddress,
31160
+ msg: new TextEncoder().encode(
31161
+ JSON.stringify(
31162
+ stringizing({
31163
+ bond: {}
31164
+ })
31165
+ )
31166
+ ),
31167
+ funds: [
31168
+ {
31169
+ denom: "peaka",
31170
+ amount
31171
+ }
31172
+ ]
31173
+ })
31174
+ }
31175
+ ];
31176
+ try {
31177
+ const result = await client.signAndBroadcast(address, msgs, "auto");
31178
+ return result;
31179
+ } catch (err) {
31180
+ throw err;
31181
+ }
31182
+ }
31183
+ /**
31184
+ * Batch revoke with withdraw (for maci)
31185
+ * @param client
31186
+ * @param contractAddress
31187
+ * @param address
31188
+ * @returns
31189
+ */
31190
+ async batchRevokeWithdraw(client, contractAddress, address) {
31191
+ const msgs = [
31192
+ {
31193
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
31194
+ value: MsgExecuteContract.fromPartial({
31195
+ sender: address,
31196
+ contract: contractAddress,
31197
+ msg: new TextEncoder().encode(
31198
+ JSON.stringify(
31199
+ stringizing({
31200
+ withdraw: {}
31201
+ })
31202
+ )
31203
+ )
31204
+ })
31205
+ },
31206
+ {
31207
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
31208
+ value: MsgExecuteContract.fromPartial({
31209
+ sender: address,
31210
+ contract: contractAddress,
31211
+ msg: new TextEncoder().encode(
31212
+ JSON.stringify(
31213
+ stringizing({
31214
+ revoke: {}
31215
+ })
31216
+ )
31217
+ )
31218
+ })
31219
+ }
31220
+ ];
31221
+ try {
31222
+ const result = await client.signAndBroadcast(address, msgs, "auto");
31223
+ return result;
31224
+ } catch (err) {
31225
+ throw err;
31226
+ }
31227
+ }
31129
31228
  };
31130
31229
 
31131
31230
  // src/maci.ts