@flarenetwork/multichain-wallet-connector 0.0.2-rc.0 → 0.0.2-rc.2
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/core/index.d.mts +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{multichain-XmuZ2Pmn.mjs → multichain-BZs-jPka.mjs} +56 -5
- package/dist/multichain-BZs-jPka.mjs.map +1 -0
- package/dist/react/index.d.mts +2 -2
- package/dist/react/index.mjs +2 -2
- package/dist/{use-wallets-Bw9IJp2u.mjs → use-wallets-B_18Wf48.mjs} +2 -2
- package/dist/{use-wallets-Bw9IJp2u.mjs.map → use-wallets-B_18Wf48.mjs.map} +1 -1
- package/dist/{use-wallets-d1_T3J-7.d.mts → use-wallets-BihNE6q5.d.mts} +2 -2
- package/dist/{use-wallets-d1_T3J-7.d.mts.map → use-wallets-BihNE6q5.d.mts.map} +1 -1
- package/dist/{utils-vepLPJH6.d.mts → utils-CMINfXL2.d.mts} +12 -1
- package/dist/{utils-vepLPJH6.d.mts.map → utils-CMINfXL2.d.mts.map} +1 -1
- package/package.json +4 -5
- package/dist/multichain-XmuZ2Pmn.mjs.map +0 -1
package/dist/core/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as LedgerConnectOptions, B as ErrorEvent, C as LedgerSession, D as ChainClient, E as EvmClient, F as ChainChangedEvent, G as ResolvedWalletConfig, H as MetaMaskWalletOptions, I as ChainOverride, J as WalletOptions, K as WalletConnectWalletOptions, L as ConnectEvent, M as LedgerPaginatedBip44, N as Bip44, O as LedgerCaip2, P as AccountChangedEvent, R as DcentWalletOptions, S as ConnectorTypeMap, T as XrpClient, U as MultiChainEvents, V as LedgerWalletOptions, W as MultiChainOptions, X as WalletAddressState, Y as XamanWalletOptions, Z as WalletState, _ as ConfigResolver, a as shortenAddress, at as EvmChain, c as WalletConnectError, ct as XrplChain, d as DcentError, et as WalletType, f as WalletError, g as MultiChain, h as ChainGuards, i as objectValues, it as Eip155Caip2, j as LedgerHDStandard, k as LedgerComputedAddress, l as MetaMaskError, m as ErrorCodeKey, n as objectFromEntries, nt as Caip2, o as WalletErrorHelper, ot as NonEvmChain, p as ErrorCode, q as WalletMetadata, r as objectKeys, rt as Chain, s as XamanError, st as XRPlCaip2, t as objectEntries, tt as BaseChain, u as LedgerError, w as DcentConnector, x as Connector, z as DisconnectEvent } from "../utils-
|
|
1
|
+
import { A as LedgerConnectOptions, B as ErrorEvent, C as LedgerSession, D as ChainClient, E as EvmClient, F as ChainChangedEvent, G as ResolvedWalletConfig, H as MetaMaskWalletOptions, I as ChainOverride, J as WalletOptions, K as WalletConnectWalletOptions, L as ConnectEvent, M as LedgerPaginatedBip44, N as Bip44, O as LedgerCaip2, P as AccountChangedEvent, R as DcentWalletOptions, S as ConnectorTypeMap, T as XrpClient, U as MultiChainEvents, V as LedgerWalletOptions, W as MultiChainOptions, X as WalletAddressState, Y as XamanWalletOptions, Z as WalletState, _ as ConfigResolver, a as shortenAddress, at as EvmChain, c as WalletConnectError, ct as XrplChain, d as DcentError, et as WalletType, f as WalletError, g as MultiChain, h as ChainGuards, i as objectValues, it as Eip155Caip2, j as LedgerHDStandard, k as LedgerComputedAddress, l as MetaMaskError, m as ErrorCodeKey, n as objectFromEntries, nt as Caip2, o as WalletErrorHelper, ot as NonEvmChain, p as ErrorCode, q as WalletMetadata, r as objectKeys, rt as Chain, s as XamanError, st as XRPlCaip2, t as objectEntries, tt as BaseChain, u as LedgerError, w as DcentConnector, x as Connector, z as DisconnectEvent } from "../utils-CMINfXL2.mjs";
|
|
2
2
|
export { type AccountChangedEvent, type BaseChain, Bip44, type Caip2, type Chain, type ChainChangedEvent, type ChainClient, ChainGuards, type ChainOverride, ConfigResolver, type ConnectEvent, type Connector, type ConnectorTypeMap, DcentConnector, DcentError, type DcentWalletOptions, type DisconnectEvent, type Eip155Caip2, ErrorCode, type ErrorCodeKey, type ErrorEvent, type EvmChain, EvmClient, type LedgerCaip2, type LedgerComputedAddress, type LedgerConnectOptions, LedgerError, type LedgerHDStandard, type LedgerPaginatedBip44, type LedgerSession, type LedgerWalletOptions, MetaMaskError, type MetaMaskWalletOptions, MultiChain, type MultiChainEvents, type MultiChainOptions, type NonEvmChain, type ResolvedWalletConfig, type WalletAddressState, WalletConnectError, type WalletConnectWalletOptions, WalletError, WalletErrorHelper, type WalletMetadata, type WalletOptions, type WalletState, type WalletType, type XRPlCaip2, XamanError, type XamanWalletOptions, type XrpClient, type XrplChain, objectEntries, objectFromEntries, objectKeys, objectValues, shortenAddress };
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as objectFromEntries, a as WalletErrorHelper, b as shortenAddress, c as MetaMaskError, d as WalletError, f as ErrorCode, g as objectEntries, h as ChainGuards, i as DcentConnector, l as LedgerError, n as EvmClient, o as XamanError, p as ConfigResolver, r as Bip44, s as WalletConnectError, t as MultiChain, u as DcentError, v as objectKeys, y as objectValues } from "../multichain-
|
|
1
|
+
import { _ as objectFromEntries, a as WalletErrorHelper, b as shortenAddress, c as MetaMaskError, d as WalletError, f as ErrorCode, g as objectEntries, h as ChainGuards, i as DcentConnector, l as LedgerError, n as EvmClient, o as XamanError, p as ConfigResolver, r as Bip44, s as WalletConnectError, t as MultiChain, u as DcentError, v as objectKeys, y as objectValues } from "../multichain-BZs-jPka.mjs";
|
|
2
2
|
|
|
3
3
|
export { Bip44, ChainGuards, ConfigResolver, DcentConnector, DcentError, ErrorCode, EvmClient, LedgerError, MetaMaskError, MultiChain, WalletConnectError, WalletError, WalletErrorHelper, XamanError, objectEntries, objectFromEntries, objectKeys, objectValues, shortenAddress };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as LedgerConnectOptions, B as ErrorEvent, C as LedgerSession, D as ChainClient, E as EvmClient, F as ChainChangedEvent, G as ResolvedWalletConfig, H as MetaMaskWalletOptions, I as ChainOverride, J as WalletOptions, K as WalletConnectWalletOptions, L as ConnectEvent, M as LedgerPaginatedBip44, N as Bip44, O as LedgerCaip2, P as AccountChangedEvent, R as DcentWalletOptions, S as ConnectorTypeMap, T as XrpClient, U as MultiChainEvents, V as LedgerWalletOptions, W as MultiChainOptions, X as WalletAddressState, Y as XamanWalletOptions, Z as WalletState, _ as ConfigResolver, a as shortenAddress, at as EvmChain, b as ConnectWalletArgs, c as WalletConnectError, ct as XrplChain, d as DcentError, et as WalletType, f as WalletError, g as MultiChain, h as ChainGuards, i as objectValues, it as Eip155Caip2, j as LedgerHDStandard, k as LedgerComputedAddress, l as MetaMaskError, m as ErrorCodeKey, n as objectFromEntries, nt as Caip2, o as WalletErrorHelper, ot as NonEvmChain, p as ErrorCode, q as WalletMetadata, r as objectKeys, rt as Chain, s as XamanError, st as XRPlCaip2, t as objectEntries, tt as BaseChain, u as LedgerError, w as DcentConnector, x as Connector, z as DisconnectEvent } from "./utils-
|
|
2
|
-
import { C as UseChainOptions, D as useChainSupport, E as useChain, O as MultichainProvider, S as UseChainNotFound, T as UseXrpChainReturn, _ as LedgerSelectionState, a as useWalletSupport, b as useLedgerSelection, c as MultichainSelectionConfig, d as UseMultichainSelectionReturn, f as WalletsConfig, g as LedgerSelectionActions, h as useMultichainEvents, i as WalletInfo, l as MultichainSelectionMode, m as useMultichain, n as UseWalletReturn, o as MultichainSelectionProvider, p as UseMultichainReturn, r as useWallet, s as useMultichainSelection, t as useWallets, u as SelectionWallet, v as UseLedgerSelectionOptions, w as UseEvmChainReturn, x as UseChainFound, y as UseLedgerSelectionReturn } from "./use-wallets-
|
|
1
|
+
import { A as LedgerConnectOptions, B as ErrorEvent, C as LedgerSession, D as ChainClient, E as EvmClient, F as ChainChangedEvent, G as ResolvedWalletConfig, H as MetaMaskWalletOptions, I as ChainOverride, J as WalletOptions, K as WalletConnectWalletOptions, L as ConnectEvent, M as LedgerPaginatedBip44, N as Bip44, O as LedgerCaip2, P as AccountChangedEvent, R as DcentWalletOptions, S as ConnectorTypeMap, T as XrpClient, U as MultiChainEvents, V as LedgerWalletOptions, W as MultiChainOptions, X as WalletAddressState, Y as XamanWalletOptions, Z as WalletState, _ as ConfigResolver, a as shortenAddress, at as EvmChain, b as ConnectWalletArgs, c as WalletConnectError, ct as XrplChain, d as DcentError, et as WalletType, f as WalletError, g as MultiChain, h as ChainGuards, i as objectValues, it as Eip155Caip2, j as LedgerHDStandard, k as LedgerComputedAddress, l as MetaMaskError, m as ErrorCodeKey, n as objectFromEntries, nt as Caip2, o as WalletErrorHelper, ot as NonEvmChain, p as ErrorCode, q as WalletMetadata, r as objectKeys, rt as Chain, s as XamanError, st as XRPlCaip2, t as objectEntries, tt as BaseChain, u as LedgerError, w as DcentConnector, x as Connector, z as DisconnectEvent } from "./utils-CMINfXL2.mjs";
|
|
2
|
+
import { C as UseChainOptions, D as useChainSupport, E as useChain, O as MultichainProvider, S as UseChainNotFound, T as UseXrpChainReturn, _ as LedgerSelectionState, a as useWalletSupport, b as useLedgerSelection, c as MultichainSelectionConfig, d as UseMultichainSelectionReturn, f as WalletsConfig, g as LedgerSelectionActions, h as useMultichainEvents, i as WalletInfo, l as MultichainSelectionMode, m as useMultichain, n as UseWalletReturn, o as MultichainSelectionProvider, p as UseMultichainReturn, r as useWallet, s as useMultichainSelection, t as useWallets, u as SelectionWallet, v as UseLedgerSelectionOptions, w as UseEvmChainReturn, x as UseChainFound, y as UseLedgerSelectionReturn } from "./use-wallets-BihNE6q5.mjs";
|
|
3
3
|
export { AccountChangedEvent, BaseChain, Bip44, Caip2, Chain, ChainChangedEvent, ChainClient, ChainGuards, ChainOverride, ConfigResolver, ConnectEvent, ConnectWalletArgs, Connector, ConnectorTypeMap, DcentConnector, DcentError, DcentWalletOptions, DisconnectEvent, Eip155Caip2, ErrorCode, ErrorCodeKey, ErrorEvent, EvmChain, EvmClient, LedgerCaip2, LedgerComputedAddress, LedgerConnectOptions, LedgerError, LedgerHDStandard, LedgerPaginatedBip44, LedgerSelectionActions, LedgerSelectionState, LedgerSession, LedgerWalletOptions, MetaMaskError, MetaMaskWalletOptions, MultiChain, MultiChainEvents, MultiChainOptions, MultichainProvider, MultichainSelectionConfig, MultichainSelectionMode, MultichainSelectionProvider, NonEvmChain, ResolvedWalletConfig, SelectionWallet, UseChainFound, UseChainNotFound, UseChainOptions, UseEvmChainReturn, UseLedgerSelectionOptions, UseLedgerSelectionReturn, UseMultichainReturn, UseMultichainSelectionReturn, UseWalletReturn, UseXrpChainReturn, WalletAddressState, WalletConnectError, WalletConnectWalletOptions, WalletError, WalletErrorHelper, WalletInfo, WalletMetadata, WalletOptions, WalletState, WalletType, WalletsConfig, XRPlCaip2, XamanError, XamanWalletOptions, XrpClient, XrplChain, objectEntries, objectFromEntries, objectKeys, objectValues, shortenAddress, useChain, useChainSupport, useLedgerSelection, useMultichain, useMultichainEvents, useMultichainSelection, useWallet, useWalletSupport, useWallets };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as objectFromEntries, a as WalletErrorHelper, b as shortenAddress, c as MetaMaskError, d as WalletError, f as ErrorCode, g as objectEntries, h as ChainGuards, i as DcentConnector, l as LedgerError, n as EvmClient, o as XamanError, p as ConfigResolver, r as Bip44, s as WalletConnectError, t as MultiChain, u as DcentError, v as objectKeys, y as objectValues } from "./multichain-
|
|
2
|
-
import { a as MultichainSelectionProvider, c as useLedgerSelection, d as MultichainProvider, i as useMultichainSelection, l as useChain, n as useWallet, o as useMultichain, r as useWalletSupport, s as useMultichainEvents, t as useWallets, u as useChainSupport } from "./use-wallets-
|
|
1
|
+
import { _ as objectFromEntries, a as WalletErrorHelper, b as shortenAddress, c as MetaMaskError, d as WalletError, f as ErrorCode, g as objectEntries, h as ChainGuards, i as DcentConnector, l as LedgerError, n as EvmClient, o as XamanError, p as ConfigResolver, r as Bip44, s as WalletConnectError, t as MultiChain, u as DcentError, v as objectKeys, y as objectValues } from "./multichain-BZs-jPka.mjs";
|
|
2
|
+
import { a as MultichainSelectionProvider, c as useLedgerSelection, d as MultichainProvider, i as useMultichainSelection, l as useChain, n as useWallet, o as useMultichain, r as useWalletSupport, s as useMultichainEvents, t as useWallets, u as useChainSupport } from "./use-wallets-B_18Wf48.mjs";
|
|
3
3
|
import "./react/index.mjs";
|
|
4
4
|
|
|
5
5
|
export { Bip44, ChainGuards, ConfigResolver, DcentConnector, DcentError, ErrorCode, EvmClient, LedgerError, MetaMaskError, MultiChain, MultichainProvider, MultichainSelectionProvider, WalletConnectError, WalletError, WalletErrorHelper, XamanError, objectEntries, objectFromEntries, objectKeys, objectValues, shortenAddress, useChain, useChainSupport, useLedgerSelection, useMultichain, useMultichainEvents, useMultichainSelection, useWallet, useWalletSupport, useWallets };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createPublicClient, createWalletClient, custom, defineChain, getAddress, getTypesForEIP712Domain, hashDomain, hashStruct, http, serializeSignature, serializeTransaction } from "viem";
|
|
2
2
|
import { flare, flareTestnet, mainnet, sepolia, songbird } from "viem/chains";
|
|
3
3
|
import { DisconnectedDevice, DisconnectedDeviceDuringOperation, LockedDeviceError, TransportInterfaceNotAvailable, TransportOpenUserCancelled, UserRefusedOnDevice } from "@ledgerhq/errors";
|
|
4
|
-
import { Client, RippledError, encode } from "xrpl";
|
|
4
|
+
import { Client, RippledError, encode, parseAccountRootFlags } from "xrpl";
|
|
5
5
|
import Eth from "@ledgerhq/hw-app-eth";
|
|
6
6
|
import * as secp256k1 from "@noble/secp256k1";
|
|
7
7
|
import { publicKeyToAddress, toAccount } from "viem/accounts";
|
|
@@ -802,6 +802,20 @@ var BaseXrplClient = class extends Client {
|
|
|
802
802
|
async ensureConnected() {
|
|
803
803
|
if (!this.isConnected()) await this.connect();
|
|
804
804
|
}
|
|
805
|
+
async requiresDestinationTag(address) {
|
|
806
|
+
await this.ensureConnected();
|
|
807
|
+
return parseAccountRootFlags((await this.request({
|
|
808
|
+
command: "account_info",
|
|
809
|
+
account: address
|
|
810
|
+
})).result.account_data.Flags).lsfRequireDestTag ?? false;
|
|
811
|
+
}
|
|
812
|
+
async isDepositAuthEnabled(address) {
|
|
813
|
+
await this.ensureConnected();
|
|
814
|
+
return parseAccountRootFlags((await this.request({
|
|
815
|
+
command: "account_info",
|
|
816
|
+
account: address
|
|
817
|
+
})).result.account_data.Flags).lsfDepositAuth ?? false;
|
|
818
|
+
}
|
|
805
819
|
async getBalance(address) {
|
|
806
820
|
try {
|
|
807
821
|
await this.ensureConnected();
|
|
@@ -850,8 +864,17 @@ var DcentXrpClient = class {
|
|
|
850
864
|
return result.tx_hash;
|
|
851
865
|
}
|
|
852
866
|
async getBalance(address) {
|
|
867
|
+
return (await this.getSimpleClient()).getBalance(address);
|
|
868
|
+
}
|
|
869
|
+
async requiresDestinationTag(address) {
|
|
870
|
+
return (await this.getSimpleClient()).requiresDestinationTag(address);
|
|
871
|
+
}
|
|
872
|
+
async isDepositAuthEnabled(address) {
|
|
873
|
+
return (await this.getSimpleClient()).isDepositAuthEnabled(address);
|
|
874
|
+
}
|
|
875
|
+
async getSimpleClient() {
|
|
853
876
|
const caip2 = await this.getCaip2();
|
|
854
|
-
return new XrplClient(this.resolvedConfig.getXrplChain(caip2))
|
|
877
|
+
return new XrplClient(this.resolvedConfig.getXrplChain(caip2));
|
|
855
878
|
}
|
|
856
879
|
async getCaip2() {
|
|
857
880
|
return (await this.provider.getWalletInfo()).chainId;
|
|
@@ -2115,18 +2138,40 @@ var WalletConnectXrpClient = class extends XrplClient {
|
|
|
2115
2138
|
try {
|
|
2116
2139
|
const prepared = await this.autofill(tx);
|
|
2117
2140
|
const xrpCaip2 = await this.getCaip2();
|
|
2118
|
-
const
|
|
2141
|
+
const result = await this.provider.request({
|
|
2119
2142
|
method: "xrpl_signTransaction",
|
|
2120
2143
|
params: {
|
|
2121
2144
|
tx_json: prepared,
|
|
2122
2145
|
submit: false
|
|
2123
2146
|
}
|
|
2124
|
-
}, xrpCaip2)
|
|
2147
|
+
}, xrpCaip2);
|
|
2148
|
+
const signedTx = this.sanitizeTx(result.tx_json);
|
|
2125
2149
|
return (await this.submitAndWait(signedTx)).result.hash;
|
|
2126
2150
|
} finally {
|
|
2127
2151
|
await this.disconnect();
|
|
2128
2152
|
}
|
|
2129
2153
|
}
|
|
2154
|
+
sanitizeTx(walletResult) {
|
|
2155
|
+
if (this.isGirin(walletResult)) return stripEmptyObjects({
|
|
2156
|
+
TransactionType: walletResult.TransactionType,
|
|
2157
|
+
Account: walletResult.Account,
|
|
2158
|
+
Fee: walletResult.Fee,
|
|
2159
|
+
Sequence: walletResult.Sequence,
|
|
2160
|
+
SigningPubKey: walletResult.SigningPubKey,
|
|
2161
|
+
TxnSignature: walletResult.TxnSignature,
|
|
2162
|
+
Flags: walletResult.Flags,
|
|
2163
|
+
LastLedgerSequence: walletResult.LastLedgerSequence,
|
|
2164
|
+
Destination: walletResult.Destination,
|
|
2165
|
+
Amount: walletResult.Amount,
|
|
2166
|
+
DestinationTag: walletResult.DestinationTag,
|
|
2167
|
+
Memos: walletResult.Memos,
|
|
2168
|
+
SourceTag: walletResult.SourceTag
|
|
2169
|
+
});
|
|
2170
|
+
return walletResult;
|
|
2171
|
+
}
|
|
2172
|
+
isGirin(walletResult) {
|
|
2173
|
+
return (this.provider.session?.peer.metadata.name ?? "unknown").toLowerCase().includes("girin");
|
|
2174
|
+
}
|
|
2130
2175
|
};
|
|
2131
2176
|
|
|
2132
2177
|
//#endregion
|
|
@@ -2479,6 +2524,12 @@ var XamanClient = class XamanClient extends Xumm {
|
|
|
2479
2524
|
async getBalance(address) {
|
|
2480
2525
|
return (await this.getSimpleClient()).getBalance(address);
|
|
2481
2526
|
}
|
|
2527
|
+
async requiresDestinationTag(address) {
|
|
2528
|
+
return (await this.getSimpleClient()).requiresDestinationTag(address);
|
|
2529
|
+
}
|
|
2530
|
+
async isDepositAuthEnabled(address) {
|
|
2531
|
+
return (await this.getSimpleClient()).isDepositAuthEnabled(address);
|
|
2532
|
+
}
|
|
2482
2533
|
async getSimpleClient() {
|
|
2483
2534
|
const caip2 = await this.getCaip2();
|
|
2484
2535
|
return new XrplClient(this.resolvedConfig.getXrplChain(caip2));
|
|
@@ -2866,4 +2917,4 @@ var MultiChain = class {
|
|
|
2866
2917
|
|
|
2867
2918
|
//#endregion
|
|
2868
2919
|
export { objectFromEntries as _, WalletErrorHelper as a, shortenAddress as b, MetaMaskError as c, WalletError as d, ErrorCode as f, objectEntries as g, ChainGuards as h, DcentConnector as i, LedgerError as l, evmCaip2s as m, EvmClient as n, XamanError as o, ConfigResolver as p, Bip44 as r, WalletConnectError as s, MultiChain as t, DcentError as u, objectKeys as v, objectValues as y };
|
|
2869
|
-
//# sourceMappingURL=multichain-
|
|
2920
|
+
//# sourceMappingURL=multichain-BZs-jPka.mjs.map
|