@avalabs/core-wallets-sdk 3.1.0-alpha.7 → 3.1.0-alpha.71
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 +438 -172
- package/esm/Avalanche/index.d.ts +5 -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 +4 -9
- package/esm/Avalanche/providers/AbstractProvider.js +1 -1
- package/esm/Avalanche/providers/JsonRpcProvider.d.ts +2 -1
- 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/getAvalancheDerivationPath.d.ts +3 -0
- package/esm/Avalanche/utils/getAvalancheDerivationPath.js +1 -0
- package/esm/Avalanche/utils/getChainAliasByChainId.js +1 -1
- package/esm/Avalanche/utils/getPchainUnixNow.d.ts +3 -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 +4 -2
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.js +1 -1
- package/esm/Avalanche/utils/getVmByChainAlias.d.ts +1 -1
- package/esm/Avalanche/utils/getXpubFromMnemonic.d.ts +1 -1
- package/esm/Avalanche/utils/getXpubFromMnemonic.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.d.ts +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 +17 -22
- package/esm/Avalanche/wallets/WalletAbstract.js +1 -1
- package/esm/Avalanche/wallets/WalletVoid.js +1 -1
- package/esm/Avalanche/wallets/ledger/LedgerLiveSigner.d.ts +16 -0
- package/esm/Avalanche/wallets/ledger/LedgerLiveSigner.js +1 -0
- package/esm/Avalanche/wallets/ledger/LedgerSigner.js +1 -1
- package/esm/Avalanche/wallets/ledger/SimpleLedgerSigner.d.ts +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/getEvmDerivationPath.d.ts +5 -0
- package/esm/EVM/utils/getEvmDerivationPath.js +1 -0
- 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/maybeGetAssociatedTokenAccount.d.ts +37 -0
- package/esm/SolanaVM/utils/maybeGetAssociatedTokenAccount.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 +32 -20
- package/esm/index.js +1 -1
- package/esm/utils/assertFeeStateProvided.js +1 -0
- package/esm/utils/getAddressDerivationPath.d.ts +8 -2
- package/esm/utils/getAddressDerivationPath.js +1 -1
- package/esm/utils/getPubKeyFromTransport.js +1 -1
- package/package.json +31 -13
- 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
package/esm/Avalanche/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddDelegatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, AddValidatorTx, BaseTx, ChainIDAlias, CreateChainTx, CreateSubnetTx, ExportTx, FeeData, ImportTx, RemoveSubnetValidatorTx, TransferSubnetOwnershipTx, TransformSubnetTx, Tx, TxBase, TxType, UnknownTx, isAddDelegatorTx, isAddPermissionlessDelegatorTx, isAddPermissionlessValidatorTx, isAddSubnetValidatorTx, isAddValidatorTx, isBaseTx, isCreateChainTx, isCreateSubnetTx, isExportTx, isImportTx, isRemoveSubnetValidatorTx, isTransferSubnetOwnershipTx, isTransformSubnetTx } from './models.js';
|
|
1
|
+
export { AddDelegatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, AddValidatorTx, BaseTx, ChainIDAlias, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetL1ValidatorWeightTx, TransferSubnetOwnershipTx, TransformSubnetTx, Tx, TxBase, TxType, UnknownTx, isAddDelegatorTx, isAddPermissionlessDelegatorTx, isAddPermissionlessValidatorTx, isAddSubnetValidatorTx, isAddValidatorTx, isBaseTx, isConvertSubnetToL1Tx, isCreateChainTx, isCreateSubnetTx, isDisableL1ValidatorTx, isExportTx, isImportTx, isIncreaseL1ValidatorBalance, isRegisterL1ValidatorTx, isRemoveSubnetValidatorTx, isSetL1ValidatorWeightTx, isTransferSubnetOwnershipTx, isTransformSubnetTx } from './models.js';
|
|
2
2
|
export { WalletAbstract } from './wallets/WalletAbstract.js';
|
|
3
3
|
export { WalletVoid } from './wallets/WalletVoid.js';
|
|
4
4
|
export { isObsidianApp } from './wallets/ledger/isObsidianApp.js';
|
|
@@ -11,10 +11,11 @@ export { StaticSigner } from './wallets/StaticSigner.js';
|
|
|
11
11
|
export { SimpleSigner } from './wallets/SimpleSigner.js';
|
|
12
12
|
export { LedgerSigner } from './wallets/ledger/LedgerSigner.js';
|
|
13
13
|
export { SimpleLedgerSigner } from './wallets/ledger/SimpleLedgerSigner.js';
|
|
14
|
+
export { LedgerLiveSigner } from './wallets/ledger/LedgerLiveSigner.js';
|
|
14
15
|
export { LedgerGetXpubResponse, SignMessageRequest, SignTxBufferRequest, SignTxRequest, Signer } from './wallets/models.js';
|
|
15
16
|
export { AbstractProvider } from './providers/AbstractProvider.js';
|
|
16
17
|
export { JsonRpcProvider } from './providers/JsonRpcProvider.js';
|
|
17
|
-
export { FujiContext, MainnetContext } from './providers/constants.js';
|
|
18
|
+
export { DevnetContext, FujiContext, MainnetContext } from './providers/constants.js';
|
|
18
19
|
export { default as addSignaturesToAvalancheTx } from './utils/addSignaturesToAvalancheTx.js';
|
|
19
20
|
export { GlacierOutput, convertGlacierUtxo } from './utils/convertGlacierUtxo.js';
|
|
20
21
|
export { createAvalancheEvmUnsignedTx } from './utils/createAvalancheEvmUnsignedTx.js';
|
|
@@ -28,14 +29,14 @@ export { getPchainUnixNow } from './utils/getPchainUnixNow.js';
|
|
|
28
29
|
export { GetStakedAvaxBalanceDict, getStakedAssetBalance } from './utils/getStakedAssetBalance.js';
|
|
29
30
|
export { getStakeForAddresses } from './utils/getStakeForAddresses.js';
|
|
30
31
|
export { getUnixNow } from './utils/getUnixNow.js';
|
|
31
|
-
export { UtxoInfo, getUtxoInfo } from './utils/getUtxoInfo.js';
|
|
32
32
|
export { getUtxosByTxFromGlacier } from './utils/getUtxosByTxFromGlacier.js';
|
|
33
33
|
export { getVmByChainAlias } from './utils/getVmByChainAlias.js';
|
|
34
34
|
export { getXpubFromMnemonic } from './utils/getXpubFromMnemonic.js';
|
|
35
35
|
export { isBech32Address } from './utils/isBech32Address.js';
|
|
36
|
-
export { parseAvalancheTx } from './utils/parseAvalancheTx.js';
|
|
36
|
+
export { ParseOptions, parseAvalancheTx } from './utils/parseAvalancheTx.js';
|
|
37
37
|
export { emptySignature, populateCredential } from './utils/populateCredential.js';
|
|
38
38
|
export { signedTxToHex } from './utils/signedTxToHex.js';
|
|
39
39
|
export { sortUTXOsByAmount, sortUTXOsByAmountAscending, sortUTXOsByAmountDescending, sortUTXOsStaking } from './utils/sortUTXOs.js';
|
|
40
40
|
export { P_CHAIN_TX_SIZE_LIMIT, SizeSupportedTx, getMaximumUtxoSet } from './utils/txSizeLimits.js';
|
|
41
41
|
export { verifyDerivationPath } from './utils/verifyDerivationPath.js';
|
|
42
|
+
export { getAvalancheDerivationPath } from './utils/getAvalancheDerivationPath.js';
|
package/esm/Avalanche/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{TxType,isAddDelegatorTx,isAddPermissionlessDelegatorTx,isAddPermissionlessValidatorTx,isAddSubnetValidatorTx,isAddValidatorTx,isBaseTx,isCreateChainTx,isCreateSubnetTx,isExportTx,isImportTx,isRemoveSubnetValidatorTx,isTransferSubnetOwnershipTx,isTransformSubnetTx}from"./models.js";export{WalletAbstract}from"./wallets/WalletAbstract.js";export{WalletVoid}from"./wallets/WalletVoid.js";export{isObsidianApp}from"./wallets/ledger/isObsidianApp.js";export{getLedgerProvider}from"./wallets/ledger/getLedgerProvider.js";export{AddressWallet}from"./wallets/AddressWallet.js";export{MnemonicWalletVoid}from"./wallets/legacy/MnemonicWalletVoid.js";export{LedgerWallet}from"./wallets/legacy/LedgerWallet.js";export{MnemonicWallet}from"./wallets/legacy/MnemonicWallet.js";export{StaticSigner}from"./wallets/StaticSigner.js";export{SimpleSigner}from"./wallets/SimpleSigner.js";export{LedgerSigner}from"./wallets/ledger/LedgerSigner.js";export{SimpleLedgerSigner}from"./wallets/ledger/SimpleLedgerSigner.js";export{AbstractProvider}from"./providers/AbstractProvider.js";export{JsonRpcProvider}from"./providers/JsonRpcProvider.js";export{FujiContext,MainnetContext}from"./providers/constants.js";export{addSignaturesToAvalancheTx}from"./utils/addSignaturesToAvalancheTx.js";export{convertGlacierUtxo}from"./utils/convertGlacierUtxo.js";export{createAvalancheEvmUnsignedTx}from"./utils/createAvalancheEvmUnsignedTx.js";export{createAvalancheUnsignedTx}from"./utils/createAvalancheUnsignedTx.js";export{digestMessage}from"./utils/digestMessage.js";export{getAddressFromXpub}from"./utils/getAddressFromXpub.js";export{getAddressPublicKeyFromXpub}from"./utils/getAddressPublicKeyFromXpub.js";export{getPaginatedUTXOs,getUTXOsForAddresses}from"./utils/getAllUTXOs.js";export{getAssetBalance}from"./utils/getAssetBalance.js";export{getPchainUnixNow}from"./utils/getPchainUnixNow.js";export{getStakedAssetBalance}from"./utils/getStakedAssetBalance.js";export{getStakeForAddresses}from"./utils/getStakeForAddresses.js";export{getUnixNow}from"./utils/getUnixNow.js";export{
|
|
1
|
+
export{TxType,isAddDelegatorTx,isAddPermissionlessDelegatorTx,isAddPermissionlessValidatorTx,isAddSubnetValidatorTx,isAddValidatorTx,isBaseTx,isConvertSubnetToL1Tx,isCreateChainTx,isCreateSubnetTx,isDisableL1ValidatorTx,isExportTx,isImportTx,isIncreaseL1ValidatorBalance,isRegisterL1ValidatorTx,isRemoveSubnetValidatorTx,isSetL1ValidatorWeightTx,isTransferSubnetOwnershipTx,isTransformSubnetTx}from"./models.js";export{WalletAbstract}from"./wallets/WalletAbstract.js";export{WalletVoid}from"./wallets/WalletVoid.js";export{isObsidianApp}from"./wallets/ledger/isObsidianApp.js";export{getLedgerProvider}from"./wallets/ledger/getLedgerProvider.js";export{AddressWallet}from"./wallets/AddressWallet.js";export{MnemonicWalletVoid}from"./wallets/legacy/MnemonicWalletVoid.js";export{LedgerWallet}from"./wallets/legacy/LedgerWallet.js";export{MnemonicWallet}from"./wallets/legacy/MnemonicWallet.js";export{StaticSigner}from"./wallets/StaticSigner.js";export{SimpleSigner}from"./wallets/SimpleSigner.js";export{LedgerSigner}from"./wallets/ledger/LedgerSigner.js";export{SimpleLedgerSigner}from"./wallets/ledger/SimpleLedgerSigner.js";export{LedgerLiveSigner}from"./wallets/ledger/LedgerLiveSigner.js";export{AbstractProvider}from"./providers/AbstractProvider.js";export{JsonRpcProvider}from"./providers/JsonRpcProvider.js";export{DevnetContext,FujiContext,MainnetContext}from"./providers/constants.js";export{addSignaturesToAvalancheTx}from"./utils/addSignaturesToAvalancheTx.js";export{convertGlacierUtxo}from"./utils/convertGlacierUtxo.js";export{createAvalancheEvmUnsignedTx}from"./utils/createAvalancheEvmUnsignedTx.js";export{createAvalancheUnsignedTx}from"./utils/createAvalancheUnsignedTx.js";export{digestMessage}from"./utils/digestMessage.js";export{getAddressFromXpub}from"./utils/getAddressFromXpub.js";export{getAddressPublicKeyFromXpub}from"./utils/getAddressPublicKeyFromXpub.js";export{getPaginatedUTXOs,getUTXOsForAddresses}from"./utils/getAllUTXOs.js";export{getAssetBalance}from"./utils/getAssetBalance.js";export{getPchainUnixNow}from"./utils/getPchainUnixNow.js";export{getStakedAssetBalance}from"./utils/getStakedAssetBalance.js";export{getStakeForAddresses}from"./utils/getStakeForAddresses.js";export{getUnixNow}from"./utils/getUnixNow.js";export{getUtxosByTxFromGlacier}from"./utils/getUtxosByTxFromGlacier.js";export{getVmByChainAlias}from"./utils/getVmByChainAlias.js";export{getXpubFromMnemonic}from"./utils/getXpubFromMnemonic.js";export{isBech32Address}from"./utils/isBech32Address.js";export{parseAvalancheTx}from"./utils/parseAvalancheTx.js";export{emptySignature,populateCredential}from"./utils/populateCredential.js";export{signedTxToHex}from"./utils/signedTxToHex.js";export{sortUTXOsByAmount,sortUTXOsByAmountAscending,sortUTXOsByAmountDescending,sortUTXOsStaking}from"./utils/sortUTXOs.js";export{P_CHAIN_TX_SIZE_LIMIT,SizeSupportedTx,getMaximumUtxoSet}from"./utils/txSizeLimits.js";export{verifyDerivationPath}from"./utils/verifyDerivationPath.js";export{getAvalancheDerivationPath}from"./utils/getAvalancheDerivationPath.js";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { VM,
|
|
1
|
+
import { VM, OutputOwners, TransferableOutput, Common, pvmSerial } from '@avalabs/avalanchejs';
|
|
2
2
|
|
|
3
3
|
type ChainIDAlias = 'X' | 'P' | 'C';
|
|
4
4
|
/**
|
|
5
5
|
* Types for parsed transaction
|
|
6
6
|
*/
|
|
7
|
-
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx | UnknownTx;
|
|
7
|
+
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx | ConvertSubnetToL1Tx | RegisterL1ValidatorTx | SetL1ValidatorWeightTx | DisableL1ValidatorTx | IncreaseL1ValidatorBalanceTx | UnknownTx;
|
|
8
8
|
interface FeeData {
|
|
9
9
|
totalAvaxBurned: bigint;
|
|
10
10
|
totalAvaxOutput: bigint;
|
|
11
11
|
totalAvaxInput: bigint;
|
|
12
12
|
isValidAvaxBurnedAmount: boolean;
|
|
13
13
|
txFee: bigint;
|
|
14
|
+
baseFee: bigint;
|
|
14
15
|
}
|
|
15
16
|
interface TxBase extends FeeData {
|
|
16
17
|
type: string;
|
|
@@ -24,6 +25,11 @@ declare enum TxType {
|
|
|
24
25
|
Import = "import",
|
|
25
26
|
CreateSubnet = "create_subnet",
|
|
26
27
|
CreateChain = "create_chain",
|
|
28
|
+
ConvertSubnetToL1 = "convert_subnet_to_l1",
|
|
29
|
+
RegisterL1Validator = "register_l1_validator",
|
|
30
|
+
SetL1ValidatorWeight = "set_l1_validator_weight",
|
|
31
|
+
IncreaseL1ValidatorBalance = "increase_l1_validator_balance",
|
|
32
|
+
DisableL1Validator = "disable_l1_validator",
|
|
27
33
|
AddSubnetValidator = "add_subnet_validator",
|
|
28
34
|
RemoveSubnetValidator = "remove_subnet_validator",
|
|
29
35
|
AddPermissionlessValidator = "add_permissionless_validator",
|
|
@@ -102,6 +108,35 @@ interface RemoveSubnetValidatorTx extends TxBase {
|
|
|
102
108
|
nodeID: string;
|
|
103
109
|
subnetID: string;
|
|
104
110
|
}
|
|
111
|
+
interface ConvertSubnetToL1Tx extends TxBase {
|
|
112
|
+
type: TxType.ConvertSubnetToL1;
|
|
113
|
+
managerAddress: string;
|
|
114
|
+
validators: {
|
|
115
|
+
nodeId: string;
|
|
116
|
+
stake: bigint;
|
|
117
|
+
balance: bigint;
|
|
118
|
+
remainingBalanceOwners: string[];
|
|
119
|
+
deactivationOwners: string[];
|
|
120
|
+
}[];
|
|
121
|
+
subnetID: string;
|
|
122
|
+
chainID: string;
|
|
123
|
+
}
|
|
124
|
+
interface RegisterL1ValidatorTx extends TxBase {
|
|
125
|
+
type: TxType.RegisterL1Validator;
|
|
126
|
+
balance: bigint;
|
|
127
|
+
}
|
|
128
|
+
interface SetL1ValidatorWeightTx extends TxBase {
|
|
129
|
+
type: TxType.SetL1ValidatorWeight;
|
|
130
|
+
}
|
|
131
|
+
interface IncreaseL1ValidatorBalanceTx extends TxBase {
|
|
132
|
+
type: TxType.IncreaseL1ValidatorBalance;
|
|
133
|
+
balance: bigint;
|
|
134
|
+
validationId: string;
|
|
135
|
+
}
|
|
136
|
+
interface DisableL1ValidatorTx extends TxBase {
|
|
137
|
+
type: TxType.DisableL1Validator;
|
|
138
|
+
validationId: string;
|
|
139
|
+
}
|
|
105
140
|
interface AddPermissionlessValidatorTx extends TxBase {
|
|
106
141
|
type: TxType.AddPermissionlessValidator;
|
|
107
142
|
nodeID: string;
|
|
@@ -111,7 +146,7 @@ interface AddPermissionlessValidatorTx extends TxBase {
|
|
|
111
146
|
rewardOwner: OutputOwners;
|
|
112
147
|
delegationRewardOwner: OutputOwners;
|
|
113
148
|
stake: bigint;
|
|
114
|
-
stakeOuts: TransferableOutput[];
|
|
149
|
+
stakeOuts: readonly TransferableOutput[];
|
|
115
150
|
subnetID: string;
|
|
116
151
|
publicKey: undefined | string;
|
|
117
152
|
signature: undefined | string;
|
|
@@ -125,7 +160,7 @@ interface AddPermissionlessDelegatorTx extends TxBase {
|
|
|
125
160
|
stake: bigint;
|
|
126
161
|
subnetID: string;
|
|
127
162
|
delegatorRewardsOwner: OutputOwners;
|
|
128
|
-
stakeOuts: TransferableOutput[];
|
|
163
|
+
stakeOuts: readonly TransferableOutput[];
|
|
129
164
|
}
|
|
130
165
|
interface TransformSubnetTx extends TxBase {
|
|
131
166
|
type: TxType.TransformSubnet;
|
|
@@ -140,7 +175,7 @@ interface TransformSubnetTx extends TxBase {
|
|
|
140
175
|
minStakeDuration: number;
|
|
141
176
|
maxStakeDuration: number;
|
|
142
177
|
minDelegationFee: number;
|
|
143
|
-
minDelegatorStake:
|
|
178
|
+
minDelegatorStake: bigint;
|
|
144
179
|
maxValidatorWeightFactor: number;
|
|
145
180
|
uptimeRequirement: number;
|
|
146
181
|
}
|
|
@@ -161,6 +196,11 @@ declare function isAddDelegatorTx(tx: Tx): tx is AddDelegatorTx;
|
|
|
161
196
|
declare function isExportTx(tx: Tx): tx is ExportTx;
|
|
162
197
|
declare function isImportTx(tx: Tx): tx is ImportTx;
|
|
163
198
|
declare function isBaseTx(tx: Tx): tx is BaseTx;
|
|
199
|
+
declare function isConvertSubnetToL1Tx(tx: Tx): tx is ConvertSubnetToL1Tx;
|
|
200
|
+
declare function isRegisterL1ValidatorTx(tx: Tx): tx is RegisterL1ValidatorTx;
|
|
201
|
+
declare function isSetL1ValidatorWeightTx(tx: Tx): tx is SetL1ValidatorWeightTx;
|
|
202
|
+
declare function isDisableL1ValidatorTx(tx: Tx): tx is DisableL1ValidatorTx;
|
|
203
|
+
declare function isIncreaseL1ValidatorBalance(tx: Tx): tx is IncreaseL1ValidatorBalanceTx;
|
|
164
204
|
declare function isCreateSubnetTx(tx: Tx): tx is CreateSubnetTx;
|
|
165
205
|
declare function isCreateChainTx(tx: Tx): tx is CreateChainTx;
|
|
166
206
|
declare function isAddSubnetValidatorTx(tx: Tx): tx is AddSubnetValidatorTx;
|
|
@@ -170,4 +210,5 @@ declare function isAddPermissionlessDelegatorTx(tx: Tx): tx is AddPermissionless
|
|
|
170
210
|
declare function isTransformSubnetTx(tx: Tx): tx is TransformSubnetTx;
|
|
171
211
|
declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwnershipTx;
|
|
172
212
|
|
|
173
|
-
export {
|
|
213
|
+
export { TxType, isAddDelegatorTx, isAddPermissionlessDelegatorTx, isAddPermissionlessValidatorTx, isAddSubnetValidatorTx, isAddValidatorTx, isBaseTx, isConvertSubnetToL1Tx, isCreateChainTx, isCreateSubnetTx, isDisableL1ValidatorTx, isExportTx, isImportTx, isIncreaseL1ValidatorBalance, isRegisterL1ValidatorTx, isRemoveSubnetValidatorTx, isSetL1ValidatorWeightTx, isTransferSubnetOwnershipTx, isTransformSubnetTx };
|
|
214
|
+
export type { AddDelegatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, AddValidatorTx, BaseTx, ChainIDAlias, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetL1ValidatorWeightTx, TransferSubnetOwnershipTx, TransformSubnetTx, Tx, TxBase, UnknownTx };
|
package/esm/Avalanche/models.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=(e=>(e.Base="base",e.AddValidator="add_validator",e.AddDelegator="add_delegator",e.Export="export",e.Import="import",e.CreateSubnet="create_subnet",e.CreateChain="create_chain",e.AddSubnetValidator="add_subnet_validator",e.RemoveSubnetValidator="remove_subnet_validator",e.AddPermissionlessValidator="add_permissionless_validator",e.AddPermissionlessDelegator="add_permissionless_delegator",e.TransformSubnet="transform_subnet",e.TransferSubnetOwnership="transfer_subnet_ownership",e.Unknown="unknown",e))(e||{});function t(e){return"add_validator"===e.type}function r(e){return"add_delegator"===e.type}function n(e){return"export"===e.type}function a(e){return"import"===e.type}function o(e){return"base"===e.type}function d(e){return"
|
|
1
|
+
var e=(e=>(e.Base="base",e.AddValidator="add_validator",e.AddDelegator="add_delegator",e.Export="export",e.Import="import",e.CreateSubnet="create_subnet",e.CreateChain="create_chain",e.ConvertSubnetToL1="convert_subnet_to_l1",e.RegisterL1Validator="register_l1_validator",e.SetL1ValidatorWeight="set_l1_validator_weight",e.IncreaseL1ValidatorBalance="increase_l1_validator_balance",e.DisableL1Validator="disable_l1_validator",e.AddSubnetValidator="add_subnet_validator",e.RemoveSubnetValidator="remove_subnet_validator",e.AddPermissionlessValidator="add_permissionless_validator",e.AddPermissionlessDelegator="add_permissionless_delegator",e.TransformSubnet="transform_subnet",e.TransferSubnetOwnership="transfer_subnet_ownership",e.Unknown="unknown",e))(e||{});function t(e){return"add_validator"===e.type}function r(e){return"add_delegator"===e.type}function n(e){return"export"===e.type}function a(e){return"import"===e.type}function o(e){return"base"===e.type}function i(e){return"convert_subnet_to_l1"===e.type}function d(e){return"register_l1_validator"===e.type}function s(e){return"set_l1_validator_weight"===e.type}function _(e){return"disable_l1_validator"===e.type}function u(e){return"increase_l1_validator_balance"===e.type}function l(e){return"create_subnet"===e.type}function c(e){return"create_chain"===e.type}function p(e){return"add_subnet_validator"===e.type}function b(e){return"remove_subnet_validator"===e.type}function f(e){return"add_permissionless_validator"===e.type}function v(e){return"add_permissionless_delegator"===e.type}function y(e){return"transform_subnet"===e.type}function m(e){return"transfer_subnet_ownership"===e.type}export{e as TxType,r as isAddDelegatorTx,v as isAddPermissionlessDelegatorTx,f as isAddPermissionlessValidatorTx,p as isAddSubnetValidatorTx,t as isAddValidatorTx,o as isBaseTx,i as isConvertSubnetToL1Tx,c as isCreateChainTx,l as isCreateSubnetTx,_ as isDisableL1ValidatorTx,n as isExportTx,a as isImportTx,u as isIncreaseL1ValidatorBalance,d as isRegisterL1ValidatorTx,b as isRemoveSubnetValidatorTx,s as isSetL1ValidatorWeightTx,m as isTransferSubnetOwnershipTx,y as isTransformSubnetTx};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import * as _avalabs_avalanchejs_dist_vms_common from '@avalabs/avalanchejs/dist/vms/common';
|
|
2
|
-
import
|
|
3
|
-
import { JsonRpcProvider } from 'ethers';
|
|
4
|
-
import { Context, avm, pvm, evm, VM, avaxSerial } from '@avalabs/avalanchejs';
|
|
2
|
+
import { Context, avm, pvm, evm, info, VM, avaxSerial } from '@avalabs/avalanchejs';
|
|
5
3
|
import { ChainIDAlias } from '../models.js';
|
|
6
4
|
|
|
7
5
|
declare class AbstractProvider {
|
|
8
6
|
protected baseUrl: string;
|
|
9
7
|
protected context: Context.Context;
|
|
10
|
-
|
|
11
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
12
|
-
/**
|
|
13
|
-
* @link https://docs.ethers.io/v5/api/providers/provider/#Provider-getFeeData
|
|
14
|
-
*/
|
|
15
|
-
getEvmFeeData(): Promise<ethers.FeeData>;
|
|
8
|
+
fetchOptions?: RequestInit | undefined;
|
|
9
|
+
constructor(baseUrl: string, context: Context.Context, fetchOptions?: RequestInit | undefined);
|
|
16
10
|
getContext(): Context.Context;
|
|
17
11
|
getChainID(chainAlias: ChainIDAlias): string;
|
|
18
12
|
getNetworkID(): number;
|
|
@@ -20,6 +14,7 @@ declare class AbstractProvider {
|
|
|
20
14
|
getApiX(): avm.AVMApi;
|
|
21
15
|
getApiP(): pvm.PVMApi;
|
|
22
16
|
getApiC(): evm.EVMApi;
|
|
17
|
+
getInfo(): info.InfoApi;
|
|
23
18
|
getApi(chain: ChainIDAlias): avm.AVMApi | pvm.PVMApi | evm.EVMApi;
|
|
24
19
|
getAvaxID(): string;
|
|
25
20
|
getAddress(publicKey: Buffer, chain: ChainIDAlias): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as t,secp256k1 as e,networkIDs as s,avm as i,pvm as r,evm as n,info as c}from"@avalabs/avalanchejs";import{strip0x as o}from"@avalabs/core-utils-sdk";import{signedTxToHex as h}from"../utils/signedTxToHex.js";import{SigningKey as a}from"ethers";const{parseBech32:p,format:u}=t,{publicKeyBytesToAddress:g}=e;class A{constructor(t,e,s){this.baseUrl=t,this.context=e,this.fetchOptions=s}getContext(){return this.context}getChainID(t){switch(t){case"X":return this.context.xBlockchainID;case"P":return this.context.pBlockchainID;case"C":return this.context.cBlockchainID}}getNetworkID(){return this.context.networkID}getHrp(){return s.getHRP(this.getNetworkID())}getApiX(){const t=new i.AVMApi(this.baseUrl);return this.fetchOptions&&t.setFetchOptions(this.fetchOptions),t}getApiP(){const t=new r.PVMApi(this.baseUrl);return this.fetchOptions&&t.setFetchOptions(this.fetchOptions),t}getApiC(){const t=new n.EVMApi(this.baseUrl);return this.fetchOptions&&t.setFetchOptions(this.fetchOptions),t}getInfo(){const t=new c.InfoApi(this.baseUrl);return this.fetchOptions&&t.setFetchOptions(this.fetchOptions),t}getApi(t){switch(t){case"X":return this.getApiX();case"P":return this.getApiP();case"C":return this.getApiC()}}getAvaxID(){return this.getContext().avaxAssetID}getAddress(t,e){const s=o(a.computePublicKey(t,!0)),i=Buffer.from(s,"hex"),r=g(i);return u(e,this.getHrp(),r)}getAddressFromBuffer(t,e){return u(e,this.getHrp(),t)}formatAddress(t,e){const[,s]=p(t);return u(e,this.getHrp(),s)}getApiByVM(t){switch(t){case"AVM":return this.getApiX();case"PVM":return this.getApiP();case"EVM":return this.getApiC()}}getApiByChainID(t){switch(t){case this.context.xBlockchainID:return this.getApiX();case this.context.pBlockchainID:return this.getApiP();case this.context.cBlockchainID:return this.getApiC()}}async issueTx(t){const e=t.unsignedTx.getVM(),s=h(t);return this.issueTxHex(s,e)}async issueTxHex(t,e){return this.getApiByVM(e).issueTx({tx:t})}async waitForTransaction(t,e,s=6e4){const i=this.getApiByVM(e),r=Date.now();return new Promise(((e,c)=>{const o=async()=>{let h;switch(s&&r+s<Date.now()&&c(new Error("Timeout")),h=i instanceof n.EVMApi?await i.getAtomicTxStatus(t):await i.getTxStatus({txID:t,includeReason:!0}),h.status){case"Accepted":case"Committed":return void e({success:!0});case"Dropped":case"Rejected":return void e({success:!1});default:setTimeout((()=>{o()}),1e3)}};o()}))}}export{A as AbstractProvider};
|
|
@@ -2,10 +2,11 @@ import { AbstractProvider } from './AbstractProvider.js';
|
|
|
2
2
|
import { Context } from '@avalabs/avalanchejs';
|
|
3
3
|
|
|
4
4
|
declare class JsonRpcProvider extends AbstractProvider {
|
|
5
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
5
|
+
constructor(baseUrl: string, context: Context.Context, fetchOptions?: RequestInit);
|
|
6
6
|
static fromBaseURL(url: string): Promise<JsonRpcProvider>;
|
|
7
7
|
static getDefaultMainnetProvider(): JsonRpcProvider;
|
|
8
8
|
static getDefaultFujiProvider(): JsonRpcProvider;
|
|
9
|
+
static getDefaultDevnetProvider(): JsonRpcProvider;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export { JsonRpcProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractProvider as r}from"./AbstractProvider.js";import{Context as t}from"@avalabs/avalanchejs";import{MainnetContext as
|
|
1
|
+
import{AbstractProvider as r}from"./AbstractProvider.js";import{Context as t}from"@avalabs/avalanchejs";import{MainnetContext as e,FujiContext as a,DevnetContext as n}from"./constants.js";import{AVALANCHE_XP_NETWORK as s,AVALANCHE_XP_TEST_NETWORK as o,AVALANCHE_P_DEV_NETWORK as c}from"@avalabs/core-chains-sdk";class i extends r{constructor(r,t,e){super(r,t,e)}static async fromBaseURL(r){const e=await t.getContextFromURI(r);try{return new i(r,e)}catch{return new i(r,e)}}static getDefaultMainnetProvider(){return new i(s.rpcUrl,e)}static getDefaultFujiProvider(){return new i(o.rpcUrl,a)}static getDefaultDevnetProvider(){return new i(c.rpcUrl,n)}}export{i as JsonRpcProvider};
|
|
@@ -8,5 +8,6 @@ declare const MainnetContext: Context.Context;
|
|
|
8
8
|
* Avalanche Fuji testnet context
|
|
9
9
|
*/
|
|
10
10
|
declare const FujiContext: Context.Context;
|
|
11
|
+
declare const DevnetContext: Context.Context;
|
|
11
12
|
|
|
12
|
-
export { FujiContext, MainnetContext };
|
|
13
|
+
export { DevnetContext, FujiContext, MainnetContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{platformFeeConfig as e}from"./platformFeeConfig.js";const o={xBlockchainID:"2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",pBlockchainID:"11111111111111111111111111111111LpoYY",cBlockchainID:"2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5",avaxAssetID:"FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",baseTxFee:BigInt(1e6),createAssetTxFee:BigInt(1e7),networkID:1,hrp:"avax",platformFeeConfig:e},c={xBlockchainID:"2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm",pBlockchainID:"11111111111111111111111111111111LpoYY",cBlockchainID:"yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp",avaxAssetID:"U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK",baseTxFee:BigInt(1e6),createAssetTxFee:BigInt(1e7),networkID:5,hrp:"fuji",platformFeeConfig:e},n={xBlockchainID:"2piQ2AVHCjnduiWXsSY15DtbVuwHE2cwMHYnEXHsLL73BBkdbV",pBlockchainID:"11111111111111111111111111111111LpoYY",cBlockchainID:"vV3cui1DsEPC3nLCGH9rorwo8s6BYxM2Hz4QFE5gEYjwTqAu",avaxAssetID:"22jjRVdyTJiAEtcZciAVR8bTFyVDUVoo1T3o5PiDspQSZ2maXR",baseTxFee:1000000n,createAssetTxFee:1000000n,networkID:76,hrp:"custom",platformFeeConfig:e};export{n as DevnetContext,c as FujiContext,o as MainnetContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Common as e}from"@avalabs/avalanchejs";const t={weights:e.createDimensions({bandwidth:1,dbRead:1e3,dbWrite:1e3,compute:4}),maxCapacity:BigInt(1e6),maxPerSecond:BigInt(1e5),targetPerSecond:BigInt(5e4),minPrice:BigInt(1),excessConversionConstant:BigInt(2164043)};export{t as platformFeeConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getVmByChainAlias as e}from"./getVmByChainAlias.js";import{
|
|
1
|
+
import{getVmByChainAlias as e}from"./getVmByChainAlias.js";import{utils as t,Credential as r,UnsignedTx as n,avaxSerial as a,EVM as s}from"@avalabs/avalanchejs";import i from"./createAvalancheUnsignedTx.js";import{populateCredential as o}from"./populateCredential.js";import{signedTxToHex as c}from"./signedTxToHex.js";const{getManagerForVM:d,hexToBuffer:x,unpackWithManager:g}=t,p=async({transactionHex:t,chainAlias:n,provider:c,utxos:p})=>{const u=e(n);if(u===s)throw new Error("EVM transactions are not supported");const l=x(t),m=g(u,l),h=await(async({tx:e,txBytes:t,provider:n,vm:s,utxos:c})=>{try{const x=d(s).unpack(t,a.SignedTx),g=await i({tx:e,utxos:c,provider:n,credentials:x.getCredentials()});return e.getSigIndices().map(((e,t)=>new r(o(e,{unsignedTx:g,credentialIndex:t}))))}catch(t){return e.getSigIndices().map((e=>new r(o(e))))}})({tx:m,txBytes:l,provider:c,vm:u,utxos:p});return i({tx:m,provider:c,credentials:h,utxos:p})},u=async({transactionHex:e,signatures:t,chainAlias:s,provider:i,utxos:o})=>{if(!t.length)throw new Error("signatures were not provided");const d=await p({transactionHex:e,chainAlias:s,provider:i,utxos:o});await Promise.all(t.map((e=>d.addSignature(e))));const x=d.getCredentials(),g=d.getSigIndices().reduce(((e,t,n)=>{const a=t.map((e=>{const t=x[n]?.toJSON()[e];if(!t)throw new Error(`Failed to sign [${n}, ${e}]`);return t}));return e.push(new r(a)),e}),[]),u=new n(d.getTx(),d.getInputUtxos(),d.addressMaps,g),l=new a.SignedTx(d.getTx(),g);return{signedTxHex:c(l),hasAllSignatures:u.hasAllSignatures()}};export{u as addSignaturesToAvalancheTx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{utils as a}from"@avalabs/avalanchejs";async function e(e,r,t){try{const{deactivationOwner:s}=await t.getApiP().getL1Validator(r.validationId.toString()),i=r.getDisableAuth().values(),n=s.addresses.reduce(((a,e,r)=>(i.includes(r)&&a.push([e,r]),a)),[]);return e.push(new a.AddressMap(n)),e}catch(a){throw new Error(`Error while preparing disableAuth data: ${a.message}`)}}export{e as appendDisableAuthAddressMaps};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Utxo as Utxo$1 } from '@avalabs/avalanchejs';
|
|
2
|
-
import { Utxo, PChainUtxo } from '@avalabs/glacier-sdk';
|
|
1
|
+
import { Utxo as Utxo$1, TransferOutput, pvmSerial } from '@avalabs/avalanchejs';
|
|
2
|
+
import { Utxo, PChainUtxo, Network } from '@avalabs/glacier-sdk';
|
|
3
3
|
|
|
4
4
|
type GlacierOutput = Utxo | PChainUtxo;
|
|
5
|
-
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput,
|
|
5
|
+
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, network: Network) => Utxo$1<TransferOutput | pvmSerial.StakeableLockOut<TransferOutput>>;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { convertGlacierUtxo };
|
|
8
|
+
export type { GlacierOutput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as t,Utxo as e,avaxSerial as a,Id as o,pvmSerial as s,BigIntPr as n,TransferOutput as r,OutputOwners as m}from"@avalabs/avalanchejs";import{getChainAliasByChainId as i}from"./getChainAliasByChainId.js";const{bytesCompare:c,parseBech32:l}=t,d=(t,e)=>"P"===e,h=(t,e,a)=>{const o=d(0,e)?t.amount:t.asset?.amount;return new r(new n(BigInt(o)),m.fromNative(t.addresses.map((t=>l(t)[1])).sort(c),BigInt(a??0),t.threshold))},k=(t,r)=>{const m=i(t.createdOnChainId,r),c=d(0,m)?t.txHash:t.creationTxHash,l=d(0,m)?t.assetId:t.asset?.assetId;return new e(a.UTXOID.fromNative(c,Number(t.outputIndex)),o.fromString(l),((t,e)=>d(0,e)?t.stakeableLocktime?new s.StakeableLockOut(new n(BigInt(t.stakeableLocktime??0)),h(t,e,t.platformLocktime??0)):h(t,e,t.platformLocktime):h(t,e,t.locktime))(t,m))};export{k as convertGlacierUtxo};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VM, Credential, Utxo, UnsignedTx } from '@avalabs/avalanchejs';
|
|
2
2
|
|
|
3
3
|
type Params = {
|
|
4
4
|
txBytes: Uint8Array;
|
|
5
5
|
fromAddress: string;
|
|
6
6
|
vm: VM;
|
|
7
|
+
credentials?: Credential[];
|
|
7
8
|
utxos: Utxo[];
|
|
8
9
|
};
|
|
9
|
-
declare const createAvalancheEvmUnsignedTx: ({ txBytes, fromAddress, vm, utxos, }: Params) => Promise<UnsignedTx>;
|
|
10
|
+
declare const createAvalancheEvmUnsignedTx: ({ txBytes, fromAddress, vm, credentials, utxos, }: Params) => Promise<UnsignedTx>;
|
|
10
11
|
|
|
11
12
|
export { createAvalancheEvmUnsignedTx };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as r,evmSerial as e,EVMUnsignedTx as t,UnsignedTx as s}from"@avalabs/avalanchejs";const{unpackWithManager:n,parse:a,bufferToHex:o,AddressMaps:p,AddressMap:i}=r,f=async({txBytes:r,fromAddress:f,vm:d,credentials:m,utxos:c})=>{const u=n(d,r),x=a(f)[2],w=o(x);if(e.isExportTx(u))return new t(u,[],new p([i.fromJSON([[w,0]])]),m);if(e.isImportTx(u)){const r=p.fromTransferableInputs(u.importedInputs,c,BigInt(Math.floor((new Date).getTime()/1e3)),[x]);return new s(u,c,r,m)}throw new Error("Unsupported transaction type")};export{f as createAvalancheEvmUnsignedTx};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UnsignedTx as r,
|
|
1
|
+
import{utils as e,UnsignedTx as r,pvmSerial as a}from"@avalabs/avalanchejs";import{isSubnetTx as t,handleSubnetAuth as s}from"./handleSubnetAuth.js";import{appendDisableAuthAddressMaps as n}from"./appendDisableAuthAddressMaps.js";const{getTransferableInputsByTx:o,AddressMaps:i}=e,d=async({tx:e,fromAddressBytes:d,provider:p,credentials:l,utxos:u})=>{const f=o(e);let m=i.fromTransferableInputs(f,u,BigInt(Math.floor((new Date).getTime()/1e3)),d);if(t(e))try{const a=await s({tx:e,provider:p,addressMaps:m});return new r(e,u,a,l)}catch(e){throw new Error(`Error while preparing subnet authorization data: ${e.message}`)}else a.isDisableL1ValidatorTx(e)&&(m=await n(m,e,p));return new r(e,u,m,l)};var p=d;export{d as createAvalancheUnsignedTx,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as t}from"@avalabs/avalanchejs";import{getUnixNow as e}from"./getUnixNow.js";const{getUtxoInfo:a}=t;function o(t,o){const l=t.getAssetDict()[o],i={locked:BigInt(0),available:BigInt(0),multisig:BigInt(0),lockedStakeable:BigInt(0),total:BigInt(0)};if(!l)return i;const n=l.getUTXOs(),c=e();return n.forEach((t=>{const e=a(t);i[e.threshold>1?"multisig":e.locktime>c?"locked":e.stakeableLocktime>c?"lockedStakeable":"available"]+=e.amount})),i.total=i.locked+i.lockedStakeable+i.multisig+i.available,i}export{o as getAssetBalance};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=(o,t=!0)=>`${t?"m/":""}44'/9000'/${o}'/0/0`;export{o as getAvalancheDerivationPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"@avalabs/
|
|
1
|
+
import{Network as r}from"@avalabs/glacier-sdk";import"../providers/AbstractProvider.js";import"@avalabs/avalanchejs";import{FujiContext as o,MainnetContext as a}from"../providers/constants.js";import"@avalabs/core-chains-sdk";const i=(i,n)=>{const c=n===r.FUJI,{cBlockchainID:s,xBlockchainID:t,pBlockchainID:e}=c?o:a;if(s===i)return"C";if(t===i)return"X";if(e===i)return"P";throw new Error(`Unknown chainId "${i}"`)};export{i as getChainAliasByChainId};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { AbstractProvider } from '../providers/AbstractProvider.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Get the current p-chain timestamp in unix
|
|
3
5
|
*/
|
|
4
|
-
declare function getPchainUnixNow(
|
|
6
|
+
declare function getPchainUnixNow(provider: AbstractProvider): Promise<bigint>;
|
|
5
7
|
|
|
6
8
|
export { getPchainUnixNow };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
async function t(t){const e=await t.getApiP().getTimestamp(),a=new Date(e.timestamp),i=Math.floor(a.getTime()/1e3);return BigInt(i)}export{t as getPchainUnixNow};
|
|
@@ -13,4 +13,5 @@ interface GetStakedAvaxBalanceDict {
|
|
|
13
13
|
}
|
|
14
14
|
declare function getStakedAssetBalance(stakeResponse: pvm.GetStakeResponse): GetStakedAvaxBalanceDict;
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export { getStakedAssetBalance };
|
|
17
|
+
export type { GetStakedAvaxBalanceDict };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as t,avmSerial as e,pvmSerial as a,evmSerial as o}from"@avalabs/avalanchejs";const{isTransferOut:s,isStakeableLockOut:n}=t;function r(t){const e=t.output;return s(e)||n(e)?e.getOwners():[]}function u(t){const s=t.getTx();return e.isExportTx(s)||a.isExportTx(s)?new Set(s.outs.map(r).flat()):o.isExportTx(s)?new Set(s.exportedOutputs.map(r).flat()):new Set((s.baseTx?.outputs??[]).map(r).flat())}export{r as getOutputAddresses,u as getTxOutputAddresses};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import * as _avalabs_avalanchejs_dist_serializable_common_types from '@avalabs/avalanchejs/dist/serializable/common/types';
|
|
2
|
+
import { Network } from '@avalabs/glacier-sdk';
|
|
1
3
|
import { Utxo } from '@avalabs/avalanchejs';
|
|
2
4
|
import { ChainIDAlias } from '../models.js';
|
|
3
5
|
|
|
4
6
|
type Params = {
|
|
5
7
|
transactionHex: string;
|
|
6
8
|
chainAlias: ChainIDAlias;
|
|
7
|
-
|
|
9
|
+
network: Network;
|
|
8
10
|
url: string;
|
|
9
11
|
token?: string;
|
|
10
12
|
headers?: Record<string, string>;
|
|
11
13
|
};
|
|
12
|
-
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias,
|
|
14
|
+
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias, network, url, token, headers, }: Params) => Promise<Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[]>;
|
|
13
15
|
|
|
14
16
|
export { getUtxosByTxFromGlacier };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Glacier as t,
|
|
1
|
+
import{Glacier as t,BlockchainId as r}from"@avalabs/glacier-sdk";import{utils as o,evmSerial as e,avmSerial as n,pvmSerial as a,PVM as i,AVM as s,EVM as x}from"@avalabs/avalanchejs";import{getVmByChainAlias as c}from"./getVmByChainAlias.js";import{convertGlacierUtxo as u}from"./convertGlacierUtxo.js";const{getTransferableInputsByTx:I,hexToBuffer:p,unpackWithManager:f}=o,h=async({transactionHex:o,chainAlias:h,network:l,url:m,token:d,headers:w})=>{const D=c(h),g=p(o),T=f(D,g);if(e.isExportTx(T))return[];const E=(t=>{if(e.isImportTx(t)||n.isImportTx(t)||a.isImportTx(t))return t.sourceChain.toString();const o=t.getVM();switch(o){case x:return r.C_CHAIN;case s:return r.X_CHAIN;case i:return r.P_CHAIN;default:throw new Error(`Unable to get chain for VM type "${o}"`)}})(T),H=I(T),b=new t({BASE:m,TOKEN:d,HEADERS:w}),k=[...new Set(H.map((t=>t.utxoID.txID.toString())))],A=await Promise.all(k.map((t=>b.primaryNetworkTransactions.getTxByHash({blockchainId:E,network:l,txHash:t}))));return H.reduce(((t,r)=>{const o=A.find((t=>t.txHash===r.utxoID.txID.toString()));if(!o)throw new Error(`Unable to find parent tx "${r.utxoID.txID.toString()}"`);const e=o.emittedUtxos.find((t=>t.utxoId===r.utxoID.ID()));if(!e)throw new Error(`Unable to find UTXO "${r.utxoID.ID()}" at index "${r.utxoID.outputIdx.value()}"`);const n=u(e,l);return t.push(n),t}),[])};export{h as getUtxosByTxFromGlacier};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Get the xpub for m/44'/9000'/0' from the given mnemonic
|
|
3
3
|
* @param mnemonic
|
|
4
4
|
*/
|
|
5
|
-
declare function getXpubFromMnemonic(mnemonic: string): string;
|
|
5
|
+
declare function getXpubFromMnemonic(mnemonic: string, accountIndex: number): string;
|
|
6
6
|
|
|
7
7
|
export { getXpubFromMnemonic };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateMnemonic as r,mnemonicToSeedSync as e}from"bip39";import{fromSeed as o}from"bip32";function t(t){if(!r(t))throw new Error("Invalid mnemonic phrase.");const
|
|
1
|
+
import{validateMnemonic as r,mnemonicToSeedSync as e}from"bip39";import{fromSeed as o}from"bip32";function t(t,i){if(!r(t))throw new Error("Invalid mnemonic phrase.");const n=e(t);return o(n).derivePath(`44'/9000'/${i}'`).neutered().toBase58()}export{t as getXpubFromMnemonic};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as e,utils as s}from"@avalabs/avalanchejs";const t
|
|
1
|
+
import{pvmSerial as e,OutputOwners as t,utils as s}from"@avalabs/avalanchejs";const a=t=>e.isCreateChainTx(t)||e.isAddSubnetValidatorTx(t)||e.isRemoveSubnetValidatorTx(t)||e.isTransformSubnetTx(t)||e.isTransferSubnetOwnershipTx(t)||e.isConvertSubnetToL1Tx(t),r=async({tx:e,provider:a,addressMaps:r})=>{const n=e.getSubnetAuth().values(),i=await a.getApiP().getSubnet({subnetID:e.getSubnetID().value()}),u=t.fromNative(i.controlKeys.map((e=>s.parse(e)[2])),BigInt(i.locktime),Number(i.threshold)).addrs.reduce(((e,t,s)=>(n.includes(s)&&e.push([t,s]),e)),[]);return r.push(new s.AddressMap(u)),r};export{r as handleSubnetAuth,a as isSubnetTx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(r,t,n){return[...r].sort(((r,e)=>{for(let o=0;o<t.length;o++){const u=t[o];if(r[u]>e[u])return"asc"===n?1:-1;if(r[u]<e[u])return"asc"===n?-1:1}return 0}))}export{r as orderBy};
|
|
@@ -2,9 +2,20 @@ import { Common } from '@avalabs/avalanchejs';
|
|
|
2
2
|
import { Tx } from '../models.js';
|
|
3
3
|
import { JsonRpcProvider } from '../providers/JsonRpcProvider.js';
|
|
4
4
|
|
|
5
|
+
type ParseOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Tolerance percentage range where the burned amount is considered valid.
|
|
8
|
+
*/
|
|
9
|
+
feeTolerance?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Base fee used for validating burn amount. Priced in nAvax.
|
|
12
|
+
*/
|
|
13
|
+
baseFee?: bigint;
|
|
14
|
+
};
|
|
5
15
|
/**
|
|
6
16
|
* Returns human readable data from a given a transaction buffer,
|
|
7
17
|
*/
|
|
8
|
-
declare function parseAvalancheTx(unsignedTx: Common.UnsignedTx, provider: JsonRpcProvider, currentAddress: string): Promise<Tx>;
|
|
18
|
+
declare function parseAvalancheTx(unsignedTx: Common.UnsignedTx, provider: JsonRpcProvider, currentAddress: string, { feeTolerance, baseFee: inputBaseFee }?: ParseOptions): Promise<Tx>;
|
|
9
19
|
|
|
10
20
|
export { parseAvalancheTx };
|
|
21
|
+
export type { ParseOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{utils as t,evmSerial as e}from"@avalabs/avalanchejs";import{TxType as n}from"../models.js";import a from"./parsers/index.js";const{getBurnedAmountByTx:o,getOutputAmounts:r,getInputAmounts:s,validateBurnedAmount:i}=t;async function u(t,u,x,{feeTolerance:c=50,baseFee:g}={}){try{const n=u.getContext(),d=t.getTx(),p=(t=>{for(const e of Object.values(a)){const n=e(t);if(null!==n)return n}throw new Error("no parser found for tx")})(d),A=o(d,n),l=r(d),m=s(d).get(n.avaxAssetID)??BigInt(0),v=A.get(n.avaxAssetID)??BigInt(0),I=l.get(n.avaxAssetID)??BigInt(0);let f=g;void 0===f&&(f=0n,e.isImportExportTx(d)?(f=await u.getApiC().getBaseFee()/BigInt(1e9),0n===f&&(f=1n)):"PVM"===d.vm&&(f=await u.getApiP().getFeeState().then((t=>t.price)).catch((()=>BigInt(0)))));const{isValid:B,txFee:F}=i({unsignedTx:t,context:n,burnedAmount:v,baseFee:f,feeTolerance:c});return await p({feeData:{totalAvaxBurned:v,totalAvaxOutput:I,totalAvaxInput:m,isValidAvaxBurnedAmount:B,txFee:F,baseFee:f},assetId:n.avaxAssetID,provider:u,currentAddress:x})}catch(t){return{type:n.Unknown}}}export{u as parseAvalancheTx};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"./
|
|
1
|
+
import r from"./parseCreateSubnetTx.js";import e from"./parseCreateChainTx.js";import a from"./parseAddSubnetValidorTx.js";import s from"./parseImportTx.js";import o from"./parseExportTx.js";import t from"./parseBaseTx.js";import p from"./parseAddPermissionlessValidatorTx.js";import i from"./parseAddPermissionlessDelegatorTx.js";import m from"./parseRemoveSubnetValidatorTx.js";import x from"./parseTransferSubnetOwnershipTx.js";import T from"./parseConvertSubnetToL1Tx.js";import d from"./parseRegisterL1ValidatorTx.js";import n from"./parseSetL1ValidatorWeightTx.js";import l from"./parseDisableL1ValidatorTx.js";import f from"./parseIncreaseL1ValidatorBalanceTx.js";var j={parseCreateSubnetTx:r,parseCreateChainTx:e,parseAddSubnetValidatorTx:a,parseRemoveSubnetValidatorTx:m,parseImportTx:s,parseExportTx:o,parseBaseTx:t,parseAddPermissionlessValidatorTx:p,parseAddPermissionlessDelegatorTx:i,parseTransferSubnetOwnershipTx:x,parseConvertSubnetTx:T,parseRegisterL1ValidatorTx:d,parseIncreaseL1ValidatorBalanceTx:f,parseSetL1ValidatorWeightTx:n,parseDisableL1ValidatorTx:l};export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as e}from"@avalabs/avalanchejs";import{TxType as a}from"../../models.js";
|
|
1
|
+
import{pvmSerial as e}from"@avalabs/avalanchejs";import{TxType as a}from"../../models.js";var t=t=>e.isAddPermissionlessDelegatorTx(t)?({feeData:e})=>({type:a.AddPermissionlessDelegator,chain:t.getVM(),stake:t.subnetValidator.validator.weight.value(),nodeID:t.subnetValidator.validator.nodeId.value(),start:t.subnetValidator.validator.startTime.value().toString(),end:t.subnetValidator.validator.endTime.value().toString(),subnetID:t.subnetValidator.subnetId.value(),stakeOuts:t.stake,delegatorRewardsOwner:t.getDelegatorRewardsOwner(),...e}):null;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as e,utils as a}from"@avalabs/avalanchejs";import{TxType as
|
|
1
|
+
import{pvmSerial as e,utils as a}from"@avalabs/avalanchejs";import{TxType as r}from"../../models.js";var t=t=>{if(!e.isAddPermissionlessValidatorTx(t))return null;let i,s;return e.isSigner(t.signer)&&(s=a.bufferToHex(t.signer.proof.publicKey),i=a.bufferToHex(t.signer.proof.signature)),({feeData:e})=>({type:r.AddPermissionlessValidator,chain:t.getVM(),stake:t.subnetValidator.validator.weight.value(),nodeID:t.subnetValidator.validator.nodeId.value(),start:t.subnetValidator.validator.startTime.value().toString(),end:t.subnetValidator.validator.endTime.value().toString(),subnetID:t.subnetValidator.subnetId.value(),delegationFee:t.shares.value(),stakeOuts:t.stake,rewardOwner:t.getValidatorRewardsOwner(),delegationRewardOwner:t.getDelegatorRewardsOwner(),signer:t.signer,publicKey:s,signature:i,...e})};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as a}from"@avalabs/avalanchejs";import{TxType as t}from"../../models.js";
|
|
1
|
+
import{pvmSerial as a}from"@avalabs/avalanchejs";import{TxType as t}from"../../models.js";var e=e=>a.isAddSubnetValidatorTx(e)?({feeData:a})=>({type:t.AddSubnetValidator,chain:e.getVM(),stake:e.subnetValidator.validator.weight.value(),nodeID:e.subnetValidator.validator.nodeId.value(),start:e.subnetValidator.validator.startTime.value().toString(),end:e.subnetValidator.validator.endTime.value().toString(),subnetID:e.getSubnetID().value(),...a}):null;export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{avmSerial as t,pvmSerial as e,TransferOutput as s}from"@avalabs/avalanchejs";import o from"xss";import{TxType as
|
|
1
|
+
import{avmSerial as t,pvmSerial as e,TransferOutput as s}from"@avalabs/avalanchejs";import o from"xss";import{TxType as a}from"../../models.js";import{getUnixNow as r}from"../getUnixNow.js";var u=u=>t.isAvmBaseTx(u)||e.isPvmBaseTx(u)?async({feeData:e,currentAddress:n,provider:i})=>{const p=u.baseTx,m=await(async(e,o)=>{const a=e.baseTx,r=new Set;if(a.outputs.forEach((t=>{r.add(t.assetId.value())})),t.isAvmBaseTx(e)){const t=await Promise.all([...r.values()].map((t=>o.getApiX().getAssetDescription(t))));return a.outputs.reduce(((e,a)=>{if(a.output instanceof s){const s=a.assetId.value(),u=[...r.values()].indexOf(s),n=t[u],i=a.output.outputOwners.addrs.map((t=>`X-${t.toString(o.getContext().hrp)}`));return[...e,{assetId:s,amount:a.output.amount(),locktime:a.output.getLocktime(),threshold:BigInt(a.output.getThreshold()),assetDescription:n,owners:i,isAvax:o.getContext().avaxAssetID===s}]}return e}),[])}return a.outputs.reduce(((t,e)=>{if(e.output instanceof s){const s=e.assetId.value(),a=e.output.outputOwners.addrs.map((t=>`P-${t.toString(o.getContext().hrp)}`));return[...t,{assetId:s,amount:e.output.amount(),locktime:e.output.getLocktime(),threshold:BigInt(e.output.getThreshold()),owners:a,isAvax:o.getContext().avaxAssetID===s}]}return t}),[])})(u,i),d=r(),c=m.filter((t=>!(1===t.owners.length&&t.owners[0]===n&&t.locktime<=d)));return{type:a.Base,chain:u.getVM(),outputs:c,memo:o(Buffer.from(p.memo.toBytes()).toString("utf-8",4)),...e}}:null;export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pvmSerial as e,NodeId as a}from"@avalabs/avalanchejs";import{TxType as n}from"../../models.js";var t=t=>e.isConvertSubnetToL1Tx(t)?({feeData:e,provider:r})=>{const s=r.getHrp(),o=e=>`P-${e.toString(s)}`;return{type:n.ConvertSubnetToL1,chain:t.getVM(),managerAddress:`0x${t.address.toString("hex")}`,validators:t.validators.map((e=>({nodeId:a.fromHex(e.nodeId.toString("hex")).toString(),stake:e.weight.value(),balance:e.balance.value(),remainingBalanceOwners:e.remainingBalanceOwner.addresses.map(o),deactivationOwners:e.deactivationOwner.addresses.map(o)}))),chainID:t.chainID.value(),subnetID:t.subnetID.value(),...e}}:null;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as a}from"@avalabs/avalanchejs";import{TxType as e}from"../../models.js";
|
|
1
|
+
import{pvmSerial as a}from"@avalabs/avalanchejs";import{TxType as e}from"../../models.js";var t=t=>a.isCreateChainTx(t)?({feeData:a})=>({type:e.CreateChain,chain:t.getVM(),subnetID:t.getSubnetID().value(),chainName:t.chainName.value(),chainID:t.getBlockchainId(),vmID:t.vmID.value(),fxIDs:t.fxIds.map((a=>a.value())),genesisData:t.genesisData.toString(),...a}):null;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as e}from"@avalabs/avalanchejs";import{TxType as t}from"../../models.js";
|
|
1
|
+
import{pvmSerial as e}from"@avalabs/avalanchejs";import{TxType as t}from"../../models.js";var r=r=>e.isCreateSubnetTx(r)?({feeData:e,provider:a})=>({type:t.CreateSubnet,chain:r.getVM(),threshold:r.getSubnetOwners().threshold.value(),controlKeys:r.getSubnetOwners().addrs.map((e=>`P-${e.toString(a.getHrp())}`)),...e}):null;export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pvmSerial as a}from"@avalabs/avalanchejs";import{TxType as i}from"../../models.js";var t=t=>a.isDisableL1ValidatorTx(t)?({feeData:a})=>({type:i.DisableL1Validator,chain:t.getVM(),validationId:t.validationId.toString(),...a}):null;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pvmSerial as t,avmSerial as
|
|
1
|
+
import{pvmSerial as t,avmSerial as a,evmSerial as o}from"@avalabs/avalanchejs";import{TxType as e}from"../../models.js";import s from"./utils/chainIdToVm.js";import{getTransferableOutputAmount as i}from"./utils/getTransferableAmount.js";var r=r=>t.isExportTx(r)||a.isExportTx(r)||o.isExportTx(r)?o.isExportTx(r)?({feeData:t,assetId:a})=>({type:e.Export,chain:r.getVM(),destination:s(r.destinationChain.toString()),amount:i(r.exportedOutputs,a),...t}):({feeData:t,assetId:a})=>({type:e.Export,chain:r.getVM(),destination:s(r.destination.value()),amount:i(r.outs,a),...t}):null;export{r as default};
|