@bluxcc/core 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.d.ts +13 -0
- package/dist/components/CardItem/index.d.ts +3 -2
- package/dist/components/CardItem/variants/input.d.ts +3 -2
- package/dist/exports/core/helpers/account.d.ts +0 -8
- package/dist/exports/core/swap.d.ts +9 -0
- package/dist/exports/createConfig.d.ts +1 -1
- package/dist/exports/index.d.ts +1 -0
- package/dist/hooks/useTransactions.d.ts +5 -0
- package/dist/index.cjs.js +11 -11
- package/dist/index.esm.js +14 -14
- package/dist/stellar/getTransactionDetails.d.ts +1 -1
- package/dist/stellar/moneygram.d.ts +26 -0
- package/dist/stellar/paymentTransaction.d.ts +3 -3
- package/dist/store.d.ts +4 -4
- package/dist/types.d.ts +7 -3
- package/dist/utils/api.d.ts +1 -1
- package/dist/utils/helpers.d.ts +2 -2
- package/dist/utils/networkRpc.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const getTransactionDetails: (xdr: string, network: string) => {
|
|
2
|
-
action: "
|
|
2
|
+
action: "pathPaymentStrictSend" | "pathPaymentStrictReceive" | "payment" | "createAccount" | "createClaimableBalance" | "accountMerge" | "allowTrust" | "beginSponsoringFutureReserves" | "bumpSequence" | "changeTrust" | "claimClaimableBalance" | "clawbackClaimableBalance" | "clawback" | "createPassiveSellOffer" | "endSponsoringFutureReserves" | "extendFootprintTtl" | "inflation" | "invokeHostFunction" | "liquidityPoolDeposit" | "liquidityPoolWithdraw" | "manageBuyOffer" | "manageData" | "manageSellOffer" | "restoreFootprint" | "revokeAccountSponsorship" | "revokeClaimableBalanceSponsorship" | "revokeDataSponsorship" | "revokeLiquidityPoolSponsorship" | "revokeOfferSponsorship" | "revokeSignerSponsorship" | "revokeTrustlineSponsorship" | "setOptions" | "setTrustLineFlags";
|
|
3
3
|
operations: number;
|
|
4
4
|
sender: string;
|
|
5
5
|
receiver: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
import { IAsset } from '../types';
|
|
3
|
+
export type MoneygramMemoType = 'text' | 'id' | 'hash';
|
|
4
|
+
export type MoneygramSession = {
|
|
5
|
+
url: string;
|
|
6
|
+
id: string;
|
|
7
|
+
token: string;
|
|
8
|
+
transferServer: string;
|
|
9
|
+
};
|
|
10
|
+
export type MoneygramWithdrawDetails = {
|
|
11
|
+
amount: string;
|
|
12
|
+
destination: string;
|
|
13
|
+
memo: string;
|
|
14
|
+
memoType: MoneygramMemoType;
|
|
15
|
+
};
|
|
16
|
+
export declare const isMoneygramNetwork: (network: string) => boolean;
|
|
17
|
+
export declare const moneygramUsdc: (network: string) => IAsset;
|
|
18
|
+
export declare const startMoneygramWithdraw: ({ address, network, lang, sign, signal, }: {
|
|
19
|
+
address: string;
|
|
20
|
+
network: string;
|
|
21
|
+
lang?: string;
|
|
22
|
+
sign: (xdr: string) => Promise<string>;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}) => Promise<MoneygramSession>;
|
|
25
|
+
export declare const waitForMoneygramTransfer: (session: MoneygramSession, signal?: AbortSignal) => Promise<MoneygramWithdrawDetails>;
|
|
26
|
+
export declare const assertHorizon: (horizon?: Horizon.Server) => Horizon.Server;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Horizon } from
|
|
2
|
-
import { IAsset } from
|
|
3
|
-
declare const paymentTransaction: (memo: string, amount: string, destinationAddress: string, asset: IAsset, sourceAddress: string, server: Horizon.Server, networkPassphrase: string) => Promise<string>;
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
import { IAsset } from '../types';
|
|
3
|
+
declare const paymentTransaction: (memo: string, amount: string, destinationAddress: string, asset: IAsset, sourceAddress: string, server: Horizon.Server, networkPassphrase: string, memoType?: "text" | "id" | "hash") => Promise<string>;
|
|
4
4
|
export default paymentTransaction;
|
package/dist/store.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Horizon, rpc } from '@stellar/stellar-sdk';
|
|
2
2
|
import { SignClient } from '@walletconnect/sign-client/dist/types/client';
|
|
3
3
|
import { Route } from './enums';
|
|
4
|
-
import { UseBalancesResult } from './hooks/useBalances';
|
|
5
|
-
import { UseTransactionsResult } from './hooks/useTransactions';
|
|
4
|
+
import type { UseBalancesResult } from './hooks/useBalances';
|
|
6
5
|
import Emitter, { BluxEventMap } from './utils/events';
|
|
7
6
|
import { IAsset, IWallet, IAppearance, AssetMetaMap, ICustomToken, ICustomTokens, ISignMessage, IInternalConfig, ISendTransaction, AuthenticateApiResponse, ISignAuthEntry } from './types';
|
|
8
7
|
export type AlertType = 'error' | 'success' | 'warn' | 'none' | 'copy';
|
|
@@ -78,7 +77,7 @@ export interface IStoreProperties {
|
|
|
78
77
|
loginError?: string;
|
|
79
78
|
balances: UseBalancesResult;
|
|
80
79
|
balanceValues: Record<string, string>;
|
|
81
|
-
|
|
80
|
+
accountRefreshNonce: number;
|
|
82
81
|
selectAsset: ISelectAsset;
|
|
83
82
|
detailsAsset?: IAsset;
|
|
84
83
|
customTokens: ICustomTokens;
|
|
@@ -93,6 +92,7 @@ export interface IStoreProperties {
|
|
|
93
92
|
}
|
|
94
93
|
export interface IStoreMethods {
|
|
95
94
|
connectEmail: (email: string) => void;
|
|
95
|
+
connectSms: (phone: string) => void;
|
|
96
96
|
connectSocial: (provider: string) => void;
|
|
97
97
|
connectWallet: (walletName: string) => void;
|
|
98
98
|
connectWalletSuccessful: (publicKey: string, passphrase: string) => void;
|
|
@@ -120,7 +120,7 @@ export interface IStoreMethods {
|
|
|
120
120
|
setCustomTokenBalances: (network: 'mainnet' | 'testnet', balances: Record<number, string>) => void;
|
|
121
121
|
setBalancesTab: (tab: 'assets' | 'tokens') => void;
|
|
122
122
|
setDetailsToken: (token: ICustomToken | undefined) => void;
|
|
123
|
-
|
|
123
|
+
bumpAccountRefresh: () => void;
|
|
124
124
|
setWalletConnectClient: (client: SignClient, connection: any) => void;
|
|
125
125
|
cleanUp: (method: 'sendTransaction' | 'signMessage' | 'signAuthEntry') => void;
|
|
126
126
|
setNetworkSyncDisabled: (isDisabled: boolean) => void;
|
package/dist/types.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface ITrezorMetaData {
|
|
|
42
42
|
}
|
|
43
43
|
/** Configuration passed to {@link createConfig}. */
|
|
44
44
|
export interface IConfig {
|
|
45
|
-
/** Your Blux app id, from the Blux dashboard. Required for email/passkey/social login. */
|
|
45
|
+
/** Your Blux app id, from the Blux dashboard. Required for email/SMS/passkey/social login. */
|
|
46
46
|
appId: string;
|
|
47
47
|
/** Display name of your app, shown in wallet prompts and UI. */
|
|
48
48
|
appName: string;
|
|
@@ -56,11 +56,11 @@ export interface IConfig {
|
|
|
56
56
|
lang?: LanguageKey;
|
|
57
57
|
/** Block explorer used for links. Defaults to `'stellarchain'`. */
|
|
58
58
|
explorer?: IExplorer;
|
|
59
|
-
/** Persist the session across reloads. Defaults to `false
|
|
59
|
+
/** Persist the session across page reloads. Defaults to `false` and should remain `false` in most scenarios. */
|
|
60
60
|
isPersistent?: boolean;
|
|
61
61
|
/** Show Blux's built-in signing/approval UIs. When `false`, signing happens headlessly. Defaults to `true`. */
|
|
62
62
|
showWalletUIs?: boolean;
|
|
63
|
-
/** Login methods to offer. Defaults to `['wallet']`. */
|
|
63
|
+
/** Login methods to offer. Defaults to `['wallet']`. `'sms'` is shown only when `/auth/validate` reports a paid plan. */
|
|
64
64
|
loginMethods?: Array<ILoginMethods[number] | LooseString>;
|
|
65
65
|
/** Custom Horizon/Soroban endpoints per network; required for custom networks. */
|
|
66
66
|
transports?: ITransports;
|
|
@@ -267,5 +267,9 @@ export interface AuthenticateApiResponse {
|
|
|
267
267
|
terms: string;
|
|
268
268
|
socials: string[];
|
|
269
269
|
socialsConfig: ISocialConfigEntry[];
|
|
270
|
+
/** Entitled billing plan of the account that owns this app. */
|
|
271
|
+
plan: string;
|
|
272
|
+
/** True when the account is on a paid plan and may offer SMS login. */
|
|
273
|
+
smsEnabled: boolean;
|
|
270
274
|
}
|
|
271
275
|
export {};
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ type ApiPasskeyChallenge = {
|
|
|
9
9
|
export declare const authenticateAppId: (appId: string) => Promise<AuthenticateApiResponse>;
|
|
10
10
|
export declare const apiPasskeyChallenge: (appId: string, authValue: string) => Promise<ApiPasskeyChallenge>;
|
|
11
11
|
export declare const apiPasskeyVerify: (appId: string, challenge: ApiPasskeyChallenge, passkeyResult: PasskeyFlowResult) => Promise<string>;
|
|
12
|
-
export declare const apiSendOtp: (appId: string, authValue: string) => Promise<boolean>;
|
|
12
|
+
export declare const apiSendOtp: (appId: string, authValue: string, authMethod?: "email" | "sms") => Promise<boolean>;
|
|
13
13
|
type ApiWalletChallenge = {
|
|
14
14
|
challenge_xdr?: string;
|
|
15
15
|
challenge?: string;
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Asset, Horizon } from '@stellar/stellar-sdk';
|
|
|
2
2
|
import translations from '../constants/locales';
|
|
3
3
|
import { Route, SupportedWallet } from '../enums';
|
|
4
4
|
import { IAsset, IWallet, IExplorer, LanguageKey, ITransports, IWalletNames, ILoginMethods } from '../types';
|
|
5
|
-
import { INetworkTransports } from '../constants/networkDetails';
|
|
6
5
|
export declare const bufferToBase64Url: (buf: ArrayBuffer) => string;
|
|
7
6
|
export declare const base64UrlToBuffer: (value: string) => ArrayBuffer;
|
|
8
7
|
export declare const getAssetTitle: (asset: Horizon.HorizonApi.BalanceLineNative | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum4"> | Horizon.HorizonApi.BalanceLineAsset<"credit_alphanum12"> | Horizon.HorizonApi.BalanceLineLiquidityPool) => string;
|
|
@@ -34,7 +33,7 @@ export declare const getExplorerUrl: (networkPassphrase: string, explorerProvide
|
|
|
34
33
|
export declare const getMappedWallets: (walletNames: IWalletNames) => Promise<IWallet[]>;
|
|
35
34
|
export declare const getRecentConnectionMethod: () => SupportedWallet[];
|
|
36
35
|
export declare const getNetworkByPassphrase: (passphrase: string) => string;
|
|
37
|
-
export
|
|
36
|
+
export { getNetworkRpc } from './networkRpc';
|
|
38
37
|
export declare const canonicalWalletName: (name: string) => string;
|
|
39
38
|
export declare const loginMethodsIncludeWallet: (loginMethods: ILoginMethods | string[] | undefined) => boolean;
|
|
40
39
|
export declare const getSortedCheckedWallets: (wallets: IWallet[], priorityNames?: string[]) => IWallet[];
|
|
@@ -55,3 +54,4 @@ export declare const getNetworkNamesFromPassphrase: (userNetworks: string[]) =>
|
|
|
55
54
|
export declare const validateOrderWallets: (orderWallets: string[] | undefined) => string[];
|
|
56
55
|
export declare const validateNetworkOptions: (networks: string[], defaultNetwork: string | undefined, transports: ITransports | undefined) => void;
|
|
57
56
|
export declare const validateInput: (type: string, value: string) => boolean;
|
|
57
|
+
export declare const isUSCanadaPhone: (raw: string) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITransports } from '../types';
|
|
2
|
+
import { INetworkTransports } from '../constants/networkDetails';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves Horizon and Soroban URLs for a passphrase, overlaying any custom
|
|
5
|
+
* transports from config.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getNetworkRpc: (network: string, transports: ITransports) => INetworkTransports;
|