diff --git a/package.json b/package.json index d25cd689..980634a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/wallet-sdk", - "version": "0.0.6-rc.2", + "version": "0.0.6-rc.3", "description": "Libraries to help you write Stellar-enabled wallets in Javascript", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/constants/transfers.ts b/src/constants/transfers.ts index 59f5dcc1..dfab59d4 100644 --- a/src/constants/transfers.ts +++ b/src/constants/transfers.ts @@ -5,3 +5,18 @@ export enum TransferResponseType { customer_info_status = "customer_info_status", error = "error", } + +export enum TransactionStatus { + completed = "completed", + pending_external = "pending_external", + pending_anchor = "pending_anchor", + pending_stellar = "pending_stellar", + pending_trust = "pending_trust", + pending_user = "pending_user", + pending_user_transfer_start = "pending_user_transfer_start", + incomplete = "incomplete", + no_market = "no_market", + too_small = "too_small", + too_large = "too_large", + error = "error", +} diff --git a/src/index.ts b/src/index.ts index 346da51d..9faa0654 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,7 @@ export { Types }; */ export { EffectType } from "./constants/data"; export { KeyType } from "./constants/keys"; -export { TransferResponseType } from "./constants/transfers"; +export { TransferResponseType, TransactionStatus } from "./constants/transfers"; /** * Data diff --git a/src/transfers/DepositProvider.test.ts b/src/transfers/DepositProvider.test.ts index 8015efb7..cc6dd650 100644 --- a/src/transfers/DepositProvider.test.ts +++ b/src/transfers/DepositProvider.test.ts @@ -2,7 +2,8 @@ import sinon from "sinon"; import StellarSdk from "stellar-sdk"; import { DepositProvider } from "./DepositProvider"; -import { DepositInfo, Transaction, TransactionStatus } from "../types"; +import { TransactionStatus } from "../constants/transfers"; +import { DepositInfo, Transaction } from "../types"; const originalSetTimeout = global.setTimeout; diff --git a/src/transfers/TransferProvider.ts b/src/transfers/TransferProvider.ts index bdd7ce28..41c2e167 100644 --- a/src/transfers/TransferProvider.ts +++ b/src/transfers/TransferProvider.ts @@ -10,11 +10,12 @@ import { Transaction, TransactionArgs, TransactionsArgs, - TransactionStatus, WatchTransactionArgs, WithdrawInfo, } from "../types"; +import { TransactionStatus } from "../constants/transfers"; + import { parseInfo } from "./parseInfo"; /** diff --git a/src/types/transfers.ts b/src/types/transfers.ts index b4356f45..da108113 100644 --- a/src/types/transfers.ts +++ b/src/types/transfers.ts @@ -1,4 +1,7 @@ -import { TransferResponseType } from "../constants/transfers"; +import { + TransactionStatus, + TransferResponseType, +} from "../constants/transfers"; import { WatcherParams } from "./watchers"; export interface GetKycArgs { @@ -222,21 +225,6 @@ export interface TransferError extends Error { originalResponse?: any; } -export enum TransactionStatus { - completed = "completed", - pending_external = "pending_external", - pending_anchor = "pending_anchor", - pending_stellar = "pending_stellar", - pending_trust = "pending_trust", - pending_user = "pending_user", - pending_user_transfer_start = "pending_user_transfer_start", - incomplete = "incomplete", - no_market = "no_market", - too_small = "too_small", - too_large = "too_large", - error = "error", -} - interface BaseTransaction { id: string; status: