@avalabs/core-wallets-sdk 3.1.0-canary.a0ef572.0 → 3.1.0-canary.a1461ba.0
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 +1 -1
- package/dist/index.d.ts +90 -11
- package/esm/Avalanche/index.d.ts +1 -1
- package/esm/Avalanche/index.js +1 -1
- package/esm/Avalanche/models.d.ts +35 -3
- package/esm/Avalanche/models.js +1 -1
- package/esm/Avalanche/providers/JsonRpcProvider.d.ts +3 -3
- package/esm/Avalanche/providers/JsonRpcProvider.js +1 -1
- package/esm/Avalanche/utils/appendAutoRenewedValidatorConfigAddressMaps.js +1 -0
- package/esm/Avalanche/utils/createAvalancheUnsignedTx.js +1 -1
- package/esm/Avalanche/utils/parseAvalancheTx.js +1 -1
- package/esm/Avalanche/utils/parsers/index.js +1 -1
- package/esm/Avalanche/utils/parsers/parseAddAutoRenewedValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseRewardAutoRenewedValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseSetAutoRenewedValidatorConfigTx.js +1 -0
- package/esm/Avalanche/wallets/SimpleSigner.js +1 -1
- package/esm/Avalanche/wallets/TxBuilderTypes.d.ts +29 -1
- package/esm/Avalanche/wallets/WalletAbstract.d.ts +3 -1
- package/esm/Avalanche/wallets/WalletAbstract.js +1 -1
- package/esm/Avalanche/wallets/legacy/MnemonicWallet.js +1 -1
- package/esm/BitcoinVM/index.js +1 -1
- package/esm/SolanaVM/utils/maybeGetAssociatedTokenAccount.d.ts +6 -3
- package/esm/SolanaVM/utils/maybeGetAssociatedTokenAccount.js +1 -1
- package/esm/SolanaVM/utils/resolveTokenProgramForMint.d.ts +13 -0
- package/esm/SolanaVM/utils/resolveTokenProgramForMint.js +1 -0
- package/esm/SolanaVM/utils/transferToken.js +1 -1
- package/esm/SolanaVM/wallets/SolanaLedgerSigner.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -1
- package/esm/utils/getAddressDerivationPath.js +1 -1
- package/package.json +4 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { Address } from '@solana/kit';
|
|
2
3
|
import { SolanaProvider } from './solanaProvider.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -9,14 +10,16 @@ import { SolanaProvider } from './solanaProvider.js';
|
|
|
9
10
|
* @param mint - The mint address of the token.
|
|
10
11
|
* @param owner - The public key of the wallet owner.
|
|
11
12
|
* @param provider - An instance of SolanaProvider to interact with the Solana blockchain.
|
|
13
|
+
* @param tokenProgram - SPL Token program id for this mint (legacy or Token-2022). If omitted, it is resolved via RPC.
|
|
12
14
|
* @returns { ataAddress: string; exists: boolean; info: SolanaAccountInfo } - The ATA address, a boolean indicating if it exists, and the account info if it does.
|
|
13
15
|
*/
|
|
14
|
-
declare const maybeGetAssociatedTokenAccount: ({ mint, owner, provider, }: {
|
|
16
|
+
declare const maybeGetAssociatedTokenAccount: ({ mint, owner, provider, tokenProgram: tokenProgramOverride, }: {
|
|
15
17
|
mint: string;
|
|
16
18
|
owner: string;
|
|
17
19
|
provider: SolanaProvider;
|
|
20
|
+
tokenProgram?: Address<string> | undefined;
|
|
18
21
|
}) => Promise<{
|
|
19
|
-
address:
|
|
22
|
+
address: Address<string>;
|
|
20
23
|
exists: boolean;
|
|
21
24
|
info: Readonly<{
|
|
22
25
|
context: Readonly<{
|
|
@@ -25,7 +28,7 @@ declare const maybeGetAssociatedTokenAccount: ({ mint, owner, provider, }: {
|
|
|
25
28
|
value: (Readonly<{
|
|
26
29
|
executable: boolean;
|
|
27
30
|
lamports: _solana_kit.Lamports;
|
|
28
|
-
owner:
|
|
31
|
+
owner: Address<string>;
|
|
29
32
|
rentEpoch: bigint;
|
|
30
33
|
space: bigint;
|
|
31
34
|
}> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findAssociatedTokenPda as o
|
|
1
|
+
import{findAssociatedTokenPda as o}from"@solana-program/token";import{address as r}from"@solana/kit";import{resolveTokenProgramForMint as n}from"./resolveTokenProgramForMint.js";const t=async({mint:t,owner:e,provider:a,tokenProgram:i})=>{const m=i??await n({mint:t,provider:a}),[s]=await o({mint:r(t),owner:r(e),tokenProgram:m}),p=await a.getAccountInfo(s,{encoding:"base64"}).send();return{address:s,exists:Boolean(p.value),info:p}};export{t as maybeGetAssociatedTokenAccount};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Address } from '@solana/kit';
|
|
2
|
+
import { SolanaProvider } from './solanaProvider.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Loads the mint account and returns the SPL Token program that owns it
|
|
6
|
+
* (legacy Tokenkeg... or Token-2022 TokenzQd...).
|
|
7
|
+
*/
|
|
8
|
+
declare const resolveTokenProgramForMint: ({ mint, provider, }: {
|
|
9
|
+
mint: string;
|
|
10
|
+
provider: SolanaProvider;
|
|
11
|
+
}) => Promise<Address>;
|
|
12
|
+
|
|
13
|
+
export { resolveTokenProgramForMint };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{address as o}from"@solana/kit";import{TOKEN_PROGRAM_ADDRESS as r}from"@solana-program/token";import{TOKEN_2022_PROGRAM_ADDRESS as n}from"@solana-program/token-2022";const t=(o,r)=>String(o)===String(r),e=async({mint:e,provider:i})=>{const a=o(e),{value:m}=await i.getAccountInfo(a,{encoding:"base64"}).send();if(!m)throw new Error(`Mint account not found: ${e}`);const p=m.owner;if(t(p,r))return r;if(t(p,n))return n;throw new Error(`Unsupported token program for mint ${e}: ${String(p)}`)};export{e as resolveTokenProgramForMint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{address as t,createNoopSigner as o,pipe as
|
|
1
|
+
import{address as t,createNoopSigner as o,pipe as r,createTransactionMessage as e,setTransactionMessageLifetimeUsingBlockhash as a,setTransactionMessageFeePayer as n,appendTransactionMessageInstructions as i}from"@solana/kit";import{getCreateAssociatedTokenIdempotentInstruction as s,getTransferCheckedInstruction as m}from"@solana-program/token";import{getCreateAssociatedTokenIdempotentInstruction as c,TOKEN_2022_PROGRAM_ADDRESS as d,getTransferCheckedInstruction as p}from"@solana-program/token-2022";import{maybeGetAssociatedTokenAccount as u}from"./maybeGetAssociatedTokenAccount.js";import{resolveTokenProgramForMint as g}from"./resolveTokenProgramForMint.js";const k=async({from:k,to:l,mint:w,amount:f,decimals:h,provider:v})=>{const y=await g({mint:w,provider:v}),P=String(y)===String(d);const{address:T}=await u({mint:w,owner:k,provider:v,tokenProgram:y}),{address:A,exists:I}=await u({mint:w,owner:l,provider:v,tokenProgram:y}),j=[];I||j.push(P?c({payer:o(t(k)),mint:t(w),owner:t(l),ata:A,tokenProgram:d}):s({payer:o(t(k)),mint:t(w),owner:t(l),ata:A})),j.push(P?p({amount:f,authority:o(t(k)),decimals:h,mint:t(w),destination:A,source:T}):m({amount:f,authority:o(t(k)),decimals:h,mint:t(w),destination:A,source:T}));const{value:x}=await v.getLatestBlockhash().send();return r(e({version:0}),(t=>a(x,t)),(o=>n(t(k),o)),(t=>i(j,t)))};export{k as transferToken};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{base58 as r}from"@scure/base";import t from"@ledgerhq/hw-app-solana";import{compileTransaction as a,address as s,assertIsSignature as i,getBase64EncodedWireTransaction as e}from"@solana/kit";import{deserializeTransactionMessage as o}from"../utils/deserializeSolanaTx.js";import"@solana-program/system";import"@solana-program/token";import{getSolanaDerivationPath as n}from"../utils/derivationPath.js";class m{#r;#t;constructor(r,t){this.#r=n(r,!1),this.#t=t}async signTx(n,m){const
|
|
1
|
+
import{base58 as r}from"@scure/base";import t from"@ledgerhq/hw-app-solana";import{compileTransaction as a,address as s,assertIsSignature as i,getBase64EncodedWireTransaction as e}from"@solana/kit";import{deserializeTransactionMessage as o}from"../utils/deserializeSolanaTx.js";import"@solana-program/system";import"@solana-program/token";import"@solana-program/token-2022";import{getSolanaDerivationPath as n}from"../utils/derivationPath.js";class m{#r;#t;constructor(r,t){this.#r=n(r,!1),this.#t=t}async signTx(n,m){const p=await o(n,m),{signatures:d,messageBytes:u,...g}=a(p),h=new t(this.#t),{address:c}=await h.getAddress(this.#r),f=s(r.encode(Uint8Array.from(c)));if(!this.#a(f,d))return n;const{signature:l}=await h.signTransaction(this.#r,Buffer.from(u)),y=r.encode(Uint8Array.from(l));return i(y),e({...g,messageBytes:u,signatures:{...d,[f]:r.decode(y)}})}#a(r,t){return r in t&&!t[r]}}export{m as SolanaLedgerSigner};
|
package/esm/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export { transferToken } from './SolanaVM/utils/transferToken.js';
|
|
|
32
32
|
export { getSolanaDerivationPath } from './SolanaVM/utils/derivationPath.js';
|
|
33
33
|
export { getSolanaPublicKeyFromLedger } from './SolanaVM/utils/getSolanaPublicKeyFromLedger.js';
|
|
34
34
|
export { maybeGetAssociatedTokenAccount } from './SolanaVM/utils/maybeGetAssociatedTokenAccount.js';
|
|
35
|
+
export { resolveTokenProgramForMint } from './SolanaVM/utils/resolveTokenProgramForMint.js';
|
|
35
36
|
export { SolanaSigner } from './SolanaVM/wallets/SolanaSigner.js';
|
|
36
37
|
export { SolanaLedgerSigner } from './SolanaVM/wallets/SolanaLedgerSigner.js';
|
|
37
38
|
export { BitcoinHistoryTx, BitcoinInputUTXO, BitcoinInputUTXOWithOptionalScript, BitcoinLedgerInputUTXO, BitcoinOutputUTXO, BitcoinTx } from './BitcoinVM/models.js';
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BtcNetworks}from"./BitcoinVM/index.js";export{getAppEth}from"./EVM/utils/getAppEth.js";export{getVoidSigner}from"./EVM/utils/getVoidSigner.js";export{getWalletFromMnemonic}from"./EVM/utils/getWalletFromMnemonic.js";export{isERC20Transfer,isNativeTxn,onBalanceChange}from"./EVM/utils/blockPolling.js";export{JsonRpcBatchInternal}from"./EVM/utils/jsonRpcBatchProvider.js";export{getAddressPrivateKeyFromXPriv}from"./EVM/utils/getAddressPrivateKeyFromXPriv.js";export{getAddressPublicKeyFromXPub}from"./EVM/utils/getAddressPublicKeyFromXPub.js";export{getAddressFromXPub}from"./EVM/utils/getAddressFromXPub.js";export{getXpubFromMnemonic}from"./EVM/utils/getXpubFromMnemonic.js";export{getEvmAddressFromPubKey}from"./EVM/utils/getEvmAddressFromPubKey.js";export{getBtcAddressFromPubKey}from"./EVM/utils/getBtcAddressFromPubKey.js";export{getEVMDerivationPath}from"./EVM/utils/getEvmDerivationPath.js";export{DerivationPath,ETH_ACCOUNT_PATH,ETH_COIN_PATH}from"./EVM/constants.js";export{LedgerSigner}from"./EVM/LedgerSigner.js";import*as e from"./Avalanche/index.js";export{e as Avalanche};export{getAddressDerivationPath}from"./utils/getAddressDerivationPath.js";export{getPublicKeyFromPrivateKey}from"./utils/getPublicKeyFromPrivateKey.js";export{getPubKeyFromTransport}from"./utils/getPubKeyFromTransport.js";export{getLedgerExtendedPublicKey}from"./utils/getLedgerExtendedPublicKey.js";export{omitUndefinedKeys}from"./utils/omitUndefinedKeys.js";export{getLedgerAppInfo}from"./utils/getLedgerAppInfo.js";export{openLedgerApp}from"./utils/openLedgerApp.js";export{quitLedgerApp}from"./utils/quitLedgerApp.js";export{compileSolanaTx}from"./SolanaVM/utils/compileSolanaTx.js";export{deserializeTransactionMessage}from"./SolanaVM/utils/deserializeSolanaTx.js";export{serializeSolanaTx}from"./SolanaVM/utils/serializeSolanaTx.js";export{getSolanaProvider,isSolanaProvider}from"./SolanaVM/utils/solanaProvider.js";export{transferSol}from"./SolanaVM/utils/transferSol.js";export{transferToken}from"./SolanaVM/utils/transferToken.js";export{getSolanaDerivationPath}from"./SolanaVM/utils/derivationPath.js";export{getSolanaPublicKeyFromLedger}from"./SolanaVM/utils/getSolanaPublicKeyFromLedger.js";export{maybeGetAssociatedTokenAccount}from"./SolanaVM/utils/maybeGetAssociatedTokenAccount.js";export{SolanaSigner}from"./SolanaVM/wallets/SolanaSigner.js";export{SolanaLedgerSigner}from"./SolanaVM/wallets/SolanaLedgerSigner.js";export{BitcoinProviderAbstract}from"./BitcoinVM/providers/BitcoinProviderAbstract.js";export{BitcoinProvider}from"./BitcoinVM/providers/BitcoinProvider.js";export{addEncodedSigToPsbt}from"./BitcoinVM/utils/addEncodedSigToPsbt.js";export{createPsbt}from"./BitcoinVM/utils/createPsbt.js";export{createTransferTx}from"./BitcoinVM/utils/createTransferTx.js";export{formatAddressForNetworkBech32}from"./BitcoinVM/utils/formatAddressForNetworkBech32.js";export{getBech32Address}from"./BitcoinVM/utils/getBech32Address.js";export{getBech32AddressFromXPub}from"./BitcoinVM/utils/getBech32AddressFromXPub.js";export{getMaxTransferAmount}from"./BitcoinVM/utils/getMaxTransferAmount.js";export{selectUtxos}from"./BitcoinVM/utils/selectUtxos.js";export{createWalletPolicy}from"./BitcoinVM/utils/createWalletPolicy.js";export{createPSBTV2}from"./BitcoinVM/utils/createPSBTV2.js";export{psbt2ToPsbt0}from"./BitcoinVM/utils/psbt2ToPsbt0.js";export{getTransferTxDetails}from"./BitcoinVM/utils/getTransferTxDetails.js";export{BitcoinWalletAbstract}from"./BitcoinVM/wallets/BitcoinWalletAbstract.js";export{BitcoinWallet}from"./BitcoinVM/wallets/BitcoinWallet.js";export{BitcoinLedgerWallet}from"./BitcoinVM/wallets/BitcoinWalletLedger.js";export{BitcoinWalletVoid}from"./BitcoinVM/wallets/BitcoinWalletVoid.js";
|
|
1
|
+
export{BtcNetworks}from"./BitcoinVM/index.js";export{getAppEth}from"./EVM/utils/getAppEth.js";export{getVoidSigner}from"./EVM/utils/getVoidSigner.js";export{getWalletFromMnemonic}from"./EVM/utils/getWalletFromMnemonic.js";export{isERC20Transfer,isNativeTxn,onBalanceChange}from"./EVM/utils/blockPolling.js";export{JsonRpcBatchInternal}from"./EVM/utils/jsonRpcBatchProvider.js";export{getAddressPrivateKeyFromXPriv}from"./EVM/utils/getAddressPrivateKeyFromXPriv.js";export{getAddressPublicKeyFromXPub}from"./EVM/utils/getAddressPublicKeyFromXPub.js";export{getAddressFromXPub}from"./EVM/utils/getAddressFromXPub.js";export{getXpubFromMnemonic}from"./EVM/utils/getXpubFromMnemonic.js";export{getEvmAddressFromPubKey}from"./EVM/utils/getEvmAddressFromPubKey.js";export{getBtcAddressFromPubKey}from"./EVM/utils/getBtcAddressFromPubKey.js";export{getEVMDerivationPath}from"./EVM/utils/getEvmDerivationPath.js";export{DerivationPath,ETH_ACCOUNT_PATH,ETH_COIN_PATH}from"./EVM/constants.js";export{LedgerSigner}from"./EVM/LedgerSigner.js";import*as e from"./Avalanche/index.js";export{e as Avalanche};export{getAddressDerivationPath}from"./utils/getAddressDerivationPath.js";export{getPublicKeyFromPrivateKey}from"./utils/getPublicKeyFromPrivateKey.js";export{getPubKeyFromTransport}from"./utils/getPubKeyFromTransport.js";export{getLedgerExtendedPublicKey}from"./utils/getLedgerExtendedPublicKey.js";export{omitUndefinedKeys}from"./utils/omitUndefinedKeys.js";export{getLedgerAppInfo}from"./utils/getLedgerAppInfo.js";export{openLedgerApp}from"./utils/openLedgerApp.js";export{quitLedgerApp}from"./utils/quitLedgerApp.js";export{compileSolanaTx}from"./SolanaVM/utils/compileSolanaTx.js";export{deserializeTransactionMessage}from"./SolanaVM/utils/deserializeSolanaTx.js";export{serializeSolanaTx}from"./SolanaVM/utils/serializeSolanaTx.js";export{getSolanaProvider,isSolanaProvider}from"./SolanaVM/utils/solanaProvider.js";export{transferSol}from"./SolanaVM/utils/transferSol.js";export{transferToken}from"./SolanaVM/utils/transferToken.js";export{getSolanaDerivationPath}from"./SolanaVM/utils/derivationPath.js";export{getSolanaPublicKeyFromLedger}from"./SolanaVM/utils/getSolanaPublicKeyFromLedger.js";export{maybeGetAssociatedTokenAccount}from"./SolanaVM/utils/maybeGetAssociatedTokenAccount.js";export{resolveTokenProgramForMint}from"./SolanaVM/utils/resolveTokenProgramForMint.js";export{SolanaSigner}from"./SolanaVM/wallets/SolanaSigner.js";export{SolanaLedgerSigner}from"./SolanaVM/wallets/SolanaLedgerSigner.js";export{BitcoinProviderAbstract}from"./BitcoinVM/providers/BitcoinProviderAbstract.js";export{BitcoinProvider}from"./BitcoinVM/providers/BitcoinProvider.js";export{addEncodedSigToPsbt}from"./BitcoinVM/utils/addEncodedSigToPsbt.js";export{createPsbt}from"./BitcoinVM/utils/createPsbt.js";export{createTransferTx}from"./BitcoinVM/utils/createTransferTx.js";export{formatAddressForNetworkBech32}from"./BitcoinVM/utils/formatAddressForNetworkBech32.js";export{getBech32Address}from"./BitcoinVM/utils/getBech32Address.js";export{getBech32AddressFromXPub}from"./BitcoinVM/utils/getBech32AddressFromXPub.js";export{getMaxTransferAmount}from"./BitcoinVM/utils/getMaxTransferAmount.js";export{selectUtxos}from"./BitcoinVM/utils/selectUtxos.js";export{createWalletPolicy}from"./BitcoinVM/utils/createWalletPolicy.js";export{createPSBTV2}from"./BitcoinVM/utils/createPSBTV2.js";export{psbt2ToPsbt0}from"./BitcoinVM/utils/psbt2ToPsbt0.js";export{getTransferTxDetails}from"./BitcoinVM/utils/getTransferTxDetails.js";export{BitcoinWalletAbstract}from"./BitcoinVM/wallets/BitcoinWalletAbstract.js";export{BitcoinWallet}from"./BitcoinVM/wallets/BitcoinWallet.js";export{BitcoinLedgerWallet}from"./BitcoinVM/wallets/BitcoinWalletLedger.js";export{BitcoinWalletVoid}from"./BitcoinVM/wallets/BitcoinWalletVoid.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"@ledgerhq/hw-app-eth";import"ethers";import{getEVMDerivationPath as a}from"../EVM/utils/getEvmDerivationPath.js";import"bip32";import"bip39";import"bitcoinjs-lib";import"@avalabs/core-utils-sdk";import"@ledgerhq/hw-transport";import"@metamask/eth-sig-util";import"../Avalanche/wallets/WalletAbstract.js";import"../Avalanche/utils/addSignaturesToAvalancheTx.js";import"../Avalanche/utils/convertGlacierUtxo.js";import"../Avalanche/utils/createAvalancheEvmUnsignedTx.js";import"../Avalanche/utils/createAvalancheUnsignedTx.js";import"create-hash";import"@avalabs/avalanchejs";import"../Avalanche/utils/getAssetBalance.js";import"../Avalanche/utils/getUtxosByTxFromGlacier.js";import"../Avalanche/utils/parseAvalancheTx.js";import"../Avalanche/utils/populateCredential.js";import"../Avalanche/utils/txSizeLimits.js";import"bip32-path";import{getAvalancheDerivationPath as t}from"../Avalanche/utils/getAvalancheDerivationPath.js";import"@avalabs/hw-app-avalanche";import"../Avalanche/wallets/legacy/MnemonicWalletVoid.js";import"../Avalanche/wallets/legacy/LedgerWallet.js";import"../Avalanche/wallets/legacy/MnemonicWallet.js";import"../Avalanche/wallets/StaticSigner.js";import"@solana/kit";import"@solana-program/system";import"@solana-program/token";import{getSolanaDerivationPath as e}from"../SolanaVM/utils/derivationPath.js";import"@ledgerhq/hw-app-solana";import"@noble/curves/ed25519";import"@scure/base";import"micro-key-producer/slip10.js";import"hdkey";import"../Avalanche/wallets/ledger/LedgerSigner.js";import"../Avalanche/wallets/ledger/SimpleLedgerSigner.js";import"../Avalanche/providers/AbstractProvider.js";import"../Avalanche/providers/constants.js";import"@avalabs/core-chains-sdk";function r(r,i,o={withRoot:!0}){if(r<0)throw new Error("Account index can not be less than 0.");switch(i){case"EVM":if(!o.pathSpec)throw new Error("Path spec is required for EVM: either BIP44 or Ledger Live");return a(r,o.pathSpec,o.withRoot);case"AVM":case"PVM":return t(r,o.withRoot);case"SVM":return e(r,o.withRoot);default:throw new Error(`Unknown derivation path for VM: ${i}`)}}export{r as getAddressDerivationPath};
|
|
1
|
+
import"@ledgerhq/hw-app-eth";import"ethers";import{getEVMDerivationPath as a}from"../EVM/utils/getEvmDerivationPath.js";import"bip32";import"bip39";import"bitcoinjs-lib";import"@avalabs/core-utils-sdk";import"@ledgerhq/hw-transport";import"@metamask/eth-sig-util";import"../Avalanche/wallets/WalletAbstract.js";import"../Avalanche/utils/addSignaturesToAvalancheTx.js";import"../Avalanche/utils/convertGlacierUtxo.js";import"../Avalanche/utils/createAvalancheEvmUnsignedTx.js";import"../Avalanche/utils/createAvalancheUnsignedTx.js";import"create-hash";import"@avalabs/avalanchejs";import"../Avalanche/utils/getAssetBalance.js";import"../Avalanche/utils/getUtxosByTxFromGlacier.js";import"../Avalanche/utils/parseAvalancheTx.js";import"../Avalanche/utils/populateCredential.js";import"../Avalanche/utils/txSizeLimits.js";import"bip32-path";import{getAvalancheDerivationPath as t}from"../Avalanche/utils/getAvalancheDerivationPath.js";import"@avalabs/hw-app-avalanche";import"../Avalanche/wallets/legacy/MnemonicWalletVoid.js";import"../Avalanche/wallets/legacy/LedgerWallet.js";import"../Avalanche/wallets/legacy/MnemonicWallet.js";import"../Avalanche/wallets/StaticSigner.js";import"@solana/kit";import"@solana-program/system";import"@solana-program/token";import"@solana-program/token-2022";import{getSolanaDerivationPath as e}from"../SolanaVM/utils/derivationPath.js";import"@ledgerhq/hw-app-solana";import"@noble/curves/ed25519";import"@scure/base";import"micro-key-producer/slip10.js";import"hdkey";import"../Avalanche/wallets/ledger/LedgerSigner.js";import"../Avalanche/wallets/ledger/SimpleLedgerSigner.js";import"../Avalanche/providers/AbstractProvider.js";import"../Avalanche/providers/constants.js";import"@avalabs/core-chains-sdk";function r(r,i,o={withRoot:!0}){if(r<0)throw new Error("Account index can not be less than 0.");switch(i){case"EVM":if(!o.pathSpec)throw new Error("Path spec is required for EVM: either BIP44 or Ledger Live");return a(r,o.pathSpec,o.withRoot);case"AVM":case"PVM":return t(r,o.withRoot);case"SVM":return e(r,o.withRoot);default:throw new Error(`Unknown derivation path for VM: ${i}`)}}export{r as getAddressDerivationPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/core-wallets-sdk",
|
|
3
|
-
"version": "3.1.0-canary.
|
|
3
|
+
"version": "3.1.0-canary.a1461ba.0+a1461ba",
|
|
4
4
|
"license": "Limited Ecosystem License",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ts-jest": "29.1.2"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@avalabs/avalanchejs": "5.1.0-
|
|
42
|
+
"@avalabs/avalanchejs": "5.1.0-canary.5",
|
|
43
43
|
"@avalabs/core-chains-sdk": "3.1.0-alpha.61",
|
|
44
44
|
"@avalabs/core-utils-sdk": "3.1.0-alpha.61",
|
|
45
45
|
"@avalabs/glacier-sdk": "3.1.0-alpha.61",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@scure/base": "1.2.4",
|
|
55
55
|
"@solana-program/system": "0.7.0",
|
|
56
56
|
"@solana-program/token": "0.5.1",
|
|
57
|
+
"@solana-program/token-2022": "0.4.2",
|
|
57
58
|
"@solana/kit": "2.1.0",
|
|
58
59
|
"bip174": "2.1.1",
|
|
59
60
|
"bip32": "2.0.6",
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"peerDependencies": {
|
|
71
72
|
"ethers": "^6.7.1"
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "a1461ba0d5c7fe3b635a6808c6162c25872df673"
|
|
74
75
|
}
|