|
1 | 1 | import { |
2 | 2 | InitiateRecoveryOptions as BaseInitiateRecoveryOptions, |
3 | 3 | SignTransactionOptions as BaseSignTransactionOptions, |
| 4 | + TransactionExplanation as BaseTransactionExplanation, |
4 | 5 | VerifyAddressOptions as BaseVerifyAddressOptions, |
5 | | - TransactionExplanation, |
6 | 6 | TransactionPrebuild, |
7 | 7 | } from '@bitgo/sdk-core'; |
| 8 | +import { AccountSet, Payment, Signer, SignerEntry, SignerListSet } from 'xrpl'; |
| 9 | + |
| 10 | +export enum XrpTransactionType { |
| 11 | + AccountSet = 'AccountSet', |
| 12 | + Payment = 'Payment', |
| 13 | + SignerListSet = 'SignerListSet', |
| 14 | + TrustSet = 'TrustSet', |
| 15 | +} |
| 16 | + |
| 17 | +export type XrpTransaction = Payment | AccountSet | SignerListSet; |
8 | 18 |
|
9 | 19 | export interface Address { |
10 | 20 | address: string; |
@@ -35,7 +45,7 @@ export interface VerifyAddressOptions extends BaseVerifyAddressOptions { |
35 | 45 | rootAddress: string; |
36 | 46 | } |
37 | 47 |
|
38 | | -export interface RecoveryInfo extends TransactionExplanation { |
| 48 | +export interface RecoveryInfo extends BaseTransactionExplanation { |
39 | 49 | txHex: string; |
40 | 50 | backupKey?: string; |
41 | 51 | coin?: string; |
@@ -68,3 +78,53 @@ export interface HalfSignedTransaction { |
68 | 78 | export interface SupplementGenerateWalletOptions { |
69 | 79 | rootPrivateKey?: string; |
70 | 80 | } |
| 81 | + |
| 82 | +export type TransactionExplanation = |
| 83 | + | BaseTransactionExplanation |
| 84 | + | AccountSetTransactionExplanation |
| 85 | + | SignerListSetTransactionExplanation; |
| 86 | + |
| 87 | +export interface AccountSetTransactionExplanation extends BaseTransactionExplanation { |
| 88 | + accountSet: { |
| 89 | + messageKey?: string; |
| 90 | + setFlag: number; |
| 91 | + }; |
| 92 | +} |
| 93 | + |
| 94 | +export interface SignerListSetTransactionExplanation extends BaseTransactionExplanation { |
| 95 | + signerListSet: { |
| 96 | + signerQuorum: number; |
| 97 | + signerEntries: SignerEntry[]; |
| 98 | + }; |
| 99 | +} |
| 100 | + |
| 101 | +export interface TxData { |
| 102 | + // mandatory fields |
| 103 | + from: string; |
| 104 | + transactionType: XrpTransactionType; |
| 105 | + isMultiSig: boolean; |
| 106 | + // optional fields |
| 107 | + id?: string; |
| 108 | + fee?: string; |
| 109 | + flags: number; |
| 110 | + sequence?: number; |
| 111 | + lastLedgerSequence?: number; |
| 112 | + signingPubKey?: string; // if '' then it is a multi sig |
| 113 | + txnSignature?: string; // only for single sig |
| 114 | + signers?: Signer[]; // only for multi sig |
| 115 | + // transfer xrp fields |
| 116 | + destination?: string; |
| 117 | + destinationTag?: number; |
| 118 | + amount?: string; |
| 119 | + // account set fields |
| 120 | + messageKey?: string; |
| 121 | + setFlag?: number; |
| 122 | + // signer list set fields |
| 123 | + signerQuorum?: number; |
| 124 | + signerEntries?: SignerEntry[]; |
| 125 | +} |
| 126 | + |
| 127 | +export interface SignerDetails { |
| 128 | + address: string; |
| 129 | + weight: number; |
| 130 | +} |
0 commit comments