@dorafactory/maci-sdk 0.0.29 → 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.d.mts +17 -0
- package/dist/browser.d.ts +17 -0
- package/dist/browser.js +100 -1
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +100 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +100 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/libs/contract/contract.ts +1 -1
- package/src/libs/maci/maci.ts +112 -0
package/dist/browser.d.mts
CHANGED
|
@@ -1899,6 +1899,23 @@ declare class MACI {
|
|
|
1899
1899
|
contractAddress: string;
|
|
1900
1900
|
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1901
1901
|
getOracleCertificateConfig(): Promise<EcosystemsResponse>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Batch grant with bond (for maci)
|
|
1904
|
+
* @param client
|
|
1905
|
+
* @param contractAddress
|
|
1906
|
+
* @param address
|
|
1907
|
+
* @param amount
|
|
1908
|
+
* @returns
|
|
1909
|
+
*/
|
|
1910
|
+
batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1911
|
+
/**
|
|
1912
|
+
* Batch revoke with withdraw (for maci)
|
|
1913
|
+
* @param client
|
|
1914
|
+
* @param contractAddress
|
|
1915
|
+
* @param address
|
|
1916
|
+
* @returns
|
|
1917
|
+
*/
|
|
1918
|
+
batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1902
1919
|
}
|
|
1903
1920
|
|
|
1904
1921
|
declare const circuits: Record<string, CircuitType>;
|
package/dist/browser.d.ts
CHANGED
|
@@ -1899,6 +1899,23 @@ declare class MACI {
|
|
|
1899
1899
|
contractAddress: string;
|
|
1900
1900
|
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1901
1901
|
getOracleCertificateConfig(): Promise<EcosystemsResponse>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Batch grant with bond (for maci)
|
|
1904
|
+
* @param client
|
|
1905
|
+
* @param contractAddress
|
|
1906
|
+
* @param address
|
|
1907
|
+
* @param amount
|
|
1908
|
+
* @returns
|
|
1909
|
+
*/
|
|
1910
|
+
batchGrantWithBond(client: SigningCosmWasmClient, contractAddress: string, address: string, amount: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1911
|
+
/**
|
|
1912
|
+
* Batch revoke with withdraw (for maci)
|
|
1913
|
+
* @param client
|
|
1914
|
+
* @param contractAddress
|
|
1915
|
+
* @param address
|
|
1916
|
+
* @returns
|
|
1917
|
+
*/
|
|
1918
|
+
batchRevokeWithdraw(client: SigningCosmWasmClient, contractAddress: string, address: string): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1902
1919
|
}
|
|
1903
1920
|
|
|
1904
1921
|
declare const circuits: Record<string, CircuitType>;
|
package/dist/browser.js
CHANGED
|
@@ -30156,7 +30156,7 @@ var Contract = class {
|
|
|
30156
30156
|
groth16_tally_vkey: groth16TallyVkey,
|
|
30157
30157
|
plonk_process_vkey: plonkProcessVkey,
|
|
30158
30158
|
plonk_tally_vkey: plonkTallyVkey,
|
|
30159
|
-
max_vote_options: maxOption,
|
|
30159
|
+
max_vote_options: maxOption.toString(),
|
|
30160
30160
|
whitelist,
|
|
30161
30161
|
circuit_type: maciVoteType,
|
|
30162
30162
|
certification_system: maciCertSystem,
|
|
@@ -31150,6 +31150,105 @@ var MACI = class {
|
|
|
31150
31150
|
const ecosystems = await this.oracleCertificate.listEcosystems();
|
|
31151
31151
|
return ecosystems;
|
|
31152
31152
|
}
|
|
31153
|
+
/**
|
|
31154
|
+
* Batch grant with bond (for maci)
|
|
31155
|
+
* @param client
|
|
31156
|
+
* @param contractAddress
|
|
31157
|
+
* @param address
|
|
31158
|
+
* @param amount
|
|
31159
|
+
* @returns
|
|
31160
|
+
*/
|
|
31161
|
+
async batchGrantWithBond(client, contractAddress, address, amount) {
|
|
31162
|
+
const msgs = [
|
|
31163
|
+
{
|
|
31164
|
+
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
31165
|
+
value: import_tx.MsgExecuteContract.fromPartial({
|
|
31166
|
+
sender: address,
|
|
31167
|
+
contract: contractAddress,
|
|
31168
|
+
msg: new TextEncoder().encode(
|
|
31169
|
+
JSON.stringify(
|
|
31170
|
+
stringizing({
|
|
31171
|
+
grant: {
|
|
31172
|
+
max_amount: BigInt("100000000000000000000000")
|
|
31173
|
+
}
|
|
31174
|
+
})
|
|
31175
|
+
)
|
|
31176
|
+
)
|
|
31177
|
+
})
|
|
31178
|
+
},
|
|
31179
|
+
{
|
|
31180
|
+
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
31181
|
+
value: import_tx.MsgExecuteContract.fromPartial({
|
|
31182
|
+
sender: address,
|
|
31183
|
+
contract: contractAddress,
|
|
31184
|
+
msg: new TextEncoder().encode(
|
|
31185
|
+
JSON.stringify(
|
|
31186
|
+
stringizing({
|
|
31187
|
+
bond: {}
|
|
31188
|
+
})
|
|
31189
|
+
)
|
|
31190
|
+
),
|
|
31191
|
+
funds: [
|
|
31192
|
+
{
|
|
31193
|
+
denom: "peaka",
|
|
31194
|
+
amount
|
|
31195
|
+
}
|
|
31196
|
+
]
|
|
31197
|
+
})
|
|
31198
|
+
}
|
|
31199
|
+
];
|
|
31200
|
+
try {
|
|
31201
|
+
const result = await client.signAndBroadcast(address, msgs, "auto");
|
|
31202
|
+
return result;
|
|
31203
|
+
} catch (err) {
|
|
31204
|
+
throw err;
|
|
31205
|
+
}
|
|
31206
|
+
}
|
|
31207
|
+
/**
|
|
31208
|
+
* Batch revoke with withdraw (for maci)
|
|
31209
|
+
* @param client
|
|
31210
|
+
* @param contractAddress
|
|
31211
|
+
* @param address
|
|
31212
|
+
* @returns
|
|
31213
|
+
*/
|
|
31214
|
+
async batchRevokeWithdraw(client, contractAddress, address) {
|
|
31215
|
+
const msgs = [
|
|
31216
|
+
{
|
|
31217
|
+
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
31218
|
+
value: import_tx.MsgExecuteContract.fromPartial({
|
|
31219
|
+
sender: address,
|
|
31220
|
+
contract: contractAddress,
|
|
31221
|
+
msg: new TextEncoder().encode(
|
|
31222
|
+
JSON.stringify(
|
|
31223
|
+
stringizing({
|
|
31224
|
+
withdraw: {}
|
|
31225
|
+
})
|
|
31226
|
+
)
|
|
31227
|
+
)
|
|
31228
|
+
})
|
|
31229
|
+
},
|
|
31230
|
+
{
|
|
31231
|
+
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
31232
|
+
value: import_tx.MsgExecuteContract.fromPartial({
|
|
31233
|
+
sender: address,
|
|
31234
|
+
contract: contractAddress,
|
|
31235
|
+
msg: new TextEncoder().encode(
|
|
31236
|
+
JSON.stringify(
|
|
31237
|
+
stringizing({
|
|
31238
|
+
revoke: {}
|
|
31239
|
+
})
|
|
31240
|
+
)
|
|
31241
|
+
)
|
|
31242
|
+
})
|
|
31243
|
+
}
|
|
31244
|
+
];
|
|
31245
|
+
try {
|
|
31246
|
+
const result = await client.signAndBroadcast(address, msgs, "auto");
|
|
31247
|
+
return result;
|
|
31248
|
+
} catch (err) {
|
|
31249
|
+
throw err;
|
|
31250
|
+
}
|
|
31251
|
+
}
|
|
31153
31252
|
};
|
|
31154
31253
|
|
|
31155
31254
|
// src/maci.ts
|