PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@substrate/txwrapper-core/lib/core/construct

Просмотр файла: createSignedTx.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSignedTx = void 0;
const __1 = require("..");
/**
 * Serialize a signed transaction in a format that can be submitted over the
 * Node RPC Interface from the signing payload and signature produced by the
 * remote signer.
 *
 * @param unsigned - The JSON representing the unsigned transaction.
 * @param signature - Signature of the signing payload produced by the remote
 * signer. A signed ExtrinsicPayload returns a signature with the type `0x${string}` via polkadot-js.
 * @param options - Registry and metadata used for constructing the method.
 */
function createSignedTx(unsigned, signature, options) {
    const { metadataRpc, registry, asCallsOnlyArg, asSpecifiedCallsOnlyV14, signedExtensions, userExtensions, } = options;
    const metadata = (0, __1.createMetadata)(registry, metadataRpc, asCallsOnlyArg, asSpecifiedCallsOnlyV14);
    registry.setMetadata(metadata, signedExtensions, userExtensions);
    const extrinsic = registry.createType('Extrinsic', { method: unsigned.method }, { version: unsigned.version });
    extrinsic.addSignature(unsigned.address, signature, unsigned);
    return extrinsic.toHex();
}
exports.createSignedTx = createSignedTx;
//# sourceMappingURL=createSignedTx.js.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!