/** * Pallet's api and rpc methods * @packageDocumentation * */ import { SubmittableExtrinsic } from '@polkadot/api/types'; import { KeyringPair } from '@polkadot/keyring/types'; import { SnGenericId, SnOperation, SnOperationWithStorage } from '@sensio/types'; import { CustomEventEmitter } from '../../events'; import { IncomingParam } from './decodeStorage'; /** * Save a single operation to the chain * {@link SnOperation} * @param op Operation data that we want to save to the chain. * @param signer Account that will be owner of the transaction and ones who pays the fees */ export declare function save(op: SnOperation, signer: KeyringPair): Promise; /** * Create Submittable transactions * @param d */ export declare function createSubmittableExtrinsics(d: SnOperation[]): Promise>>; /** * Save many operations in single transaction. It uses the `batch` capability of the chain * @param ops * @param signer * * ```ts await api.api() const operations: SnOperation[] = ops const signer = getAlice() const o = await api.pallets.operations.saveOperationsBulk(operations, signer) o.on(EVENT_NAME_BATCH, p => console.log(p.message)) ``` */ export declare function saveOperationsBulk(ops: SnOperation[], signer: KeyringPair): Promise; /** * Get All operations from the chain * @returns Promise list of a map SCALE encoded Storage */ export declare function getAll(): Promise>; /** * Get all Operations from the network then decode them * * @returns the list of the Decoded operations as they are stored. */ export declare function getAllDecoded(): Promise; /** * Get All operations from the chain * @returns Promise list of a map SCALE encoded Storage */ export declare function getOperation(item: SnGenericId): Promise; /** * Get some Operations from the network * * @params items List of Operation IDs * @returns the list of the Decoded operations as they are stored. */ export declare function getSome(items: SnGenericId[]): Promise; /** * Get some Operations from the network then decode them * * @params items List of Operation IDs * @returns the list of the Decoded operations decoded */ export declare function getSomeDecoded(items: SnGenericId[]): Promise; /** * Helper function for creating the Submittable result. This can be easily used in the `ramda.map` function with the list of SnOperations. * * ```ts * import { map } from 'ramda' * const txs = map(createNetworkTx, ops) * ``` * * @param op * @returns the Submittable operation * */ export declare function createNetworkTx(op: SnOperation): SubmittableExtrinsic<'promise'>; //# sourceMappingURL=api.d.ts.map