@avalabs/core-wallets-sdk 3.1.0-alpha.8 → 3.1.0-alpha.9
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.d.ts +157 -39
- package/dist/index.js +1 -1
- package/esm/Avalanche/models.d.ts +2 -2
- package/esm/Avalanche/providers/AbstractProvider.d.ts +7 -2
- package/esm/Avalanche/providers/AbstractProvider.js +1 -1
- package/esm/Avalanche/providers/JsonRpcProvider.d.ts +4 -3
- package/esm/Avalanche/providers/JsonRpcProvider.js +1 -1
- package/esm/Avalanche/providers/constants.js +1 -1
- package/esm/Avalanche/providers/platformFeeConfig.js +1 -0
- package/esm/Avalanche/utils/convertGlacierUtxo.d.ts +2 -2
- package/esm/Avalanche/utils/getPchainUnixNow.js +1 -1
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.d.ts +2 -1
- package/esm/Avalanche/utils/parseAvalancheTx.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/sortUTXOs.d.ts +5 -4
- package/esm/Avalanche/utils/txSizeLimits.d.ts +9 -2
- package/esm/Avalanche/utils/txSizeLimits.js +1 -1
- package/esm/Avalanche/wallets/TxBuilderTypes.d.ts +110 -0
- package/esm/Avalanche/wallets/WalletAbstract.d.ts +17 -16
- package/esm/Avalanche/wallets/WalletAbstract.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -8,12 +8,14 @@ import { Provider, VoidSigner, HDNodeWallet, TransactionResponse, JsonRpcProvide
|
|
|
8
8
|
import Transport from '@ledgerhq/hw-transport';
|
|
9
9
|
import Eth from '@ledgerhq/hw-app-eth';
|
|
10
10
|
import * as _avalabs_avalanchejs from '@avalabs/avalanchejs';
|
|
11
|
-
import { VM, Common, OutputOwners, TransferableOutput, pvmSerial, Context, avm, pvm, evm, avaxSerial, utils, UnsignedTx, EVMUnsignedTx, Utxo, Credential, Signature } from '@avalabs/avalanchejs';
|
|
11
|
+
import { VM, Common, OutputOwners, TransferableOutput, pvmSerial, Context, avm, pvm, evm, Info, avaxSerial, utils, UnsignedTx, EVMUnsignedTx, Utxo, TransferOutput, Credential, Signature } from '@avalabs/avalanchejs';
|
|
12
12
|
import * as _avalabs_avalanchejs_dist_vms_common from '@avalabs/avalanchejs/dist/vms/common';
|
|
13
|
+
import { GetUpgradesInfoResponse } from '@avalabs/avalanchejs/dist/info/model';
|
|
13
14
|
import { Bip32Path } from 'bip32-path';
|
|
14
15
|
import AppZondax, { ResponseBase } from '@avalabs/hw-app-avalanche';
|
|
15
16
|
import { BIP32Interface } from 'bip32';
|
|
16
17
|
import { Utxo as Utxo$1, PChainUtxo } from '@avalabs/glacier-sdk';
|
|
18
|
+
import * as _avalabs_avalanchejs_dist_serializable_common_types from '@avalabs/avalanchejs/dist/serializable/common/types';
|
|
17
19
|
import { WalletAbstract as WalletAbstract$1 } from 'Avalanche/wallets';
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -563,7 +565,7 @@ type ChainIDAlias = 'X' | 'P' | 'C';
|
|
|
563
565
|
/**
|
|
564
566
|
* Types for parsed transaction
|
|
565
567
|
*/
|
|
566
|
-
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx | UnknownTx;
|
|
568
|
+
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx$1 | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx$1 | UnknownTx;
|
|
567
569
|
interface FeeData {
|
|
568
570
|
totalAvaxBurned: bigint;
|
|
569
571
|
totalAvaxOutput: bigint;
|
|
@@ -591,7 +593,7 @@ declare enum TxType {
|
|
|
591
593
|
TransferSubnetOwnership = "transfer_subnet_ownership",
|
|
592
594
|
Unknown = "unknown"
|
|
593
595
|
}
|
|
594
|
-
interface BaseTx extends TxBase {
|
|
596
|
+
interface BaseTx$1 extends TxBase {
|
|
595
597
|
type: TxType.Base;
|
|
596
598
|
chain: VM;
|
|
597
599
|
outputs: {
|
|
@@ -670,7 +672,7 @@ interface AddPermissionlessValidatorTx extends TxBase {
|
|
|
670
672
|
rewardOwner: OutputOwners;
|
|
671
673
|
delegationRewardOwner: OutputOwners;
|
|
672
674
|
stake: bigint;
|
|
673
|
-
stakeOuts: TransferableOutput[];
|
|
675
|
+
stakeOuts: readonly TransferableOutput[];
|
|
674
676
|
subnetID: string;
|
|
675
677
|
publicKey: undefined | string;
|
|
676
678
|
signature: undefined | string;
|
|
@@ -684,7 +686,7 @@ interface AddPermissionlessDelegatorTx extends TxBase {
|
|
|
684
686
|
stake: bigint;
|
|
685
687
|
subnetID: string;
|
|
686
688
|
delegatorRewardsOwner: OutputOwners;
|
|
687
|
-
stakeOuts: TransferableOutput[];
|
|
689
|
+
stakeOuts: readonly TransferableOutput[];
|
|
688
690
|
}
|
|
689
691
|
interface TransformSubnetTx extends TxBase {
|
|
690
692
|
type: TxType.TransformSubnet;
|
|
@@ -703,7 +705,7 @@ interface TransformSubnetTx extends TxBase {
|
|
|
703
705
|
maxValidatorWeightFactor: number;
|
|
704
706
|
uptimeRequirement: number;
|
|
705
707
|
}
|
|
706
|
-
interface TransferSubnetOwnershipTx extends TxBase {
|
|
708
|
+
interface TransferSubnetOwnershipTx$1 extends TxBase {
|
|
707
709
|
type: TxType.TransferSubnetOwnership;
|
|
708
710
|
subnetID: string;
|
|
709
711
|
threshold: number;
|
|
@@ -719,7 +721,7 @@ declare function isAddValidatorTx(tx: Tx): tx is AddValidatorTx;
|
|
|
719
721
|
declare function isAddDelegatorTx(tx: Tx): tx is AddDelegatorTx;
|
|
720
722
|
declare function isExportTx(tx: Tx): tx is ExportTx;
|
|
721
723
|
declare function isImportTx(tx: Tx): tx is ImportTx;
|
|
722
|
-
declare function isBaseTx(tx: Tx): tx is BaseTx;
|
|
724
|
+
declare function isBaseTx(tx: Tx): tx is BaseTx$1;
|
|
723
725
|
declare function isCreateSubnetTx(tx: Tx): tx is CreateSubnetTx;
|
|
724
726
|
declare function isCreateChainTx(tx: Tx): tx is CreateChainTx;
|
|
725
727
|
declare function isAddSubnetValidatorTx(tx: Tx): tx is AddSubnetValidatorTx;
|
|
@@ -727,24 +729,28 @@ declare function isRemoveSubnetValidatorTx(tx: Tx): tx is RemoveSubnetValidatorT
|
|
|
727
729
|
declare function isAddPermissionlessValidatorTx(tx: Tx): tx is AddPermissionlessValidatorTx;
|
|
728
730
|
declare function isAddPermissionlessDelegatorTx(tx: Tx): tx is AddPermissionlessDelegatorTx;
|
|
729
731
|
declare function isTransformSubnetTx(tx: Tx): tx is TransformSubnetTx;
|
|
730
|
-
declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwnershipTx;
|
|
732
|
+
declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwnershipTx$1;
|
|
731
733
|
|
|
732
734
|
declare class AbstractProvider {
|
|
733
735
|
protected baseUrl: string;
|
|
734
736
|
protected context: Context.Context;
|
|
737
|
+
protected upgradesInfo: GetUpgradesInfoResponse;
|
|
735
738
|
evmRpc: JsonRpcProvider$1;
|
|
736
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
739
|
+
constructor(baseUrl: string, context: Context.Context, upgradesInfo: GetUpgradesInfoResponse);
|
|
737
740
|
/**
|
|
738
741
|
* @link https://docs.ethers.io/v5/api/providers/provider/#Provider-getFeeData
|
|
739
742
|
*/
|
|
740
743
|
getEvmFeeData(): Promise<ethers.FeeData>;
|
|
741
744
|
getContext(): Context.Context;
|
|
745
|
+
isEtnaEnabled(): boolean;
|
|
746
|
+
getUpgradesInfo(): GetUpgradesInfoResponse;
|
|
742
747
|
getChainID(chainAlias: ChainIDAlias): string;
|
|
743
748
|
getNetworkID(): number;
|
|
744
749
|
getHrp(): string;
|
|
745
750
|
getApiX(): avm.AVMApi;
|
|
746
751
|
getApiP(): pvm.PVMApi;
|
|
747
752
|
getApiC(): evm.EVMApi;
|
|
753
|
+
getInfo(): Info;
|
|
748
754
|
getApi(chain: ChainIDAlias): avm.AVMApi | pvm.PVMApi | evm.EVMApi;
|
|
749
755
|
getAvaxID(): string;
|
|
750
756
|
getAddress(publicKey: Buffer, chain: ChainIDAlias): string;
|
|
@@ -765,10 +771,10 @@ declare class AbstractProvider {
|
|
|
765
771
|
}
|
|
766
772
|
|
|
767
773
|
declare class JsonRpcProvider extends AbstractProvider {
|
|
768
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
774
|
+
constructor(baseUrl: string, context: Context.Context, upgradesInfo: GetUpgradesInfoResponse);
|
|
769
775
|
static fromBaseURL(url: string): Promise<JsonRpcProvider>;
|
|
770
|
-
static getDefaultMainnetProvider(): JsonRpcProvider;
|
|
771
|
-
static getDefaultFujiProvider(): JsonRpcProvider;
|
|
776
|
+
static getDefaultMainnetProvider(upgradesInfo: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
777
|
+
static getDefaultFujiProvider(upgradesInfo: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
772
778
|
}
|
|
773
779
|
|
|
774
780
|
/**
|
|
@@ -780,6 +786,113 @@ declare const MainnetContext: Context.Context;
|
|
|
780
786
|
*/
|
|
781
787
|
declare const FujiContext: Context.Context;
|
|
782
788
|
|
|
789
|
+
type BaseTx = {
|
|
790
|
+
utxoSet: utils.UtxoSet;
|
|
791
|
+
chain: 'X' | 'P';
|
|
792
|
+
toAddress: string;
|
|
793
|
+
amountsPerAsset: Record<string, bigint>;
|
|
794
|
+
feeState: pvm.FeeState;
|
|
795
|
+
options?: Common.SpendOptions;
|
|
796
|
+
fromAddresses?: string[];
|
|
797
|
+
};
|
|
798
|
+
type ImportP = {
|
|
799
|
+
utxoSet: utils.UtxoSet;
|
|
800
|
+
sourceChain: 'X' | 'C';
|
|
801
|
+
toAddress?: string;
|
|
802
|
+
threshold?: number;
|
|
803
|
+
feeState: pvm.FeeState;
|
|
804
|
+
locktime?: bigint;
|
|
805
|
+
};
|
|
806
|
+
type ExportP = {
|
|
807
|
+
amount: bigint;
|
|
808
|
+
utxoSet: utils.UtxoSet;
|
|
809
|
+
destination: 'X' | 'C';
|
|
810
|
+
feeState: pvm.FeeState;
|
|
811
|
+
toAddress?: string;
|
|
812
|
+
};
|
|
813
|
+
type ConsolidateP = {
|
|
814
|
+
utxoSet: utils.UtxoSet;
|
|
815
|
+
amount: bigint;
|
|
816
|
+
feeState: pvm.FeeState;
|
|
817
|
+
toAddress?: string;
|
|
818
|
+
options?: Common.SpendOptions;
|
|
819
|
+
};
|
|
820
|
+
type CreateSubnet = {
|
|
821
|
+
utxoSet: utils.UtxoSet;
|
|
822
|
+
rewardAddresses: string[];
|
|
823
|
+
feeState: pvm.FeeState;
|
|
824
|
+
fromAddresses?: string[];
|
|
825
|
+
options?: Common.SpendOptions;
|
|
826
|
+
threshold?: number;
|
|
827
|
+
locktime?: bigint;
|
|
828
|
+
};
|
|
829
|
+
type AddSubnetValidator = {
|
|
830
|
+
utxoSet: utils.UtxoSet;
|
|
831
|
+
nodeId: string;
|
|
832
|
+
start: bigint;
|
|
833
|
+
end: bigint;
|
|
834
|
+
weight: bigint;
|
|
835
|
+
subnetId: string;
|
|
836
|
+
subnetAuth: number[];
|
|
837
|
+
feeState: pvm.FeeState;
|
|
838
|
+
fromAddresses?: string[];
|
|
839
|
+
options?: Common.SpendOptions;
|
|
840
|
+
};
|
|
841
|
+
type AddPermissionlessValidator = {
|
|
842
|
+
utxoSet: utils.UtxoSet;
|
|
843
|
+
nodeId: string;
|
|
844
|
+
start: bigint;
|
|
845
|
+
end: bigint;
|
|
846
|
+
weight: bigint;
|
|
847
|
+
subnetId: string;
|
|
848
|
+
shares: number;
|
|
849
|
+
fromAddresses?: string[];
|
|
850
|
+
rewardAddresses?: string[];
|
|
851
|
+
delegatorRewardAddresses?: string[];
|
|
852
|
+
publicKey?: Buffer;
|
|
853
|
+
signature?: Buffer;
|
|
854
|
+
options?: Common.SpendOptions;
|
|
855
|
+
stakingAssetId?: string;
|
|
856
|
+
locktime?: bigint;
|
|
857
|
+
threshold?: number;
|
|
858
|
+
feeState: pvm.FeeState;
|
|
859
|
+
};
|
|
860
|
+
type AddPermissionlessDelegator = {
|
|
861
|
+
utxoSet: utils.UtxoSet;
|
|
862
|
+
nodeId: string;
|
|
863
|
+
start: bigint;
|
|
864
|
+
end: bigint;
|
|
865
|
+
weight: bigint;
|
|
866
|
+
subnetId: string;
|
|
867
|
+
fromAddresses?: string[];
|
|
868
|
+
rewardAddresses?: string[];
|
|
869
|
+
options?: Common.SpendOptions;
|
|
870
|
+
locktime?: bigint;
|
|
871
|
+
feeState: pvm.FeeState;
|
|
872
|
+
stakingAssetId?: string;
|
|
873
|
+
threshold?: number;
|
|
874
|
+
};
|
|
875
|
+
type RemoveSubnetValidator = {
|
|
876
|
+
utxoSet: utils.UtxoSet;
|
|
877
|
+
nodeId: string;
|
|
878
|
+
subnetId: string;
|
|
879
|
+
subnetAuth: number[];
|
|
880
|
+
feeState: pvm.FeeState;
|
|
881
|
+
fromAddresses?: string[];
|
|
882
|
+
options?: Common.SpendOptions;
|
|
883
|
+
};
|
|
884
|
+
type TransferSubnetOwnershipTx = {
|
|
885
|
+
utxoSet: utils.UtxoSet;
|
|
886
|
+
subnetId: string;
|
|
887
|
+
subnetAuth: number[];
|
|
888
|
+
subnetOwners: string[];
|
|
889
|
+
feeState: pvm.FeeState;
|
|
890
|
+
fromAddresses?: string[];
|
|
891
|
+
options?: Common.SpendOptions;
|
|
892
|
+
threshold?: number;
|
|
893
|
+
locktime?: bigint;
|
|
894
|
+
};
|
|
895
|
+
|
|
783
896
|
/**
|
|
784
897
|
* An abstract class that that is shared by all wallet classes.
|
|
785
898
|
*/
|
|
@@ -825,8 +938,12 @@ declare abstract class WalletAbstract {
|
|
|
825
938
|
* @param source What is the source chain of the atomic UTXOs
|
|
826
939
|
*/
|
|
827
940
|
getAtomicUTXOs(chain: ChainIDAlias, source: ChainIDAlias): Promise<utils.UtxoSet>;
|
|
941
|
+
/**
|
|
942
|
+
* Get the nonce of this wallet's C chain address
|
|
943
|
+
*/
|
|
944
|
+
getNonce(): Promise<number>;
|
|
828
945
|
exportX(amount: bigint, utxoSet: utils.UtxoSet, destination: 'P' | 'C', toAddress?: string): Common.UnsignedTx;
|
|
829
|
-
importP(
|
|
946
|
+
importP({ utxoSet, sourceChain, toAddress, threshold, feeState, locktime, }: ImportP): Common.UnsignedTx;
|
|
830
947
|
importX(utxos: utils.UtxoSet, sourceChain: 'P' | 'C', toAddress?: string): Common.UnsignedTx;
|
|
831
948
|
/**
|
|
832
949
|
*
|
|
@@ -846,10 +963,6 @@ declare abstract class WalletAbstract {
|
|
|
846
963
|
* @param toAddress
|
|
847
964
|
*/
|
|
848
965
|
exportC(amount: bigint, destination: 'X' | 'P', nonce: bigint, baseFee: bigint, toAddress?: string): _avalabs_avalanchejs.EVMUnsignedTx;
|
|
849
|
-
/**
|
|
850
|
-
* Get the nonce of this wallet's C chain address
|
|
851
|
-
*/
|
|
852
|
-
getNonce(): Promise<number>;
|
|
853
966
|
/**
|
|
854
967
|
* Export the given amount of AVAX from the P chain. Export fee is automatically added.
|
|
855
968
|
* @param amount
|
|
@@ -857,18 +970,18 @@ declare abstract class WalletAbstract {
|
|
|
857
970
|
* @param destination
|
|
858
971
|
* @param toAddress
|
|
859
972
|
*/
|
|
860
|
-
exportP(amount
|
|
861
|
-
addValidator(utxos: utils.UtxoSet,
|
|
973
|
+
exportP({ amount, utxoSet, destination, feeState, toAddress }: ExportP): Common.UnsignedTx;
|
|
974
|
+
addValidator(utxos: utils.UtxoSet, nodeId: string, stakeAmount: bigint, startDate: bigint, endDate: bigint, delegationFee: number, config?: {
|
|
862
975
|
rewardAddress?: string;
|
|
863
976
|
}): Common.UnsignedTx;
|
|
864
|
-
addDelegator(utxos: utils.UtxoSet,
|
|
977
|
+
addDelegator(utxos: utils.UtxoSet, nodeId: string, stakeAmount: bigint, startDate: bigint, endDate: bigint, config?: {
|
|
865
978
|
rewardAddress?: string;
|
|
866
979
|
}): Common.UnsignedTx;
|
|
867
|
-
consolidateP(utxoSet
|
|
868
|
-
baseTX(utxoSet
|
|
980
|
+
consolidateP({ utxoSet, amount, feeState, toAddress, options, }: ConsolidateP): Common.UnsignedTx;
|
|
981
|
+
baseTX({ utxoSet, chain, toAddress, amountsPerAsset, feeState, options, fromAddresses, }: BaseTx): Common.UnsignedTx;
|
|
869
982
|
createBlockchain(utxoSet: utils.UtxoSet, subnetId: string, chainName: string, vmID: string, fxIds: string[], genesisData: Record<string, unknown>, subnetAuth: number[], options?: Common.SpendOptions, fromAddresses?: string[]): Common.UnsignedTx;
|
|
870
|
-
createSubnet(utxoSet
|
|
871
|
-
addSubnetValidator(utxoSet
|
|
983
|
+
createSubnet({ utxoSet, rewardAddresses, feeState, fromAddresses, options, threshold, locktime, }: CreateSubnet): Common.UnsignedTx;
|
|
984
|
+
addSubnetValidator({ utxoSet, nodeId, start, end, weight, subnetId, subnetAuth, feeState, fromAddresses, options, }: AddSubnetValidator): Common.UnsignedTx;
|
|
872
985
|
/**
|
|
873
986
|
*
|
|
874
987
|
* @param utxoSet The transaction will be constructed from these UTXOs.
|
|
@@ -885,7 +998,7 @@ declare abstract class WalletAbstract {
|
|
|
885
998
|
* @param signature the BLS signature, If the subnet is the primary network. Can be found in the Node on startup.
|
|
886
999
|
* @param options
|
|
887
1000
|
*/
|
|
888
|
-
addPermissionlessValidator(utxoSet
|
|
1001
|
+
addPermissionlessValidator({ utxoSet, nodeId, start, end, weight, subnetId, shares, feeState, fromAddresses, rewardAddresses, delegatorRewardAddresses, publicKey, signature, options, threshold, locktime, stakingAssetId, }: AddPermissionlessValidator): Common.UnsignedTx;
|
|
889
1002
|
/**
|
|
890
1003
|
*
|
|
891
1004
|
* @param utxoSet The transaction will be constructed from these UTXOs.
|
|
@@ -898,9 +1011,9 @@ declare abstract class WalletAbstract {
|
|
|
898
1011
|
* @param rewardAddresses Will use active address if not provided. Given addresses will share the reward UTXO.
|
|
899
1012
|
* @param options
|
|
900
1013
|
*/
|
|
901
|
-
addPermissionlessDelegator(utxoSet
|
|
902
|
-
removeSubnetValidator(utxoSet
|
|
903
|
-
transferSubnetOwnershipTx(utxoSet
|
|
1014
|
+
addPermissionlessDelegator({ utxoSet, nodeId, start, end, weight, subnetId, fromAddresses, rewardAddresses, options, locktime, feeState, threshold, stakingAssetId, }: AddPermissionlessDelegator): Common.UnsignedTx;
|
|
1015
|
+
removeSubnetValidator({ utxoSet, nodeId, subnetId, subnetAuth, fromAddresses, feeState, options, }: RemoveSubnetValidator): Common.UnsignedTx;
|
|
1016
|
+
transferSubnetOwnershipTx({ utxoSet, subnetId, subnetAuth, subnetOwners, feeState, fromAddresses, options, threshold, locktime, }: TransferSubnetOwnershipTx): Common.UnsignedTx;
|
|
904
1017
|
transformSubnetTx(utxoSet: utils.UtxoSet, subnetId: string, assetId: string, initialSupply: bigint, maximumSupply: bigint, minConsumptionRate: bigint, maxConsumptionRate: bigint, minValidatorStake: bigint, maxValidatorStake: bigint, minStakeDuration: number, maxStakeDuration: number, minDelegationFee: number, minDelegatorStake: number, maxValidatorWeightFactor: number, uptimeRequirement: number, subnetAuth: number[], fromAddresses?: string[], options?: Common.SpendOptions): Common.UnsignedTx;
|
|
905
1018
|
protected constructor(provider: AbstractProvider);
|
|
906
1019
|
}
|
|
@@ -1352,7 +1465,7 @@ declare const addSignaturesToAvalancheTx: ({ transactionHex, signatures, chainAl
|
|
|
1352
1465
|
}>;
|
|
1353
1466
|
|
|
1354
1467
|
type GlacierOutput = Utxo$1 | PChainUtxo;
|
|
1355
|
-
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, isTestnet: boolean) => Utxo
|
|
1468
|
+
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, isTestnet: boolean) => Utxo<TransferOutput | pvmSerial.StakeableLockOut<TransferOutput>>;
|
|
1356
1469
|
|
|
1357
1470
|
type Params$2 = {
|
|
1358
1471
|
txBytes: Uint8Array;
|
|
@@ -1474,7 +1587,7 @@ type Params = {
|
|
|
1474
1587
|
token?: string;
|
|
1475
1588
|
headers?: Record<string, string>;
|
|
1476
1589
|
};
|
|
1477
|
-
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias, isTestnet, url, token, headers, }: Params) => Promise<Utxo[]>;
|
|
1590
|
+
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias, isTestnet, url, token, headers, }: Params) => Promise<Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[]>;
|
|
1478
1591
|
|
|
1479
1592
|
declare const getVmByChainAlias: (chainAlias: string) => "EVM" | "AVM" | "PVM";
|
|
1480
1593
|
|
|
@@ -1510,10 +1623,10 @@ declare function signedTxToHex(signedTx: avaxSerial.SignedTx): string;
|
|
|
1510
1623
|
* 2- Highest value UTXOs to lowest
|
|
1511
1624
|
* @remark Does not check for locked UTXOs
|
|
1512
1625
|
*/
|
|
1513
|
-
declare function sortUTXOsStaking(utxos: Utxo[]): Utxo[];
|
|
1514
|
-
declare function sortUTXOsByAmount(utxos: Utxo[], isDescending: boolean): Utxo[];
|
|
1515
|
-
declare const sortUTXOsByAmountDescending: (utxos: Utxo[]) => Utxo[];
|
|
1516
|
-
declare const sortUTXOsByAmountAscending: (utxos: Utxo[]) => Utxo[];
|
|
1626
|
+
declare function sortUTXOsStaking(utxos: Utxo[]): Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1627
|
+
declare function sortUTXOsByAmount(utxos: Utxo[], isDescending: boolean): Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1628
|
+
declare const sortUTXOsByAmountDescending: (utxos: Utxo[]) => Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1629
|
+
declare const sortUTXOsByAmountAscending: (utxos: Utxo[]) => Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1517
1630
|
|
|
1518
1631
|
/**
|
|
1519
1632
|
* The list of transaction types supported by `getMaximumUtxoSet`.
|
|
@@ -1539,9 +1652,16 @@ declare const P_CHAIN_TX_SIZE_LIMIT = 65536;
|
|
|
1539
1652
|
* @param utxos - list of UTXOs to be consumed by the transaction.
|
|
1540
1653
|
* @param sizeSupportedTx - one of the supported transaction types
|
|
1541
1654
|
* @param limit - optional - byte size limit, defaults to 64kb.
|
|
1655
|
+
* @param feeState - current fee state on the chain
|
|
1542
1656
|
* @returns the largest prefix of sorted `utxos` before hitting the size limit. If no such prefix exists, then an empty array.
|
|
1543
1657
|
*/
|
|
1544
|
-
declare function getMaximumUtxoSet(wallet
|
|
1658
|
+
declare function getMaximumUtxoSet({ wallet, utxos, sizeSupportedTx, limit, feeState, }: {
|
|
1659
|
+
wallet: WalletAbstract$1;
|
|
1660
|
+
utxos: Utxo[];
|
|
1661
|
+
sizeSupportedTx: SizeSupportedTx;
|
|
1662
|
+
limit?: number;
|
|
1663
|
+
feeState: pvm.FeeState;
|
|
1664
|
+
}): Utxo[];
|
|
1545
1665
|
|
|
1546
1666
|
/**
|
|
1547
1667
|
* Verifies the given derivation path is valid, starts with `m`, and of the right length
|
|
@@ -1558,7 +1678,6 @@ type index_AddSubnetValidatorTx = AddSubnetValidatorTx;
|
|
|
1558
1678
|
type index_AddValidatorTx = AddValidatorTx;
|
|
1559
1679
|
type index_AddressWallet = AddressWallet;
|
|
1560
1680
|
declare const index_AddressWallet: typeof AddressWallet;
|
|
1561
|
-
type index_BaseTx = BaseTx;
|
|
1562
1681
|
type index_ChainIDAlias = ChainIDAlias;
|
|
1563
1682
|
type index_CreateChainTx = CreateChainTx;
|
|
1564
1683
|
type index_CreateSubnetTx = CreateSubnetTx;
|
|
@@ -1595,7 +1714,6 @@ type index_SizeSupportedTx = SizeSupportedTx;
|
|
|
1595
1714
|
declare const index_SizeSupportedTx: typeof SizeSupportedTx;
|
|
1596
1715
|
type index_StaticSigner = StaticSigner;
|
|
1597
1716
|
declare const index_StaticSigner: typeof StaticSigner;
|
|
1598
|
-
type index_TransferSubnetOwnershipTx = TransferSubnetOwnershipTx;
|
|
1599
1717
|
type index_TransformSubnetTx = TransformSubnetTx;
|
|
1600
1718
|
type index_Tx = Tx;
|
|
1601
1719
|
type index_TxBase = TxBase;
|
|
@@ -1660,7 +1778,7 @@ declare namespace index {
|
|
|
1660
1778
|
index_AddSubnetValidatorTx as AddSubnetValidatorTx,
|
|
1661
1779
|
index_AddValidatorTx as AddValidatorTx,
|
|
1662
1780
|
index_AddressWallet as AddressWallet,
|
|
1663
|
-
|
|
1781
|
+
BaseTx$1 as BaseTx,
|
|
1664
1782
|
index_ChainIDAlias as ChainIDAlias,
|
|
1665
1783
|
index_CreateChainTx as CreateChainTx,
|
|
1666
1784
|
index_CreateSubnetTx as CreateSubnetTx,
|
|
@@ -1688,7 +1806,7 @@ declare namespace index {
|
|
|
1688
1806
|
index_SimpleSigner as SimpleSigner,
|
|
1689
1807
|
index_SizeSupportedTx as SizeSupportedTx,
|
|
1690
1808
|
index_StaticSigner as StaticSigner,
|
|
1691
|
-
|
|
1809
|
+
TransferSubnetOwnershipTx$1 as TransferSubnetOwnershipTx,
|
|
1692
1810
|
index_TransformSubnetTx as TransformSubnetTx,
|
|
1693
1811
|
index_Tx as Tx,
|
|
1694
1812
|
index_TxBase as TxBase,
|