feat: add transfer transaction types

This commit is contained in:
Matthew Russell
2023-02-06 10:43:33 -08:00
parent 3eb1359504
commit 74a2d15200
+34 -1
View File
@@ -292,6 +292,38 @@ export interface BatchMarketInstructionSubmissionBody {
};
}
interface Transfer {
fromAccountType: Schema.AccountType;
to: string;
toAccountType: Schema.AccountType;
asset: string;
amount: string;
reference?: string;
}
interface OneOffTransfer extends Transfer {
oneOff: {
deliverOn?: number; // omit for immediate
};
}
interface RecurringTransfer extends Transfer {
recurring: {
factor: string;
startEpoch: number;
endEpoch?: number;
dispatchStrategy?: {
assetForMetric: string;
metric: Schema.DispatchMetric;
markets?: string[];
};
};
}
export interface TransferBody {
transfer: OneOffTransfer | RecurringTransfer;
}
export type Transaction =
| OrderSubmissionBody
| OrderCancellationBody
@@ -301,7 +333,8 @@ export type Transaction =
| UndelegateSubmissionBody
| OrderAmendmentBody
| ProposalSubmissionBody
| BatchMarketInstructionSubmissionBody;
| BatchMarketInstructionSubmissionBody
| TransferBody;
export const isWithdrawTransaction = (
transaction: Transaction