@avalabs/vm-module-types 4.1.1 → 4.2.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/chunk-6K5NSJZP.cjs +9 -0
- package/dist/chunk-6K5NSJZP.cjs.map +1 -0
- package/dist/chunk-FMBTNWZP.js +5 -0
- package/dist/chunk-FMBTNWZP.js.map +1 -0
- package/dist/chunk-KUIEUGHP.js +5 -0
- package/dist/chunk-KUIEUGHP.js.map +1 -0
- package/dist/chunk-NN5FFZXP.cjs +7 -0
- package/dist/chunk-NN5FFZXP.cjs.map +1 -0
- package/dist/coingecko.d.cts +4 -4
- package/dist/coingecko.d.ts +4 -4
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/module.d.cts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/{rpc-adc0ea38.d.ts → rpc-4699ee82.d.ts} +28 -3
- package/dist/{rpc-33ed263b.d.ts → rpc-bbfb0e02.d.ts} +28 -3
- package/dist/rpc.cjs +4 -4
- package/dist/rpc.d.cts +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/staking.cjs +2 -2
- package/dist/staking.d.cts +28 -16
- package/dist/staking.d.ts +28 -16
- package/dist/staking.js +1 -1
- package/dist/transaction-simulation.d.cts +1 -1
- package/dist/transaction-simulation.d.ts +1 -1
- package/package.json +3 -3
- package/dist/chunk-GK2KQ7WE.cjs +0 -7
- package/dist/chunk-GK2KQ7WE.cjs.map +0 -1
- package/dist/chunk-LU4BRIVO.js +0 -5
- package/dist/chunk-LU4BRIVO.js.map +0 -1
- package/dist/chunk-MVMJO5UX.js +0 -5
- package/dist/chunk-MVMJO5UX.js.map +0 -1
- package/dist/chunk-Q5ATT3HH.cjs +0 -9
- package/dist/chunk-Q5ATT3HH.cjs.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var n=(e=>(e.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",e.BITCOIN_SIGN_TRANSACTION="bitcoin_signTransaction",e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.ETH_SEND_TRANSACTION_BATCH="eth_sendTransactionBatch",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.AVALANCHE_SIGN_MESSAGE="avalanche_signMessage",e.AVALANCHE_SEND_TRANSACTION="avalanche_sendTransaction",e.AVALANCHE_SIGN_TRANSACTION="avalanche_signTransaction",e.AVALANCHE_DECLARE_AGENT_IDENTITY="avalanche_declareAgentIdentity",e.HVM_SIGN_TRANSACTION="hvm_signTransaction",e.SOLANA_SIGN_TRANSACTION="solana_signTransaction",e.SOLANA_SIGN_AND_SEND_TRANSACTION="solana_signAndSendTransaction",e.SOLANA_SIGN_MESSAGE="solana_signMessage",e))(n||{}),r=(t=>(t.TEXT="text",t.ADDRESS="address",t.ADDRESS_LIST="addressList",t.NODE_ID="nodeID",t.CURRENCY="currency",t.FUNDS_RECIPIENT="fundsRecipient",t.DATA="data",t.DATE="date",t.LINK="link",t.NETWORK="network",t.TRANSFER_LIST="transferList",t.COLLAPSIBLE_GROUP="collapsibleGroup",t))(r||{}),i=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(i||{});
|
|
4
|
+
|
|
5
|
+
exports.a = n;
|
|
6
|
+
exports.b = r;
|
|
7
|
+
exports.c = i;
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=chunk-6K5NSJZP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAQO,IAAKA,OAEVA,EAAA,yBAA2B,0BAC3BA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,EAAA,2BAA6B,2BAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAGXA,EAAA,uBAAyB,wBACzBA,EAAA,2BAA6B,4BAC7BA,EAAA,2BAA6B,4BAC7BA,EAAA,iCAAmC,iCAGnCA,EAAA,qBAAuB,sBAGvBA,EAAA,wBAA0B,yBAC1BA,EAAA,iCAAmC,gCACnCA,EAAA,oBAAsB,qBA3BZA,OAAA,IAsFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,cACfA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,cAAgB,eAChBA,EAAA,kBAAoB,mBAZVA,OAAA,IA8IAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Avalanche, BitcoinInputUTXO, BitcoinOutputUTXO } from '@avalabs/core-wallets-sdk';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\nimport type { TokenWithBalanceBTC } from './balance';\nimport type { TransactionPayload, VMABI } from 'hypersdk-client';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n BITCOIN_SIGN_TRANSACTION = 'bitcoin_signTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n ETH_SEND_TRANSACTION_BATCH = 'eth_sendTransactionBatch',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n\n /* AVALANCHE */\n AVALANCHE_SIGN_MESSAGE = 'avalanche_signMessage',\n AVALANCHE_SEND_TRANSACTION = 'avalanche_sendTransaction',\n AVALANCHE_SIGN_TRANSACTION = 'avalanche_signTransaction',\n AVALANCHE_DECLARE_AGENT_IDENTITY = 'avalanche_declareAgentIdentity',\n\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_signTransaction',\n\n /* SOLANA */\n SOLANA_SIGN_TRANSACTION = 'solana_signTransaction',\n SOLANA_SIGN_AND_SEND_TRANSACTION = 'solana_signAndSendTransaction',\n SOLANA_SIGN_MESSAGE = 'solana_signMessage',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport type DetailSection = {\n title?: string;\n items: DetailItem[];\n};\n\nexport type BaseDetailItem = {\n label: string;\n};\n\nexport enum DetailItemType {\n TEXT = 'text',\n ADDRESS = 'address',\n ADDRESS_LIST = 'addressList',\n NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\n NETWORK = 'network',\n TRANSFER_LIST = 'transferList',\n COLLAPSIBLE_GROUP = 'collapsibleGroup',\n}\n\n// It's very similar as CurrencyItem, but we want the client apps\n// to treat the label as an address (recognize it if possible,\n// truncate otherwise).\nexport type FundsRecipientItem = BaseDetailItem & {\n type: DetailItemType.FUNDS_RECIPIENT;\n amount: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type TextItem = BaseDetailItem & {\n type: DetailItemType.TEXT;\n value: string;\n alignment: 'vertical' | 'horizontal';\n};\n\nexport type AddressItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS;\n value: string;\n};\n\nexport type AddressListItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS_LIST;\n value: string[];\n};\n\nexport type NodeIDItem = BaseDetailItem & {\n type: DetailItemType.NODE_ID;\n value: string;\n};\n\nexport type CurrencyItem = BaseDetailItem & {\n type: DetailItemType.CURRENCY;\n value: bigint;\n maxDecimals: number;\n symbol: string;\n isNativeToken?: boolean;\n};\n\nexport type DataItem = BaseDetailItem & {\n type: DetailItemType.DATA;\n value: string;\n};\n\nexport type DateItem = BaseDetailItem & {\n type: DetailItemType.DATE;\n value: string;\n};\n\nexport type LinkItemValue = { url: string; name?: string; icon?: string };\n\nexport type LinkItem = BaseDetailItem & {\n type: DetailItemType.LINK;\n value: LinkItemValue;\n};\n\nexport type NetworkItemValue = {\n logoUri: string | undefined;\n name: string;\n};\n\nexport type NetworkItem = BaseDetailItem & {\n type: DetailItemType.NETWORK;\n value: NetworkItemValue;\n};\n\nexport type Transfer = {\n addresses: string[];\n amount: bigint;\n assetId: string;\n symbol?: string;\n decimals?: number;\n assetName?: string;\n threshold?: number;\n lockedUntil?: number;\n stakeableLockedUntil?: number;\n isNativeToken?: boolean;\n isStaked?: boolean;\n stakedUntil?: number;\n};\n\nexport type TransferListItem = BaseDetailItem & {\n type: DetailItemType.TRANSFER_LIST;\n value: Transfer[];\n};\n\nexport type CollapsibleGroupItem = BaseDetailItem & {\n type: DetailItemType.COLLAPSIBLE_GROUP;\n value: DetailSection[];\n};\n\nexport type DetailItem =\n | string\n | TextItem\n | AddressItem\n | AddressListItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem\n | NetworkItem\n | TransferListItem\n | CollapsibleGroupItem;\n\nexport type DisplayData = {\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network?: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n details: DetailSection[];\n networkFeeSelector?: boolean;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n isSimulationSuccessful?: boolean;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n body?: string[];\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinExecuteTxData = {\n to: string;\n amount: number;\n feeRate: number;\n fee: number;\n gasLimit: number;\n balance: TokenWithBalanceBTC;\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type BitcoingSignTxData = {\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.SOLANA_SIGN_AND_SEND_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_MESSAGE;\n account: string;\n data: string; // Base-64 encoded message\n }\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinExecuteTxData;\n }\n | {\n type: RpcMethod.BITCOIN_SIGN_TRANSACTION;\n account: string;\n data: BitcoingSignTxData;\n }\n | SigningData_EthSendTx\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n data: TypedData<MessageTypes>;\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_MESSAGE;\n data: string;\n accountIndex?: number;\n }\n | {\n type: RpcMethod.AVALANCHE_SEND_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n externalIndices?: number[];\n internalIndices?: number[];\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n ownSignatureIndices: [number, number][];\n }\n | {\n type: RpcMethod.HVM_SIGN_TRANSACTION;\n data: {\n abi: VMABI;\n txPayload: TransactionPayload;\n };\n };\n\nexport type SigningData_EthSendTx = {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n};\n\nexport type EvmTxBatchUpdateFn = (\n data: { maxFeeRate?: bigint; maxTipRate?: bigint },\n txIndex: number,\n) => {\n displayData: DisplayData;\n signingRequests: {\n displayData: DisplayData;\n signingData: SigningData_EthSendTx;\n }[];\n};\n\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n gasLimit?: number;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: SigningData_EthSendTx };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type SigningRequest<Data = SigningData> = {\n displayData: DisplayData;\n signingData: Data;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n} & SigningRequest;\n\nexport type BatchApprovalParams = {\n request: RpcRequest;\n signingRequests: SigningRequest<SigningData_EthSendTx>[];\n displayData: DisplayData;\n updateTx: EvmTxBatchUpdateFn;\n};\n\nexport type RequestPublicKeyParams = {\n secretId: string;\n curve: 'secp256k1' | 'ed25519';\n derivationPath?: string;\n};\n\n/**\n * We want to accept both a signed data (tx/message) and a tx hash as a response\n * coming in from the client apps, hence the XORs here.\n *\n * The reason we need to support both is because extension allows importing\n * external software wallets, such as Fireblocks or other apps that support\n * the WalletConnect protocol.\n *\n * My experience is that WalletConnect apps rarely, if ever, support\n * \"eth_signTransaction\" requests and more often only allow sending\n * \"eth_sendTransaction\" calls, which means that all we'll get in response\n * from them is the transaction hash (not a signed tx).\n */\ntype SignedData = { signedData: string };\ntype BroadcastedTx = { txHash: string };\n\nexport type SigningResult = SignedData | BroadcastedTx;\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport type BatchApprovalResponse =\n | { error: RpcError }\n | {\n result: SignedData[];\n };\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n requestPublicKey: (params: RequestPublicKeyParams) => Promise<string>;\n onTransactionPending: ({\n txHash,\n request,\n explorerLink,\n }: {\n txHash: string;\n request: RpcRequest;\n explorerLink: string;\n }) => void;\n onTransactionConfirmed: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n onTransactionReverted: ({ txHash, request }: { txHash: string; request: RpcRequest }) => void;\n /**\n * Called when the module gave up waiting for a terminal status without ever\n * learning one — the node stopped answering, or kept reporting the tx as\n * processing until the poll budget ran out. The transaction may still have\n * been accepted, so this is deliberately neither a confirmation nor a\n * revert: consumers should stop showing an in-progress state and point the\n * user at the explorer.\n *\n * Optional so existing consumers keep compiling; a module that has nothing\n * better to report simply stays silent when it is not implemented.\n */\n onTransactionStatusUnknown?: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var n=(e=>(e.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",e.BITCOIN_SIGN_TRANSACTION="bitcoin_signTransaction",e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.ETH_SEND_TRANSACTION_BATCH="eth_sendTransactionBatch",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.AVALANCHE_SIGN_MESSAGE="avalanche_signMessage",e.AVALANCHE_SEND_TRANSACTION="avalanche_sendTransaction",e.AVALANCHE_SIGN_TRANSACTION="avalanche_signTransaction",e.AVALANCHE_DECLARE_AGENT_IDENTITY="avalanche_declareAgentIdentity",e.HVM_SIGN_TRANSACTION="hvm_signTransaction",e.SOLANA_SIGN_TRANSACTION="solana_signTransaction",e.SOLANA_SIGN_AND_SEND_TRANSACTION="solana_signAndSendTransaction",e.SOLANA_SIGN_MESSAGE="solana_signMessage",e))(n||{}),r=(t=>(t.TEXT="text",t.ADDRESS="address",t.ADDRESS_LIST="addressList",t.NODE_ID="nodeID",t.CURRENCY="currency",t.FUNDS_RECIPIENT="fundsRecipient",t.DATA="data",t.DATE="date",t.LINK="link",t.NETWORK="network",t.TRANSFER_LIST="transferList",t.COLLAPSIBLE_GROUP="collapsibleGroup",t))(r||{}),i=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(i||{});
|
|
2
|
+
|
|
3
|
+
export { n as a, r as b, i as c };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-FMBTNWZP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAQO,IAAKA,OAEVA,EAAA,yBAA2B,0BAC3BA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,EAAA,2BAA6B,2BAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAGXA,EAAA,uBAAyB,wBACzBA,EAAA,2BAA6B,4BAC7BA,EAAA,2BAA6B,4BAC7BA,EAAA,iCAAmC,iCAGnCA,EAAA,qBAAuB,sBAGvBA,EAAA,wBAA0B,yBAC1BA,EAAA,iCAAmC,gCACnCA,EAAA,oBAAsB,qBA3BZA,OAAA,IAsFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,cACfA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,cAAgB,eAChBA,EAAA,kBAAoB,mBAZVA,OAAA,IA8IAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Avalanche, BitcoinInputUTXO, BitcoinOutputUTXO } from '@avalabs/core-wallets-sdk';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\nimport type { TokenWithBalanceBTC } from './balance';\nimport type { TransactionPayload, VMABI } from 'hypersdk-client';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n BITCOIN_SIGN_TRANSACTION = 'bitcoin_signTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n ETH_SEND_TRANSACTION_BATCH = 'eth_sendTransactionBatch',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n\n /* AVALANCHE */\n AVALANCHE_SIGN_MESSAGE = 'avalanche_signMessage',\n AVALANCHE_SEND_TRANSACTION = 'avalanche_sendTransaction',\n AVALANCHE_SIGN_TRANSACTION = 'avalanche_signTransaction',\n AVALANCHE_DECLARE_AGENT_IDENTITY = 'avalanche_declareAgentIdentity',\n\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_signTransaction',\n\n /* SOLANA */\n SOLANA_SIGN_TRANSACTION = 'solana_signTransaction',\n SOLANA_SIGN_AND_SEND_TRANSACTION = 'solana_signAndSendTransaction',\n SOLANA_SIGN_MESSAGE = 'solana_signMessage',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport type DetailSection = {\n title?: string;\n items: DetailItem[];\n};\n\nexport type BaseDetailItem = {\n label: string;\n};\n\nexport enum DetailItemType {\n TEXT = 'text',\n ADDRESS = 'address',\n ADDRESS_LIST = 'addressList',\n NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\n NETWORK = 'network',\n TRANSFER_LIST = 'transferList',\n COLLAPSIBLE_GROUP = 'collapsibleGroup',\n}\n\n// It's very similar as CurrencyItem, but we want the client apps\n// to treat the label as an address (recognize it if possible,\n// truncate otherwise).\nexport type FundsRecipientItem = BaseDetailItem & {\n type: DetailItemType.FUNDS_RECIPIENT;\n amount: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type TextItem = BaseDetailItem & {\n type: DetailItemType.TEXT;\n value: string;\n alignment: 'vertical' | 'horizontal';\n};\n\nexport type AddressItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS;\n value: string;\n};\n\nexport type AddressListItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS_LIST;\n value: string[];\n};\n\nexport type NodeIDItem = BaseDetailItem & {\n type: DetailItemType.NODE_ID;\n value: string;\n};\n\nexport type CurrencyItem = BaseDetailItem & {\n type: DetailItemType.CURRENCY;\n value: bigint;\n maxDecimals: number;\n symbol: string;\n isNativeToken?: boolean;\n};\n\nexport type DataItem = BaseDetailItem & {\n type: DetailItemType.DATA;\n value: string;\n};\n\nexport type DateItem = BaseDetailItem & {\n type: DetailItemType.DATE;\n value: string;\n};\n\nexport type LinkItemValue = { url: string; name?: string; icon?: string };\n\nexport type LinkItem = BaseDetailItem & {\n type: DetailItemType.LINK;\n value: LinkItemValue;\n};\n\nexport type NetworkItemValue = {\n logoUri: string | undefined;\n name: string;\n};\n\nexport type NetworkItem = BaseDetailItem & {\n type: DetailItemType.NETWORK;\n value: NetworkItemValue;\n};\n\nexport type Transfer = {\n addresses: string[];\n amount: bigint;\n assetId: string;\n symbol?: string;\n decimals?: number;\n assetName?: string;\n threshold?: number;\n lockedUntil?: number;\n stakeableLockedUntil?: number;\n isNativeToken?: boolean;\n isStaked?: boolean;\n stakedUntil?: number;\n};\n\nexport type TransferListItem = BaseDetailItem & {\n type: DetailItemType.TRANSFER_LIST;\n value: Transfer[];\n};\n\nexport type CollapsibleGroupItem = BaseDetailItem & {\n type: DetailItemType.COLLAPSIBLE_GROUP;\n value: DetailSection[];\n};\n\nexport type DetailItem =\n | string\n | TextItem\n | AddressItem\n | AddressListItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem\n | NetworkItem\n | TransferListItem\n | CollapsibleGroupItem;\n\nexport type DisplayData = {\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network?: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n details: DetailSection[];\n networkFeeSelector?: boolean;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n isSimulationSuccessful?: boolean;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n body?: string[];\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinExecuteTxData = {\n to: string;\n amount: number;\n feeRate: number;\n fee: number;\n gasLimit: number;\n balance: TokenWithBalanceBTC;\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type BitcoingSignTxData = {\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.SOLANA_SIGN_AND_SEND_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_MESSAGE;\n account: string;\n data: string; // Base-64 encoded message\n }\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinExecuteTxData;\n }\n | {\n type: RpcMethod.BITCOIN_SIGN_TRANSACTION;\n account: string;\n data: BitcoingSignTxData;\n }\n | SigningData_EthSendTx\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n data: TypedData<MessageTypes>;\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_MESSAGE;\n data: string;\n accountIndex?: number;\n }\n | {\n type: RpcMethod.AVALANCHE_SEND_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n externalIndices?: number[];\n internalIndices?: number[];\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n ownSignatureIndices: [number, number][];\n }\n | {\n type: RpcMethod.HVM_SIGN_TRANSACTION;\n data: {\n abi: VMABI;\n txPayload: TransactionPayload;\n };\n };\n\nexport type SigningData_EthSendTx = {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n};\n\nexport type EvmTxBatchUpdateFn = (\n data: { maxFeeRate?: bigint; maxTipRate?: bigint },\n txIndex: number,\n) => {\n displayData: DisplayData;\n signingRequests: {\n displayData: DisplayData;\n signingData: SigningData_EthSendTx;\n }[];\n};\n\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n gasLimit?: number;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: SigningData_EthSendTx };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type SigningRequest<Data = SigningData> = {\n displayData: DisplayData;\n signingData: Data;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n} & SigningRequest;\n\nexport type BatchApprovalParams = {\n request: RpcRequest;\n signingRequests: SigningRequest<SigningData_EthSendTx>[];\n displayData: DisplayData;\n updateTx: EvmTxBatchUpdateFn;\n};\n\nexport type RequestPublicKeyParams = {\n secretId: string;\n curve: 'secp256k1' | 'ed25519';\n derivationPath?: string;\n};\n\n/**\n * We want to accept both a signed data (tx/message) and a tx hash as a response\n * coming in from the client apps, hence the XORs here.\n *\n * The reason we need to support both is because extension allows importing\n * external software wallets, such as Fireblocks or other apps that support\n * the WalletConnect protocol.\n *\n * My experience is that WalletConnect apps rarely, if ever, support\n * \"eth_signTransaction\" requests and more often only allow sending\n * \"eth_sendTransaction\" calls, which means that all we'll get in response\n * from them is the transaction hash (not a signed tx).\n */\ntype SignedData = { signedData: string };\ntype BroadcastedTx = { txHash: string };\n\nexport type SigningResult = SignedData | BroadcastedTx;\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport type BatchApprovalResponse =\n | { error: RpcError }\n | {\n result: SignedData[];\n };\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n requestPublicKey: (params: RequestPublicKeyParams) => Promise<string>;\n onTransactionPending: ({\n txHash,\n request,\n explorerLink,\n }: {\n txHash: string;\n request: RpcRequest;\n explorerLink: string;\n }) => void;\n onTransactionConfirmed: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n onTransactionReverted: ({ txHash, request }: { txHash: string; request: RpcRequest }) => void;\n /**\n * Called when the module gave up waiting for a terminal status without ever\n * learning one — the node stopped answering, or kept reporting the tx as\n * processing until the poll budget ran out. The transaction may still have\n * been accepted, so this is deliberately neither a confirmation nor a\n * revert: consumers should stop showing an in-progress state and point the\n * user at the explorer.\n *\n * Optional so existing consumers keep compiling; a module that has nothing\n * better to report simply stays silent when it is not implemented.\n */\n onTransactionStatusUnknown?: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var e=(t=>(t.Base="base",t.AddValidator="add_validator",t.AddDelegator="add_delegator",t.Export="export",t.Import="import",t.CreateSubnet="create_subnet",t.CreateChain="create_chain",t.AddSubnetValidator="add_subnet_validator",t.RemoveSubnetValidator="remove_subnet_validator",t.AddPermissionlessValidator="add_permissionless_validator",t.AddPermissionlessDelegator="add_permissionless_delegator",t.TransformSubnet="transform_subnet",t.TransferSubnetOwnership="transfer_subnet_ownership",t.ConvertSubnetToL1="convert_subnet_to_l1",t.RegisterL1Validator="register_l1_validator",t.SetL1ValidatorWeight="set_l1_validator_weight",t.IncreaseL1ValidatorBalance="increase_l1_validator_balance",t.DisableL1Validator="disable_l1_validator",t.AddAutoRenewedValidator="add_auto_renewed_validator",t.SetAutoRenewedValidatorConfig="set_auto_renewed_validator_config",t.Unknown="unknown",t))(e||{});
|
|
2
|
+
|
|
3
|
+
export { e as a };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-KUIEUGHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/staking.ts"],"names":["TxType"],"mappings":"AA4MO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,2BAA6B,+BAC7BA,EAAA,2BAA6B,+BAC7BA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,kBAAoB,uBACpBA,EAAA,oBAAsB,wBACtBA,EAAA,qBAAuB,0BACvBA,EAAA,2BAA6B,gCAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,wBAA0B,6BAC1BA,EAAA,8BAAgC,oCAChCA,EAAA,QAAU,UArBAA,OAAA","sourcesContent":["import type { NetworkVMType } from './common';\n\nexport type TxDetails = TxValueDetails &\n (StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details);\n\nexport type TxValueDetails = {\n outputs: TxOutput[];\n inputAmounts: Record<string, bigint>;\n outputAmounts: Record<string, bigint>;\n totalAvaxInput: bigint;\n totalAvaxOutput: bigint;\n totalAvaxBurned: bigint;\n isValidAvaxBurnedAmount: boolean;\n};\n\nexport type TxOutput = {\n assetId: string;\n amount: bigint;\n owners: string[];\n locktime: bigint;\n stakeableLocktime: bigint;\n threshold: bigint;\n isAvax: boolean;\n isStake: boolean;\n assetDescription?: {\n assetID: string;\n name: string;\n symbol: string;\n denomination: number;\n };\n};\n\nexport type StakingDetails =\n | AddPermissionlessDelegatorTx\n | AddPermissionlessValidatorTx\n | AddSubnetValidatorTx\n | RemoveSubnetValidatorTx\n | AddAutoRenewedValidatorTx\n | SetAutoRenewedValidatorConfigTx;\nexport type ExportImportTxDetails = ExportTx | ImportTx;\nexport type ChainDetails = BaseTx;\nexport type BlockchainDetails = CreateChainTx;\nexport type SubnetDetails = CreateSubnetTx;\nexport type L1Details =\n | ConvertSubnetToL1Tx\n | RegisterL1ValidatorTx\n | SetL1ValidatorWeightTx\n | IncreaseL1ValidatorBalanceTx\n | DisableL1ValidatorTx;\n\nexport type VM = NetworkVMType.AVM | NetworkVMType.EVM | NetworkVMType.PVM;\n\nexport type AddPermissionlessDelegatorTx = {\n type: TxType.AddPermissionlessDelegator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type AddPermissionlessValidatorTx = {\n type: TxType.AddPermissionlessValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n delegationFee: number;\n start: string;\n end: string;\n txFee: bigint;\n publicKey?: string;\n signature?: string;\n};\n\nexport interface ExportTx {\n type: TxType.Export;\n destination: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface ImportTx {\n type: TxType.Import;\n source: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface BaseTx {\n type: TxType.Base;\n chain: VM;\n outputs: TxOutput[];\n memo?: string;\n txFee: bigint;\n}\n\nexport type AddSubnetValidatorTx = {\n type: TxType.AddSubnetValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type CreateChainTx = {\n type: TxType.CreateChain;\n chainName: string;\n chainID: string;\n vmID: string;\n genesisData: string;\n txFee: bigint;\n};\n\nexport type CreateSubnetTx = {\n type: TxType.CreateSubnet;\n threshold: number;\n controlKeys: string[];\n txFee: bigint;\n};\n\nexport type RemoveSubnetValidatorTx = {\n type: TxType.RemoveSubnetValidator;\n nodeID: string;\n subnetID: string;\n txFee: bigint;\n};\n\nexport type AddAutoRenewedValidatorTx = {\n type: TxType.AddAutoRenewedValidator;\n nodeID: string;\n stake: bigint;\n delegationFee: number;\n // Share of staking rewards reinvested as additional stake on each auto-renewal cycle (ACP-236).\n // Expressed in millionths (percentage × 10,000), range [0..1_000_000]: 1_000_000 = 100%, 300_000 = 30%.\n autoCompoundRewardShares: number;\n // Auto-renewal cycle duration in seconds (ACP-236)\n period: bigint;\n publicKey?: string;\n signature?: string;\n txFee: bigint;\n};\n\nexport type SetAutoRenewedValidatorConfigTx = {\n type: TxType.SetAutoRenewedValidatorConfig;\n // ID of the AddAutoRenewedValidator tx whose config is being updated (ACP-236)\n txId: string;\n // Same scale as `AddAutoRenewedValidatorTx.autoCompoundRewardShares`:\n // millionths (percentage × 10,000), range [0..1_000_000].\n autoCompoundRewardShares: number;\n period: bigint;\n txFee: bigint;\n};\n\nexport type FeeData = {\n totalAvaxBurned: bigint;\n totalAvaxOutput: bigint;\n totalAvaxInput: bigint;\n isValidAvaxBurnedAmount: boolean;\n txFee: bigint;\n};\n\nexport type TxBase = FeeData & {\n chain: VM;\n};\n\nexport type ConvertSubnetToL1Tx = TxBase & {\n type: TxType.ConvertSubnetToL1;\n managerAddress: string;\n validators: {\n nodeId: string;\n stake: bigint;\n balance: bigint;\n remainingBalanceOwners: string[];\n deactivationOwners: string[];\n }[];\n subnetID: string;\n chainID: string;\n};\n\nexport type RegisterL1ValidatorTx = TxBase & {\n type: TxType.RegisterL1Validator;\n balance: bigint;\n};\n\nexport type SetL1ValidatorWeightTx = TxBase & {\n type: TxType.SetL1ValidatorWeight;\n};\n\nexport type IncreaseL1ValidatorBalanceTx = TxBase & {\n type: TxType.IncreaseL1ValidatorBalance;\n balance: bigint;\n validationId: string;\n};\n\nexport type DisableL1ValidatorTx = TxBase & {\n type: TxType.DisableL1Validator;\n validationId: string;\n};\n\nexport enum TxType {\n Base = 'base',\n AddValidator = 'add_validator',\n AddDelegator = 'add_delegator',\n Export = 'export',\n Import = 'import',\n CreateSubnet = 'create_subnet',\n CreateChain = 'create_chain',\n AddSubnetValidator = 'add_subnet_validator',\n RemoveSubnetValidator = 'remove_subnet_validator',\n AddPermissionlessValidator = 'add_permissionless_validator',\n AddPermissionlessDelegator = 'add_permissionless_delegator',\n TransformSubnet = 'transform_subnet',\n TransferSubnetOwnership = 'transfer_subnet_ownership',\n ConvertSubnetToL1 = 'convert_subnet_to_l1',\n RegisterL1Validator = 'register_l1_validator',\n SetL1ValidatorWeight = 'set_l1_validator_weight',\n IncreaseL1ValidatorBalance = 'increase_l1_validator_balance',\n DisableL1Validator = 'disable_l1_validator',\n AddAutoRenewedValidator = 'add_auto_renewed_validator',\n SetAutoRenewedValidatorConfig = 'set_auto_renewed_validator_config',\n Unknown = 'unknown',\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var e=(t=>(t.Base="base",t.AddValidator="add_validator",t.AddDelegator="add_delegator",t.Export="export",t.Import="import",t.CreateSubnet="create_subnet",t.CreateChain="create_chain",t.AddSubnetValidator="add_subnet_validator",t.RemoveSubnetValidator="remove_subnet_validator",t.AddPermissionlessValidator="add_permissionless_validator",t.AddPermissionlessDelegator="add_permissionless_delegator",t.TransformSubnet="transform_subnet",t.TransferSubnetOwnership="transfer_subnet_ownership",t.ConvertSubnetToL1="convert_subnet_to_l1",t.RegisterL1Validator="register_l1_validator",t.SetL1ValidatorWeight="set_l1_validator_weight",t.IncreaseL1ValidatorBalance="increase_l1_validator_balance",t.DisableL1Validator="disable_l1_validator",t.AddAutoRenewedValidator="add_auto_renewed_validator",t.SetAutoRenewedValidatorConfig="set_auto_renewed_validator_config",t.Unknown="unknown",t))(e||{});
|
|
4
|
+
|
|
5
|
+
exports.a = e;
|
|
6
|
+
//# sourceMappingURL=out.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-NN5FFZXP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/staking.ts"],"names":["TxType"],"mappings":"AA4MO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,2BAA6B,+BAC7BA,EAAA,2BAA6B,+BAC7BA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,kBAAoB,uBACpBA,EAAA,oBAAsB,wBACtBA,EAAA,qBAAuB,0BACvBA,EAAA,2BAA6B,gCAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,wBAA0B,6BAC1BA,EAAA,8BAAgC,oCAChCA,EAAA,QAAU,UArBAA,OAAA","sourcesContent":["import type { NetworkVMType } from './common';\n\nexport type TxDetails = TxValueDetails &\n (StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details);\n\nexport type TxValueDetails = {\n outputs: TxOutput[];\n inputAmounts: Record<string, bigint>;\n outputAmounts: Record<string, bigint>;\n totalAvaxInput: bigint;\n totalAvaxOutput: bigint;\n totalAvaxBurned: bigint;\n isValidAvaxBurnedAmount: boolean;\n};\n\nexport type TxOutput = {\n assetId: string;\n amount: bigint;\n owners: string[];\n locktime: bigint;\n stakeableLocktime: bigint;\n threshold: bigint;\n isAvax: boolean;\n isStake: boolean;\n assetDescription?: {\n assetID: string;\n name: string;\n symbol: string;\n denomination: number;\n };\n};\n\nexport type StakingDetails =\n | AddPermissionlessDelegatorTx\n | AddPermissionlessValidatorTx\n | AddSubnetValidatorTx\n | RemoveSubnetValidatorTx\n | AddAutoRenewedValidatorTx\n | SetAutoRenewedValidatorConfigTx;\nexport type ExportImportTxDetails = ExportTx | ImportTx;\nexport type ChainDetails = BaseTx;\nexport type BlockchainDetails = CreateChainTx;\nexport type SubnetDetails = CreateSubnetTx;\nexport type L1Details =\n | ConvertSubnetToL1Tx\n | RegisterL1ValidatorTx\n | SetL1ValidatorWeightTx\n | IncreaseL1ValidatorBalanceTx\n | DisableL1ValidatorTx;\n\nexport type VM = NetworkVMType.AVM | NetworkVMType.EVM | NetworkVMType.PVM;\n\nexport type AddPermissionlessDelegatorTx = {\n type: TxType.AddPermissionlessDelegator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type AddPermissionlessValidatorTx = {\n type: TxType.AddPermissionlessValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n delegationFee: number;\n start: string;\n end: string;\n txFee: bigint;\n publicKey?: string;\n signature?: string;\n};\n\nexport interface ExportTx {\n type: TxType.Export;\n destination: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface ImportTx {\n type: TxType.Import;\n source: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface BaseTx {\n type: TxType.Base;\n chain: VM;\n outputs: TxOutput[];\n memo?: string;\n txFee: bigint;\n}\n\nexport type AddSubnetValidatorTx = {\n type: TxType.AddSubnetValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type CreateChainTx = {\n type: TxType.CreateChain;\n chainName: string;\n chainID: string;\n vmID: string;\n genesisData: string;\n txFee: bigint;\n};\n\nexport type CreateSubnetTx = {\n type: TxType.CreateSubnet;\n threshold: number;\n controlKeys: string[];\n txFee: bigint;\n};\n\nexport type RemoveSubnetValidatorTx = {\n type: TxType.RemoveSubnetValidator;\n nodeID: string;\n subnetID: string;\n txFee: bigint;\n};\n\nexport type AddAutoRenewedValidatorTx = {\n type: TxType.AddAutoRenewedValidator;\n nodeID: string;\n stake: bigint;\n delegationFee: number;\n // Share of staking rewards reinvested as additional stake on each auto-renewal cycle (ACP-236).\n // Expressed in millionths (percentage × 10,000), range [0..1_000_000]: 1_000_000 = 100%, 300_000 = 30%.\n autoCompoundRewardShares: number;\n // Auto-renewal cycle duration in seconds (ACP-236)\n period: bigint;\n publicKey?: string;\n signature?: string;\n txFee: bigint;\n};\n\nexport type SetAutoRenewedValidatorConfigTx = {\n type: TxType.SetAutoRenewedValidatorConfig;\n // ID of the AddAutoRenewedValidator tx whose config is being updated (ACP-236)\n txId: string;\n // Same scale as `AddAutoRenewedValidatorTx.autoCompoundRewardShares`:\n // millionths (percentage × 10,000), range [0..1_000_000].\n autoCompoundRewardShares: number;\n period: bigint;\n txFee: bigint;\n};\n\nexport type FeeData = {\n totalAvaxBurned: bigint;\n totalAvaxOutput: bigint;\n totalAvaxInput: bigint;\n isValidAvaxBurnedAmount: boolean;\n txFee: bigint;\n};\n\nexport type TxBase = FeeData & {\n chain: VM;\n};\n\nexport type ConvertSubnetToL1Tx = TxBase & {\n type: TxType.ConvertSubnetToL1;\n managerAddress: string;\n validators: {\n nodeId: string;\n stake: bigint;\n balance: bigint;\n remainingBalanceOwners: string[];\n deactivationOwners: string[];\n }[];\n subnetID: string;\n chainID: string;\n};\n\nexport type RegisterL1ValidatorTx = TxBase & {\n type: TxType.RegisterL1Validator;\n balance: bigint;\n};\n\nexport type SetL1ValidatorWeightTx = TxBase & {\n type: TxType.SetL1ValidatorWeight;\n};\n\nexport type IncreaseL1ValidatorBalanceTx = TxBase & {\n type: TxType.IncreaseL1ValidatorBalance;\n balance: bigint;\n validationId: string;\n};\n\nexport type DisableL1ValidatorTx = TxBase & {\n type: TxType.DisableL1Validator;\n validationId: string;\n};\n\nexport enum TxType {\n Base = 'base',\n AddValidator = 'add_validator',\n AddDelegator = 'add_delegator',\n Export = 'export',\n Import = 'import',\n CreateSubnet = 'create_subnet',\n CreateChain = 'create_chain',\n AddSubnetValidator = 'add_subnet_validator',\n RemoveSubnetValidator = 'remove_subnet_validator',\n AddPermissionlessValidator = 'add_permissionless_validator',\n AddPermissionlessDelegator = 'add_permissionless_delegator',\n TransformSubnet = 'transform_subnet',\n TransferSubnetOwnership = 'transfer_subnet_ownership',\n ConvertSubnetToL1 = 'convert_subnet_to_l1',\n RegisterL1Validator = 'register_l1_validator',\n SetL1ValidatorWeight = 'set_l1_validator_weight',\n IncreaseL1ValidatorBalance = 'increase_l1_validator_balance',\n DisableL1Validator = 'disable_l1_validator',\n AddAutoRenewedValidator = 'add_auto_renewed_validator',\n SetAutoRenewedValidatorConfig = 'set_auto_renewed_validator_config',\n Unknown = 'unknown',\n}\n"]}
|
package/dist/coingecko.d.cts
CHANGED
|
@@ -6,15 +6,15 @@ declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.
|
|
|
6
6
|
marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
7
|
vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
|
|
9
|
+
price?: number | null | undefined;
|
|
10
10
|
change24?: number | null | undefined;
|
|
11
|
+
marketCap?: number | null | undefined;
|
|
11
12
|
vol24?: number | null | undefined;
|
|
12
|
-
price?: number | null | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
|
|
14
|
+
price?: number | null | undefined;
|
|
15
15
|
change24?: number | null | undefined;
|
|
16
|
+
marketCap?: number | null | undefined;
|
|
16
17
|
vol24?: number | null | undefined;
|
|
17
|
-
price?: number | null | undefined;
|
|
18
18
|
}>>>;
|
|
19
19
|
type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
|
|
20
20
|
declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
|
package/dist/coingecko.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.
|
|
|
6
6
|
marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
7
|
vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
|
|
9
|
+
price?: number | null | undefined;
|
|
10
10
|
change24?: number | null | undefined;
|
|
11
|
+
marketCap?: number | null | undefined;
|
|
11
12
|
vol24?: number | null | undefined;
|
|
12
|
-
price?: number | null | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
|
|
14
|
+
price?: number | null | undefined;
|
|
15
15
|
change24?: number | null | undefined;
|
|
16
|
+
marketCap?: number | null | undefined;
|
|
16
17
|
vol24?: number | null | undefined;
|
|
17
|
-
price?: number | null | undefined;
|
|
18
18
|
}>>>;
|
|
19
19
|
type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
|
|
20
20
|
declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
|
package/dist/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
require('./chunk-YB5EN6FL.cjs');
|
|
4
4
|
require('./chunk-AILYKQEY.cjs');
|
|
5
5
|
var chunk4NMX4VK7_cjs = require('./chunk-4NMX4VK7.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunk6K5NSJZP_cjs = require('./chunk-6K5NSJZP.cjs');
|
|
7
|
+
var chunkNN5FFZXP_cjs = require('./chunk-NN5FFZXP.cjs');
|
|
8
8
|
var chunkEC2O5ECQ_cjs = require('./chunk-EC2O5ECQ.cjs');
|
|
9
9
|
var chunkDTK5YHAN_cjs = require('./chunk-DTK5YHAN.cjs');
|
|
10
10
|
require('./chunk-47KTBBRA.cjs');
|
|
@@ -25,19 +25,19 @@ Object.defineProperty(exports, 'EventNames', {
|
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, 'AlertType', {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk6K5NSJZP_cjs.c; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, 'DetailItemType', {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk6K5NSJZP_cjs.b; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, 'RpcMethod', {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk6K5NSJZP_cjs.a; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, 'TxType', {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkNN5FFZXP_cjs.a; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, 'TokenType', {
|
|
43
43
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -5,11 +5,11 @@ export { Error } from './error.cjs';
|
|
|
5
5
|
export { Manifest, parseManifest } from './manifest.cjs';
|
|
6
6
|
export { AppInfo, ConstructorParams, Module, NetworkFeeParam, RuntimeParams } from './module.cjs';
|
|
7
7
|
export { NetworkFees, SuggestGasPriceOptionsResponse } from './network-fee.cjs';
|
|
8
|
-
export { A as AddressItem, i as AddressListItem,
|
|
8
|
+
export { A as AddressItem, i as AddressListItem, v as Alert, u as AlertDetails, t as AlertType, U as ApprovalController, I as ApprovalParams, P as ApprovalResponse, W as BalanceChange, B as BaseDetailItem, V as BatchApprovalController, J as BatchApprovalParams, Q as BatchApprovalResponse, w as BitcoinExecuteTxData, x as BitcoingSignTxData, G as BtcTxUpdateFn, q as CollapsibleGroupItem, C as CurrencyItem, D as DappInfo, j as DataItem, k as DateItem, r as DetailItem, g as DetailItemType, f as DetailSection, s as DisplayData, E as EvmTxBatchUpdateFn, z as EvmTxUpdateFn, F as FundsRecipientItem, l as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, n as NetworkItem, m as NetworkItemValue, N as NodeIDItem, K as RequestPublicKeyParams, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, y as SigningData_EthSendTx, H as SigningRequest, O as SigningResult, h as TextItem, Z as TokenApproval, _ as TokenApprovals, X as TokenDiff, Y as TokenDiffItem, $ as TransactionSimulationResult, o as Transfer, p as TransferListItem, T as TypedData, e as TypedDataV1 } from './rpc-4699ee82.js';
|
|
9
9
|
export { ERC1155Token, ERC20Token, ERC721Token, HypercoreSpotToken, NONERCToken, NetworkContractToken, NetworkToken, SPLToken, TokenType } from './token.cjs';
|
|
10
10
|
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
|
|
11
11
|
export { BtcWalletPolicyDetails, BuildDerivationPathParams, BuildDerivationPathResponse, DerivationPathType, DeriveAddressParams, DeriveAddressResponse, DeriveAddressesParams, DeriveAddressesResponse, DetailedDeriveAddressParams, GetAddressParams, GetAddressResponse, PubKeyType, SimpleDeriveAddressParams, WalletType } from './account.cjs';
|
|
12
|
-
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM } from './staking.cjs';
|
|
12
|
+
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxOutput, TxType, TxValueDetails, VM } from './staking.cjs';
|
|
13
13
|
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.cjs';
|
|
14
14
|
export { AgentIdentity, AgentIdentityDeclaration, TrustLevel } from './agent-identity.cjs';
|
|
15
15
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ export { Error } from './error.js';
|
|
|
5
5
|
export { Manifest, parseManifest } from './manifest.js';
|
|
6
6
|
export { AppInfo, ConstructorParams, Module, NetworkFeeParam, RuntimeParams } from './module.js';
|
|
7
7
|
export { NetworkFees, SuggestGasPriceOptionsResponse } from './network-fee.js';
|
|
8
|
-
export { A as AddressItem, i as AddressListItem,
|
|
8
|
+
export { A as AddressItem, i as AddressListItem, v as Alert, u as AlertDetails, t as AlertType, U as ApprovalController, I as ApprovalParams, P as ApprovalResponse, W as BalanceChange, B as BaseDetailItem, V as BatchApprovalController, J as BatchApprovalParams, Q as BatchApprovalResponse, w as BitcoinExecuteTxData, x as BitcoingSignTxData, G as BtcTxUpdateFn, q as CollapsibleGroupItem, C as CurrencyItem, D as DappInfo, j as DataItem, k as DateItem, r as DetailItem, g as DetailItemType, f as DetailSection, s as DisplayData, E as EvmTxBatchUpdateFn, z as EvmTxUpdateFn, F as FundsRecipientItem, l as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, n as NetworkItem, m as NetworkItemValue, N as NodeIDItem, K as RequestPublicKeyParams, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, y as SigningData_EthSendTx, H as SigningRequest, O as SigningResult, h as TextItem, Z as TokenApproval, _ as TokenApprovals, X as TokenDiff, Y as TokenDiffItem, $ as TransactionSimulationResult, o as Transfer, p as TransferListItem, T as TypedData, e as TypedDataV1 } from './rpc-bbfb0e02.js';
|
|
9
9
|
export { ERC1155Token, ERC20Token, ERC721Token, HypercoreSpotToken, NONERCToken, NetworkContractToken, NetworkToken, SPLToken, TokenType } from './token.js';
|
|
10
10
|
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
|
|
11
11
|
export { BtcWalletPolicyDetails, BuildDerivationPathParams, BuildDerivationPathResponse, DerivationPathType, DeriveAddressParams, DeriveAddressResponse, DeriveAddressesParams, DeriveAddressesResponse, DetailedDeriveAddressParams, GetAddressParams, GetAddressResponse, PubKeyType, SimpleDeriveAddressParams, WalletType } from './account.js';
|
|
12
|
-
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM } from './staking.js';
|
|
12
|
+
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxOutput, TxType, TxValueDetails, VM } from './staking.js';
|
|
13
13
|
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.js';
|
|
14
14
|
export { AgentIdentity, AgentIdentityDeclaration, TrustLevel } from './agent-identity.js';
|
|
15
15
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './chunk-GF7C4PA6.js';
|
|
2
2
|
import './chunk-7U2R34EQ.js';
|
|
3
3
|
export { a as EventNames } from './chunk-6ZLXXGIV.js';
|
|
4
|
-
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-
|
|
5
|
-
export { a as TxType } from './chunk-
|
|
4
|
+
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-FMBTNWZP.js';
|
|
5
|
+
export { a as TxType } from './chunk-KUIEUGHP.js';
|
|
6
6
|
export { a as TokenType } from './chunk-GNNCJP76.js';
|
|
7
7
|
export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-4NLGTKVT.js';
|
|
8
8
|
import './chunk-P6AM7I3B.js';
|
package/dist/module.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { GetBalancesParams, GetBalancesResponse } from './balance.cjs';
|
|
|
4
4
|
import { AppName, Environment, Network } from './common.cjs';
|
|
5
5
|
import { Manifest } from './manifest.cjs';
|
|
6
6
|
import { NetworkFees } from './network-fee.cjs';
|
|
7
|
-
import {
|
|
7
|
+
import { U as ApprovalController, a as RpcRequest, c as RpcResponse } from './rpc-4699ee82.js';
|
|
8
8
|
import { NetworkContractToken, HypercoreSpotToken } from './token.cjs';
|
|
9
9
|
import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.cjs';
|
|
10
10
|
import { HyperSDKClient } from 'hypersdk-client';
|
package/dist/module.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { GetBalancesParams, GetBalancesResponse } from './balance.js';
|
|
|
4
4
|
import { AppName, Environment, Network } from './common.js';
|
|
5
5
|
import { Manifest } from './manifest.js';
|
|
6
6
|
import { NetworkFees } from './network-fee.js';
|
|
7
|
-
import {
|
|
7
|
+
import { U as ApprovalController, a as RpcRequest, c as RpcResponse } from './rpc-bbfb0e02.js';
|
|
8
8
|
import { NetworkContractToken, HypercoreSpotToken } from './token.js';
|
|
9
9
|
import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.js';
|
|
10
10
|
import { HyperSDKClient } from 'hypersdk-client';
|
|
@@ -115,7 +115,9 @@ declare enum DetailItemType {
|
|
|
115
115
|
DATA = "data",
|
|
116
116
|
DATE = "date",
|
|
117
117
|
LINK = "link",
|
|
118
|
-
NETWORK = "network"
|
|
118
|
+
NETWORK = "network",
|
|
119
|
+
TRANSFER_LIST = "transferList",
|
|
120
|
+
COLLAPSIBLE_GROUP = "collapsibleGroup"
|
|
119
121
|
}
|
|
120
122
|
type FundsRecipientItem = BaseDetailItem & {
|
|
121
123
|
type: DetailItemType.FUNDS_RECIPIENT;
|
|
@@ -145,6 +147,7 @@ type CurrencyItem = BaseDetailItem & {
|
|
|
145
147
|
value: bigint;
|
|
146
148
|
maxDecimals: number;
|
|
147
149
|
symbol: string;
|
|
150
|
+
isNativeToken?: boolean;
|
|
148
151
|
};
|
|
149
152
|
type DataItem = BaseDetailItem & {
|
|
150
153
|
type: DetailItemType.DATA;
|
|
@@ -171,7 +174,29 @@ type NetworkItem = BaseDetailItem & {
|
|
|
171
174
|
type: DetailItemType.NETWORK;
|
|
172
175
|
value: NetworkItemValue;
|
|
173
176
|
};
|
|
174
|
-
type
|
|
177
|
+
type Transfer = {
|
|
178
|
+
addresses: string[];
|
|
179
|
+
amount: bigint;
|
|
180
|
+
assetId: string;
|
|
181
|
+
symbol?: string;
|
|
182
|
+
decimals?: number;
|
|
183
|
+
assetName?: string;
|
|
184
|
+
threshold?: number;
|
|
185
|
+
lockedUntil?: number;
|
|
186
|
+
stakeableLockedUntil?: number;
|
|
187
|
+
isNativeToken?: boolean;
|
|
188
|
+
isStaked?: boolean;
|
|
189
|
+
stakedUntil?: number;
|
|
190
|
+
};
|
|
191
|
+
type TransferListItem = BaseDetailItem & {
|
|
192
|
+
type: DetailItemType.TRANSFER_LIST;
|
|
193
|
+
value: Transfer[];
|
|
194
|
+
};
|
|
195
|
+
type CollapsibleGroupItem = BaseDetailItem & {
|
|
196
|
+
type: DetailItemType.COLLAPSIBLE_GROUP;
|
|
197
|
+
value: DetailSection[];
|
|
198
|
+
};
|
|
199
|
+
type DetailItem = string | TextItem | AddressItem | AddressListItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem | FundsRecipientItem | NetworkItem | TransferListItem | CollapsibleGroupItem;
|
|
175
200
|
type DisplayData = {
|
|
176
201
|
title: string;
|
|
177
202
|
dAppInfo?: {
|
|
@@ -398,4 +423,4 @@ interface BatchApprovalController extends ApprovalController {
|
|
|
398
423
|
requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;
|
|
399
424
|
}
|
|
400
425
|
|
|
401
|
-
export { AddressItem as A, BaseDetailItem as B, CurrencyItem as C, DappInfo as D, EvmTxBatchUpdateFn as E, FundsRecipientItem as F,
|
|
426
|
+
export { TransactionSimulationResult as $, AddressItem as A, BaseDetailItem as B, CurrencyItem as C, DappInfo as D, EvmTxBatchUpdateFn as E, FundsRecipientItem as F, BtcTxUpdateFn as G, SigningRequest as H, ApprovalParams as I, BatchApprovalParams as J, RequestPublicKeyParams as K, LinkItemValue as L, MessageTypeProperty as M, NodeIDItem as N, SigningResult as O, ApprovalResponse as P, BatchApprovalResponse as Q, RpcMethod as R, SigningData as S, TypedData as T, ApprovalController as U, BatchApprovalController as V, BalanceChange as W, TokenDiff as X, TokenDiffItem as Y, TokenApproval as Z, TokenApprovals as _, RpcRequest as a, RpcError as b, RpcResponse as c, MessageTypes as d, TypedDataV1 as e, DetailSection as f, DetailItemType as g, TextItem as h, AddressListItem as i, DataItem as j, DateItem as k, LinkItem as l, NetworkItemValue as m, NetworkItem as n, Transfer as o, TransferListItem as p, CollapsibleGroupItem as q, DetailItem as r, DisplayData as s, AlertType as t, AlertDetails as u, Alert as v, BitcoinExecuteTxData as w, BitcoingSignTxData as x, SigningData_EthSendTx as y, EvmTxUpdateFn as z };
|
|
@@ -115,7 +115,9 @@ declare enum DetailItemType {
|
|
|
115
115
|
DATA = "data",
|
|
116
116
|
DATE = "date",
|
|
117
117
|
LINK = "link",
|
|
118
|
-
NETWORK = "network"
|
|
118
|
+
NETWORK = "network",
|
|
119
|
+
TRANSFER_LIST = "transferList",
|
|
120
|
+
COLLAPSIBLE_GROUP = "collapsibleGroup"
|
|
119
121
|
}
|
|
120
122
|
type FundsRecipientItem = BaseDetailItem & {
|
|
121
123
|
type: DetailItemType.FUNDS_RECIPIENT;
|
|
@@ -145,6 +147,7 @@ type CurrencyItem = BaseDetailItem & {
|
|
|
145
147
|
value: bigint;
|
|
146
148
|
maxDecimals: number;
|
|
147
149
|
symbol: string;
|
|
150
|
+
isNativeToken?: boolean;
|
|
148
151
|
};
|
|
149
152
|
type DataItem = BaseDetailItem & {
|
|
150
153
|
type: DetailItemType.DATA;
|
|
@@ -171,7 +174,29 @@ type NetworkItem = BaseDetailItem & {
|
|
|
171
174
|
type: DetailItemType.NETWORK;
|
|
172
175
|
value: NetworkItemValue;
|
|
173
176
|
};
|
|
174
|
-
type
|
|
177
|
+
type Transfer = {
|
|
178
|
+
addresses: string[];
|
|
179
|
+
amount: bigint;
|
|
180
|
+
assetId: string;
|
|
181
|
+
symbol?: string;
|
|
182
|
+
decimals?: number;
|
|
183
|
+
assetName?: string;
|
|
184
|
+
threshold?: number;
|
|
185
|
+
lockedUntil?: number;
|
|
186
|
+
stakeableLockedUntil?: number;
|
|
187
|
+
isNativeToken?: boolean;
|
|
188
|
+
isStaked?: boolean;
|
|
189
|
+
stakedUntil?: number;
|
|
190
|
+
};
|
|
191
|
+
type TransferListItem = BaseDetailItem & {
|
|
192
|
+
type: DetailItemType.TRANSFER_LIST;
|
|
193
|
+
value: Transfer[];
|
|
194
|
+
};
|
|
195
|
+
type CollapsibleGroupItem = BaseDetailItem & {
|
|
196
|
+
type: DetailItemType.COLLAPSIBLE_GROUP;
|
|
197
|
+
value: DetailSection[];
|
|
198
|
+
};
|
|
199
|
+
type DetailItem = string | TextItem | AddressItem | AddressListItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem | FundsRecipientItem | NetworkItem | TransferListItem | CollapsibleGroupItem;
|
|
175
200
|
type DisplayData = {
|
|
176
201
|
title: string;
|
|
177
202
|
dAppInfo?: {
|
|
@@ -398,4 +423,4 @@ interface BatchApprovalController extends ApprovalController {
|
|
|
398
423
|
requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;
|
|
399
424
|
}
|
|
400
425
|
|
|
401
|
-
export { AddressItem as A, BaseDetailItem as B, CurrencyItem as C, DappInfo as D, EvmTxBatchUpdateFn as E, FundsRecipientItem as F,
|
|
426
|
+
export { TransactionSimulationResult as $, AddressItem as A, BaseDetailItem as B, CurrencyItem as C, DappInfo as D, EvmTxBatchUpdateFn as E, FundsRecipientItem as F, BtcTxUpdateFn as G, SigningRequest as H, ApprovalParams as I, BatchApprovalParams as J, RequestPublicKeyParams as K, LinkItemValue as L, MessageTypeProperty as M, NodeIDItem as N, SigningResult as O, ApprovalResponse as P, BatchApprovalResponse as Q, RpcMethod as R, SigningData as S, TypedData as T, ApprovalController as U, BatchApprovalController as V, BalanceChange as W, TokenDiff as X, TokenDiffItem as Y, TokenApproval as Z, TokenApprovals as _, RpcRequest as a, RpcError as b, RpcResponse as c, MessageTypes as d, TypedDataV1 as e, DetailSection as f, DetailItemType as g, TextItem as h, AddressListItem as i, DataItem as j, DateItem as k, LinkItem as l, NetworkItemValue as m, NetworkItem as n, Transfer as o, TransferListItem as p, CollapsibleGroupItem as q, DetailItem as r, DisplayData as s, AlertType as t, AlertDetails as u, Alert as v, BitcoinExecuteTxData as w, BitcoingSignTxData as x, SigningData_EthSendTx as y, EvmTxUpdateFn as z };
|
package/dist/rpc.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6K5NSJZP_cjs = require('./chunk-6K5NSJZP.cjs');
|
|
4
4
|
require('./chunk-IQLAM2UJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, 'AlertType', {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk6K5NSJZP_cjs.c; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, 'DetailItemType', {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk6K5NSJZP_cjs.b; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, 'RpcMethod', {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk6K5NSJZP_cjs.a; }
|
|
19
19
|
});
|
|
20
20
|
//# sourceMappingURL=out.js.map
|
|
21
21
|
//# sourceMappingURL=rpc.cjs.map
|
package/dist/rpc.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import 'ethers';
|
|
|
2
2
|
import '@avalabs/core-wallets-sdk';
|
|
3
3
|
import './common.cjs';
|
|
4
4
|
import '@metamask/rpc-errors';
|
|
5
|
-
export { A as AddressItem, i as AddressListItem,
|
|
5
|
+
export { A as AddressItem, i as AddressListItem, v as Alert, u as AlertDetails, t as AlertType, U as ApprovalController, I as ApprovalParams, P as ApprovalResponse, B as BaseDetailItem, V as BatchApprovalController, J as BatchApprovalParams, Q as BatchApprovalResponse, w as BitcoinExecuteTxData, x as BitcoingSignTxData, G as BtcTxUpdateFn, q as CollapsibleGroupItem, C as CurrencyItem, D as DappInfo, j as DataItem, k as DateItem, r as DetailItem, g as DetailItemType, f as DetailSection, s as DisplayData, E as EvmTxBatchUpdateFn, z as EvmTxUpdateFn, F as FundsRecipientItem, l as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, n as NetworkItem, m as NetworkItemValue, N as NodeIDItem, K as RequestPublicKeyParams, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, y as SigningData_EthSendTx, H as SigningRequest, O as SigningResult, h as TextItem, o as Transfer, p as TransferListItem, T as TypedData, e as TypedDataV1 } from './rpc-4699ee82.js';
|
|
6
6
|
import './balance.cjs';
|
|
7
7
|
import 'hypersdk-client';
|
|
8
8
|
import './token.cjs';
|
package/dist/rpc.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import 'ethers';
|
|
|
2
2
|
import '@avalabs/core-wallets-sdk';
|
|
3
3
|
import './common.js';
|
|
4
4
|
import '@metamask/rpc-errors';
|
|
5
|
-
export { A as AddressItem, i as AddressListItem,
|
|
5
|
+
export { A as AddressItem, i as AddressListItem, v as Alert, u as AlertDetails, t as AlertType, U as ApprovalController, I as ApprovalParams, P as ApprovalResponse, B as BaseDetailItem, V as BatchApprovalController, J as BatchApprovalParams, Q as BatchApprovalResponse, w as BitcoinExecuteTxData, x as BitcoingSignTxData, G as BtcTxUpdateFn, q as CollapsibleGroupItem, C as CurrencyItem, D as DappInfo, j as DataItem, k as DateItem, r as DetailItem, g as DetailItemType, f as DetailSection, s as DisplayData, E as EvmTxBatchUpdateFn, z as EvmTxUpdateFn, F as FundsRecipientItem, l as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, n as NetworkItem, m as NetworkItemValue, N as NodeIDItem, K as RequestPublicKeyParams, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, y as SigningData_EthSendTx, H as SigningRequest, O as SigningResult, h as TextItem, o as Transfer, p as TransferListItem, T as TypedData, e as TypedDataV1 } from './rpc-bbfb0e02.js';
|
|
6
6
|
import './balance.js';
|
|
7
7
|
import 'hypersdk-client';
|
|
8
8
|
import './token.js';
|
package/dist/rpc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-
|
|
1
|
+
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-FMBTNWZP.js';
|
|
2
2
|
import './chunk-DYCPFO4Y.js';
|
|
3
3
|
//# sourceMappingURL=out.js.map
|
|
4
4
|
//# sourceMappingURL=rpc.js.map
|
package/dist/staking.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNN5FFZXP_cjs = require('./chunk-NN5FFZXP.cjs');
|
|
4
4
|
require('./chunk-IQLAM2UJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, 'TxType', {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkNN5FFZXP_cjs.a; }
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=out.js.map
|
|
13
13
|
//# sourceMappingURL=staking.cjs.map
|
package/dist/staking.d.cts
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
import { NetworkVMType } from './common.cjs';
|
|
2
2
|
import './token.cjs';
|
|
3
3
|
|
|
4
|
-
type TxDetails = StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details;
|
|
4
|
+
type TxDetails = TxValueDetails & (StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details);
|
|
5
|
+
type TxValueDetails = {
|
|
6
|
+
outputs: TxOutput[];
|
|
7
|
+
inputAmounts: Record<string, bigint>;
|
|
8
|
+
outputAmounts: Record<string, bigint>;
|
|
9
|
+
totalAvaxInput: bigint;
|
|
10
|
+
totalAvaxOutput: bigint;
|
|
11
|
+
totalAvaxBurned: bigint;
|
|
12
|
+
isValidAvaxBurnedAmount: boolean;
|
|
13
|
+
};
|
|
14
|
+
type TxOutput = {
|
|
15
|
+
assetId: string;
|
|
16
|
+
amount: bigint;
|
|
17
|
+
owners: string[];
|
|
18
|
+
locktime: bigint;
|
|
19
|
+
stakeableLocktime: bigint;
|
|
20
|
+
threshold: bigint;
|
|
21
|
+
isAvax: boolean;
|
|
22
|
+
isStake: boolean;
|
|
23
|
+
assetDescription?: {
|
|
24
|
+
assetID: string;
|
|
25
|
+
name: string;
|
|
26
|
+
symbol: string;
|
|
27
|
+
denomination: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
5
30
|
type StakingDetails = AddPermissionlessDelegatorTx | AddPermissionlessValidatorTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddAutoRenewedValidatorTx | SetAutoRenewedValidatorConfigTx;
|
|
6
31
|
type ExportImportTxDetails = ExportTx | ImportTx;
|
|
7
32
|
type ChainDetails = BaseTx;
|
|
@@ -47,20 +72,7 @@ interface ImportTx {
|
|
|
47
72
|
interface BaseTx {
|
|
48
73
|
type: TxType.Base;
|
|
49
74
|
chain: VM;
|
|
50
|
-
outputs:
|
|
51
|
-
assetId: string;
|
|
52
|
-
locktime: bigint;
|
|
53
|
-
threshold: bigint;
|
|
54
|
-
amount: bigint;
|
|
55
|
-
assetDescription?: {
|
|
56
|
-
assetID: string;
|
|
57
|
-
name: string;
|
|
58
|
-
symbol: string;
|
|
59
|
-
denomination: number;
|
|
60
|
-
};
|
|
61
|
-
owners: string[];
|
|
62
|
-
isAvax: boolean;
|
|
63
|
-
}[];
|
|
75
|
+
outputs: TxOutput[];
|
|
64
76
|
memo?: string;
|
|
65
77
|
txFee: bigint;
|
|
66
78
|
}
|
|
@@ -174,4 +186,4 @@ declare enum TxType {
|
|
|
174
186
|
Unknown = "unknown"
|
|
175
187
|
}
|
|
176
188
|
|
|
177
|
-
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM };
|
|
189
|
+
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxOutput, TxType, TxValueDetails, VM };
|
package/dist/staking.d.ts
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
import { NetworkVMType } from './common.js';
|
|
2
2
|
import './token.js';
|
|
3
3
|
|
|
4
|
-
type TxDetails = StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details;
|
|
4
|
+
type TxDetails = TxValueDetails & (StakingDetails | ExportImportTxDetails | ChainDetails | BlockchainDetails | SubnetDetails | L1Details);
|
|
5
|
+
type TxValueDetails = {
|
|
6
|
+
outputs: TxOutput[];
|
|
7
|
+
inputAmounts: Record<string, bigint>;
|
|
8
|
+
outputAmounts: Record<string, bigint>;
|
|
9
|
+
totalAvaxInput: bigint;
|
|
10
|
+
totalAvaxOutput: bigint;
|
|
11
|
+
totalAvaxBurned: bigint;
|
|
12
|
+
isValidAvaxBurnedAmount: boolean;
|
|
13
|
+
};
|
|
14
|
+
type TxOutput = {
|
|
15
|
+
assetId: string;
|
|
16
|
+
amount: bigint;
|
|
17
|
+
owners: string[];
|
|
18
|
+
locktime: bigint;
|
|
19
|
+
stakeableLocktime: bigint;
|
|
20
|
+
threshold: bigint;
|
|
21
|
+
isAvax: boolean;
|
|
22
|
+
isStake: boolean;
|
|
23
|
+
assetDescription?: {
|
|
24
|
+
assetID: string;
|
|
25
|
+
name: string;
|
|
26
|
+
symbol: string;
|
|
27
|
+
denomination: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
5
30
|
type StakingDetails = AddPermissionlessDelegatorTx | AddPermissionlessValidatorTx | AddSubnetValidatorTx | RemoveSubnetValidatorTx | AddAutoRenewedValidatorTx | SetAutoRenewedValidatorConfigTx;
|
|
6
31
|
type ExportImportTxDetails = ExportTx | ImportTx;
|
|
7
32
|
type ChainDetails = BaseTx;
|
|
@@ -47,20 +72,7 @@ interface ImportTx {
|
|
|
47
72
|
interface BaseTx {
|
|
48
73
|
type: TxType.Base;
|
|
49
74
|
chain: VM;
|
|
50
|
-
outputs:
|
|
51
|
-
assetId: string;
|
|
52
|
-
locktime: bigint;
|
|
53
|
-
threshold: bigint;
|
|
54
|
-
amount: bigint;
|
|
55
|
-
assetDescription?: {
|
|
56
|
-
assetID: string;
|
|
57
|
-
name: string;
|
|
58
|
-
symbol: string;
|
|
59
|
-
denomination: number;
|
|
60
|
-
};
|
|
61
|
-
owners: string[];
|
|
62
|
-
isAvax: boolean;
|
|
63
|
-
}[];
|
|
75
|
+
outputs: TxOutput[];
|
|
64
76
|
memo?: string;
|
|
65
77
|
txFee: bigint;
|
|
66
78
|
}
|
|
@@ -174,4 +186,4 @@ declare enum TxType {
|
|
|
174
186
|
Unknown = "unknown"
|
|
175
187
|
}
|
|
176
188
|
|
|
177
|
-
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM };
|
|
189
|
+
export { AddAutoRenewedValidatorTx, AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetAutoRenewedValidatorConfigTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxOutput, TxType, TxValueDetails, VM };
|
package/dist/staking.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { W as BalanceChange, Z as TokenApproval, _ as TokenApprovals, X as TokenDiff, Y as TokenDiffItem, $ as TransactionSimulationResult } from './rpc-4699ee82.js';
|
|
2
2
|
import './token.cjs';
|
|
3
3
|
import 'ethers';
|
|
4
4
|
import '@avalabs/core-wallets-sdk';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { W as BalanceChange, Z as TokenApproval, _ as TokenApprovals, X as TokenDiff, Y as TokenDiffItem, $ as TransactionSimulationResult } from './rpc-bbfb0e02.js';
|
|
2
2
|
import './token.js';
|
|
3
3
|
import 'ethers';
|
|
4
4
|
import '@avalabs/core-wallets-sdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ava-labs/core-vm-modules",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "Limited Ecosystem License",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@avalabs/core-wallets-sdk": "3.1.0-alpha.
|
|
20
|
-
"@avalabs/glacier-sdk": "3.1.0-alpha.
|
|
19
|
+
"@avalabs/core-wallets-sdk": "3.1.0-alpha.101",
|
|
20
|
+
"@avalabs/glacier-sdk": "3.1.0-alpha.101",
|
|
21
21
|
"@metamask/rpc-errors": "6.3.0",
|
|
22
22
|
"bitcoinjs-lib": "5.2.0",
|
|
23
23
|
"zod": "3.23.8",
|
package/dist/chunk-GK2KQ7WE.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var t=(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.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.AddAutoRenewedValidator="add_auto_renewed_validator",e.SetAutoRenewedValidatorConfig="set_auto_renewed_validator_config",e.Unknown="unknown",e))(t||{});
|
|
4
|
-
|
|
5
|
-
exports.a = t;
|
|
6
|
-
//# sourceMappingURL=out.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-GK2KQ7WE.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/staking.ts"],"names":["TxType"],"mappings":"AAmMO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,2BAA6B,+BAC7BA,EAAA,2BAA6B,+BAC7BA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,kBAAoB,uBACpBA,EAAA,oBAAsB,wBACtBA,EAAA,qBAAuB,0BACvBA,EAAA,2BAA6B,gCAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,wBAA0B,6BAC1BA,EAAA,8BAAgC,oCAChCA,EAAA,QAAU,UArBAA,OAAA","sourcesContent":["import type { NetworkVMType } from './common';\n\nexport type TxDetails =\n | StakingDetails\n | ExportImportTxDetails\n | ChainDetails\n | BlockchainDetails\n | SubnetDetails\n | L1Details;\n\nexport type StakingDetails =\n | AddPermissionlessDelegatorTx\n | AddPermissionlessValidatorTx\n | AddSubnetValidatorTx\n | RemoveSubnetValidatorTx\n | AddAutoRenewedValidatorTx\n | SetAutoRenewedValidatorConfigTx;\nexport type ExportImportTxDetails = ExportTx | ImportTx;\nexport type ChainDetails = BaseTx;\nexport type BlockchainDetails = CreateChainTx;\nexport type SubnetDetails = CreateSubnetTx;\nexport type L1Details =\n | ConvertSubnetToL1Tx\n | RegisterL1ValidatorTx\n | SetL1ValidatorWeightTx\n | IncreaseL1ValidatorBalanceTx\n | DisableL1ValidatorTx;\n\nexport type VM = NetworkVMType.AVM | NetworkVMType.EVM | NetworkVMType.PVM;\n\nexport type AddPermissionlessDelegatorTx = {\n type: TxType.AddPermissionlessDelegator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type AddPermissionlessValidatorTx = {\n type: TxType.AddPermissionlessValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n delegationFee: number;\n start: string;\n end: string;\n txFee: bigint;\n publicKey?: string;\n signature?: string;\n};\n\nexport interface ExportTx {\n type: TxType.Export;\n destination: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface ImportTx {\n type: TxType.Import;\n source: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface BaseTx {\n type: TxType.Base;\n chain: VM;\n outputs: {\n assetId: string;\n locktime: bigint;\n threshold: bigint;\n amount: bigint;\n assetDescription?: {\n assetID: string;\n name: string;\n symbol: string;\n denomination: number;\n };\n owners: string[];\n isAvax: boolean;\n }[];\n memo?: string;\n txFee: bigint;\n}\n\nexport type AddSubnetValidatorTx = {\n type: TxType.AddSubnetValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type CreateChainTx = {\n type: TxType.CreateChain;\n chainName: string;\n chainID: string;\n vmID: string;\n genesisData: string;\n txFee: bigint;\n};\n\nexport type CreateSubnetTx = {\n type: TxType.CreateSubnet;\n threshold: number;\n controlKeys: string[];\n txFee: bigint;\n};\n\nexport type RemoveSubnetValidatorTx = {\n type: TxType.RemoveSubnetValidator;\n nodeID: string;\n subnetID: string;\n txFee: bigint;\n};\n\nexport type AddAutoRenewedValidatorTx = {\n type: TxType.AddAutoRenewedValidator;\n nodeID: string;\n stake: bigint;\n delegationFee: number;\n // Share of staking rewards reinvested as additional stake on each auto-renewal cycle (ACP-236).\n // Expressed in millionths (percentage × 10,000), range [0..1_000_000]: 1_000_000 = 100%, 300_000 = 30%.\n autoCompoundRewardShares: number;\n // Auto-renewal cycle duration in seconds (ACP-236)\n period: bigint;\n publicKey?: string;\n signature?: string;\n txFee: bigint;\n};\n\nexport type SetAutoRenewedValidatorConfigTx = {\n type: TxType.SetAutoRenewedValidatorConfig;\n // ID of the AddAutoRenewedValidator tx whose config is being updated (ACP-236)\n txId: string;\n // Same scale as `AddAutoRenewedValidatorTx.autoCompoundRewardShares`:\n // millionths (percentage × 10,000), range [0..1_000_000].\n autoCompoundRewardShares: number;\n period: bigint;\n txFee: bigint;\n};\n\nexport type FeeData = {\n totalAvaxBurned: bigint;\n totalAvaxOutput: bigint;\n totalAvaxInput: bigint;\n isValidAvaxBurnedAmount: boolean;\n txFee: bigint;\n};\n\nexport type TxBase = FeeData & {\n chain: VM;\n};\n\nexport type ConvertSubnetToL1Tx = TxBase & {\n type: TxType.ConvertSubnetToL1;\n managerAddress: string;\n validators: {\n nodeId: string;\n stake: bigint;\n balance: bigint;\n remainingBalanceOwners: string[];\n deactivationOwners: string[];\n }[];\n subnetID: string;\n chainID: string;\n};\n\nexport type RegisterL1ValidatorTx = TxBase & {\n type: TxType.RegisterL1Validator;\n balance: bigint;\n};\n\nexport type SetL1ValidatorWeightTx = TxBase & {\n type: TxType.SetL1ValidatorWeight;\n};\n\nexport type IncreaseL1ValidatorBalanceTx = TxBase & {\n type: TxType.IncreaseL1ValidatorBalance;\n balance: bigint;\n validationId: string;\n};\n\nexport type DisableL1ValidatorTx = TxBase & {\n type: TxType.DisableL1Validator;\n validationId: string;\n};\n\nexport enum TxType {\n Base = 'base',\n AddValidator = 'add_validator',\n AddDelegator = 'add_delegator',\n Export = 'export',\n Import = 'import',\n CreateSubnet = 'create_subnet',\n CreateChain = 'create_chain',\n AddSubnetValidator = 'add_subnet_validator',\n RemoveSubnetValidator = 'remove_subnet_validator',\n AddPermissionlessValidator = 'add_permissionless_validator',\n AddPermissionlessDelegator = 'add_permissionless_delegator',\n TransformSubnet = 'transform_subnet',\n TransferSubnetOwnership = 'transfer_subnet_ownership',\n ConvertSubnetToL1 = 'convert_subnet_to_l1',\n RegisterL1Validator = 'register_l1_validator',\n SetL1ValidatorWeight = 'set_l1_validator_weight',\n IncreaseL1ValidatorBalance = 'increase_l1_validator_balance',\n DisableL1Validator = 'disable_l1_validator',\n AddAutoRenewedValidator = 'add_auto_renewed_validator',\n SetAutoRenewedValidatorConfig = 'set_auto_renewed_validator_config',\n Unknown = 'unknown',\n}\n"]}
|
package/dist/chunk-LU4BRIVO.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var t=(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.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.AddAutoRenewedValidator="add_auto_renewed_validator",e.SetAutoRenewedValidatorConfig="set_auto_renewed_validator_config",e.Unknown="unknown",e))(t||{});
|
|
2
|
-
|
|
3
|
-
export { t as a };
|
|
4
|
-
//# sourceMappingURL=out.js.map
|
|
5
|
-
//# sourceMappingURL=chunk-LU4BRIVO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/staking.ts"],"names":["TxType"],"mappings":"AAmMO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,2BAA6B,+BAC7BA,EAAA,2BAA6B,+BAC7BA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,kBAAoB,uBACpBA,EAAA,oBAAsB,wBACtBA,EAAA,qBAAuB,0BACvBA,EAAA,2BAA6B,gCAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,wBAA0B,6BAC1BA,EAAA,8BAAgC,oCAChCA,EAAA,QAAU,UArBAA,OAAA","sourcesContent":["import type { NetworkVMType } from './common';\n\nexport type TxDetails =\n | StakingDetails\n | ExportImportTxDetails\n | ChainDetails\n | BlockchainDetails\n | SubnetDetails\n | L1Details;\n\nexport type StakingDetails =\n | AddPermissionlessDelegatorTx\n | AddPermissionlessValidatorTx\n | AddSubnetValidatorTx\n | RemoveSubnetValidatorTx\n | AddAutoRenewedValidatorTx\n | SetAutoRenewedValidatorConfigTx;\nexport type ExportImportTxDetails = ExportTx | ImportTx;\nexport type ChainDetails = BaseTx;\nexport type BlockchainDetails = CreateChainTx;\nexport type SubnetDetails = CreateSubnetTx;\nexport type L1Details =\n | ConvertSubnetToL1Tx\n | RegisterL1ValidatorTx\n | SetL1ValidatorWeightTx\n | IncreaseL1ValidatorBalanceTx\n | DisableL1ValidatorTx;\n\nexport type VM = NetworkVMType.AVM | NetworkVMType.EVM | NetworkVMType.PVM;\n\nexport type AddPermissionlessDelegatorTx = {\n type: TxType.AddPermissionlessDelegator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type AddPermissionlessValidatorTx = {\n type: TxType.AddPermissionlessValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n delegationFee: number;\n start: string;\n end: string;\n txFee: bigint;\n publicKey?: string;\n signature?: string;\n};\n\nexport interface ExportTx {\n type: TxType.Export;\n destination: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface ImportTx {\n type: TxType.Import;\n source: VM;\n amount: bigint;\n chain: VM;\n txFee: bigint;\n}\n\nexport interface BaseTx {\n type: TxType.Base;\n chain: VM;\n outputs: {\n assetId: string;\n locktime: bigint;\n threshold: bigint;\n amount: bigint;\n assetDescription?: {\n assetID: string;\n name: string;\n symbol: string;\n denomination: number;\n };\n owners: string[];\n isAvax: boolean;\n }[];\n memo?: string;\n txFee: bigint;\n}\n\nexport type AddSubnetValidatorTx = {\n type: TxType.AddSubnetValidator;\n nodeID: string;\n subnetID: string;\n stake: bigint;\n start: string;\n end: string;\n txFee: bigint;\n};\n\nexport type CreateChainTx = {\n type: TxType.CreateChain;\n chainName: string;\n chainID: string;\n vmID: string;\n genesisData: string;\n txFee: bigint;\n};\n\nexport type CreateSubnetTx = {\n type: TxType.CreateSubnet;\n threshold: number;\n controlKeys: string[];\n txFee: bigint;\n};\n\nexport type RemoveSubnetValidatorTx = {\n type: TxType.RemoveSubnetValidator;\n nodeID: string;\n subnetID: string;\n txFee: bigint;\n};\n\nexport type AddAutoRenewedValidatorTx = {\n type: TxType.AddAutoRenewedValidator;\n nodeID: string;\n stake: bigint;\n delegationFee: number;\n // Share of staking rewards reinvested as additional stake on each auto-renewal cycle (ACP-236).\n // Expressed in millionths (percentage × 10,000), range [0..1_000_000]: 1_000_000 = 100%, 300_000 = 30%.\n autoCompoundRewardShares: number;\n // Auto-renewal cycle duration in seconds (ACP-236)\n period: bigint;\n publicKey?: string;\n signature?: string;\n txFee: bigint;\n};\n\nexport type SetAutoRenewedValidatorConfigTx = {\n type: TxType.SetAutoRenewedValidatorConfig;\n // ID of the AddAutoRenewedValidator tx whose config is being updated (ACP-236)\n txId: string;\n // Same scale as `AddAutoRenewedValidatorTx.autoCompoundRewardShares`:\n // millionths (percentage × 10,000), range [0..1_000_000].\n autoCompoundRewardShares: number;\n period: bigint;\n txFee: bigint;\n};\n\nexport type FeeData = {\n totalAvaxBurned: bigint;\n totalAvaxOutput: bigint;\n totalAvaxInput: bigint;\n isValidAvaxBurnedAmount: boolean;\n txFee: bigint;\n};\n\nexport type TxBase = FeeData & {\n chain: VM;\n};\n\nexport type ConvertSubnetToL1Tx = TxBase & {\n type: TxType.ConvertSubnetToL1;\n managerAddress: string;\n validators: {\n nodeId: string;\n stake: bigint;\n balance: bigint;\n remainingBalanceOwners: string[];\n deactivationOwners: string[];\n }[];\n subnetID: string;\n chainID: string;\n};\n\nexport type RegisterL1ValidatorTx = TxBase & {\n type: TxType.RegisterL1Validator;\n balance: bigint;\n};\n\nexport type SetL1ValidatorWeightTx = TxBase & {\n type: TxType.SetL1ValidatorWeight;\n};\n\nexport type IncreaseL1ValidatorBalanceTx = TxBase & {\n type: TxType.IncreaseL1ValidatorBalance;\n balance: bigint;\n validationId: string;\n};\n\nexport type DisableL1ValidatorTx = TxBase & {\n type: TxType.DisableL1Validator;\n validationId: string;\n};\n\nexport enum TxType {\n Base = 'base',\n AddValidator = 'add_validator',\n AddDelegator = 'add_delegator',\n Export = 'export',\n Import = 'import',\n CreateSubnet = 'create_subnet',\n CreateChain = 'create_chain',\n AddSubnetValidator = 'add_subnet_validator',\n RemoveSubnetValidator = 'remove_subnet_validator',\n AddPermissionlessValidator = 'add_permissionless_validator',\n AddPermissionlessDelegator = 'add_permissionless_delegator',\n TransformSubnet = 'transform_subnet',\n TransferSubnetOwnership = 'transfer_subnet_ownership',\n ConvertSubnetToL1 = 'convert_subnet_to_l1',\n RegisterL1Validator = 'register_l1_validator',\n SetL1ValidatorWeight = 'set_l1_validator_weight',\n IncreaseL1ValidatorBalance = 'increase_l1_validator_balance',\n DisableL1Validator = 'disable_l1_validator',\n AddAutoRenewedValidator = 'add_auto_renewed_validator',\n SetAutoRenewedValidatorConfig = 'set_auto_renewed_validator_config',\n Unknown = 'unknown',\n}\n"]}
|
package/dist/chunk-MVMJO5UX.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var n=(t=>(t.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",t.BITCOIN_SIGN_TRANSACTION="bitcoin_signTransaction",t.ETH_SEND_TRANSACTION="eth_sendTransaction",t.ETH_SEND_TRANSACTION_BATCH="eth_sendTransactionBatch",t.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",t.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",t.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",t.SIGN_TYPED_DATA="eth_signTypedData",t.PERSONAL_SIGN="personal_sign",t.ETH_SIGN="eth_sign",t.AVALANCHE_SIGN_MESSAGE="avalanche_signMessage",t.AVALANCHE_SEND_TRANSACTION="avalanche_sendTransaction",t.AVALANCHE_SIGN_TRANSACTION="avalanche_signTransaction",t.AVALANCHE_DECLARE_AGENT_IDENTITY="avalanche_declareAgentIdentity",t.HVM_SIGN_TRANSACTION="hvm_signTransaction",t.SOLANA_SIGN_TRANSACTION="solana_signTransaction",t.SOLANA_SIGN_AND_SEND_TRANSACTION="solana_signAndSendTransaction",t.SOLANA_SIGN_MESSAGE="solana_signMessage",t))(n||{}),r=(e=>(e.TEXT="text",e.ADDRESS="address",e.ADDRESS_LIST="addressList",e.NODE_ID="nodeID",e.CURRENCY="currency",e.FUNDS_RECIPIENT="fundsRecipient",e.DATA="data",e.DATE="date",e.LINK="link",e.NETWORK="network",e))(r||{}),i=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(i||{});
|
|
2
|
-
|
|
3
|
-
export { n as a, r as b, i as c };
|
|
4
|
-
//# sourceMappingURL=out.js.map
|
|
5
|
-
//# sourceMappingURL=chunk-MVMJO5UX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAQO,IAAKA,OAEVA,EAAA,yBAA2B,0BAC3BA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,EAAA,2BAA6B,2BAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAGXA,EAAA,uBAAyB,wBACzBA,EAAA,2BAA6B,4BAC7BA,EAAA,2BAA6B,4BAC7BA,EAAA,iCAAmC,iCAGnCA,EAAA,qBAAuB,sBAGvBA,EAAA,wBAA0B,yBAC1BA,EAAA,iCAAmC,gCACnCA,EAAA,oBAAsB,qBA3BZA,OAAA,IAsFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,cACfA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UAVAA,OAAA,IAgHAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Avalanche, BitcoinInputUTXO, BitcoinOutputUTXO } from '@avalabs/core-wallets-sdk';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\nimport type { TokenWithBalanceBTC } from './balance';\nimport type { TransactionPayload, VMABI } from 'hypersdk-client';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n BITCOIN_SIGN_TRANSACTION = 'bitcoin_signTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n ETH_SEND_TRANSACTION_BATCH = 'eth_sendTransactionBatch',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n\n /* AVALANCHE */\n AVALANCHE_SIGN_MESSAGE = 'avalanche_signMessage',\n AVALANCHE_SEND_TRANSACTION = 'avalanche_sendTransaction',\n AVALANCHE_SIGN_TRANSACTION = 'avalanche_signTransaction',\n AVALANCHE_DECLARE_AGENT_IDENTITY = 'avalanche_declareAgentIdentity',\n\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_signTransaction',\n\n /* SOLANA */\n SOLANA_SIGN_TRANSACTION = 'solana_signTransaction',\n SOLANA_SIGN_AND_SEND_TRANSACTION = 'solana_signAndSendTransaction',\n SOLANA_SIGN_MESSAGE = 'solana_signMessage',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport type DetailSection = {\n title?: string;\n items: DetailItem[];\n};\n\nexport type BaseDetailItem = {\n label: string;\n};\n\nexport enum DetailItemType {\n TEXT = 'text',\n ADDRESS = 'address',\n ADDRESS_LIST = 'addressList',\n NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\n NETWORK = 'network',\n}\n\n// It's very similar as CurrencyItem, but we want the client apps\n// to treat the label as an address (recognize it if possible,\n// truncate otherwise).\nexport type FundsRecipientItem = BaseDetailItem & {\n type: DetailItemType.FUNDS_RECIPIENT;\n amount: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type TextItem = BaseDetailItem & {\n type: DetailItemType.TEXT;\n value: string;\n alignment: 'vertical' | 'horizontal';\n};\n\nexport type AddressItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS;\n value: string;\n};\n\nexport type AddressListItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS_LIST;\n value: string[];\n};\n\nexport type NodeIDItem = BaseDetailItem & {\n type: DetailItemType.NODE_ID;\n value: string;\n};\n\nexport type CurrencyItem = BaseDetailItem & {\n type: DetailItemType.CURRENCY;\n value: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type DataItem = BaseDetailItem & {\n type: DetailItemType.DATA;\n value: string;\n};\n\nexport type DateItem = BaseDetailItem & {\n type: DetailItemType.DATE;\n value: string;\n};\n\nexport type LinkItemValue = { url: string; name?: string; icon?: string };\n\nexport type LinkItem = BaseDetailItem & {\n type: DetailItemType.LINK;\n value: LinkItemValue;\n};\n\nexport type NetworkItemValue = {\n logoUri: string | undefined;\n name: string;\n};\n\nexport type NetworkItem = BaseDetailItem & {\n type: DetailItemType.NETWORK;\n value: NetworkItemValue;\n};\n\nexport type DetailItem =\n | string\n | TextItem\n | AddressItem\n | AddressListItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem\n | NetworkItem;\n\nexport type DisplayData = {\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network?: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n details: DetailSection[];\n networkFeeSelector?: boolean;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n isSimulationSuccessful?: boolean;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n body?: string[];\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinExecuteTxData = {\n to: string;\n amount: number;\n feeRate: number;\n fee: number;\n gasLimit: number;\n balance: TokenWithBalanceBTC;\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type BitcoingSignTxData = {\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.SOLANA_SIGN_AND_SEND_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_MESSAGE;\n account: string;\n data: string; // Base-64 encoded message\n }\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinExecuteTxData;\n }\n | {\n type: RpcMethod.BITCOIN_SIGN_TRANSACTION;\n account: string;\n data: BitcoingSignTxData;\n }\n | SigningData_EthSendTx\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n data: TypedData<MessageTypes>;\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_MESSAGE;\n data: string;\n accountIndex?: number;\n }\n | {\n type: RpcMethod.AVALANCHE_SEND_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n externalIndices?: number[];\n internalIndices?: number[];\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n ownSignatureIndices: [number, number][];\n }\n | {\n type: RpcMethod.HVM_SIGN_TRANSACTION;\n data: {\n abi: VMABI;\n txPayload: TransactionPayload;\n };\n };\n\nexport type SigningData_EthSendTx = {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n};\n\nexport type EvmTxBatchUpdateFn = (\n data: { maxFeeRate?: bigint; maxTipRate?: bigint },\n txIndex: number,\n) => {\n displayData: DisplayData;\n signingRequests: {\n displayData: DisplayData;\n signingData: SigningData_EthSendTx;\n }[];\n};\n\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n gasLimit?: number;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: SigningData_EthSendTx };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type SigningRequest<Data = SigningData> = {\n displayData: DisplayData;\n signingData: Data;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n} & SigningRequest;\n\nexport type BatchApprovalParams = {\n request: RpcRequest;\n signingRequests: SigningRequest<SigningData_EthSendTx>[];\n displayData: DisplayData;\n updateTx: EvmTxBatchUpdateFn;\n};\n\nexport type RequestPublicKeyParams = {\n secretId: string;\n curve: 'secp256k1' | 'ed25519';\n derivationPath?: string;\n};\n\n/**\n * We want to accept both a signed data (tx/message) and a tx hash as a response\n * coming in from the client apps, hence the XORs here.\n *\n * The reason we need to support both is because extension allows importing\n * external software wallets, such as Fireblocks or other apps that support\n * the WalletConnect protocol.\n *\n * My experience is that WalletConnect apps rarely, if ever, support\n * \"eth_signTransaction\" requests and more often only allow sending\n * \"eth_sendTransaction\" calls, which means that all we'll get in response\n * from them is the transaction hash (not a signed tx).\n */\ntype SignedData = { signedData: string };\ntype BroadcastedTx = { txHash: string };\n\nexport type SigningResult = SignedData | BroadcastedTx;\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport type BatchApprovalResponse =\n | { error: RpcError }\n | {\n result: SignedData[];\n };\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n requestPublicKey: (params: RequestPublicKeyParams) => Promise<string>;\n onTransactionPending: ({\n txHash,\n request,\n explorerLink,\n }: {\n txHash: string;\n request: RpcRequest;\n explorerLink: string;\n }) => void;\n onTransactionConfirmed: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n onTransactionReverted: ({ txHash, request }: { txHash: string; request: RpcRequest }) => void;\n /**\n * Called when the module gave up waiting for a terminal status without ever\n * learning one — the node stopped answering, or kept reporting the tx as\n * processing until the poll budget ran out. The transaction may still have\n * been accepted, so this is deliberately neither a confirmation nor a\n * revert: consumers should stop showing an in-progress state and point the\n * user at the explorer.\n *\n * Optional so existing consumers keep compiling; a module that has nothing\n * better to report simply stays silent when it is not implemented.\n */\n onTransactionStatusUnknown?: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\n}\n"]}
|
package/dist/chunk-Q5ATT3HH.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var n=(t=>(t.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",t.BITCOIN_SIGN_TRANSACTION="bitcoin_signTransaction",t.ETH_SEND_TRANSACTION="eth_sendTransaction",t.ETH_SEND_TRANSACTION_BATCH="eth_sendTransactionBatch",t.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",t.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",t.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",t.SIGN_TYPED_DATA="eth_signTypedData",t.PERSONAL_SIGN="personal_sign",t.ETH_SIGN="eth_sign",t.AVALANCHE_SIGN_MESSAGE="avalanche_signMessage",t.AVALANCHE_SEND_TRANSACTION="avalanche_sendTransaction",t.AVALANCHE_SIGN_TRANSACTION="avalanche_signTransaction",t.AVALANCHE_DECLARE_AGENT_IDENTITY="avalanche_declareAgentIdentity",t.HVM_SIGN_TRANSACTION="hvm_signTransaction",t.SOLANA_SIGN_TRANSACTION="solana_signTransaction",t.SOLANA_SIGN_AND_SEND_TRANSACTION="solana_signAndSendTransaction",t.SOLANA_SIGN_MESSAGE="solana_signMessage",t))(n||{}),r=(e=>(e.TEXT="text",e.ADDRESS="address",e.ADDRESS_LIST="addressList",e.NODE_ID="nodeID",e.CURRENCY="currency",e.FUNDS_RECIPIENT="fundsRecipient",e.DATA="data",e.DATE="date",e.LINK="link",e.NETWORK="network",e))(r||{}),i=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(i||{});
|
|
4
|
-
|
|
5
|
-
exports.a = n;
|
|
6
|
-
exports.b = r;
|
|
7
|
-
exports.c = i;
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-Q5ATT3HH.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAQO,IAAKA,OAEVA,EAAA,yBAA2B,0BAC3BA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,EAAA,2BAA6B,2BAC7BA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAGXA,EAAA,uBAAyB,wBACzBA,EAAA,2BAA6B,4BAC7BA,EAAA,2BAA6B,4BAC7BA,EAAA,iCAAmC,iCAGnCA,EAAA,qBAAuB,sBAGvBA,EAAA,wBAA0B,yBAC1BA,EAAA,iCAAmC,gCACnCA,EAAA,oBAAsB,qBA3BZA,OAAA,IAsFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,cACfA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UAVAA,OAAA,IAgHAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Avalanche, BitcoinInputUTXO, BitcoinOutputUTXO } from '@avalabs/core-wallets-sdk';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\nimport type { TokenWithBalanceBTC } from './balance';\nimport type { TransactionPayload, VMABI } from 'hypersdk-client';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n BITCOIN_SIGN_TRANSACTION = 'bitcoin_signTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n ETH_SEND_TRANSACTION_BATCH = 'eth_sendTransactionBatch',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n\n /* AVALANCHE */\n AVALANCHE_SIGN_MESSAGE = 'avalanche_signMessage',\n AVALANCHE_SEND_TRANSACTION = 'avalanche_sendTransaction',\n AVALANCHE_SIGN_TRANSACTION = 'avalanche_signTransaction',\n AVALANCHE_DECLARE_AGENT_IDENTITY = 'avalanche_declareAgentIdentity',\n\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_signTransaction',\n\n /* SOLANA */\n SOLANA_SIGN_TRANSACTION = 'solana_signTransaction',\n SOLANA_SIGN_AND_SEND_TRANSACTION = 'solana_signAndSendTransaction',\n SOLANA_SIGN_MESSAGE = 'solana_signMessage',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport type DetailSection = {\n title?: string;\n items: DetailItem[];\n};\n\nexport type BaseDetailItem = {\n label: string;\n};\n\nexport enum DetailItemType {\n TEXT = 'text',\n ADDRESS = 'address',\n ADDRESS_LIST = 'addressList',\n NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\n NETWORK = 'network',\n}\n\n// It's very similar as CurrencyItem, but we want the client apps\n// to treat the label as an address (recognize it if possible,\n// truncate otherwise).\nexport type FundsRecipientItem = BaseDetailItem & {\n type: DetailItemType.FUNDS_RECIPIENT;\n amount: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type TextItem = BaseDetailItem & {\n type: DetailItemType.TEXT;\n value: string;\n alignment: 'vertical' | 'horizontal';\n};\n\nexport type AddressItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS;\n value: string;\n};\n\nexport type AddressListItem = BaseDetailItem & {\n type: DetailItemType.ADDRESS_LIST;\n value: string[];\n};\n\nexport type NodeIDItem = BaseDetailItem & {\n type: DetailItemType.NODE_ID;\n value: string;\n};\n\nexport type CurrencyItem = BaseDetailItem & {\n type: DetailItemType.CURRENCY;\n value: bigint;\n maxDecimals: number;\n symbol: string;\n};\n\nexport type DataItem = BaseDetailItem & {\n type: DetailItemType.DATA;\n value: string;\n};\n\nexport type DateItem = BaseDetailItem & {\n type: DetailItemType.DATE;\n value: string;\n};\n\nexport type LinkItemValue = { url: string; name?: string; icon?: string };\n\nexport type LinkItem = BaseDetailItem & {\n type: DetailItemType.LINK;\n value: LinkItemValue;\n};\n\nexport type NetworkItemValue = {\n logoUri: string | undefined;\n name: string;\n};\n\nexport type NetworkItem = BaseDetailItem & {\n type: DetailItemType.NETWORK;\n value: NetworkItemValue;\n};\n\nexport type DetailItem =\n | string\n | TextItem\n | AddressItem\n | AddressListItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem\n | NetworkItem;\n\nexport type DisplayData = {\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network?: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n details: DetailSection[];\n networkFeeSelector?: boolean;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n isSimulationSuccessful?: boolean;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n body?: string[];\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinExecuteTxData = {\n to: string;\n amount: number;\n feeRate: number;\n fee: number;\n gasLimit: number;\n balance: TokenWithBalanceBTC;\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type BitcoingSignTxData = {\n inputs: BitcoinInputUTXO[];\n outputs: BitcoinOutputUTXO[];\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.SOLANA_SIGN_AND_SEND_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_TRANSACTION;\n account: string;\n data: string; // Base-64 encoded \"Wire Transaction\"\n }\n | {\n type: RpcMethod.SOLANA_SIGN_MESSAGE;\n account: string;\n data: string; // Base-64 encoded message\n }\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinExecuteTxData;\n }\n | {\n type: RpcMethod.BITCOIN_SIGN_TRANSACTION;\n account: string;\n data: BitcoingSignTxData;\n }\n | SigningData_EthSendTx\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n data: TypedData<MessageTypes>;\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_MESSAGE;\n data: string;\n accountIndex?: number;\n }\n | {\n type: RpcMethod.AVALANCHE_SEND_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n externalIndices?: number[];\n internalIndices?: number[];\n }\n | {\n type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;\n unsignedTxJson: string;\n data: Avalanche.Tx;\n vm: 'EVM' | 'AVM' | 'PVM';\n ownSignatureIndices: [number, number][];\n }\n | {\n type: RpcMethod.HVM_SIGN_TRANSACTION;\n data: {\n abi: VMABI;\n txPayload: TransactionPayload;\n };\n };\n\nexport type SigningData_EthSendTx = {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n};\n\nexport type EvmTxBatchUpdateFn = (\n data: { maxFeeRate?: bigint; maxTipRate?: bigint },\n txIndex: number,\n) => {\n displayData: DisplayData;\n signingRequests: {\n displayData: DisplayData;\n signingData: SigningData_EthSendTx;\n }[];\n};\n\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n gasLimit?: number;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: SigningData_EthSendTx };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type SigningRequest<Data = SigningData> = {\n displayData: DisplayData;\n signingData: Data;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n} & SigningRequest;\n\nexport type BatchApprovalParams = {\n request: RpcRequest;\n signingRequests: SigningRequest<SigningData_EthSendTx>[];\n displayData: DisplayData;\n updateTx: EvmTxBatchUpdateFn;\n};\n\nexport type RequestPublicKeyParams = {\n secretId: string;\n curve: 'secp256k1' | 'ed25519';\n derivationPath?: string;\n};\n\n/**\n * We want to accept both a signed data (tx/message) and a tx hash as a response\n * coming in from the client apps, hence the XORs here.\n *\n * The reason we need to support both is because extension allows importing\n * external software wallets, such as Fireblocks or other apps that support\n * the WalletConnect protocol.\n *\n * My experience is that WalletConnect apps rarely, if ever, support\n * \"eth_signTransaction\" requests and more often only allow sending\n * \"eth_sendTransaction\" calls, which means that all we'll get in response\n * from them is the transaction hash (not a signed tx).\n */\ntype SignedData = { signedData: string };\ntype BroadcastedTx = { txHash: string };\n\nexport type SigningResult = SignedData | BroadcastedTx;\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport type BatchApprovalResponse =\n | { error: RpcError }\n | {\n result: SignedData[];\n };\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n requestPublicKey: (params: RequestPublicKeyParams) => Promise<string>;\n onTransactionPending: ({\n txHash,\n request,\n explorerLink,\n }: {\n txHash: string;\n request: RpcRequest;\n explorerLink: string;\n }) => void;\n onTransactionConfirmed: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n onTransactionReverted: ({ txHash, request }: { txHash: string; request: RpcRequest }) => void;\n /**\n * Called when the module gave up waiting for a terminal status without ever\n * learning one — the node stopped answering, or kept reporting the tx as\n * processing until the poll budget ran out. The transaction may still have\n * been accepted, so this is deliberately neither a confirmation nor a\n * revert: consumers should stop showing an in-progress state and point the\n * user at the explorer.\n *\n * Optional so existing consumers keep compiling; a module that has nothing\n * better to report simply stays silent when it is not implemented.\n */\n onTransactionStatusUnknown?: ({\n txHash,\n explorerLink,\n request,\n }: {\n txHash: string;\n explorerLink: string;\n request: RpcRequest;\n }) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\n}\n"]}
|