diff --git a/packages/auto-consensus/src/batch.ts b/packages/auto-consensus/src/batch.ts new file mode 100644 index 00000000..cf2e6a38 --- /dev/null +++ b/packages/auto-consensus/src/batch.ts @@ -0,0 +1,3 @@ +import type { ApiPromise } from '@polkadot/api' + +export const batch = async (api: ApiPromise, txs: any[]) => await api.tx.utility.batch(txs) diff --git a/packages/auto-consensus/src/index.ts b/packages/auto-consensus/src/index.ts index 93380ff7..b2845280 100644 --- a/packages/auto-consensus/src/index.ts +++ b/packages/auto-consensus/src/index.ts @@ -2,7 +2,9 @@ export * from './address' export * from './balances' +export * from './batch' export * from './info' +export * from './remark' export * from './staking' export * from './transfer' diff --git a/packages/auto-consensus/src/remark.ts b/packages/auto-consensus/src/remark.ts new file mode 100644 index 00000000..cc8a2274 --- /dev/null +++ b/packages/auto-consensus/src/remark.ts @@ -0,0 +1,4 @@ +import type { ApiPromise } from '@polkadot/api' + +export const remark = async (api: ApiPromise, remark: string, withEvent?: boolean) => + !withEvent ? await api.tx.system.remark(remark) : await api.tx.system.remarkWithEvent(remark)