Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
maxima-net committed Sep 5, 2022
1 parent d279a3b commit ed8322a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/tezos/contracts/fa2.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { ContractAbstraction, ContractMethod, ContractProvider, Wallet } from '@taquito/taquito';

export interface FA2UpdateOperatorParams {
export interface FA2UpdateOperatorParameters {
owner: string;
operator: string;
token_id: number;
}

export interface FA2AddOperatorParams {
add_operator: FA2UpdateOperatorParams;
export interface FA2AddOperatorParameters {
add_operator: FA2UpdateOperatorParameters;
}

export interface FA2RemoveOperatorParams {
remove_operator: FA2UpdateOperatorParams;
export interface FA2RemoveOperatorParameters {
remove_operator: FA2UpdateOperatorParameters;
}

export type FA2UpdateOperatorsPayload = Array<FA2AddOperatorParams | FA2RemoveOperatorParams>;
export type FA2UpdateOperatorsPayload = Array<FA2AddOperatorParameters | FA2RemoveOperatorParameters>;

export type FA2Contract<T extends ContractProvider | Wallet = ContractProvider> = ContractAbstraction<T> & {
methods: {
Expand Down
6 changes: 3 additions & 3 deletions src/tezos/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type { FA12Contract } from './fa12';
export type {
FA2Contract,
FA2AddOperatorParams,
FA2RemoveOperatorParams,
FA2UpdateOperatorParams,
FA2AddOperatorParameters,
FA2RemoveOperatorParameters,
FA2UpdateOperatorParameters,
FA2UpdateOperatorsPayload
} from './fa2';
4 changes: 2 additions & 2 deletions src/tezos/utils/fa12helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import type BigNumber from 'bignumber.js';

import type { FA12Contract } from '../contracts';

export interface WrapTransactionsWithFA12ApproveOptions {
export interface WrapTransactionsWithFA12ApproveParameters {
toolkit: TezosToolkit;
tokenContract: FA12Contract<Wallet>;
approvedAddress: string;
approvedAmount: BigNumber;
contractCalls: Array<ContractMethod<Wallet> | ContractMethodObject<Wallet>>;
}

export const wrapContractCallsWithApprove = (options: WrapTransactionsWithFA12ApproveOptions): WalletOperationBatch => {
export const wrapContractCallsWithApprove = (options: WrapTransactionsWithFA12ApproveParameters): WalletOperationBatch => {
const batch = options.toolkit.wallet.batch()
.withContractCall(options.tokenContract.methods.approve(options.approvedAddress, options.approvedAmount));

Expand Down
4 changes: 2 additions & 2 deletions src/tezos/utils/fa2helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ContractMethod, ContractMethodObject, TezosToolkit, Wallet, Wallet

import type { FA2Contract } from '../contracts';

export interface WrapTransactionsWithFA2ApproveOptions {
export interface WrapTransactionsWithFA2ApproveParameters {
toolkit: TezosToolkit;
tokenContract: FA2Contract<Wallet>;
ownerAddress: string;
Expand All @@ -11,7 +11,7 @@ export interface WrapTransactionsWithFA2ApproveOptions {
contractCalls: Array<ContractMethod<Wallet> | ContractMethodObject<Wallet>>;
}

export const wrapContractCallsWithApprove = (options: WrapTransactionsWithFA2ApproveOptions): WalletOperationBatch => {
export const wrapContractCallsWithApprove = (options: WrapTransactionsWithFA2ApproveParameters): WalletOperationBatch => {
const batch = options.toolkit.wallet.batch()
.withContractCall(options.tokenContract.methods.update_operators([{
add_operator: {
Expand Down

0 comments on commit ed8322a

Please sign in to comment.