@sodax/wallet-sdk-core 1.2.7-beta → 1.3.1-beta-rc1
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/index.cjs +10217 -626
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.mjs +10196 -608
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Chain, PublicClient, WalletClient, Transport, Account, Hash as Hash$1, Address } from 'viem';
|
|
3
|
-
import { ChainId, IEvmWalletProvider, EvmRawTransaction, EvmRawTransactionReceipt, ISuiWalletProvider, SuiTransaction, SuiExecutionResult, SuiPaginatedCoins, IIconWalletProvider, IcxCallTransaction, IconTransactionResult, IInjectiveWalletProvider, JsonObject, InjectiveRawTransaction, InjectiveEoaAddress, InjectiveCoin, InjectiveExecuteResponse, ISolanaWalletProvider, SolanaRpcResponseAndContext, SolanaSignatureResult, TransactionSignature, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaBase58PublicKey, Hex as Hex$1, XDR, IStellarWalletProvider, StellarRawTransactionReceipt } from '@sodax/types';
|
|
3
|
+
import { ChainId, IEvmWalletProvider, EvmRawTransaction, EvmRawTransactionReceipt, ISuiWalletProvider, SuiTransaction, SuiExecutionResult, SuiPaginatedCoins, IIconWalletProvider, IcxCallTransaction, IconTransactionResult, IInjectiveWalletProvider, JsonObject, InjectiveRawTransaction, InjectiveEoaAddress, InjectiveCoin, InjectiveExecuteResponse, ISolanaWalletProvider, SolanaRpcResponseAndContext, SolanaSignatureResult, TransactionSignature, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaBase58PublicKey, Hex as Hex$1, XDR, IStellarWalletProvider, StellarRawTransactionReceipt, INearWalletProvider, CallContractParams, NearRawTransaction } from '@sodax/types';
|
|
4
4
|
import { SuiClient } from '@mysten/sui/client';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
6
6
|
import { Transaction } from '@mysten/sui/transactions';
|
|
@@ -13,6 +13,8 @@ import { ChainId as ChainId$1, EvmChainId } from '@injectivelabs/ts-types';
|
|
|
13
13
|
import { PublicKey, Connection, Commitment, RpcResponseAndContext, TokenAmount } from '@solana/web3.js';
|
|
14
14
|
import { SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
|
|
15
15
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
16
|
+
import { Account as Account$1, JsonRpcProvider } from 'near-api-js';
|
|
17
|
+
import { NearConnector } from '@hot-labs/near-connect';
|
|
16
18
|
|
|
17
19
|
declare const hyper: {
|
|
18
20
|
blockExplorers: {
|
|
@@ -241,7 +243,7 @@ type PrivateKeySolanaWalletConfig = {
|
|
|
241
243
|
};
|
|
242
244
|
type BrowserExtensionSolanaWalletConfig = {
|
|
243
245
|
wallet: WalletContextState;
|
|
244
|
-
|
|
246
|
+
endpoint: string;
|
|
245
247
|
};
|
|
246
248
|
type SolanaWalletConfig = PrivateKeySolanaWalletConfig | BrowserExtensionSolanaWalletConfig;
|
|
247
249
|
declare class SolanaWalletProvider implements ISolanaWalletProvider {
|
|
@@ -341,4 +343,36 @@ declare class StellarWalletProvider implements IStellarWalletProvider {
|
|
|
341
343
|
waitForTransactionReceipt(txHash: string): Promise<StellarRawTransactionReceipt>;
|
|
342
344
|
}
|
|
343
345
|
|
|
344
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Near Wallet Configuration Types
|
|
348
|
+
*/
|
|
349
|
+
type PrivateKeyNearWalletConfig = {
|
|
350
|
+
rpcUrl: string;
|
|
351
|
+
accountId: string;
|
|
352
|
+
privateKey: string;
|
|
353
|
+
};
|
|
354
|
+
type BrowserExtensionNearWalletConfig = {
|
|
355
|
+
wallet: NearConnector;
|
|
356
|
+
};
|
|
357
|
+
type NearWalletConfig = PrivateKeyNearWalletConfig | BrowserExtensionNearWalletConfig;
|
|
358
|
+
/**
|
|
359
|
+
* Near Type Guards
|
|
360
|
+
*/
|
|
361
|
+
declare function isPrivateKeyNearWalletConfig(config: NearWalletConfig): config is PrivateKeyNearWalletConfig;
|
|
362
|
+
declare function isBrowserExtensionNearWalletConfig(config: NearWalletConfig): config is BrowserExtensionNearWalletConfig;
|
|
363
|
+
/**
|
|
364
|
+
* NearWalletProvider implements INearWalletProvider
|
|
365
|
+
* Supports both private key and browser extension wallet configurations
|
|
366
|
+
*/
|
|
367
|
+
declare class NearWalletProvider implements INearWalletProvider {
|
|
368
|
+
readonly account?: Account$1;
|
|
369
|
+
readonly rpcProvider?: JsonRpcProvider;
|
|
370
|
+
private readonly wallet?;
|
|
371
|
+
constructor(config: NearWalletConfig);
|
|
372
|
+
getWalletAddress(): Promise<string>;
|
|
373
|
+
getWalletAddressBytes(): Promise<Hex$1>;
|
|
374
|
+
getRawTransaction(params: CallContractParams): Promise<NearRawTransaction>;
|
|
375
|
+
signAndSubmitTxn(transaction: NearRawTransaction): Promise<string>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export { BigNumberToBigInt, type BrowserExtensionEvmWalletConfig, type BrowserExtensionIconWalletConfig, type BrowserExtensionInjectiveWalletConfig, type BrowserExtensionNearWalletConfig, type BrowserExtensionSolanaWalletConfig, type BrowserExtensionStellarWalletConfig, type BrowserExtensionSuiWallet, type BrowserExtensionSuiWalletConfig, type EvmWalletConfig, EvmWalletProvider, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type Hash, type Hex, type IconAddress, type IconBrowserExtensionWallet, type IconEoaAddress, type IconJsonRpcVersion, type IconPkWallet, type IconWallet, type IconWalletConfig, IconWalletProvider, type InjectiveWallet, type InjectiveWalletConfig, InjectiveWalletProvider, type JsonRpcPayloadResponse, type NearWalletConfig, NearWalletProvider, type PkSuiWallet, type PrivateKeyEvmWalletConfig, type PrivateKeyIconWalletConfig, type PrivateKeyNearWalletConfig, type PrivateKeySolanaWalletConfig, type PrivateKeyStellarWalletConfig, type PrivateKeySuiWalletConfig, type RelayRequestDetail, type RelayRequestSigning, type ResponseAddressType, type ResponseSigningType, type SecretInjectiveWalletConfig, type SolanaWalletConfig, SolanaWalletProvider, type StellarAddress, type StellarBrowserExtensionWallet, type StellarNetwork, type StellarPkWallet, type StellarWallet, type StellarWalletConfig, StellarWalletError, StellarWalletProvider, type SuiWallet, type SuiWalletConfig, SuiWalletProvider, getEvmViemChain, hyper, isBrowserExtensionEvmWalletConfig, isBrowserExtensionIconWalletConfig, isBrowserExtensionInjectiveWalletConfig, isBrowserExtensionNearWalletConfig, isBrowserExtensionStellarWalletConfig, isBrowserExtensionSuiWallet, isIconAddress, isIconBrowserExtensionWallet, isIconEoaAddress, isIconPkWallet, isJsonRpcPayloadResponse, isPkSuiWallet, isPrivateKeyEvmWalletConfig, isPrivateKeyIconWalletConfig, isPrivateKeyNearWalletConfig, isPrivateKeyStellarWalletConfig, isResponseAddressType, isResponseSigningType, isSecretInjectiveWalletConfig, isStellarBrowserExtensionWallet, isStellarPkWallet, isSuiWallet, isValidStellarNetwork, isValidStellarPrivateKey, requestAddress, requestJsonRpc, requestSigning };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Chain, PublicClient, WalletClient, Transport, Account, Hash as Hash$1, Address } from 'viem';
|
|
3
|
-
import { ChainId, IEvmWalletProvider, EvmRawTransaction, EvmRawTransactionReceipt, ISuiWalletProvider, SuiTransaction, SuiExecutionResult, SuiPaginatedCoins, IIconWalletProvider, IcxCallTransaction, IconTransactionResult, IInjectiveWalletProvider, JsonObject, InjectiveRawTransaction, InjectiveEoaAddress, InjectiveCoin, InjectiveExecuteResponse, ISolanaWalletProvider, SolanaRpcResponseAndContext, SolanaSignatureResult, TransactionSignature, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaBase58PublicKey, Hex as Hex$1, XDR, IStellarWalletProvider, StellarRawTransactionReceipt } from '@sodax/types';
|
|
3
|
+
import { ChainId, IEvmWalletProvider, EvmRawTransaction, EvmRawTransactionReceipt, ISuiWalletProvider, SuiTransaction, SuiExecutionResult, SuiPaginatedCoins, IIconWalletProvider, IcxCallTransaction, IconTransactionResult, IInjectiveWalletProvider, JsonObject, InjectiveRawTransaction, InjectiveEoaAddress, InjectiveCoin, InjectiveExecuteResponse, ISolanaWalletProvider, SolanaRpcResponseAndContext, SolanaSignatureResult, TransactionSignature, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaBase58PublicKey, Hex as Hex$1, XDR, IStellarWalletProvider, StellarRawTransactionReceipt, INearWalletProvider, CallContractParams, NearRawTransaction } from '@sodax/types';
|
|
4
4
|
import { SuiClient } from '@mysten/sui/client';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
6
6
|
import { Transaction } from '@mysten/sui/transactions';
|
|
@@ -13,6 +13,8 @@ import { ChainId as ChainId$1, EvmChainId } from '@injectivelabs/ts-types';
|
|
|
13
13
|
import { PublicKey, Connection, Commitment, RpcResponseAndContext, TokenAmount } from '@solana/web3.js';
|
|
14
14
|
import { SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
|
|
15
15
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
16
|
+
import { Account as Account$1, JsonRpcProvider } from 'near-api-js';
|
|
17
|
+
import { NearConnector } from '@hot-labs/near-connect';
|
|
16
18
|
|
|
17
19
|
declare const hyper: {
|
|
18
20
|
blockExplorers: {
|
|
@@ -241,7 +243,7 @@ type PrivateKeySolanaWalletConfig = {
|
|
|
241
243
|
};
|
|
242
244
|
type BrowserExtensionSolanaWalletConfig = {
|
|
243
245
|
wallet: WalletContextState;
|
|
244
|
-
|
|
246
|
+
endpoint: string;
|
|
245
247
|
};
|
|
246
248
|
type SolanaWalletConfig = PrivateKeySolanaWalletConfig | BrowserExtensionSolanaWalletConfig;
|
|
247
249
|
declare class SolanaWalletProvider implements ISolanaWalletProvider {
|
|
@@ -341,4 +343,36 @@ declare class StellarWalletProvider implements IStellarWalletProvider {
|
|
|
341
343
|
waitForTransactionReceipt(txHash: string): Promise<StellarRawTransactionReceipt>;
|
|
342
344
|
}
|
|
343
345
|
|
|
344
|
-
|
|
346
|
+
/**
|
|
347
|
+
* Near Wallet Configuration Types
|
|
348
|
+
*/
|
|
349
|
+
type PrivateKeyNearWalletConfig = {
|
|
350
|
+
rpcUrl: string;
|
|
351
|
+
accountId: string;
|
|
352
|
+
privateKey: string;
|
|
353
|
+
};
|
|
354
|
+
type BrowserExtensionNearWalletConfig = {
|
|
355
|
+
wallet: NearConnector;
|
|
356
|
+
};
|
|
357
|
+
type NearWalletConfig = PrivateKeyNearWalletConfig | BrowserExtensionNearWalletConfig;
|
|
358
|
+
/**
|
|
359
|
+
* Near Type Guards
|
|
360
|
+
*/
|
|
361
|
+
declare function isPrivateKeyNearWalletConfig(config: NearWalletConfig): config is PrivateKeyNearWalletConfig;
|
|
362
|
+
declare function isBrowserExtensionNearWalletConfig(config: NearWalletConfig): config is BrowserExtensionNearWalletConfig;
|
|
363
|
+
/**
|
|
364
|
+
* NearWalletProvider implements INearWalletProvider
|
|
365
|
+
* Supports both private key and browser extension wallet configurations
|
|
366
|
+
*/
|
|
367
|
+
declare class NearWalletProvider implements INearWalletProvider {
|
|
368
|
+
readonly account?: Account$1;
|
|
369
|
+
readonly rpcProvider?: JsonRpcProvider;
|
|
370
|
+
private readonly wallet?;
|
|
371
|
+
constructor(config: NearWalletConfig);
|
|
372
|
+
getWalletAddress(): Promise<string>;
|
|
373
|
+
getWalletAddressBytes(): Promise<Hex$1>;
|
|
374
|
+
getRawTransaction(params: CallContractParams): Promise<NearRawTransaction>;
|
|
375
|
+
signAndSubmitTxn(transaction: NearRawTransaction): Promise<string>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export { BigNumberToBigInt, type BrowserExtensionEvmWalletConfig, type BrowserExtensionIconWalletConfig, type BrowserExtensionInjectiveWalletConfig, type BrowserExtensionNearWalletConfig, type BrowserExtensionSolanaWalletConfig, type BrowserExtensionStellarWalletConfig, type BrowserExtensionSuiWallet, type BrowserExtensionSuiWalletConfig, type EvmWalletConfig, EvmWalletProvider, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type Hash, type Hex, type IconAddress, type IconBrowserExtensionWallet, type IconEoaAddress, type IconJsonRpcVersion, type IconPkWallet, type IconWallet, type IconWalletConfig, IconWalletProvider, type InjectiveWallet, type InjectiveWalletConfig, InjectiveWalletProvider, type JsonRpcPayloadResponse, type NearWalletConfig, NearWalletProvider, type PkSuiWallet, type PrivateKeyEvmWalletConfig, type PrivateKeyIconWalletConfig, type PrivateKeyNearWalletConfig, type PrivateKeySolanaWalletConfig, type PrivateKeyStellarWalletConfig, type PrivateKeySuiWalletConfig, type RelayRequestDetail, type RelayRequestSigning, type ResponseAddressType, type ResponseSigningType, type SecretInjectiveWalletConfig, type SolanaWalletConfig, SolanaWalletProvider, type StellarAddress, type StellarBrowserExtensionWallet, type StellarNetwork, type StellarPkWallet, type StellarWallet, type StellarWalletConfig, StellarWalletError, StellarWalletProvider, type SuiWallet, type SuiWalletConfig, SuiWalletProvider, getEvmViemChain, hyper, isBrowserExtensionEvmWalletConfig, isBrowserExtensionIconWalletConfig, isBrowserExtensionInjectiveWalletConfig, isBrowserExtensionNearWalletConfig, isBrowserExtensionStellarWalletConfig, isBrowserExtensionSuiWallet, isIconAddress, isIconBrowserExtensionWallet, isIconEoaAddress, isIconPkWallet, isJsonRpcPayloadResponse, isPkSuiWallet, isPrivateKeyEvmWalletConfig, isPrivateKeyIconWalletConfig, isPrivateKeyNearWalletConfig, isPrivateKeyStellarWalletConfig, isResponseAddressType, isResponseSigningType, isSecretInjectiveWalletConfig, isStellarBrowserExtensionWallet, isStellarPkWallet, isSuiWallet, isValidStellarNetwork, isValidStellarPrivateKey, requestAddress, requestJsonRpc, requestSigning };
|