/************************************************************** * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED * **************************************************************/ import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js'; import { bcs, type BcsType } from '@mysten/sui/bcs'; import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions'; import * as vec_set from './vec_set.js'; import * as type_name from './deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.js'; import * as balance from './balance.js'; const $moduleName = '0x2::transfer_policy'; export const TransferRequest = new MoveStruct({ name: `${$moduleName}::TransferRequest`, fields: { item: bcs.Address, paid: bcs.u64(), from: bcs.Address, receipts: vec_set.VecSet(type_name.TypeName), }, }); export const TransferPolicy = new MoveStruct({ name: `${$moduleName}::TransferPolicy`, fields: { id: bcs.Address, balance: balance.Balance, rules: vec_set.VecSet(type_name.TypeName), }, }); export const TransferPolicyCap = new MoveStruct({ name: `${$moduleName}::TransferPolicyCap`, fields: { id: bcs.Address, policy_id: bcs.Address, }, }); export const TransferPolicyCreated = new MoveStruct({ name: `${$moduleName}::TransferPolicyCreated`, fields: { id: bcs.Address, }, }); export const TransferPolicyDestroyed = new MoveStruct({ name: `${$moduleName}::TransferPolicyDestroyed`, fields: { id: bcs.Address, }, }); export const RuleKey = new MoveStruct({ name: `${$moduleName}::RuleKey`, fields: { dummy_field: bcs.bool(), }, }); export interface NewRequestOptions { package?: string; arguments: [ RawTransactionArgument, RawTransactionArgument, RawTransactionArgument, ]; typeArguments: [string]; } export function newRequest(options: NewRequestOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = ['0x2::object::ID', 'u64', '0x2::object::ID'] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'new_request', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface NewOptions { package?: string; arguments: [RawTransactionArgument]; typeArguments: [string]; } export function _new(options: NewOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'new', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface DefaultOptions { package?: string; arguments: [RawTransactionArgument]; typeArguments: [string]; } export function _default(options: DefaultOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'default', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface WithdrawOptions { package?: string; arguments: [ RawTransactionArgument, RawTransactionArgument, RawTransactionArgument, ]; typeArguments: [string]; } export function withdraw(options: WithdrawOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null, null, '0x1::option::Option'] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'withdraw', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface DestroyAndWithdrawOptions { package?: string; arguments: [RawTransactionArgument, RawTransactionArgument]; typeArguments: [string]; } export function destroyAndWithdraw(options: DestroyAndWithdrawOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'destroy_and_withdraw', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface ConfirmRequestOptions { package?: string; arguments: [RawTransactionArgument, TransactionArgument]; typeArguments: [string]; } export function confirmRequest(options: ConfirmRequestOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'confirm_request', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface AddRuleOptions, T2 extends BcsType> { package?: string; arguments: [ RawTransactionArgument, RawTransactionArgument, RawTransactionArgument, RawTransactionArgument, ]; typeArguments: [string, string, string]; } export function addRule, T2 extends BcsType>( options: AddRuleOptions, ) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [ `${options.typeArguments[1]}`, null, null, `${options.typeArguments[2]}`, ] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'add_rule', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface GetRuleOptions> { package?: string; arguments: [RawTransactionArgument, RawTransactionArgument]; typeArguments: [string, string, string]; } export function getRule>(options: GetRuleOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'get_rule', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface AddToBalanceOptions> { package?: string; arguments: [ RawTransactionArgument, RawTransactionArgument, RawTransactionArgument, ]; typeArguments: [string, string]; } export function addToBalance>(options: AddToBalanceOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [`${options.typeArguments[1]}`, null, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'add_to_balance', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface AddReceiptOptions> { package?: string; arguments: [RawTransactionArgument, TransactionArgument]; typeArguments: [string, string]; } export function addReceipt>(options: AddReceiptOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'add_receipt', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface HasRuleOptions { package?: string; arguments: [RawTransactionArgument]; typeArguments: [string, string]; } export function hasRule(options: HasRuleOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'has_rule', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface RemoveRuleOptions { package?: string; arguments: [RawTransactionArgument, RawTransactionArgument]; typeArguments: [string, string, string]; } export function removeRule(options: RemoveRuleOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'remove_rule', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface UidOptions { package?: string; arguments: [RawTransactionArgument]; typeArguments: [string]; } export function uid(options: UidOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'uid', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface UidMutAsOwnerOptions { package?: string; arguments: [RawTransactionArgument, RawTransactionArgument]; typeArguments: [string]; } export function uidMutAsOwner(options: UidMutAsOwnerOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null, null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'uid_mut_as_owner', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface RulesOptions { package?: string; arguments: [RawTransactionArgument]; typeArguments: [string]; } export function rules(options: RulesOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'rules', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface ItemOptions { package?: string; arguments: [TransactionArgument]; typeArguments: [string]; } export function item(options: ItemOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'item', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface PaidOptions { package?: string; arguments: [TransactionArgument]; typeArguments: [string]; } export function paid(options: PaidOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'paid', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); } export interface FromOptions { package?: string; arguments: [TransactionArgument]; typeArguments: [string]; } export function _from(options: FromOptions) { const packageAddress = options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002'; const argumentsTypes = [null] satisfies (string | null)[]; return (tx: Transaction) => tx.moveCall({ package: packageAddress, module: 'transfer_policy', function: 'from', arguments: normalizeMoveArguments(options.arguments, argumentsTypes), typeArguments: options.typeArguments, }); }