@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/index.mjs CHANGED
@@ -5318,6 +5318,105 @@ var MACI = class {
5318
5318
  const ecosystems = await this.oracleCertificate.listEcosystems();
5319
5319
  return ecosystems;
5320
5320
  }
5321
+ /**
5322
+ * Batch grant with bond (for maci)
5323
+ * @param client
5324
+ * @param contractAddress
5325
+ * @param address
5326
+ * @param amount
5327
+ * @returns
5328
+ */
5329
+ async batchGrantWithBond(client, contractAddress, address, amount) {
5330
+ const msgs = [
5331
+ {
5332
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
5333
+ value: MsgExecuteContract.fromPartial({
5334
+ sender: address,
5335
+ contract: contractAddress,
5336
+ msg: new TextEncoder().encode(
5337
+ JSON.stringify(
5338
+ stringizing({
5339
+ grant: {
5340
+ max_amount: BigInt("100000000000000000000000")
5341
+ }
5342
+ })
5343
+ )
5344
+ )
5345
+ })
5346
+ },
5347
+ {
5348
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
5349
+ value: MsgExecuteContract.fromPartial({
5350
+ sender: address,
5351
+ contract: contractAddress,
5352
+ msg: new TextEncoder().encode(
5353
+ JSON.stringify(
5354
+ stringizing({
5355
+ bond: {}
5356
+ })
5357
+ )
5358
+ ),
5359
+ funds: [
5360
+ {
5361
+ denom: "peaka",
5362
+ amount
5363
+ }
5364
+ ]
5365
+ })
5366
+ }
5367
+ ];
5368
+ try {
5369
+ const result = await client.signAndBroadcast(address, msgs, "auto");
5370
+ return result;
5371
+ } catch (err) {
5372
+ throw err;
5373
+ }
5374
+ }
5375
+ /**
5376
+ * Batch revoke with withdraw (for maci)
5377
+ * @param client
5378
+ * @param contractAddress
5379
+ * @param address
5380
+ * @returns
5381
+ */
5382
+ async batchRevokeWithdraw(client, contractAddress, address) {
5383
+ const msgs = [
5384
+ {
5385
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
5386
+ value: MsgExecuteContract.fromPartial({
5387
+ sender: address,
5388
+ contract: contractAddress,
5389
+ msg: new TextEncoder().encode(
5390
+ JSON.stringify(
5391
+ stringizing({
5392
+ withdraw: {}
5393
+ })
5394
+ )
5395
+ )
5396
+ })
5397
+ },
5398
+ {
5399
+ typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
5400
+ value: MsgExecuteContract.fromPartial({
5401
+ sender: address,
5402
+ contract: contractAddress,
5403
+ msg: new TextEncoder().encode(
5404
+ JSON.stringify(
5405
+ stringizing({
5406
+ revoke: {}
5407
+ })
5408
+ )
5409
+ )
5410
+ })
5411
+ }
5412
+ ];
5413
+ try {
5414
+ const result = await client.signAndBroadcast(address, msgs, "auto");
5415
+ return result;
5416
+ } catch (err) {
5417
+ throw err;
5418
+ }
5419
+ }
5321
5420
  };
5322
5421
 
5323
5422
  // src/maci.ts