@avalabs/core-wallets-sdk 3.1.0-canary.49a66d7.0 → 3.1.0-canary.4bb44cd.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +166 -44
- package/dist/index.js +1 -1
- package/esm/Avalanche/index.d.ts +2 -3
- package/esm/Avalanche/index.js +1 -1
- package/esm/Avalanche/models.d.ts +42 -3
- package/esm/Avalanche/models.js +1 -1
- package/esm/Avalanche/providers/AbstractProvider.d.ts +5 -6
- package/esm/Avalanche/providers/AbstractProvider.js +1 -1
- package/esm/Avalanche/providers/JsonRpcProvider.d.ts +1 -0
- package/esm/Avalanche/providers/JsonRpcProvider.js +1 -1
- package/esm/Avalanche/providers/constants.d.ts +2 -1
- package/esm/Avalanche/providers/constants.js +1 -1
- package/esm/Avalanche/providers/platformFeeConfig.js +1 -1
- package/esm/Avalanche/utils/appendDisableAuthAddressMaps.js +1 -0
- package/esm/Avalanche/utils/convertGlacierUtxo.d.ts +2 -2
- package/esm/Avalanche/utils/createAvalancheUnsignedTx.js +1 -1
- package/esm/Avalanche/utils/getAssetBalance.js +1 -1
- package/esm/Avalanche/utils/getChainAliasByChainId.js +1 -1
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.d.ts +3 -2
- package/esm/Avalanche/utils/getUtxosByTxFromGlacier.js +1 -1
- package/esm/Avalanche/utils/handleSubnetAuth.js +1 -1
- package/esm/Avalanche/utils/orderBy.js +1 -0
- package/esm/Avalanche/utils/parseAvalancheTx.d.ts +7 -1
- package/esm/Avalanche/utils/parseAvalancheTx.js +1 -1
- package/esm/Avalanche/utils/parsers/index.js +1 -1
- package/esm/Avalanche/utils/parsers/parseConvertSubnetToL1Tx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseDisableL1ValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseIncreaseL1ValidatorBalanceTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseRegisterL1ValidatorTx.js +1 -0
- package/esm/Avalanche/utils/parsers/parseSetL1ValidatorWeightTx.js +1 -0
- package/esm/Avalanche/utils/parsers/utils/chainIdToVm.js +1 -1
- package/esm/Avalanche/utils/sortUTXOs.d.ts +5 -4
- package/esm/Avalanche/utils/sortUTXOs.js +1 -1
- package/esm/Avalanche/utils/txSizeLimits.d.ts +1 -1
- package/esm/Avalanche/utils/txSizeLimits.js +1 -1
- package/esm/Avalanche/wallets/AddressWallet.js +1 -1
- package/esm/Avalanche/wallets/SimpleSigner.js +1 -1
- package/esm/Avalanche/wallets/StaticSigner.js +1 -1
- package/esm/Avalanche/wallets/TxBuilderTypes.d.ts +70 -1
- package/esm/Avalanche/wallets/WalletAbstract.d.ts +7 -9
- package/esm/Avalanche/wallets/WalletAbstract.js +1 -1
- package/esm/Avalanche/wallets/WalletVoid.js +1 -1
- package/esm/Avalanche/wallets/ledger/LedgerSigner.js +1 -1
- package/esm/Avalanche/wallets/ledger/SimpleLedgerSigner.js +1 -1
- package/esm/BitcoinVM/providers/BitcoinProvider.d.ts +3 -3
- package/esm/BitcoinVM/providers/BitcoinProvider.js +1 -1
- package/package.json +6 -6
- 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/dist/index.d.ts
CHANGED
|
@@ -8,15 +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,
|
|
11
|
+
import { VM, Common, OutputOwners, TransferableOutput, pvmSerial, Context, info, avm, pvm, evm, 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';
|
|
14
13
|
import { Bip32Path } from 'bip32-path';
|
|
15
14
|
import AppZondax, { ResponseBase } from '@avalabs/hw-app-avalanche';
|
|
16
15
|
import { BIP32Interface } from 'bip32';
|
|
17
|
-
import {
|
|
16
|
+
import { GetUpgradesInfoResponse } from '@avalabs/avalanchejs/dist/info/model';
|
|
17
|
+
import { Utxo as Utxo$1, PChainUtxo, Network as Network$2 } from '@avalabs/glacier-sdk';
|
|
18
18
|
import * as _avalabs_avalanchejs_dist_serializable_common_types from '@avalabs/avalanchejs/dist/serializable/common/types';
|
|
19
|
-
import { WalletAbstract as WalletAbstract$1 } from 'Avalanche/wallets';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Custom Bitcoin UTXO interface.
|
|
@@ -158,12 +157,12 @@ declare class BitcoinProvider extends BitcoinProviderAbstract {
|
|
|
158
157
|
private readonly extraParams?;
|
|
159
158
|
constructor(isMainnet?: boolean, apiKey?: string, explorerUrl?: string, nodeUrl?: string, extraParams?: Record<string, string> | undefined);
|
|
160
159
|
getTxHex(txHash: string): Promise<string>;
|
|
161
|
-
getUTXOs(address: string, withScripts?: boolean): Promise<{
|
|
160
|
+
getUTXOs(address: string, withScripts?: boolean, skipBatch?: boolean): Promise<{
|
|
162
161
|
confirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
163
162
|
unconfirmed: BitcoinInputUTXOWithOptionalScript[];
|
|
164
163
|
}>;
|
|
165
164
|
getAddressFromScript(script: string): Promise<string>;
|
|
166
|
-
getScriptsForUtxos(utxos: BitcoinInputUTXOWithOptionalScript[]): Promise<BitcoinInputUTXO[]>;
|
|
165
|
+
getScriptsForUtxos(utxos: BitcoinInputUTXOWithOptionalScript[], skipBatch?: boolean): Promise<BitcoinInputUTXO[]>;
|
|
167
166
|
private _parseUtxo;
|
|
168
167
|
getBalances(address: string): Promise<{
|
|
169
168
|
available: bigint;
|
|
@@ -171,7 +170,7 @@ declare class BitcoinProvider extends BitcoinProviderAbstract {
|
|
|
171
170
|
final: bigint;
|
|
172
171
|
}>;
|
|
173
172
|
getChainHeight(): Promise<number>;
|
|
174
|
-
getFeeRates(): Promise<{
|
|
173
|
+
getFeeRates(skipBatch?: boolean): Promise<{
|
|
175
174
|
low: number;
|
|
176
175
|
medium: number;
|
|
177
176
|
high: number;
|
|
@@ -565,7 +564,7 @@ type ChainIDAlias = 'X' | 'P' | 'C';
|
|
|
565
564
|
/**
|
|
566
565
|
* Types for parsed transaction
|
|
567
566
|
*/
|
|
568
|
-
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx$1 | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx$1 | UnknownTx;
|
|
567
|
+
type Tx = AddValidatorTx | AddDelegatorTx | ExportTx | ImportTx | BaseTx$1 | CreateSubnetTx | CreateChainTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddPermissionlessValidatorTx | AddPermissionlessDelegatorTx | TransformSubnetTx | TransferSubnetOwnershipTx$1 | ConvertSubnetToL1Tx | RegisterL1ValidatorTx | SetL1ValidatorWeightTx | DisableL1ValidatorTx | IncreaseL1ValidatorBalanceTx | UnknownTx;
|
|
569
568
|
interface FeeData {
|
|
570
569
|
totalAvaxBurned: bigint;
|
|
571
570
|
totalAvaxOutput: bigint;
|
|
@@ -585,6 +584,11 @@ declare enum TxType {
|
|
|
585
584
|
Import = "import",
|
|
586
585
|
CreateSubnet = "create_subnet",
|
|
587
586
|
CreateChain = "create_chain",
|
|
587
|
+
ConvertSubnetToL1 = "convert_subnet_to_l1",
|
|
588
|
+
RegisterL1Validator = "register_l1_validator",
|
|
589
|
+
SetL1ValidatorWeight = "set_l1_validator_weight",
|
|
590
|
+
IncreaseL1ValidatorBalance = "increase_l1_validator_balance",
|
|
591
|
+
DisableL1Validator = "disable_l1_validator",
|
|
588
592
|
AddSubnetValidator = "add_subnet_validator",
|
|
589
593
|
RemoveSubnetValidator = "remove_subnet_validator",
|
|
590
594
|
AddPermissionlessValidator = "add_permissionless_validator",
|
|
@@ -663,6 +667,35 @@ interface RemoveSubnetValidatorTx extends TxBase {
|
|
|
663
667
|
nodeID: string;
|
|
664
668
|
subnetID: string;
|
|
665
669
|
}
|
|
670
|
+
interface ConvertSubnetToL1Tx extends TxBase {
|
|
671
|
+
type: TxType.ConvertSubnetToL1;
|
|
672
|
+
managerAddress: string;
|
|
673
|
+
validators: {
|
|
674
|
+
nodeId: string;
|
|
675
|
+
stake: bigint;
|
|
676
|
+
balance: bigint;
|
|
677
|
+
remainingBalanceOwners: string[];
|
|
678
|
+
deactivationOwners: string[];
|
|
679
|
+
}[];
|
|
680
|
+
subnetID: string;
|
|
681
|
+
chainID: string;
|
|
682
|
+
}
|
|
683
|
+
interface RegisterL1ValidatorTx extends TxBase {
|
|
684
|
+
type: TxType.RegisterL1Validator;
|
|
685
|
+
balance: bigint;
|
|
686
|
+
}
|
|
687
|
+
interface SetL1ValidatorWeightTx extends TxBase {
|
|
688
|
+
type: TxType.SetL1ValidatorWeight;
|
|
689
|
+
}
|
|
690
|
+
interface IncreaseL1ValidatorBalanceTx extends TxBase {
|
|
691
|
+
type: TxType.IncreaseL1ValidatorBalance;
|
|
692
|
+
balance: bigint;
|
|
693
|
+
validationId: string;
|
|
694
|
+
}
|
|
695
|
+
interface DisableL1ValidatorTx extends TxBase {
|
|
696
|
+
type: TxType.DisableL1Validator;
|
|
697
|
+
validationId: string;
|
|
698
|
+
}
|
|
666
699
|
interface AddPermissionlessValidatorTx extends TxBase {
|
|
667
700
|
type: TxType.AddPermissionlessValidator;
|
|
668
701
|
nodeID: string;
|
|
@@ -701,7 +734,7 @@ interface TransformSubnetTx extends TxBase {
|
|
|
701
734
|
minStakeDuration: number;
|
|
702
735
|
maxStakeDuration: number;
|
|
703
736
|
minDelegationFee: number;
|
|
704
|
-
minDelegatorStake:
|
|
737
|
+
minDelegatorStake: bigint;
|
|
705
738
|
maxValidatorWeightFactor: number;
|
|
706
739
|
uptimeRequirement: number;
|
|
707
740
|
}
|
|
@@ -722,6 +755,11 @@ declare function isAddDelegatorTx(tx: Tx): tx is AddDelegatorTx;
|
|
|
722
755
|
declare function isExportTx(tx: Tx): tx is ExportTx;
|
|
723
756
|
declare function isImportTx(tx: Tx): tx is ImportTx;
|
|
724
757
|
declare function isBaseTx(tx: Tx): tx is BaseTx$1;
|
|
758
|
+
declare function isConvertSubnetToL1Tx(tx: Tx): tx is ConvertSubnetToL1Tx;
|
|
759
|
+
declare function isRegisterL1ValidatorTx(tx: Tx): tx is RegisterL1ValidatorTx;
|
|
760
|
+
declare function isSetL1ValidatorWeightTx(tx: Tx): tx is SetL1ValidatorWeightTx;
|
|
761
|
+
declare function isDisableL1ValidatorTx(tx: Tx): tx is DisableL1ValidatorTx;
|
|
762
|
+
declare function isIncreaseL1ValidatorBalance(tx: Tx): tx is IncreaseL1ValidatorBalanceTx;
|
|
725
763
|
declare function isCreateSubnetTx(tx: Tx): tx is CreateSubnetTx;
|
|
726
764
|
declare function isCreateChainTx(tx: Tx): tx is CreateChainTx;
|
|
727
765
|
declare function isAddSubnetValidatorTx(tx: Tx): tx is AddSubnetValidatorTx;
|
|
@@ -734,23 +772,23 @@ declare function isTransferSubnetOwnershipTx(tx: Tx): tx is TransferSubnetOwners
|
|
|
734
772
|
declare class AbstractProvider {
|
|
735
773
|
protected baseUrl: string;
|
|
736
774
|
protected context: Context.Context;
|
|
737
|
-
protected upgradesInfo?: GetUpgradesInfoResponse | undefined;
|
|
775
|
+
protected upgradesInfo?: info.GetUpgradesInfoResponse | undefined;
|
|
738
776
|
evmRpc: JsonRpcProvider$1;
|
|
739
|
-
constructor(baseUrl: string, context: Context.Context, upgradesInfo?: GetUpgradesInfoResponse | undefined);
|
|
777
|
+
constructor(baseUrl: string, context: Context.Context, upgradesInfo?: info.GetUpgradesInfoResponse | undefined);
|
|
740
778
|
/**
|
|
741
779
|
* @link https://docs.ethers.io/v5/api/providers/provider/#Provider-getFeeData
|
|
742
780
|
*/
|
|
743
781
|
getEvmFeeData(): Promise<ethers.FeeData>;
|
|
744
782
|
getContext(): Context.Context;
|
|
745
783
|
isEtnaEnabled(): boolean;
|
|
746
|
-
getUpgradesInfo(): GetUpgradesInfoResponse | undefined;
|
|
784
|
+
getUpgradesInfo(): info.GetUpgradesInfoResponse | undefined;
|
|
747
785
|
getChainID(chainAlias: ChainIDAlias): string;
|
|
748
786
|
getNetworkID(): number;
|
|
749
787
|
getHrp(): string;
|
|
750
788
|
getApiX(): avm.AVMApi;
|
|
751
789
|
getApiP(): pvm.PVMApi;
|
|
752
790
|
getApiC(): evm.EVMApi;
|
|
753
|
-
getInfo():
|
|
791
|
+
getInfo(): info.InfoApi;
|
|
754
792
|
getApi(chain: ChainIDAlias): avm.AVMApi | pvm.PVMApi | evm.EVMApi;
|
|
755
793
|
getAvaxID(): string;
|
|
756
794
|
getAddress(publicKey: Buffer, chain: ChainIDAlias): string;
|
|
@@ -775,6 +813,7 @@ declare class JsonRpcProvider extends AbstractProvider {
|
|
|
775
813
|
static fromBaseURL(url: string): Promise<JsonRpcProvider>;
|
|
776
814
|
static getDefaultMainnetProvider(upgradesInfo?: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
777
815
|
static getDefaultFujiProvider(upgradesInfo?: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
816
|
+
static getDefaultDevnetProvider(upgradesInfo?: GetUpgradesInfoResponse): JsonRpcProvider;
|
|
778
817
|
}
|
|
779
818
|
|
|
780
819
|
/**
|
|
@@ -785,6 +824,7 @@ declare const MainnetContext: Context.Context;
|
|
|
785
824
|
* Avalanche Fuji testnet context
|
|
786
825
|
*/
|
|
787
826
|
declare const FujiContext: Context.Context;
|
|
827
|
+
declare const DevnetContext: Context.Context;
|
|
788
828
|
|
|
789
829
|
type BaseTx = {
|
|
790
830
|
utxoSet: utils.UtxoSet;
|
|
@@ -826,6 +866,75 @@ type CreateSubnet = {
|
|
|
826
866
|
threshold?: number;
|
|
827
867
|
locktime?: bigint;
|
|
828
868
|
};
|
|
869
|
+
type CreateChain = {
|
|
870
|
+
utxoSet: utils.UtxoSet;
|
|
871
|
+
subnetId: string;
|
|
872
|
+
chainName: string;
|
|
873
|
+
vmID: string;
|
|
874
|
+
fxIds: string[];
|
|
875
|
+
genesisData: Record<string, unknown>;
|
|
876
|
+
subnetAuth: number[];
|
|
877
|
+
feeState?: pvm.FeeState;
|
|
878
|
+
options?: Common.SpendOptions;
|
|
879
|
+
fromAddresses?: string[];
|
|
880
|
+
};
|
|
881
|
+
type ConvertSubnetToL1 = {
|
|
882
|
+
utxoSet: utils.UtxoSet;
|
|
883
|
+
address: string;
|
|
884
|
+
chainId: string;
|
|
885
|
+
subnetId: string;
|
|
886
|
+
subnetAuth: number[];
|
|
887
|
+
options?: Common.SpendOptions;
|
|
888
|
+
feeState: pvm.FeeState;
|
|
889
|
+
fromAddresses?: string[];
|
|
890
|
+
validators: {
|
|
891
|
+
nodeId: string;
|
|
892
|
+
weight: bigint;
|
|
893
|
+
balance: bigint;
|
|
894
|
+
pubKey: string;
|
|
895
|
+
signature: string;
|
|
896
|
+
remainingBalanceOwner: {
|
|
897
|
+
addresses: string[];
|
|
898
|
+
threshold?: number;
|
|
899
|
+
};
|
|
900
|
+
deactivationOwner: {
|
|
901
|
+
addresses: string[];
|
|
902
|
+
threshold?: number;
|
|
903
|
+
};
|
|
904
|
+
}[];
|
|
905
|
+
};
|
|
906
|
+
type RegisterL1Validator = {
|
|
907
|
+
utxoSet: utils.UtxoSet;
|
|
908
|
+
balance: bigint;
|
|
909
|
+
signature: string;
|
|
910
|
+
feeState: pvm.FeeState;
|
|
911
|
+
message: string;
|
|
912
|
+
options?: Common.SpendOptions;
|
|
913
|
+
fromAddresses?: string[];
|
|
914
|
+
};
|
|
915
|
+
type SetL1ValidatorWeight = {
|
|
916
|
+
utxoSet: utils.UtxoSet;
|
|
917
|
+
feeState: pvm.FeeState;
|
|
918
|
+
message: string;
|
|
919
|
+
options?: Common.SpendOptions;
|
|
920
|
+
fromAddresses?: string[];
|
|
921
|
+
};
|
|
922
|
+
type DisableL1Validator = {
|
|
923
|
+
utxoSet: utils.UtxoSet;
|
|
924
|
+
feeState: pvm.FeeState;
|
|
925
|
+
disableAuth: number[];
|
|
926
|
+
validationId: string;
|
|
927
|
+
options?: Common.SpendOptions;
|
|
928
|
+
fromAddresses?: string[];
|
|
929
|
+
};
|
|
930
|
+
type IncreaseL1ValidatorBalance = {
|
|
931
|
+
utxoSet: utils.UtxoSet;
|
|
932
|
+
feeState: pvm.FeeState;
|
|
933
|
+
balance: bigint;
|
|
934
|
+
validationId: string;
|
|
935
|
+
options?: Common.SpendOptions;
|
|
936
|
+
fromAddresses?: string[];
|
|
937
|
+
};
|
|
829
938
|
type AddSubnetValidator = {
|
|
830
939
|
utxoSet: utils.UtxoSet;
|
|
831
940
|
nodeId: string;
|
|
@@ -971,15 +1080,14 @@ declare abstract class WalletAbstract {
|
|
|
971
1080
|
* @param toAddress
|
|
972
1081
|
*/
|
|
973
1082
|
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?: {
|
|
975
|
-
rewardAddress?: string;
|
|
976
|
-
}): Common.UnsignedTx;
|
|
977
|
-
addDelegator(utxos: utils.UtxoSet, nodeId: string, stakeAmount: bigint, startDate: bigint, endDate: bigint, config?: {
|
|
978
|
-
rewardAddress?: string;
|
|
979
|
-
}): Common.UnsignedTx;
|
|
980
1083
|
consolidateP({ utxoSet, amount, feeState, toAddress, options, }: ConsolidateP): Common.UnsignedTx;
|
|
981
1084
|
baseTX({ utxoSet, chain, toAddress, amountsPerAsset, feeState, options, fromAddresses, }: BaseTx): Common.UnsignedTx;
|
|
982
|
-
|
|
1085
|
+
convertSubnetToL1({ utxoSet, chainId, subnetId, subnetAuth, feeState, address, validators, options, fromAddresses, }: ConvertSubnetToL1): Common.UnsignedTx;
|
|
1086
|
+
registerL1Validator({ utxoSet, balance, signature, message, feeState, fromAddresses, options, }: RegisterL1Validator): Common.UnsignedTx;
|
|
1087
|
+
setL1ValidatorWeight({ utxoSet, feeState, message, options, fromAddresses, }: SetL1ValidatorWeight): Common.UnsignedTx;
|
|
1088
|
+
disableL1Validator({ utxoSet, feeState, options, fromAddresses, disableAuth, validationId, }: DisableL1Validator): Common.UnsignedTx;
|
|
1089
|
+
increaseL1ValidatorBalance({ utxoSet, feeState, options, fromAddresses, balance, validationId, }: IncreaseL1ValidatorBalance): Common.UnsignedTx;
|
|
1090
|
+
createBlockchain({ utxoSet, subnetId, chainName, vmID, fxIds, genesisData, subnetAuth, feeState, options, fromAddresses, }: CreateChain): Common.UnsignedTx;
|
|
983
1091
|
createSubnet({ utxoSet, rewardAddresses, feeState, fromAddresses, options, threshold, locktime, }: CreateSubnet): Common.UnsignedTx;
|
|
984
1092
|
addSubnetValidator({ utxoSet, nodeId, start, end, weight, subnetId, subnetAuth, feeState, fromAddresses, options, }: AddSubnetValidator): Common.UnsignedTx;
|
|
985
1093
|
/**
|
|
@@ -1014,7 +1122,6 @@ declare abstract class WalletAbstract {
|
|
|
1014
1122
|
addPermissionlessDelegator({ utxoSet, nodeId, start, end, weight, subnetId, fromAddresses, rewardAddresses, options, locktime, feeState, threshold, stakingAssetId, }: AddPermissionlessDelegator): Common.UnsignedTx;
|
|
1015
1123
|
removeSubnetValidator({ utxoSet, nodeId, subnetId, subnetAuth, fromAddresses, feeState, options, }: RemoveSubnetValidator): Common.UnsignedTx;
|
|
1016
1124
|
transferSubnetOwnershipTx({ utxoSet, subnetId, subnetAuth, subnetOwners, feeState, fromAddresses, options, threshold, locktime, }: TransferSubnetOwnershipTx): Common.UnsignedTx;
|
|
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;
|
|
1018
1125
|
protected constructor(provider: AbstractProvider);
|
|
1019
1126
|
}
|
|
1020
1127
|
|
|
@@ -1465,7 +1572,7 @@ declare const addSignaturesToAvalancheTx: ({ transactionHex, signatures, chainAl
|
|
|
1465
1572
|
}>;
|
|
1466
1573
|
|
|
1467
1574
|
type GlacierOutput = Utxo$1 | PChainUtxo;
|
|
1468
|
-
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput,
|
|
1575
|
+
declare const convertGlacierUtxo: (glacierUtxo: GlacierOutput, network: Network$2) => Utxo<TransferOutput | pvmSerial.StakeableLockOut<TransferOutput>>;
|
|
1469
1576
|
|
|
1470
1577
|
type Params$2 = {
|
|
1471
1578
|
txBytes: Uint8Array;
|
|
@@ -1569,25 +1676,15 @@ declare function getStakeForAddresses(addresses: string[], api: pvm.PVMApi): Pro
|
|
|
1569
1676
|
*/
|
|
1570
1677
|
declare function getUnixNow(): bigint;
|
|
1571
1678
|
|
|
1572
|
-
type UtxoInfo = {
|
|
1573
|
-
utxoId: string;
|
|
1574
|
-
assetId: string;
|
|
1575
|
-
locktime: bigint;
|
|
1576
|
-
stakeableLocktime: bigint;
|
|
1577
|
-
threshold: number;
|
|
1578
|
-
amount: bigint;
|
|
1579
|
-
};
|
|
1580
|
-
declare const getUtxoInfo: (utxo: Utxo) => UtxoInfo;
|
|
1581
|
-
|
|
1582
1679
|
type Params = {
|
|
1583
1680
|
transactionHex: string;
|
|
1584
1681
|
chainAlias: ChainIDAlias;
|
|
1585
|
-
|
|
1682
|
+
network: Network$2;
|
|
1586
1683
|
url: string;
|
|
1587
1684
|
token?: string;
|
|
1588
1685
|
headers?: Record<string, string>;
|
|
1589
1686
|
};
|
|
1590
|
-
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias,
|
|
1687
|
+
declare const getUtxosByTxFromGlacier: ({ transactionHex, chainAlias, network, url, token, headers, }: Params) => Promise<Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[]>;
|
|
1591
1688
|
|
|
1592
1689
|
declare const getVmByChainAlias: (chainAlias: string) => "EVM" | "AVM" | "PVM";
|
|
1593
1690
|
|
|
@@ -1604,10 +1701,16 @@ declare function getXpubFromMnemonic(mnemonic: string): string;
|
|
|
1604
1701
|
*/
|
|
1605
1702
|
declare function isBech32Address(address: string, hasChainId?: boolean): boolean;
|
|
1606
1703
|
|
|
1704
|
+
type ParseOptions = {
|
|
1705
|
+
/**
|
|
1706
|
+
* Tolerance percentage range where the burned amount is considered valid.
|
|
1707
|
+
*/
|
|
1708
|
+
feeTolerance?: number;
|
|
1709
|
+
};
|
|
1607
1710
|
/**
|
|
1608
1711
|
* Returns human readable data from a given a transaction buffer,
|
|
1609
1712
|
*/
|
|
1610
|
-
declare function parseAvalancheTx(unsignedTx: Common.UnsignedTx, provider: JsonRpcProvider, currentAddress: string): Promise<Tx>;
|
|
1713
|
+
declare function parseAvalancheTx(unsignedTx: Common.UnsignedTx, provider: JsonRpcProvider, currentAddress: string, { feeTolerance }?: ParseOptions): Promise<Tx>;
|
|
1611
1714
|
|
|
1612
1715
|
declare const emptySignature: Signature;
|
|
1613
1716
|
declare const populateCredential: (indices: number[], existingCredentialData?: {
|
|
@@ -1619,12 +1722,13 @@ declare function signedTxToHex(signedTx: avaxSerial.SignedTx): string;
|
|
|
1619
1722
|
|
|
1620
1723
|
/**
|
|
1621
1724
|
* The UTXOs will be sorted in the following order.
|
|
1622
|
-
* 1-
|
|
1623
|
-
* 2-
|
|
1725
|
+
* 1- Highest value unlocked UTXO (for fees)
|
|
1726
|
+
* 2- LockedStakeable UTXOs with the highest locktime to lowest
|
|
1727
|
+
* 3- Rest of the unlocked UTXOs highest to lowest
|
|
1624
1728
|
* @remark Does not check for locked UTXOs
|
|
1625
1729
|
*/
|
|
1626
|
-
declare function sortUTXOsStaking(utxos: Utxo[]): Utxo
|
|
1627
|
-
declare function sortUTXOsByAmount(utxos: Utxo[], isDescending: boolean): Utxo
|
|
1730
|
+
declare function sortUTXOsStaking(utxos: Utxo[]): Utxo[];
|
|
1731
|
+
declare function sortUTXOsByAmount(utxos: Utxo[], isDescending: boolean): Utxo[];
|
|
1628
1732
|
declare const sortUTXOsByAmountDescending: (utxos: Utxo[]) => Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1629
1733
|
declare const sortUTXOsByAmountAscending: (utxos: Utxo[]) => Utxo<_avalabs_avalanchejs_dist_serializable_common_types.Serializable>[];
|
|
1630
1734
|
|
|
@@ -1656,7 +1760,7 @@ declare const P_CHAIN_TX_SIZE_LIMIT = 65536;
|
|
|
1656
1760
|
* @returns the largest prefix of sorted `utxos` before hitting the size limit. If no such prefix exists, then an empty array.
|
|
1657
1761
|
*/
|
|
1658
1762
|
declare function getMaximumUtxoSet({ wallet, utxos, sizeSupportedTx, limit, feeState, }: {
|
|
1659
|
-
wallet: WalletAbstract
|
|
1763
|
+
wallet: WalletAbstract;
|
|
1660
1764
|
utxos: Utxo[];
|
|
1661
1765
|
sizeSupportedTx: SizeSupportedTx;
|
|
1662
1766
|
limit?: number;
|
|
@@ -1679,8 +1783,11 @@ type index_AddValidatorTx = AddValidatorTx;
|
|
|
1679
1783
|
type index_AddressWallet = AddressWallet;
|
|
1680
1784
|
declare const index_AddressWallet: typeof AddressWallet;
|
|
1681
1785
|
type index_ChainIDAlias = ChainIDAlias;
|
|
1786
|
+
type index_ConvertSubnetToL1Tx = ConvertSubnetToL1Tx;
|
|
1682
1787
|
type index_CreateChainTx = CreateChainTx;
|
|
1683
1788
|
type index_CreateSubnetTx = CreateSubnetTx;
|
|
1789
|
+
declare const index_DevnetContext: typeof DevnetContext;
|
|
1790
|
+
type index_DisableL1ValidatorTx = DisableL1ValidatorTx;
|
|
1684
1791
|
type index_ExportTx = ExportTx;
|
|
1685
1792
|
type index_FeeData = FeeData;
|
|
1686
1793
|
declare const index_FujiContext: typeof FujiContext;
|
|
@@ -1688,6 +1795,7 @@ type index_GetAvaxBalanceDict = GetAvaxBalanceDict;
|
|
|
1688
1795
|
type index_GetStakedAvaxBalanceDict = GetStakedAvaxBalanceDict;
|
|
1689
1796
|
type index_GlacierOutput = GlacierOutput;
|
|
1690
1797
|
type index_ImportTx = ImportTx;
|
|
1798
|
+
type index_IncreaseL1ValidatorBalanceTx = IncreaseL1ValidatorBalanceTx;
|
|
1691
1799
|
type index_JsonRpcProvider = JsonRpcProvider;
|
|
1692
1800
|
declare const index_JsonRpcProvider: typeof JsonRpcProvider;
|
|
1693
1801
|
type index_LedgerGetXpubResponse = LedgerGetXpubResponse;
|
|
@@ -1701,7 +1809,9 @@ declare const index_MnemonicWallet: typeof MnemonicWallet;
|
|
|
1701
1809
|
type index_MnemonicWalletVoid = MnemonicWalletVoid;
|
|
1702
1810
|
declare const index_MnemonicWalletVoid: typeof MnemonicWalletVoid;
|
|
1703
1811
|
declare const index_P_CHAIN_TX_SIZE_LIMIT: typeof P_CHAIN_TX_SIZE_LIMIT;
|
|
1812
|
+
type index_RegisterL1ValidatorTx = RegisterL1ValidatorTx;
|
|
1704
1813
|
type index_RemoveSubnetValidatorTx = RemoveSubnetValidatorTx;
|
|
1814
|
+
type index_SetL1ValidatorWeightTx = SetL1ValidatorWeightTx;
|
|
1705
1815
|
type index_SignMessageRequest = SignMessageRequest;
|
|
1706
1816
|
type index_SignTxBufferRequest = SignTxBufferRequest;
|
|
1707
1817
|
type index_SignTxRequest = SignTxRequest;
|
|
@@ -1720,7 +1830,6 @@ type index_TxBase = TxBase;
|
|
|
1720
1830
|
type index_TxType = TxType;
|
|
1721
1831
|
declare const index_TxType: typeof TxType;
|
|
1722
1832
|
type index_UnknownTx = UnknownTx;
|
|
1723
|
-
type index_UtxoInfo = UtxoInfo;
|
|
1724
1833
|
type index_WalletAbstract = WalletAbstract;
|
|
1725
1834
|
declare const index_WalletAbstract: typeof WalletAbstract;
|
|
1726
1835
|
type index_WalletVoid = WalletVoid;
|
|
@@ -1742,7 +1851,6 @@ declare const index_getStakeForAddresses: typeof getStakeForAddresses;
|
|
|
1742
1851
|
declare const index_getStakedAssetBalance: typeof getStakedAssetBalance;
|
|
1743
1852
|
declare const index_getUTXOsForAddresses: typeof getUTXOsForAddresses;
|
|
1744
1853
|
declare const index_getUnixNow: typeof getUnixNow;
|
|
1745
|
-
declare const index_getUtxoInfo: typeof getUtxoInfo;
|
|
1746
1854
|
declare const index_getUtxosByTxFromGlacier: typeof getUtxosByTxFromGlacier;
|
|
1747
1855
|
declare const index_getVmByChainAlias: typeof getVmByChainAlias;
|
|
1748
1856
|
declare const index_getXpubFromMnemonic: typeof getXpubFromMnemonic;
|
|
@@ -1753,12 +1861,17 @@ declare const index_isAddSubnetValidatorTx: typeof isAddSubnetValidatorTx;
|
|
|
1753
1861
|
declare const index_isAddValidatorTx: typeof isAddValidatorTx;
|
|
1754
1862
|
declare const index_isBaseTx: typeof isBaseTx;
|
|
1755
1863
|
declare const index_isBech32Address: typeof isBech32Address;
|
|
1864
|
+
declare const index_isConvertSubnetToL1Tx: typeof isConvertSubnetToL1Tx;
|
|
1756
1865
|
declare const index_isCreateChainTx: typeof isCreateChainTx;
|
|
1757
1866
|
declare const index_isCreateSubnetTx: typeof isCreateSubnetTx;
|
|
1867
|
+
declare const index_isDisableL1ValidatorTx: typeof isDisableL1ValidatorTx;
|
|
1758
1868
|
declare const index_isExportTx: typeof isExportTx;
|
|
1759
1869
|
declare const index_isImportTx: typeof isImportTx;
|
|
1870
|
+
declare const index_isIncreaseL1ValidatorBalance: typeof isIncreaseL1ValidatorBalance;
|
|
1760
1871
|
declare const index_isObsidianApp: typeof isObsidianApp;
|
|
1872
|
+
declare const index_isRegisterL1ValidatorTx: typeof isRegisterL1ValidatorTx;
|
|
1761
1873
|
declare const index_isRemoveSubnetValidatorTx: typeof isRemoveSubnetValidatorTx;
|
|
1874
|
+
declare const index_isSetL1ValidatorWeightTx: typeof isSetL1ValidatorWeightTx;
|
|
1762
1875
|
declare const index_isTransferSubnetOwnershipTx: typeof isTransferSubnetOwnershipTx;
|
|
1763
1876
|
declare const index_isTransformSubnetTx: typeof isTransformSubnetTx;
|
|
1764
1877
|
declare const index_parseAvalancheTx: typeof parseAvalancheTx;
|
|
@@ -1780,8 +1893,11 @@ declare namespace index {
|
|
|
1780
1893
|
index_AddressWallet as AddressWallet,
|
|
1781
1894
|
BaseTx$1 as BaseTx,
|
|
1782
1895
|
index_ChainIDAlias as ChainIDAlias,
|
|
1896
|
+
index_ConvertSubnetToL1Tx as ConvertSubnetToL1Tx,
|
|
1783
1897
|
index_CreateChainTx as CreateChainTx,
|
|
1784
1898
|
index_CreateSubnetTx as CreateSubnetTx,
|
|
1899
|
+
index_DevnetContext as DevnetContext,
|
|
1900
|
+
index_DisableL1ValidatorTx as DisableL1ValidatorTx,
|
|
1785
1901
|
index_ExportTx as ExportTx,
|
|
1786
1902
|
index_FeeData as FeeData,
|
|
1787
1903
|
index_FujiContext as FujiContext,
|
|
@@ -1789,6 +1905,7 @@ declare namespace index {
|
|
|
1789
1905
|
index_GetStakedAvaxBalanceDict as GetStakedAvaxBalanceDict,
|
|
1790
1906
|
index_GlacierOutput as GlacierOutput,
|
|
1791
1907
|
index_ImportTx as ImportTx,
|
|
1908
|
+
index_IncreaseL1ValidatorBalanceTx as IncreaseL1ValidatorBalanceTx,
|
|
1792
1909
|
index_JsonRpcProvider as JsonRpcProvider,
|
|
1793
1910
|
index_LedgerGetXpubResponse as LedgerGetXpubResponse,
|
|
1794
1911
|
index_LedgerSigner as LedgerSigner,
|
|
@@ -1797,7 +1914,9 @@ declare namespace index {
|
|
|
1797
1914
|
index_MnemonicWallet as MnemonicWallet,
|
|
1798
1915
|
index_MnemonicWalletVoid as MnemonicWalletVoid,
|
|
1799
1916
|
index_P_CHAIN_TX_SIZE_LIMIT as P_CHAIN_TX_SIZE_LIMIT,
|
|
1917
|
+
index_RegisterL1ValidatorTx as RegisterL1ValidatorTx,
|
|
1800
1918
|
index_RemoveSubnetValidatorTx as RemoveSubnetValidatorTx,
|
|
1919
|
+
index_SetL1ValidatorWeightTx as SetL1ValidatorWeightTx,
|
|
1801
1920
|
index_SignMessageRequest as SignMessageRequest,
|
|
1802
1921
|
index_SignTxBufferRequest as SignTxBufferRequest,
|
|
1803
1922
|
index_SignTxRequest as SignTxRequest,
|
|
@@ -1812,7 +1931,6 @@ declare namespace index {
|
|
|
1812
1931
|
index_TxBase as TxBase,
|
|
1813
1932
|
index_TxType as TxType,
|
|
1814
1933
|
index_UnknownTx as UnknownTx,
|
|
1815
|
-
index_UtxoInfo as UtxoInfo,
|
|
1816
1934
|
index_WalletAbstract as WalletAbstract,
|
|
1817
1935
|
index_WalletVoid as WalletVoid,
|
|
1818
1936
|
index_addSignaturesToAvalancheTx as addSignaturesToAvalancheTx,
|
|
@@ -1832,7 +1950,6 @@ declare namespace index {
|
|
|
1832
1950
|
index_getStakedAssetBalance as getStakedAssetBalance,
|
|
1833
1951
|
index_getUTXOsForAddresses as getUTXOsForAddresses,
|
|
1834
1952
|
index_getUnixNow as getUnixNow,
|
|
1835
|
-
index_getUtxoInfo as getUtxoInfo,
|
|
1836
1953
|
index_getUtxosByTxFromGlacier as getUtxosByTxFromGlacier,
|
|
1837
1954
|
index_getVmByChainAlias as getVmByChainAlias,
|
|
1838
1955
|
index_getXpubFromMnemonic as getXpubFromMnemonic,
|
|
@@ -1843,12 +1960,17 @@ declare namespace index {
|
|
|
1843
1960
|
index_isAddValidatorTx as isAddValidatorTx,
|
|
1844
1961
|
index_isBaseTx as isBaseTx,
|
|
1845
1962
|
index_isBech32Address as isBech32Address,
|
|
1963
|
+
index_isConvertSubnetToL1Tx as isConvertSubnetToL1Tx,
|
|
1846
1964
|
index_isCreateChainTx as isCreateChainTx,
|
|
1847
1965
|
index_isCreateSubnetTx as isCreateSubnetTx,
|
|
1966
|
+
index_isDisableL1ValidatorTx as isDisableL1ValidatorTx,
|
|
1848
1967
|
index_isExportTx as isExportTx,
|
|
1849
1968
|
index_isImportTx as isImportTx,
|
|
1969
|
+
index_isIncreaseL1ValidatorBalance as isIncreaseL1ValidatorBalance,
|
|
1850
1970
|
index_isObsidianApp as isObsidianApp,
|
|
1971
|
+
index_isRegisterL1ValidatorTx as isRegisterL1ValidatorTx,
|
|
1851
1972
|
index_isRemoveSubnetValidatorTx as isRemoveSubnetValidatorTx,
|
|
1973
|
+
index_isSetL1ValidatorWeightTx as isSetL1ValidatorWeightTx,
|
|
1852
1974
|
index_isTransferSubnetOwnershipTx as isTransferSubnetOwnershipTx,
|
|
1853
1975
|
index_isTransformSubnetTx as isTransformSubnetTx,
|
|
1854
1976
|
index_parseAvalancheTx as parseAvalancheTx,
|