@avalabs/core-wallets-sdk 3.1.0-alpha.7 → 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 +159 -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/esm/BitcoinVM/providers/BitcoinProvider.d.ts +1 -0
- package/esm/BitcoinVM/providers/BitcoinProvider.js +1 -1
- package/esm/BitcoinVM/providers/BitcoinProviderAbstract.d.ts +1 -0
- 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
|
/**
|
|
@@ -147,6 +149,7 @@ declare abstract class BitcoinProviderAbstract {
|
|
|
147
149
|
medium: number;
|
|
148
150
|
low: number;
|
|
149
151
|
}>;
|
|
152
|
+
abstract getAddressFromScript(script: string): Promise<string>;
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
declare class BitcoinProvider extends BitcoinProviderAbstract {
|
|
@@ -159,6 +162,7 @@ declare class BitcoinProvider extends BitcoinProviderAbstract {
|
|
|
159
162
|
confirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
160
163
|
unconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
161
164
|
}>;
|
|
165
|
+
getAddressFromScript(script: string): Promise<string>;
|
|
162
166
|
getScriptsForUtxos(utxos: BitcoinInputUTXOWithOptionalScript[]): Promise<BitcoinInputUTXO[]>;
|
|
163
167
|
private _parseUtxo;
|
|
164
168
|
getBalances(address: string): Promise<{
|
|
@@ -561,7 +565,7 @@ type ChainIDAlias = 'X' | 'P' | 'C';
|
|
|
561
565
|
/**
|
|
562
566
|
* Types for parsed transaction
|
|
563
567
|
*/
|
|
564
|
-
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;
|
|
565
569
|
interface FeeData {
|
|
566
570
|
totalAvaxBurned: bigint;
|
|
567
571
|
totalAvaxOutput: bigint;
|
|
@@ -589,7 +593,7 @@ declare enum TxType {
|
|
|
589
593
|
TransferSubnetOwnership = "transfer_subnet_ownership",
|
|
590
594
|
Unknown = "unknown"
|
|
591
595
|
}
|
|
592
|
-
interface BaseTx extends TxBase {
|
|
596
|
+
interface BaseTx$1 extends TxBase {
|
|
593
597
|
type: TxType.Base;
|
|
594
598
|
chain: VM;
|
|
595
599
|
outputs: {
|
|
@@ -668,7 +672,7 @@ interface AddPermissionlessValidatorTx extends TxBase {
|
|
|
668
672
|
rewardOwner: OutputOwners;
|
|
669
673
|
delegationRewardOwner: OutputOwners;
|
|
670
674
|
stake: bigint;
|
|
671
|
-
stakeOuts: TransferableOutput[];
|
|
675
|
+
stakeOuts: readonly TransferableOutput[];
|
|
672
676
|
subnetID: string;
|
|
673
677
|
publicKey: undefined | string;
|
|
674
678
|
signature: undefined | string;
|
|
@@ -682,7 +686,7 @@ interface AddPermissionlessDelegatorTx extends TxBase {
|
|
|
682
686
|
stake: bigint;
|
|
683
687
|
subnetID: string;
|
|
684
688
|
delegatorRewardsOwner: OutputOwners;
|
|
685
|
-
stakeOuts: TransferableOutput[];
|
|
689
|
+
stakeOuts: readonly TransferableOutput[];
|
|
686
690
|
}
|
|
687
691
|
interface TransformSubnetTx extends TxBase {
|
|
688
692
|
type: TxType.TransformSubnet;
|
|
@@ -701,7 +705,7 @@ interface TransformSubnetTx extends TxBase {
|
|
|
701
705
|
maxValidatorWeightFactor: number;
|
|
702
706
|
uptimeRequirement: number;
|
|
703
707
|
}
|
|
704
|
-
interface TransferSubnetOwnershipTx extends TxBase {
|
|
708
|
+
interface TransferSubnetOwnershipTx$1 extends TxBase {
|
|
705
709
|
type: TxType.TransferSubnetOwnership;
|
|
706
710
|
subnetID: string;
|
|
707
711
|
threshold: number;
|
|
@@ -717,7 +721,7 @@ declare function isAddValidatorTx(tx: Tx): tx is AddValidatorTx;
|
|
|
717
721
|
declare function isAddDelegatorTx(tx: Tx): tx is AddDelegatorTx;
|
|
718
722
|
declare function isExportTx(tx: Tx): tx is ExportTx;
|
|
719
723
|
declare function isImportTx(tx: Tx): tx is ImportTx;
|
|
720
|
-
declare function isBaseTx(tx: Tx): tx is BaseTx;
|
|
724
|
+
declare function isBaseTx(tx: Tx): tx is BaseTx$1;
|
|
721
725
|
declare function isCreateSubnetTx(tx: Tx): tx is CreateSubnetTx;
|
|
722
726
|
declare function isCreateChainTx(tx: Tx): tx is CreateChainTx;
|
|
723
727
|
declare function isAddSubnetValidatorTx(tx: Tx): tx is AddSubnetValidatorTx;
|
|
@@ -725,24 +729,28 @@ declare function isRemoveSubnetValidatorTx(tx: Tx): tx is RemoveSubnetValidatorT
|
|
|
725
729
|
declare function isAddPermissionlessValidatorTx(tx: Tx): tx is AddPermissionlessValidatorTx;
|
|
726
730
|
declare function isAddPermissionlessDelegatorTx(tx: Tx): tx is AddPermissionlessDelegatorTx;
|
|
727
731
|
declare function isTransformSubnetTx(tx: Tx): tx is TransformSubnetTx;
|
|
728
|
-
declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwnershipTx;
|
|
732
|
+
declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwnershipTx$1;
|
|
729
733
|
|
|
730
734
|
declare class AbstractProvider {
|
|
731
735
|
protected baseUrl: string;
|
|
732
736
|
protected context: Context.Context;
|
|
737
|
+
protected upgradesInfo: GetUpgradesInfoResponse;
|
|
733
738
|
evmRpc: JsonRpcProvider$1;
|
|
734
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
739
|
+
constructor(baseUrl: string, context: Context.Context, upgradesInfo: GetUpgradesInfoResponse);
|
|
735
740
|
/**
|
|
736
741
|
* @link https://docs.ethers.io/v5/api/providers/provider/#Provider-getFeeData
|
|
737
742
|
*/
|
|
738
743
|
getEvmFeeData(): Promise<ethers.FeeData>;
|
|
739
744
|
getContext(): Context.Context;
|
|
745
|
+
isEtnaEnabled(): boolean;
|
|
746
|
+
getUpgradesInfo(): GetUpgradesInfoResponse;
|
|
740
747
|
getChainID(chainAlias: ChainIDAlias): string;
|
|
741
748
|
getNetworkID(): number;
|
|
742
749
|
getHrp(): string;
|
|
743
750
|
getApiX(): avm.AVMApi;
|
|
744
751
|
getApiP(): pvm.PVMApi;
|
|
745
752
|
getApiC(): evm.EVMApi;
|
|
753
|
+
getInfo(): Info;
|
|
746
754
|
getApi(chain: ChainIDAlias): avm.AVMApi | pvm.PVMApi | evm.EVMApi;
|
|
747
755
|
getAvaxID(): string;
|
|
748
756
|
getAddress(publicKey: Buffer, chain: ChainIDAlias): string;
|
|
@@ -763,10 +771,10 @@ declare class AbstractProvider {
|
|
|
763
771
|
}
|
|
764
772
|
|
|
765
773
|
declare class JsonRpcProvider extends AbstractProvider {
|
|
766
|
-
constructor(baseUrl: string, context: Context.Context);
|
|
774
|
+
constructor(baseUrl: string, context: Context.Context, upgradesInfo: GetUpgradesInfoResponse);
|
|
767
775
|
static fromBaseURL(url: string): Promise<JsonRpcProvider>;
|
|
768
|
-
static getDefaultMainnetProvider(): JsonRpcProvider;
|
|
769
|
-
static getDefaultFujiProvider(): JsonRpcProvider;
|
|
776
|
+
static getDefaultMainnetProvider(upgradesInfo: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
777
|
+
static getDefaultFujiProvider(upgradesInfo: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
770
778
|
}
|
|
771
779
|
|
|
772
780
|
/**
|
|
@@ -778,6 +786,113 @@ declare const MainnetContext: Context.Context;
|
|
|
778
786
|
*/
|
|
779
787
|
declare const FujiContext: Context.Context;
|
|
780
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
|
+
|
|
781
896
|
/**
|
|
782
897
|
* An abstract class that that is shared by all wallet classes.
|
|
783
898
|
*/
|
|
@@ -823,8 +938,12 @@ declare abstract class WalletAbstract {
|
|
|
823
938
|
* @param source What is the source chain of the atomic UTXOs
|
|
824
939
|
*/
|
|
825
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>;
|
|
826
945
|
exportX(amount: bigint, utxoSet: utils.UtxoSet, destination: 'P' | 'C', toAddress?: string): Common.UnsignedTx;
|
|
827
|
-
importP(
|
|
946
|
+
importP({ utxoSet, sourceChain, toAddress, threshold, feeState, locktime, }: ImportP): Common.UnsignedTx;
|
|
828
947
|
importX(utxos: utils.UtxoSet, sourceChain: 'P' | 'C', toAddress?: string): Common.UnsignedTx;
|
|
829
948
|
/**
|
|
830
949
|
*
|
|
@@ -844,10 +963,6 @@ declare abstract class WalletAbstract {
|
|
|
844
963
|
* @param toAddress
|
|
845
964
|
*/
|
|
846
965
|
exportC(amount: bigint, destination: 'X' | 'P', nonce: bigint, baseFee: bigint, toAddress?: string): _avalabs_avalanchejs.EVMUnsignedTx;
|
|
847
|
-
/**
|
|
848
|
-
* Get the nonce of this wallet's C chain address
|
|
849
|
-
*/
|
|
850
|
-
getNonce(): Promise<number>;
|
|
851
966
|
/**
|
|
852
967
|
* Export the given amount of AVAX from the P chain. Export fee is automatically added.
|
|
853
968
|
* @param amount
|
|
@@ -855,18 +970,18 @@ declare abstract class WalletAbstract {
|
|
|
855
970
|
* @param destination
|
|
856
971
|
* @param toAddress
|
|
857
972
|
*/
|
|
858
|
-
exportP(amount
|
|
859
|
-
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?: {
|
|
860
975
|
rewardAddress?: string;
|
|
861
976
|
}): Common.UnsignedTx;
|
|
862
|
-
addDelegator(utxos: utils.UtxoSet,
|
|
977
|
+
addDelegator(utxos: utils.UtxoSet, nodeId: string, stakeAmount: bigint, startDate: bigint, endDate: bigint, config?: {
|
|
863
978
|
rewardAddress?: string;
|
|
864
979
|
}): Common.UnsignedTx;
|
|
865
|
-
consolidateP(utxoSet
|
|
866
|
-
baseTX(utxoSet
|
|
980
|
+
consolidateP({ utxoSet, amount, feeState, toAddress, options, }: ConsolidateP): Common.UnsignedTx;
|
|
981
|
+
baseTX({ utxoSet, chain, toAddress, amountsPerAsset, feeState, options, fromAddresses, }: BaseTx): Common.UnsignedTx;
|
|
867
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;
|
|
868
|
-
createSubnet(utxoSet
|
|
869
|
-
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;
|
|
870
985
|
/**
|
|
871
986
|
*
|
|
872
987
|
* @param utxoSet The transaction will be constructed from these UTXOs.
|
|
@@ -883,7 +998,7 @@ declare abstract class WalletAbstract {
|
|
|
883
998
|
* @param signature the BLS signature, If the subnet is the primary network. Can be found in the Node on startup.
|
|
884
999
|
* @param options
|
|
885
1000
|
*/
|
|
886
|
-
addPermissionlessValidator(utxoSet
|
|
1001
|
+
addPermissionlessValidator({ utxoSet, nodeId, start, end, weight, subnetId, shares, feeState, fromAddresses, rewardAddresses, delegatorRewardAddresses, publicKey, signature, options, threshold, locktime, stakingAssetId, }: AddPermissionlessValidator): Common.UnsignedTx;
|
|
887
1002
|
/**
|
|
888
1003
|
*
|
|
889
1004
|
* @param utxoSet The transaction will be constructed from these UTXOs.
|
|
@@ -896,9 +1011,9 @@ declare abstract class WalletAbstract {
|
|
|
896
1011
|
* @param rewardAddresses Will use active address if not provided. Given addresses will share the reward UTXO.
|
|
897
1012
|
* @param options
|
|
898
1013
|
*/
|
|
899
|
-
addPermissionlessDelegator(utxoSet
|
|
900
|
-
removeSubnetValidator(utxoSet
|
|
901
|
-
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;
|
|
902
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;
|
|
903
1018
|
protected constructor(provider: AbstractProvider);
|
|
904
1019
|
}
|
|
@@ -1350,7 +1465,7 @@ declare const addSignaturesToAvalancheTx: ({ transactionHex, signatures, chainAl
|
|
|
1350
1465
|
}>;
|
|
1351
1466
|
|
|
1352
1467
|
type GlacierOutput = Utxo$1 | PChainUtxo;
|
|
1353
|
-
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, isTestnet: boolean) => Utxo
|
|
1468
|
+
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, isTestnet: boolean) => Utxo<TransferOutput | pvmSerial.StakeableLockOut<TransferOutput>>;
|
|
1354
1469
|
|
|
1355
1470
|
type Params$2 = {
|
|
1356
1471
|
txBytes: Uint8Array;
|
|
@@ -1472,7 +1587,7 @@ type Params = {
|
|
|
1472
1587
|
token?: string;
|
|
1473
1588
|
headers?: Record<string, string>;
|
|
1474
1589
|
};
|
|
1475
|
-
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>[]>;
|
|
1476
1591
|
|
|
1477
1592
|
declare const getVmByChainAlias: (chainAlias: string) => "EVM" | "AVM" | "PVM";
|
|
1478
1593
|
|
|
@@ -1508,10 +1623,10 @@ declare function signedTxToHex(signedTx: avaxSerial.SignedTx): string;
|
|
|
1508
1623
|
* 2- Highest value UTXOs to lowest
|
|
1509
1624
|
* @remark Does not check for locked UTXOs
|
|
1510
1625
|
*/
|
|
1511
|
-
declare function sortUTXOsStaking(utxos: Utxo[]): Utxo[];
|
|
1512
|
-
declare function sortUTXOsByAmount(utxos: Utxo[], isDescending: boolean): Utxo[];
|
|
1513
|
-
declare const sortUTXOsByAmountDescending: (utxos: Utxo[]) => Utxo[];
|
|
1514
|
-
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>[];
|
|
1515
1630
|
|
|
1516
1631
|
/**
|
|
1517
1632
|
* The list of transaction types supported by `getMaximumUtxoSet`.
|
|
@@ -1537,9 +1652,16 @@ declare const P_CHAIN_TX_SIZE_LIMIT = 65536;
|
|
|
1537
1652
|
* @param utxos - list of UTXOs to be consumed by the transaction.
|
|
1538
1653
|
* @param sizeSupportedTx - one of the supported transaction types
|
|
1539
1654
|
* @param limit - optional - byte size limit, defaults to 64kb.
|
|
1655
|
+
* @param feeState - current fee state on the chain
|
|
1540
1656
|
* @returns the largest prefix of sorted `utxos` before hitting the size limit. If no such prefix exists, then an empty array.
|
|
1541
1657
|
*/
|
|
1542
|
-
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[];
|
|
1543
1665
|
|
|
1544
1666
|
/**
|
|
1545
1667
|
* Verifies the given derivation path is valid, starts with `m`, and of the right length
|
|
@@ -1556,7 +1678,6 @@ type index_AddSubnetValidatorTx = AddSubnetValidatorTx;
|
|
|
1556
1678
|
type index_AddValidatorTx = AddValidatorTx;
|
|
1557
1679
|
type index_AddressWallet = AddressWallet;
|
|
1558
1680
|
declare const index_AddressWallet: typeof AddressWallet;
|
|
1559
|
-
type index_BaseTx = BaseTx;
|
|
1560
1681
|
type index_ChainIDAlias = ChainIDAlias;
|
|
1561
1682
|
type index_CreateChainTx = CreateChainTx;
|
|
1562
1683
|
type index_CreateSubnetTx = CreateSubnetTx;
|
|
@@ -1593,7 +1714,6 @@ type index_SizeSupportedTx = SizeSupportedTx;
|
|
|
1593
1714
|
declare const index_SizeSupportedTx: typeof SizeSupportedTx;
|
|
1594
1715
|
type index_StaticSigner = StaticSigner;
|
|
1595
1716
|
declare const index_StaticSigner: typeof StaticSigner;
|
|
1596
|
-
type index_TransferSubnetOwnershipTx = TransferSubnetOwnershipTx;
|
|
1597
1717
|
type index_TransformSubnetTx = TransformSubnetTx;
|
|
1598
1718
|
type index_Tx = Tx;
|
|
1599
1719
|
type index_TxBase = TxBase;
|
|
@@ -1658,7 +1778,7 @@ declare namespace index {
|
|
|
1658
1778
|
index_AddSubnetValidatorTx as AddSubnetValidatorTx,
|
|
1659
1779
|
index_AddValidatorTx as AddValidatorTx,
|
|
1660
1780
|
index_AddressWallet as AddressWallet,
|
|
1661
|
-
|
|
1781
|
+
BaseTx$1 as BaseTx,
|
|
1662
1782
|
index_ChainIDAlias as ChainIDAlias,
|
|
1663
1783
|
index_CreateChainTx as CreateChainTx,
|
|
1664
1784
|
index_CreateSubnetTx as CreateSubnetTx,
|
|
@@ -1686,7 +1806,7 @@ declare namespace index {
|
|
|
1686
1806
|
index_SimpleSigner as SimpleSigner,
|
|
1687
1807
|
index_SizeSupportedTx as SizeSupportedTx,
|
|
1688
1808
|
index_StaticSigner as StaticSigner,
|
|
1689
|
-
|
|
1809
|
+
TransferSubnetOwnershipTx$1 as TransferSubnetOwnershipTx,
|
|
1690
1810
|
index_TransformSubnetTx as TransformSubnetTx,
|
|
1691
1811
|
index_Tx as Tx,
|
|
1692
1812
|
index_TxBase as TxBase,
|