@dorafactory/maci-sdk 0.0.32 → 0.0.34

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.
@@ -1770,7 +1770,7 @@ declare class MACI {
1770
1770
  });
1771
1771
  getStateIdxInc({ signer, address, contractAddress, }: {
1772
1772
  signer: OfflineSigner;
1773
- address: string;
1773
+ address?: string;
1774
1774
  contractAddress: string;
1775
1775
  }): Promise<string>;
1776
1776
  getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
@@ -1792,14 +1792,14 @@ declare class MACI {
1792
1792
  }): Promise<boolean>;
1793
1793
  queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
1794
1794
  signer: OfflineSigner;
1795
- address: string;
1795
+ address?: string;
1796
1796
  contractAddress: string;
1797
1797
  certificate?: string;
1798
1798
  mode?: 'maci' | 'amaci';
1799
1799
  }): Promise<string>;
1800
1800
  isWhitelisted({ signer, address, contractAddress, }: {
1801
1801
  signer: OfflineSigner;
1802
- address: string;
1802
+ address?: string;
1803
1803
  contractAddress: string;
1804
1804
  }): Promise<boolean>;
1805
1805
  getOracleWhitelistConfig({ signer, contractAddress, }: {
@@ -1838,12 +1838,12 @@ declare class MACI {
1838
1838
  requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
1839
1839
  signer: OfflineSigner;
1840
1840
  ecosystem: CertificateEcosystem;
1841
- address: string;
1841
+ address?: string;
1842
1842
  contractAddress: string;
1843
1843
  }): Promise<SignatureResponse>;
1844
1844
  signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1845
1845
  signer: OfflineSigner;
1846
- address: string;
1846
+ address?: string;
1847
1847
  contractAddress: string;
1848
1848
  maciAccount?: Account;
1849
1849
  oracleCertificate?: {
@@ -1855,7 +1855,7 @@ declare class MACI {
1855
1855
  private processVoteOptions;
1856
1856
  vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1857
1857
  signer: OfflineSigner;
1858
- address: string;
1858
+ address?: string;
1859
1859
  stateIdx: number;
1860
1860
  contractAddress: string;
1861
1861
  selectedOptions: {
@@ -1901,13 +1901,18 @@ declare class MACI {
1901
1901
  getOracleCertificateConfig(): Promise<EcosystemsResponse>;
1902
1902
  /**
1903
1903
  * Batch grant with bond (for maci)
1904
- * @param client
1904
+ * @param signer
1905
1905
  * @param contractAddress
1906
1906
  * @param address
1907
1907
  * @param amount
1908
1908
  * @returns
1909
1909
  */
1910
- batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1910
+ batchGrantWithBond({ signer, contractAddress, address, amount, }: {
1911
+ signer: OfflineSigner;
1912
+ contractAddress: string;
1913
+ amount: string;
1914
+ address?: string;
1915
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1911
1916
  /**
1912
1917
  * Batch revoke with withdraw (for maci)
1913
1918
  * @param client
@@ -1915,7 +1920,11 @@ declare class MACI {
1915
1920
  * @param address
1916
1921
  * @returns
1917
1922
  */
1918
- batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1923
+ batchRevokeWithdraw({ signer, contractAddress, address, }: {
1924
+ signer: OfflineSigner;
1925
+ contractAddress: string;
1926
+ address?: string;
1927
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1919
1928
  }
1920
1929
 
1921
1930
  declare const circuits: Record<string, CircuitType>;
@@ -2200,8 +2209,17 @@ declare class MaciClient {
2200
2209
  contractAddress: string;
2201
2210
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2202
2211
  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>;
2212
+ batchGrantWithBond({ signer, contractAddress, address, amount, }: {
2213
+ signer: OfflineSigner;
2214
+ contractAddress: string;
2215
+ address: string;
2216
+ amount: string;
2217
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2218
+ batchRevokeWithdraw({ signer, contractAddress, address, }: {
2219
+ signer: OfflineSigner;
2220
+ contractAddress: string;
2221
+ address: string;
2222
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2205
2223
  }
2206
2224
 
2207
2225
  declare function isValidAddress(address: string): boolean;
package/dist/browser.d.ts CHANGED
@@ -1770,7 +1770,7 @@ declare class MACI {
1770
1770
  });
1771
1771
  getStateIdxInc({ signer, address, contractAddress, }: {
1772
1772
  signer: OfflineSigner;
1773
- address: string;
1773
+ address?: string;
1774
1774
  contractAddress: string;
1775
1775
  }): Promise<string>;
1776
1776
  getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
@@ -1792,14 +1792,14 @@ declare class MACI {
1792
1792
  }): Promise<boolean>;
1793
1793
  queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
1794
1794
  signer: OfflineSigner;
1795
- address: string;
1795
+ address?: string;
1796
1796
  contractAddress: string;
1797
1797
  certificate?: string;
1798
1798
  mode?: 'maci' | 'amaci';
1799
1799
  }): Promise<string>;
1800
1800
  isWhitelisted({ signer, address, contractAddress, }: {
1801
1801
  signer: OfflineSigner;
1802
- address: string;
1802
+ address?: string;
1803
1803
  contractAddress: string;
1804
1804
  }): Promise<boolean>;
1805
1805
  getOracleWhitelistConfig({ signer, contractAddress, }: {
@@ -1838,12 +1838,12 @@ declare class MACI {
1838
1838
  requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
1839
1839
  signer: OfflineSigner;
1840
1840
  ecosystem: CertificateEcosystem;
1841
- address: string;
1841
+ address?: string;
1842
1842
  contractAddress: string;
1843
1843
  }): Promise<SignatureResponse>;
1844
1844
  signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1845
1845
  signer: OfflineSigner;
1846
- address: string;
1846
+ address?: string;
1847
1847
  contractAddress: string;
1848
1848
  maciAccount?: Account;
1849
1849
  oracleCertificate?: {
@@ -1855,7 +1855,7 @@ declare class MACI {
1855
1855
  private processVoteOptions;
1856
1856
  vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1857
1857
  signer: OfflineSigner;
1858
- address: string;
1858
+ address?: string;
1859
1859
  stateIdx: number;
1860
1860
  contractAddress: string;
1861
1861
  selectedOptions: {
@@ -1901,13 +1901,18 @@ declare class MACI {
1901
1901
  getOracleCertificateConfig(): Promise<EcosystemsResponse>;
1902
1902
  /**
1903
1903
  * Batch grant with bond (for maci)
1904
- * @param client
1904
+ * @param signer
1905
1905
  * @param contractAddress
1906
1906
  * @param address
1907
1907
  * @param amount
1908
1908
  * @returns
1909
1909
  */
1910
- batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1910
+ batchGrantWithBond({ signer, contractAddress, address, amount, }: {
1911
+ signer: OfflineSigner;
1912
+ contractAddress: string;
1913
+ amount: string;
1914
+ address?: string;
1915
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1911
1916
  /**
1912
1917
  * Batch revoke with withdraw (for maci)
1913
1918
  * @param client
@@ -1915,7 +1920,11 @@ declare class MACI {
1915
1920
  * @param address
1916
1921
  * @returns
1917
1922
  */
1918
- batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1923
+ batchRevokeWithdraw({ signer, contractAddress, address, }: {
1924
+ signer: OfflineSigner;
1925
+ contractAddress: string;
1926
+ address?: string;
1927
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1919
1928
  }
1920
1929
 
1921
1930
  declare const circuits: Record<string, CircuitType>;
@@ -2200,8 +2209,17 @@ declare class MaciClient {
2200
2209
  contractAddress: string;
2201
2210
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
2202
2211
  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>;
2212
+ batchGrantWithBond({ signer, contractAddress, address, amount, }: {
2213
+ signer: OfflineSigner;
2214
+ contractAddress: string;
2215
+ address: string;
2216
+ amount: string;
2217
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2218
+ batchRevokeWithdraw({ signer, contractAddress, address, }: {
2219
+ signer: OfflineSigner;
2220
+ contractAddress: string;
2221
+ address: string;
2222
+ }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
2205
2223
  }
2206
2224
 
2207
2225
  declare function isValidAddress(address: string): boolean;
package/dist/browser.js CHANGED
@@ -30626,6 +30626,9 @@ var MACI = class {
30626
30626
  address,
30627
30627
  contractAddress
30628
30628
  }) {
30629
+ if (!address) {
30630
+ address = (await signer.getAccounts())[0].address;
30631
+ }
30629
30632
  const client = await this.contract.maciClient({
30630
30633
  signer,
30631
30634
  contractAddress
@@ -30700,6 +30703,9 @@ var MACI = class {
30700
30703
  certificate,
30701
30704
  mode = "maci"
30702
30705
  }) {
30706
+ if (!address) {
30707
+ address = (await signer.getAccounts())[0].address;
30708
+ }
30703
30709
  if (mode === "amaci") {
30704
30710
  const isWhiteListed = await this.isWhitelisted({
30705
30711
  signer,
@@ -30752,6 +30758,9 @@ var MACI = class {
30752
30758
  address,
30753
30759
  contractAddress
30754
30760
  }) {
30761
+ if (!address) {
30762
+ address = (await signer.getAccounts())[0].address;
30763
+ }
30755
30764
  const client = await this.contract.amaciClient({
30756
30765
  signer,
30757
30766
  contractAddress
@@ -30885,6 +30894,9 @@ var MACI = class {
30885
30894
  signer,
30886
30895
  contractAddress
30887
30896
  });
30897
+ if (!address) {
30898
+ address = (await signer.getAccounts())[0].address;
30899
+ }
30888
30900
  const signResponse = await this.oracleCertificate.sign({
30889
30901
  ecosystem,
30890
30902
  address,
@@ -30902,6 +30914,9 @@ var MACI = class {
30902
30914
  gasStation = false
30903
30915
  }) {
30904
30916
  try {
30917
+ if (!address) {
30918
+ address = (await signer.getAccounts())[0].address;
30919
+ }
30905
30920
  if (maciAccount === void 0) {
30906
30921
  maciAccount = await this.circom.genKeypairFromSign(signer, address);
30907
30922
  }
@@ -30976,6 +30991,9 @@ var MACI = class {
30976
30991
  contractAddress,
30977
30992
  voiceCreditBalance
30978
30993
  });
30994
+ if (!address) {
30995
+ address = (await signer.getAccounts())[0].address;
30996
+ }
30979
30997
  if (maciAccount === void 0) {
30980
30998
  maciAccount = await this.circom.genKeypairFromSign(signer, address);
30981
30999
  }
@@ -31152,13 +31170,24 @@ var MACI = class {
31152
31170
  }
31153
31171
  /**
31154
31172
  * Batch grant with bond (for maci)
31155
- * @param client
31173
+ * @param signer
31156
31174
  * @param contractAddress
31157
31175
  * @param address
31158
31176
  * @param amount
31159
31177
  * @returns
31160
31178
  */
31161
- async batchGrantWithBond(client, contractAddress, address, amount) {
31179
+ async batchGrantWithBond({
31180
+ signer,
31181
+ contractAddress,
31182
+ address,
31183
+ amount
31184
+ }) {
31185
+ const client = await this.contract.contractClient({
31186
+ signer
31187
+ });
31188
+ if (!address) {
31189
+ address = (await signer.getAccounts())[0].address;
31190
+ }
31162
31191
  const msgs = [
31163
31192
  {
31164
31193
  typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
@@ -31211,7 +31240,17 @@ var MACI = class {
31211
31240
  * @param address
31212
31241
  * @returns
31213
31242
  */
31214
- async batchRevokeWithdraw(client, contractAddress, address) {
31243
+ async batchRevokeWithdraw({
31244
+ signer,
31245
+ contractAddress,
31246
+ address
31247
+ }) {
31248
+ const client = await this.contract.contractClient({
31249
+ signer
31250
+ });
31251
+ if (!address) {
31252
+ address = (await signer.getAccounts())[0].address;
31253
+ }
31215
31254
  const msgs = [
31216
31255
  {
31217
31256
  typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
@@ -31549,20 +31588,29 @@ var MaciClient2 = class {
31549
31588
  async getOracleCertificateConfig() {
31550
31589
  return await this.maci.getOracleCertificateConfig();
31551
31590
  }
31552
- async batchGrantWithBond(client, contractAddress, address, amount) {
31553
- return await this.maci.batchGrantWithBond(
31554
- client,
31591
+ async batchGrantWithBond({
31592
+ signer,
31593
+ contractAddress,
31594
+ address,
31595
+ amount
31596
+ }) {
31597
+ return await this.maci.batchGrantWithBond({
31598
+ signer,
31555
31599
  contractAddress,
31556
31600
  address,
31557
31601
  amount
31558
- );
31602
+ });
31559
31603
  }
31560
- async batchRevokeWithdraw(client, contractAddress, address) {
31561
- return await this.maci.batchRevokeWithdraw(
31562
- client,
31604
+ async batchRevokeWithdraw({
31605
+ signer,
31606
+ contractAddress,
31607
+ address
31608
+ }) {
31609
+ return await this.maci.batchRevokeWithdraw({
31610
+ signer,
31563
31611
  contractAddress,
31564
31612
  address
31565
- );
31613
+ });
31566
31614
  }
31567
31615
  };
31568
31616