PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@iota/iota-sdk/src/transactions

Просмотр файла: object.ts

// Copyright (c) Mysten Labs, Inc.
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import type { Transaction, TransactionObjectInput } from './Transaction.js';

export function createObjectMethods<T>(makeObject: (value: TransactionObjectInput) => T) {
    function object(value: TransactionObjectInput) {
        return makeObject(value);
    }

    object.system = () => object('0x5');
    object.clock = () => object('0x6');
    object.random = () => object('0x8');
    object.denyList = () => object('0x403');
    object.option =
        ({ type, value }: { type: string; value: TransactionObjectInput | null }) =>
        (tx: Transaction) =>
            tx.moveCall({
                typeArguments: [type],
                target: `0x1::option::${value === null ? 'none' : 'some'}`,
                arguments: value === null ? [] : [tx.object(value)],
            });

    return object;
}

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


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