Skip to content

Commit

Permalink
Merge pull request #50 from subspace/49-add-remark-and-batch
Browse files Browse the repository at this point in the history
Add batch and remark
  • Loading branch information
marc-aurele-besner authored Jul 3, 2024
2 parents 4e88570 + a5a22cd commit 836d2b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/auto-consensus/src/batch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { ApiPromise } from '@polkadot/api'

export const batch = async (api: ApiPromise, txs: any[]) => await api.tx.utility.batch(txs)
2 changes: 2 additions & 0 deletions packages/auto-consensus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
4 changes: 4 additions & 0 deletions packages/auto-consensus/src/remark.ts
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 836d2b2

Please sign in to comment.