@avalabs/core-wallets-sdk 3.1.0-alpha.6 → 3.1.0-alpha.60
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 -0
- package/dist/index.d.ts +379 -158
- package/esm/Avalanche/index.d.ts +3 -4
- package/esm/Avalanche/index.js +1 -1
- package/esm/Avalanche/models.d.ts +47 -6
- package/esm/Avalanche/models.js +1 -1
- package/esm/Avalanche/providers/AbstractProvider.d.ts +2 -1
- package/esm/Avalanche/providers/AbstractProvider.js +1 -1
- package/esm/Avalanche/providers/JsonRpcProvider.d.ts +1 -0
- package/esm/Avalanche/providers/JsonRpcProvider.js +1 -1
- package/esm/Avalanche/providers/constants.d.ts +2 -1
- package/esm/Avalanche/providers/constants.js +1 -1
- package/esm/Avalanche/providers/platformFeeConfig.js +1 -0
- package/esm/Avalanche/utils/addSignaturesToAvalancheTx.js +1 -1
- package/esm/Avalanche/utils/appendDisableAuthAddressMaps.js +1 -0
- package/esm/Avalanche/utils/convertGlacierUtxo.d.ts +5 -4
- package/esm/Avalanche/utils/convertGlacierUtxo.js +1 -1
- package/esm/Avalanche/utils/createAvalancheEvmUnsignedTx.d.ts +3 -2
- package/esm/Avalanche/utils/createAvalancheEvmUnsignedTx.js +1 -1
- package/esm/Avalanche/utils/createAvalancheUnsignedTx.d.ts +1 -1
- package/esm/Avalanche/utils/createAvalancheUnsignedTx.js +1 -1
- package/esm/Avalanche/utils/getAssetBalance.d.ts +2 -1
- package/esm/Avalanche/utils/getAssetBalance.js +1 -1
- package/esm/Avalanche/utils/getChainAliasByChainId.js +1 -1
- package/esm/Avalanche/utils/getPchainUnixNow.js +1 -1
- package/esm/Avalanche/utils/getStakedAssetBalance.d.ts +2 -1
- package/esm/Avalanche/utils/getTxOutputAddresses.js +1 -1
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.d.ts +5 -2
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.js +1 -1
- package/esm/Avalanche/utils/handleSubnetAuth.js +1 -1
- package/esm/Avalanche/utils/orderBy.js +1 -0
- package/esm/Avalanche/utils/parseAvalancheTx.d.ts +12 -1
- package/esm/Avalanche/utils/parseAvalancheTx.js +1 -1
- package/esm/Avalanche/utils/parsers/index.js +1 -1
- package/esm/Avalanche/utils/parsers/parseAddPermissionlessDelegatorTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseAddPermissionlessValidatorTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseAddSubnetValidorTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseBaseTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseConvertSubnetToL1Tx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseCreateChainTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseCreateSubnetTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseDisableL1ValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseExportTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseImportTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseIncreaseL1ValidatorBalanceTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseRegisterL1ValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseRemoveSubnetValidatorTx.js +1 -1
- package/esm/Avalanche/utils/parsers/parseSetL1ValidatorWeightTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseTransferSubnetOwnershipTx.js +1 -1
- package/esm/Avalanche/utils/parsers/utils/chainIdToVm.js +1 -1
- package/esm/Avalanche/utils/populateCredential.js +1 -1
- package/esm/Avalanche/utils/sortUTXOs.d.ts +6 -4
- package/esm/Avalanche/utils/sortUTXOs.js +1 -1
- package/esm/Avalanche/utils/txSizeLimits.d.ts +10 -3
- package/esm/Avalanche/utils/txSizeLimits.js +1 -1
- package/esm/Avalanche/wallets/AddressWallet.js +1 -1
- package/esm/Avalanche/wallets/SimpleSigner.js +1 -1
- package/esm/Avalanche/wallets/StaticSigner.js +1 -1
- package/esm/Avalanche/wallets/TxBuilderTypes.d.ts +179 -0
- package/esm/Avalanche/wallets/WalletAbstract.d.ts +21 -22
- package/esm/Avalanche/wallets/WalletAbstract.js +1 -1
- package/esm/Avalanche/wallets/WalletVoid.js +1 -1
- package/esm/Avalanche/wallets/ledger/LedgerSigner.js +1 -1
- package/esm/Avalanche/wallets/ledger/SimpleLedgerSigner.js +1 -1
- package/esm/Avalanche/wallets/ledger/models.d.ts +1 -1
- package/esm/Avalanche/wallets/legacy/LedgerWallet.js +1 -1
- package/esm/Avalanche/wallets/legacy/MnemonicWallet.js +1 -1
- package/esm/Avalanche/wallets/legacy/MnemonicWalletVoid.js +1 -1
- package/esm/Avalanche/wallets/models.d.ts +1 -1
- package/esm/BitcoinVM/index.d.ts +5 -0
- package/esm/BitcoinVM/index.js +1 -0
- package/esm/BitcoinVM/models.d.ts +1 -1
- package/esm/BitcoinVM/providers/BitcoinProvider.d.ts +4 -3
- package/esm/BitcoinVM/providers/BitcoinProvider.js +1 -1
- package/esm/BitcoinVM/providers/BitcoinProviderAbstract.d.ts +1 -0
- package/esm/BitcoinVM/utils/getBech32AddressFromXPub.js +1 -1
- package/esm/BitcoinVM/wallets/BitcoinWallet.js +1 -1
- package/esm/BitcoinVM/wallets/BitcoinWalletLedger.js +1 -1
- package/esm/BitcoinVM/wallets/models.d.ts +1 -1
- package/esm/EVM/LedgerSigner.js +1 -1
- package/esm/EVM/utils/blockPolling.js +1 -1
- package/esm/EVM/utils/getWalletFromMnemonic.js +1 -1
- package/esm/SolanaVM/utils/compileSolanaTx.d.ts +9 -0
- package/esm/SolanaVM/utils/compileSolanaTx.js +1 -0
- package/esm/SolanaVM/utils/derivationPath.d.ts +3 -0
- package/esm/SolanaVM/utils/derivationPath.js +1 -0
- package/esm/SolanaVM/utils/deserializeSolanaTx.d.ts +6 -0
- package/esm/SolanaVM/utils/deserializeSolanaTx.js +1 -0
- package/esm/SolanaVM/utils/getSolanaPublicKeyFromLedger.d.ts +5 -0
- package/esm/SolanaVM/utils/getSolanaPublicKeyFromLedger.js +1 -0
- package/esm/SolanaVM/utils/serializeSolanaTx.d.ts +6 -0
- package/esm/SolanaVM/utils/serializeSolanaTx.js +1 -0
- package/esm/SolanaVM/utils/solanaProvider.d.ts +11 -0
- package/esm/SolanaVM/utils/solanaProvider.js +1 -0
- package/esm/SolanaVM/utils/transferSol.d.ts +14 -0
- package/esm/SolanaVM/utils/transferSol.js +1 -0
- package/esm/SolanaVM/utils/transferToken.d.ts +17 -0
- package/esm/SolanaVM/utils/transferToken.js +1 -0
- package/esm/SolanaVM/wallets/SolanaLedgerSigner.d.ts +10 -0
- package/esm/SolanaVM/wallets/SolanaLedgerSigner.js +1 -0
- package/esm/SolanaVM/wallets/SolanaSigner.d.ts +20 -0
- package/esm/SolanaVM/wallets/SolanaSigner.js +1 -0
- package/esm/abis/erc20.abi.js +1 -0
- package/esm/index.d.ts +30 -20
- package/esm/index.js +1 -1
- package/esm/utils/assertFeeStateProvided.js +1 -0
- package/esm/utils/getAddressDerivationPath.d.ts +4 -1
- package/esm/utils/getAddressDerivationPath.js +1 -1
- package/package.json +26 -9
- package/dist/index.js +0 -1
- package/esm/Avalanche/utils/getUtxoInfo.d.ts +0 -13
- package/esm/Avalanche/utils/getUtxoInfo.js +0 -1
- package/esm/Avalanche/utils/parsers/parseAddDelegatorTx.js +0 -1
- package/esm/Avalanche/utils/parsers/parseAddValidatorTx.js +0 -1
- package/esm/Avalanche/utils/parsers/parseTransformSubnetTx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BitcoinProviderAbstract as t}from"./BitcoinProviderAbstract.js";import{networks as e}from"bitcoinjs-lib";import{HttpClient as a}from"@avalabs/core-utils-sdk";import{URL_EXPLORER_MAINNET as s,URL_EXPLORER_TESTNET as r,URL_NODE_MAINNET as i,URL_NODE_TESTNET as n}from"./models.js";import{parseAddressFullTx as o}from"./utils/parseAddressFullTx.js";class l extends t{constructor(t=!0,e,o,l,c){super(),this.isMainnet=t,this.extraParams=c;const m=e?{headers:{"api-key":e}}:{},p=t?s:r;this.#t=new a(o||p,m);const
|
|
1
|
+
import{BitcoinProviderAbstract as t}from"./BitcoinProviderAbstract.js";import{networks as e}from"bitcoinjs-lib";import{HttpClient as a}from"@avalabs/core-utils-sdk";import{URL_EXPLORER_MAINNET as s,URL_EXPLORER_TESTNET as r,URL_NODE_MAINNET as i,URL_NODE_TESTNET as n}from"./models.js";import{parseAddressFullTx as o}from"./utils/parseAddressFullTx.js";class l extends t{constructor(t=!0,e,o,l,c){super(),this.isMainnet=t,this.extraParams=c;const m=e?{headers:{"api-key":e}}:{},p=t?s:r;this.#t=new a(o||p,m);const d=t?i:n;this.#e=new a(l||d,m)}#t;#e;async#a(t,e){return this.isMainnet||e?(await Promise.all(t.map((t=>this.#e.post("",t,{},this.extraParams))))).flat():this.#e.post("",t,{},this.extraParams)}async getTxHex(t){return(await this.#t.post(`/api/v2/tx/${t}`,{},{},this.extraParams)).hex}async getUTXOs(t,e=!0,a){const s=await this.#t.post(`/api/v2/utxo/${t}`,{},{},this.extraParams);if(!s?.length)return{confirmed:[],unconfirmed:[]};const r=s.map(this._parseUtxo),i=t=>({confirmed:t.filter((t=>t.confirmations>0)),unconfirmed:t.filter((t=>0===t.confirmations))});if(!e)return i(r);return i(await this.getScriptsForUtxos(r,a))}async getAddressFromScript(t){const e=await this.#e.post("",{jsonrpc:"2.0",id:`decode-script-${t}`,method:"decodescript",params:[t]},{},this.extraParams);if(e.result)return e.result.address;throw new Error(`Unable to resolve address for script: ${t}. ${e.error.message}`)}async getScriptsForUtxos(t,e){const[a,s]=t.reduce((([t,e],a)=>a.script?[[...t,a],e]:[t,[...e,a]]),[[],[]]),r=s.map(((t,e)=>({jsonrpc:"2.0",method:"gettxout",params:[t.txHash,t.index],id:`${e}`}))),i=r.length?(await this.#a(r,e)).sort(((t,e)=>Number(t.id)-Number(e.id))):[];return[...a,...s.map(((t,e)=>({...t,script:i[e]?.result?.scriptPubKey.hex})))]}_parseUtxo(t){return{...t,txHash:t.txid,index:t.vout,value:Number(t.value),blockHeight:t.height,script:t.script,confirmations:t.confirmations}}async getBalances(t){const e=await this.#t.post(`/api/v2/address/${t}`,{},{},this.extraParams);return{available:BigInt(e.balance),pending:BigInt(e.unconfirmedBalance),final:BigInt(e.balance)+BigInt(e.unconfirmedBalance)}}async getChainHeight(){return(await this.#e.post("",{jsonrpc:"2.0",id:"nownodes",method:"getblockcount",params:[]},{},this.extraParams)).result}async getFeeRates(t){const e={jsonrpc:"2.0",method:"estimatesmartfee"},a=await this.#a([{...e,id:"1",params:[1]},{...e,id:"2",params:[3]},{...e,id:"3",params:[6]}],t).then((t=>t.sort(((t,e)=>Number(t.id)-Number(e.id))).map((t=>1e8*(t.result?.feerate??0)))));return{high:Math.ceil(a[0]/1024)||1,medium:Math.ceil(a[1]/1024)||1,low:Math.ceil(a[2]/1024)||1}}getNetwork(){return this.isMainnet?e.bitcoin:e.testnet}async issueRawTx(t){return await this.#e.post("",{jsonrpc:"2.0",id:"nownodes",method:"sendrawtransaction",params:[t]},{},this.extraParams).then((t=>t.result))}async getTransaction(t){const e=await this.#t.post(`/api/v2/tx/${t}`,{},{},this.extraParams);return{block:e.blockHeight,fees:Number(e.fees),confirmations:e.confirmations,amount:Number(e.value),hash:e.txid,addresses:Array.from(new Set([...e.vin.map((t=>t.addresses||[])).flat(),...e.vout.map((t=>t.addresses||[])).flat()])),blockTime:e.blockTime,inputs:[...e.vin.map((t=>({...t,value:Number(t.value)})))],outputs:[...e.vout.map((t=>({...t,value:Number(t.value)})))]}}async getTxHistory(t){const e=await this.#t.post(`/api/v2/address/${t}`,{},{},this.extraParams),a=e.txids?.slice(0,25)??[];return await Promise.allSettled(a.map((async e=>{try{const a=await this.#t.post(`/api/v2/tx/${e}`,{},{},this.extraParams);return o(t,a)}catch(t){console.log(`Unable to parse full tx ${e}.`)}}))).then((t=>t.map((t=>"fulfilled"===t.status&&t.value?t.value:void 0)).filter((t=>void 0!==t))))}async waitForTx(t,{maxAttempts:e=20,attempt:a=1,pollInterval:s=500}={}){try{return await this.getTransaction(t)}catch(r){if(a>=e)throw r;return await new Promise((t=>setTimeout(t,s))),this.waitForTx(t,{maxAttempts:e,attempt:a+1,pollInterval:s})}}}export{l as BitcoinProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"@ledgerhq/hw-app-eth";import"ethers";import"@
|
|
1
|
+
import"@ledgerhq/hw-app-eth";import"ethers";import"@solana/kit";import"@solana-program/system";import"@solana-program/token";import"@ledgerhq/hw-app-solana";import"bip39";import"@noble/curves/ed25519";import"@scure/base";import"micro-key-producer/slip10.js";import"@avalabs/avalanchejs";import"hdkey";import"bip32";import{getAddressPublicKeyFromXPub as r}from"../../EVM/utils/getAddressPublicKeyFromXPub.js";import{getBech32Address as o}from"./getBech32Address.js";import"@avalabs/core-utils-sdk";import"@ledgerhq/hw-transport";import"@metamask/eth-sig-util";function t(t,e,p){const i=r(t,e);return o(i,p)}export{t as getBech32AddressFromXPub};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ECPair as t}from"bitcoinjs-lib";import{BitcoinWalletAbstract as r}from"./BitcoinWalletAbstract.js";import{createPsbt as e}from"../utils/createPsbt.js";import"coinselect";import"@ledgerhq/hw-app-eth";import"ethers";import{getAddressDerivationPath as i}from"../../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"hdkey";import
|
|
1
|
+
import{ECPair as t}from"bitcoinjs-lib";import{BitcoinWalletAbstract as r}from"./BitcoinWalletAbstract.js";import{createPsbt as e}from"../utils/createPsbt.js";import"coinselect";import"@ledgerhq/hw-app-eth";import"ethers";import{getAddressDerivationPath as i}from"../../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"hdkey";import{DerivationPath as o}from"../../EVM/constants.js";import{fromSeed as s}from"bip32";import{validateMnemonic as n,mnemonicToSeed as a}from"bip39";import"@avalabs/core-utils-sdk";import"@ledgerhq/hw-transport";import"@metamask/eth-sig-util";import"ledger-bitcoin";import"@ledgerhq/hw-app-btc/lib/bip32";class p extends r{keypair;constructor(r,e){const i=t.fromPrivateKey(r);super(i.publicKey,e),this.keypair=i}static async fromMnemonic(t,r,e,m=o.BIP44){if(r<0)throw new Error("Account index must be >= 0");if(!n(t))throw new Error("Invalid mnemonic phrase.");const l=await a(t),c=s(l),h=i(r,m,"EVM"),f=c.derivePath(h);if(!f.privateKey)throw new Error("Unable to derive private key from the given mnemonic.");return new p(f.privateKey,e)}signTx(t,r){const i=e(t,r,this.provider.getNetwork());return Promise.resolve(this.signPsbt(i))}static fromEthersWallet(t,r){const e=t.privateKey;if(!e)throw new Error("Unable to get private key from ethers wallet.");const i=Buffer.from(e.substring(2),"hex");return new p(i,r)}signPsbt(t){return t.signAllInputs(this.keypair),t.validateSignaturesOfAllInputs(),t.finalizeAllInputs(),t.extractTransaction()}}export{p as BitcoinWallet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BitcoinWalletAbstract as t}from"./BitcoinWalletAbstract.js";import
|
|
1
|
+
import{BitcoinWalletAbstract as t}from"./BitcoinWalletAbstract.js";import{AppClient as r}from"ledger-bitcoin";import"bitcoinjs-lib";import"coinselect";import"@ledgerhq/hw-app-eth";import"ethers";import"@solana/kit";import"@solana-program/system";import"@solana-program/token";import"@ledgerhq/hw-app-solana";import"bip39";import"@noble/curves/ed25519";import"@scure/base";import"micro-key-producer/slip10.js";import"@avalabs/avalanchejs";import"hdkey";import"bip32";import"@avalabs/core-utils-sdk";import"@ledgerhq/hw-transport";import"@metamask/eth-sig-util";import{createPSBTV2 as i}from"../utils/createPSBTV2.js";import{psbt2ToPsbt0 as a}from"../utils/psbt2ToPsbt0.js";class e extends t{constructor(t,r,i,a,e){super(t,i),this.derivationPath=r,this.transport=a,this.walletPolicyDetails=e}setTransport(t){this.transport=t}async signTx(t,e){const o=function(t){return new r(t)}(this.transport),s=this.ecPair.publicKey,p=this.provider.getNetwork(),n=await o.getMasterFingerprint(),l=i(t,e,p,Buffer.from(n,"hex"),s,this.derivationPath),{policy:m,hmac:c}=this.walletPolicyDetails,h=await o.signPsbt(l,m,c),u=a(l,p,s,this.derivationPath);if(h.forEach((t=>{const[r,i]=t;u.updateInput(r,{partialSig:[{signature:i.signature,pubkey:i.pubkey}]})})),!u.validateSignaturesOfAllInputs())throw new Error("Failed to validate signatures");return u.finalizeAllInputs(),u.extractTransaction()}}export{e as BitcoinLedgerWallet};
|
package/esm/EVM/LedgerSigner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractSigner as t,defineProperties as s,getAddress as i,toUtf8Bytes as e,hexlify as r,Signature as a,Transaction as n,TypedDataEncoder as o}from"ethers";import{getAppEth as h}from"./utils/getAppEth.js";import{getAddressDerivationPath as p}from"../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"hdkey";import"
|
|
1
|
+
import{AbstractSigner as t,defineProperties as s,getAddress as i,toUtf8Bytes as e,hexlify as r,Signature as a,Transaction as n,TypedDataEncoder as o}from"ethers";import{getAppEth as h}from"./utils/getAppEth.js";import{getAddressDerivationPath as p}from"../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"hdkey";import"bip32";import"bip39";import"bitcoinjs-lib";import"@avalabs/core-utils-sdk";import{TransportStatusError as c,StatusCodes as d}from"@ledgerhq/hw-transport";import{TypedDataUtils as m,SignTypedDataVersion as g}from"@metamask/eth-sig-util";class l extends t{type="default";path;provider=null;accountIndex;derivationSpec;transport;_eth;constructor(t=0,i,e,r){super(),this.path=p(t,e,"EVM"),this.accountIndex=t,this.transport=i,this.derivationSpec=e,this._eth=h(i),s(this,{path:this.path,type:"default",provider:r??null})}setTransport(t){this._eth=h(t),this.transport=t}async getAddress(){const t=await this._eth.getAddress(this.path);return i(t.address)}async signMessage(t){"string"==typeof t&&(t=e(t));const s=r(t).substring(2),i=await this._eth.signPersonalMessage(this.path,s);return i.r="0x"+i.r,i.s="0x"+i.s,a.from(i).serialized}async signTransaction(t){const s=await this.populateTransaction(t);delete s.from;const i=n.from(s),e=i.unsignedSerialized,r=await this._eth.signTransaction(this.path,e.slice(2),null);return i.signature={v:BigInt("0x"+r.v),r:"0x"+r.r,s:"0x"+r.s},i.serialized}connect(t){return new l(this.accountIndex,this.transport,this.derivationSpec,t)}async signTypedData(t,s,i){const{EIP712Domain:e,...r}=s,n=o.getPrimaryType(r);try{const e=await this._eth.signEIP712Message(this.path,{domain:{name:t.name||void 0,chainId:t.chainId?Number(t.chainId):void 0,version:t.version||void 0,verifyingContract:t.verifyingContract||void 0,salt:t.salt?.toString()||void 0},types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],...s},primaryType:n,message:i});return e.r="0x"+e.r,e.s="0x"+e.s,a.from(e).serialized}catch(e){if(e instanceof c&&e.statusCode===d.INS_NOT_SUPPORTED){const e=m.hashStruct(n,i,s,g.V4),r=m.hashStruct("EIP712Domain",t,s,g.V4),o=await this._eth.signEIP712HashedMessage(this.path,r.toString("hex"),e.toString("hex"));return o.r="0x"+o.r,o.s="0x"+o.s,a.from(o).serialized}throw e}}}export{l as LedgerSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"../../abis/erc20.abi.js";import{Interface as a}from"ethers";const o=async(e,a,o,s)=>{const n=new Set(e.map((e=>e.toLowerCase()))),c=new Set(a.map((e=>e.toLowerCase()))),f=async e=>{const a=await o.getBlock(e,!0);a?.prefetchedTransactions.forEach((function(e){e.to&&c.has(e.to.toLowerCase())&&t(e,n)?s(e,{type:"erc20",contractAddress:e.to}):r(e,n)&&s(e,{type:"native"})}))},i=await o.on("block",f);return{unsubscribe:()=>i.off("block",f)}},r=(e,a)=>a.has(e.from.toLowerCase())||a.has((e.to??"").toLowerCase()),t=(o,r)=>{const t=new a(e).parseTransaction({data:o.data,value:o.value});if(r.has(o.from.toLowerCase()))return!0;if("transfer"===t?.name)return r.has(t.args[0]?.toLowerCase());if("transferFrom"===t?.name){const e=r.has(t.args[0]?.toLowerCase()),a=r.has(t.args[1]?.toLowerCase());return e||a}return!1};export{t as isERC20Transfer,r as isNativeTxn,o as onBalanceChange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HDNodeWallet as r,Mnemonic as e}from"ethers";import{getAddressDerivationPath as t}from"../../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"@ledgerhq/hw-app-eth";import"hdkey";
|
|
1
|
+
import{HDNodeWallet as r,Mnemonic as e}from"ethers";import{getAddressDerivationPath as t}from"../../utils/getAddressDerivationPath.js";import"@avalabs/avalanchejs";import"@ledgerhq/hw-app-eth";import"hdkey";function o(o,a,i){if(!(a>=0&&a%1==0))throw new Error("Account index must be an integer greater than or equal to 0.");return r.fromMnemonic(e.fromPhrase(o),t(a,i,"EVM"))}export{o as getWalletFromMnemonic};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { CompilableTransactionMessage } from '@solana/kit';
|
|
3
|
+
|
|
4
|
+
declare const compileSolanaTx: (compilableTx: CompilableTransactionMessage) => Readonly<Readonly<{
|
|
5
|
+
messageBytes: _solana_kit.TransactionMessageBytes;
|
|
6
|
+
signatures: _solana_kit.SignaturesMap;
|
|
7
|
+
}> & _solana_kit.TransactionWithLifetime>;
|
|
8
|
+
|
|
9
|
+
export { compileSolanaTx };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{compileTransaction as o}from"@solana/kit";const t=t=>o(t);export{t as compileSolanaTx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=(o,t=!0)=>`${t?"m/":""}44'/501'/${o}'/0'`;export{o as getSolanaDerivationPath};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { SolanaProvider } from './solanaProvider.js';
|
|
3
|
+
|
|
4
|
+
declare const deserializeTransactionMessage: (payload: string, prov: SolanaProvider) => Promise<_solana_kit.CompilableTransactionMessage<_solana_kit.TransactionVersion, _solana_kit.IInstruction<string, readonly (_solana_kit.IAccountLookupMeta<string, string> | _solana_kit.IAccountMeta<string>)[]>>>;
|
|
5
|
+
|
|
6
|
+
export { deserializeTransactionMessage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getTransactionDecoder as e,getBase64Encoder as o,getCompiledTransactionMessageDecoder as t,decompileTransactionMessageFetchingLookupTables as s}from"@solana/kit";const c=(c,d)=>{const n=e().decode(o().encode(c)),r=t().decode(n.messageBytes);return s(r,d)};export{c as deserializeTransactionMessage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"@ledgerhq/hw-app-solana";import{getSolanaDerivationPath as t}from"./derivationPath.js";const a=async(a,e)=>{const o=new r(e),{address:s}=await o.getAddress(t(a,!1));return s};export{a as getSolanaPublicKeyFromLedger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getBase64EncodedWireTransaction as o}from"@solana/kit";const t=t=>o(t);export{t as serializeSolanaTx};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
|
|
3
|
+
type SolanaProvider = ReturnType<typeof getSolanaProvider>;
|
|
4
|
+
declare const isSolanaProvider: (something: unknown) => something is _solana_kit.RpcDevnet<(_solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi) | (_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi)> | _solana_kit.RpcMainnet<(_solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi) | (_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi)>;
|
|
5
|
+
declare const getSolanaProvider: ({ isTestnet, rpcUrl, }: {
|
|
6
|
+
isTestnet: boolean;
|
|
7
|
+
rpcUrl: string;
|
|
8
|
+
}) => _solana_kit.RpcDevnet<(_solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi) | (_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi)> | _solana_kit.RpcMainnet<(_solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi) | (_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi)>;
|
|
9
|
+
|
|
10
|
+
export { getSolanaProvider, isSolanaProvider };
|
|
11
|
+
export type { SolanaProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createSolanaRpc as t,devnet as e,mainnet as o}from"@solana/kit";const n=Symbol(),r=t=>!(!t||"object"!=typeof t)&&!0===t[n],c=({isTestnet:r,rpcUrl:c})=>{const l=t(r?e(c):o(c));return new Proxy(l,{get:(t,e,o)=>e===n||("then"===e||"catch"===e||"finally"===e?t:Reflect.get(t,e,o))})};export{c as getSolanaProvider,r as isSolanaProvider};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { SolanaProvider } from './solanaProvider.js';
|
|
3
|
+
|
|
4
|
+
declare const transferSol: ({ from, to, amount, provider, }: {
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
amount: bigint;
|
|
8
|
+
provider: SolanaProvider;
|
|
9
|
+
}) => Promise<_solana_kit.ITransactionMessageWithFeePayer<string> & Omit<_solana_kit.TransactionMessageWithBlockhashLifetime & Readonly<{
|
|
10
|
+
instructions: readonly _solana_kit.IInstruction<string, readonly (_solana_kit.IAccountLookupMeta<string, string> | _solana_kit.IAccountMeta<string>)[]>[];
|
|
11
|
+
version: 0;
|
|
12
|
+
}>, "feePayer">>;
|
|
13
|
+
|
|
14
|
+
export { transferSol };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{address as o,createNoopSigner as t,pipe as a,createTransactionMessage as r,setTransactionMessageLifetimeUsingBlockhash as s,setTransactionMessageFeePayer as n,appendTransactionMessageInstructions as e}from"@solana/kit";import{getTransferSolInstruction as m}from"@solana-program/system";const i=async({from:i,to:c,amount:p,provider:u})=>{const{value:l}=await u.getLatestBlockhash().send(),d=[m({source:t(o(i)),destination:o(c),amount:p})];return a(r({version:0}),(o=>s(l,o)),(t=>n(o(i),t)),(o=>e(d,o)))};export{i as transferSol};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _solana_kit from '@solana/kit';
|
|
2
|
+
import { IInstruction } from '@solana/kit';
|
|
3
|
+
import { SolanaProvider } from './solanaProvider.js';
|
|
4
|
+
|
|
5
|
+
declare const transferToken: ({ from, to, mint, amount, decimals, provider, }: {
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
mint: string;
|
|
9
|
+
amount: bigint;
|
|
10
|
+
decimals: number;
|
|
11
|
+
provider: SolanaProvider;
|
|
12
|
+
}) => Promise<_solana_kit.ITransactionMessageWithFeePayer<string> & Omit<_solana_kit.TransactionMessageWithBlockhashLifetime & Readonly<{
|
|
13
|
+
instructions: readonly IInstruction<string, readonly (_solana_kit.IAccountLookupMeta<string, string> | _solana_kit.IAccountMeta<string>)[]>[];
|
|
14
|
+
version: 0;
|
|
15
|
+
}>, "feePayer">>;
|
|
16
|
+
|
|
17
|
+
export { transferToken };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{address as t,createNoopSigner as a,pipe as o,createTransactionMessage as n,setTransactionMessageLifetimeUsingBlockhash as e,setTransactionMessageFeePayer as r,appendTransactionMessageInstructions as i}from"@solana/kit";import{findAssociatedTokenPda as s,TOKEN_PROGRAM_ADDRESS as m,getCreateAssociatedTokenIdempotentInstruction as c,getTransferCheckedInstruction as u}from"@solana-program/token";const p=async({from:p,to:w,mint:d,amount:l,decimals:g,provider:h})=>{const[k]=await s({mint:t(d),owner:t(p),tokenProgram:m}),[f]=await s({mint:t(d),owner:t(w),tokenProgram:m}),v=await h.getAccountInfo(f,{encoding:"base64"}).send(),y=[];v.value||y.push(await c({payer:a(t(p)),mint:t(d),owner:t(w),ata:f})),y.push(u({amount:l,authority:a(t(p)),decimals:g,mint:t(d),destination:f,source:k}));const{value:P}=await h.getLatestBlockhash().send();return o(n({version:0}),(t=>e(P,t)),(a=>r(t(p),a)),(t=>i(y,t)))};export{p as transferToken};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Transport from '@ledgerhq/hw-transport';
|
|
2
|
+
import { SolanaProvider } from '../utils/solanaProvider.js';
|
|
3
|
+
|
|
4
|
+
declare class SolanaLedgerSigner {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(accountIndex: number, transport: Transport);
|
|
7
|
+
signTx(base64EncodedTx: string, provider: SolanaProvider): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { SolanaLedgerSigner };
|
|
@@ -0,0 +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 d=await o(n,m),{signatures:p,messageBytes:u,...g}=a(d),h=new t(this.#t),{address:c}=await h.getAddress(this.#r),f=s(r.encode(Uint8Array.from(c)));if(!this.#a(f,p))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:{...p,[f]:r.decode(y)}})}#a(r,t){return r in t&&!t[r]}}export{m as SolanaLedgerSigner};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolanaProvider } from '../utils/solanaProvider.js';
|
|
2
|
+
|
|
3
|
+
declare class SolanaSigner {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(privateKey: Buffer);
|
|
6
|
+
static fromMnemonic(mnemonic: string, accountIndex: number): SolanaSigner;
|
|
7
|
+
/**
|
|
8
|
+
* @param message Base-64 encoded message bytes
|
|
9
|
+
* @returns Base-64 encoded signature
|
|
10
|
+
*/
|
|
11
|
+
signMessage(message: string): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* @param base64EncodedTx Base-64 encoded transaction
|
|
14
|
+
* @param provider SolanaProvider
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
signTx(base64EncodedTx: string, provider: SolanaProvider): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { SolanaSigner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mnemonicToSeedSync as e}from"bip39";import{ed25519 as r}from"@noble/curves/ed25519";import{base58 as i,base64 as t}from"@scure/base";import{address as s,getCompiledTransactionMessageDecoder as n,compileTransaction as o,assertIsSignature as a,getBase64EncodedWireTransaction as c}from"@solana/kit";import u from"micro-key-producer/slip10.js";import{deserializeTransactionMessage as m}from"../utils/deserializeSolanaTx.js";class p{#e;#r;constructor(e){this.#e=Uint8Array.from(e),this.#r=s(i.encode(r.getPublicKey(this.#e)))}static fromMnemonic(r,i){const t=e(r),s=u.fromMasterSeed(Uint8Array.from(t)).derive(`m/44'/501'/${i}'/0'`);return new p(Buffer.from(s.privateKey))}#i(e){try{return n().decode(e),!0}catch{return!1}}async signMessage(e){const i=t.decode(e);if(this.#i(i))throw new Error("Cannot use signMessage() to sign transactions!");return t.encode(r.sign(i,this.#e))}async signTx(e,t){const s=await m(e,t),{signatures:n,messageBytes:u,...p}=o(s);if(!this.#t(n))return e;const y=i.encode(r.sign(Uint8Array.from(u),this.#e));return a(y),c({...p,messageBytes:u,signatures:{...n,[this.#r]:i.decode(y)}})}#t(e){return this.#r in e&&!e[this.#r]}}export{p as SolanaSigner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];export{e as default};
|
package/esm/index.d.ts
CHANGED
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { BitcoinProviderAbstract } from './BitcoinVM/providers/BitcoinProviderAbstract.js';
|
|
3
|
-
export { BitcoinProvider } from './BitcoinVM/providers/BitcoinProvider.js';
|
|
4
|
-
export { addEncodedSigToPsbt } from './BitcoinVM/utils/addEncodedSigToPsbt.js';
|
|
5
|
-
export { createPsbt } from './BitcoinVM/utils/createPsbt.js';
|
|
6
|
-
export { createTransferTx } from './BitcoinVM/utils/createTransferTx.js';
|
|
7
|
-
export { formatAddressForNetworkBech32 } from './BitcoinVM/utils/formatAddressForNetworkBech32.js';
|
|
8
|
-
export { getBech32Address } from './BitcoinVM/utils/getBech32Address.js';
|
|
9
|
-
export { getBech32AddressFromXPub } from './BitcoinVM/utils/getBech32AddressFromXPub.js';
|
|
10
|
-
export { getMaxTransferAmount } from './BitcoinVM/utils/getMaxTransferAmount.js';
|
|
11
|
-
export { selectUtxos } from './BitcoinVM/utils/selectUtxos.js';
|
|
12
|
-
export { createWalletPolicy } from './BitcoinVM/utils/createWalletPolicy.js';
|
|
13
|
-
export { createPSBTV2 } from './BitcoinVM/utils/createPSBTV2.js';
|
|
14
|
-
export { psbt2ToPsbt0 } from './BitcoinVM/utils/psbt2ToPsbt0.js';
|
|
15
|
-
export { getTransferTxDetails } from './BitcoinVM/utils/getTransferTxDetails.js';
|
|
16
|
-
export { BitcoinWalletAbstract } from './BitcoinVM/wallets/BitcoinWalletAbstract.js';
|
|
17
|
-
export { BitcoinWallet } from './BitcoinVM/wallets/BitcoinWallet.js';
|
|
18
|
-
export { BitcoinLedgerWallet } from './BitcoinVM/wallets/BitcoinWalletLedger.js';
|
|
19
|
-
export { BitcoinWalletVoid } from './BitcoinVM/wallets/BitcoinWalletVoid.js';
|
|
20
|
-
export { networks as BtcNetworks } from 'bitcoinjs-lib';
|
|
1
|
+
export { BtcNetworks } from './BitcoinVM/index.js';
|
|
21
2
|
export { getAppEth } from './EVM/utils/getAppEth.js';
|
|
22
3
|
export { getVoidSigner } from './EVM/utils/getVoidSigner.js';
|
|
23
4
|
export { getWalletFromMnemonic } from './EVM/utils/getWalletFromMnemonic.js';
|
|
@@ -41,3 +22,32 @@ export { omitUndefinedKeys } from './utils/omitUndefinedKeys.js';
|
|
|
41
22
|
export { getLedgerAppInfo } from './utils/getLedgerAppInfo.js';
|
|
42
23
|
export { openLedgerApp } from './utils/openLedgerApp.js';
|
|
43
24
|
export { quitLedgerApp } from './utils/quitLedgerApp.js';
|
|
25
|
+
export { compileSolanaTx } from './SolanaVM/utils/compileSolanaTx.js';
|
|
26
|
+
export { deserializeTransactionMessage } from './SolanaVM/utils/deserializeSolanaTx.js';
|
|
27
|
+
export { serializeSolanaTx } from './SolanaVM/utils/serializeSolanaTx.js';
|
|
28
|
+
export { SolanaProvider, getSolanaProvider, isSolanaProvider } from './SolanaVM/utils/solanaProvider.js';
|
|
29
|
+
export { transferSol } from './SolanaVM/utils/transferSol.js';
|
|
30
|
+
export { transferToken } from './SolanaVM/utils/transferToken.js';
|
|
31
|
+
export { getSolanaDerivationPath } from './SolanaVM/utils/derivationPath.js';
|
|
32
|
+
export { getSolanaPublicKeyFromLedger } from './SolanaVM/utils/getSolanaPublicKeyFromLedger.js';
|
|
33
|
+
export { SolanaSigner } from './SolanaVM/wallets/SolanaSigner.js';
|
|
34
|
+
export { SolanaLedgerSigner } from './SolanaVM/wallets/SolanaLedgerSigner.js';
|
|
35
|
+
export { BitcoinHistoryTx, BitcoinInputUTXO, BitcoinInputUTXOWithOptionalScript, BitcoinLedgerInputUTXO, BitcoinOutputUTXO, BitcoinTx } from './BitcoinVM/models.js';
|
|
36
|
+
export { BitcoinProviderAbstract } from './BitcoinVM/providers/BitcoinProviderAbstract.js';
|
|
37
|
+
export { BitcoinProvider } from './BitcoinVM/providers/BitcoinProvider.js';
|
|
38
|
+
export { addEncodedSigToPsbt } from './BitcoinVM/utils/addEncodedSigToPsbt.js';
|
|
39
|
+
export { createPsbt } from './BitcoinVM/utils/createPsbt.js';
|
|
40
|
+
export { createTransferTx } from './BitcoinVM/utils/createTransferTx.js';
|
|
41
|
+
export { formatAddressForNetworkBech32 } from './BitcoinVM/utils/formatAddressForNetworkBech32.js';
|
|
42
|
+
export { getBech32Address } from './BitcoinVM/utils/getBech32Address.js';
|
|
43
|
+
export { getBech32AddressFromXPub } from './BitcoinVM/utils/getBech32AddressFromXPub.js';
|
|
44
|
+
export { getMaxTransferAmount } from './BitcoinVM/utils/getMaxTransferAmount.js';
|
|
45
|
+
export { selectUtxos } from './BitcoinVM/utils/selectUtxos.js';
|
|
46
|
+
export { createWalletPolicy } from './BitcoinVM/utils/createWalletPolicy.js';
|
|
47
|
+
export { createPSBTV2 } from './BitcoinVM/utils/createPSBTV2.js';
|
|
48
|
+
export { psbt2ToPsbt0 } from './BitcoinVM/utils/psbt2ToPsbt0.js';
|
|
49
|
+
export { getTransferTxDetails } from './BitcoinVM/utils/getTransferTxDetails.js';
|
|
50
|
+
export { BitcoinWalletAbstract } from './BitcoinVM/wallets/BitcoinWalletAbstract.js';
|
|
51
|
+
export { BitcoinWallet } from './BitcoinVM/wallets/BitcoinWallet.js';
|
|
52
|
+
export { BitcoinLedgerWallet } from './BitcoinVM/wallets/BitcoinWalletLedger.js';
|
|
53
|
+
export { BitcoinWalletVoid } from './BitcoinVM/wallets/BitcoinWalletVoid.js';
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
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{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{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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if("object"!=typeof e||!e)throw new Error("feeState parameter is required post E-upgrade")}export{e as assertFeeStateProvided};
|
|
@@ -5,7 +5,10 @@ import { DerivationPath } from '../EVM/constants.js';
|
|
|
5
5
|
* @param addressIndex Which index is the address on
|
|
6
6
|
* @param pathSpec BIP44 vs LedgerLive
|
|
7
7
|
* @param vm Which VM is this address on. Coin index changes between Avalanche and EVM
|
|
8
|
+
* @param withRoot If false, skips the "m/" prefix. Needed for Solana Ledger app.
|
|
8
9
|
*/
|
|
9
|
-
declare function getAddressDerivationPath(addressIndex: number, pathSpec: DerivationPath,
|
|
10
|
+
declare function getAddressDerivationPath(addressIndex: number, pathSpec: DerivationPath, // Irrelevant for Solana
|
|
11
|
+
vm: 'SVM', withRoot?: boolean): string;
|
|
12
|
+
declare function getAddressDerivationPath(addressIndex: number, pathSpec: DerivationPath, vm: 'EVM' | 'AVM' | 'PVM', withRoot?: never): string;
|
|
10
13
|
|
|
11
14
|
export { getAddressDerivationPath };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DerivationPath as
|
|
1
|
+
import"@solana/kit";import"@solana-program/system";import"@solana-program/token";import{getSolanaDerivationPath as o}from"../SolanaVM/utils/derivationPath.js";import"@ledgerhq/hw-app-solana";import"bip39";import"@noble/curves/ed25519";import"@scure/base";import"micro-key-producer/slip10.js";import{DerivationPath as r}from"../EVM/constants.js";function t(t,i,n,a=!0){if(t<0)throw new Error("Account index can not be less than 0.");if("SVM"===n)return o(t,a);const e="EVM"===n?"60":"9000";return i==r.BIP44?`m/44'/${e}'/0'/0/${t}`:`m/44'/${e}'/${t}'/0/0`}export{t as getAddressDerivationPath};
|
package/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/core-wallets-sdk",
|
|
3
|
-
"version": "3.1.0-alpha.
|
|
3
|
+
"version": "3.1.0-alpha.60",
|
|
4
4
|
"license": "Limited Ecosystem License",
|
|
5
5
|
"private": false,
|
|
6
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
7
8
|
"module": "esm/index.js",
|
|
8
9
|
"typings": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./esm/index.d.ts",
|
|
13
|
+
"import": "./esm/index.js",
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"default": "./esm/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
9
18
|
"files": [
|
|
10
19
|
"dist",
|
|
11
20
|
"esm"
|
|
@@ -14,7 +23,7 @@
|
|
|
14
23
|
"scripts": {
|
|
15
24
|
"start": "rollup -c --watch",
|
|
16
25
|
"build": "rollup -c",
|
|
17
|
-
"lint": "eslint --fix -c ./.eslintrc.
|
|
26
|
+
"lint": "eslint --fix -c ./.eslintrc.cjs \"src/**/*.ts*\"",
|
|
18
27
|
"test": "jest",
|
|
19
28
|
"test:path": "jest --watch --testPathPattern",
|
|
20
29
|
"test:watch": "jest --watch"
|
|
@@ -30,27 +39,35 @@
|
|
|
30
39
|
"ts-jest": "29.1.2"
|
|
31
40
|
},
|
|
32
41
|
"dependencies": {
|
|
33
|
-
"@avalabs/avalanchejs": "
|
|
34
|
-
"@avalabs/core-chains-sdk": "3.1.0-alpha.
|
|
35
|
-
"@avalabs/
|
|
42
|
+
"@avalabs/avalanchejs": "5.1.0-alpha.2",
|
|
43
|
+
"@avalabs/core-chains-sdk": "3.1.0-alpha.60",
|
|
44
|
+
"@avalabs/core-utils-sdk": "3.1.0-alpha.60",
|
|
45
|
+
"@avalabs/glacier-sdk": "3.1.0-alpha.60",
|
|
36
46
|
"@avalabs/hw-app-avalanche": "0.14.1",
|
|
37
47
|
"@ledgerhq/hw-app-btc": "10.2.4",
|
|
38
48
|
"@ledgerhq/hw-app-eth": "6.36.1",
|
|
49
|
+
"@ledgerhq/hw-app-solana": "7.2.4",
|
|
39
50
|
"@ledgerhq/hw-transport": "6.30.6",
|
|
40
51
|
"@metamask/eth-sig-util": "7.0.2",
|
|
41
|
-
"@
|
|
52
|
+
"@noble/curves": "1.6.0",
|
|
53
|
+
"@noble/hashes": "1.7.1",
|
|
54
|
+
"@scure/base": "1.2.4",
|
|
55
|
+
"@solana-program/system": "0.7.0",
|
|
56
|
+
"@solana-program/token": "0.5.1",
|
|
57
|
+
"@solana/kit": "2.1.0",
|
|
42
58
|
"bip32": "2.0.6",
|
|
43
59
|
"bip32-path": "0.4.2",
|
|
44
|
-
"bip39": "3.0
|
|
60
|
+
"bip39": "3.1.0",
|
|
45
61
|
"bitcoinjs-lib": "5.2.0",
|
|
46
62
|
"coinselect": "3.1.13",
|
|
47
63
|
"create-hash": "1.2.0",
|
|
48
64
|
"hdkey": "2.0.1",
|
|
49
65
|
"ledger-bitcoin": "0.2.3",
|
|
66
|
+
"micro-key-producer": "0.7.5",
|
|
50
67
|
"xss": "1.0.14"
|
|
51
68
|
},
|
|
52
69
|
"peerDependencies": {
|
|
53
70
|
"ethers": "^6.7.1"
|
|
54
71
|
},
|
|
55
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "9659709ad71ca8f1ee32b490cfb239311111f067"
|
|
56
73
|
}
|