@avalabs/vm-module-types 0.7.2 → 0.8.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.
@@ -77,15 +77,18 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
77
77
  availableDisplayValue?: string;
78
78
  availableCurrencyDisplayValue?: string;
79
79
  utxos?: PChainBalance;
80
+ /**
81
+ * All values are represented in `nAvax`
82
+ */
80
83
  balancePerType: {
81
- lockedStaked: number;
82
- lockedStakeable: number;
83
- lockedPlatform: number;
84
- atomicMemoryLocked: number;
85
- atomicMemoryUnlocked: number;
86
- unlockedUnstaked: number;
87
- unlockedStaked: number;
88
- pendingStaked: number;
84
+ lockedStaked?: bigint;
85
+ lockedStakeable?: bigint;
86
+ lockedPlatform?: bigint;
87
+ atomicMemoryLocked?: bigint;
88
+ atomicMemoryUnlocked?: bigint;
89
+ unlockedUnstaked?: bigint;
90
+ unlockedStaked?: bigint;
91
+ pendingStaked?: bigint;
89
92
  };
90
93
  }
91
94
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
@@ -94,11 +97,14 @@ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
94
97
  availableDisplayValue?: string;
95
98
  availableCurrencyDisplayValue?: string;
96
99
  utxos?: XChainBalances;
100
+ /**
101
+ * All values are represented in `nAvax`
102
+ */
97
103
  balancePerType: {
98
- locked: number;
99
- unlocked: number;
100
- atomicMemoryUnlocked: number;
101
- atomicMemoryLocked: number;
104
+ locked?: bigint;
105
+ unlocked?: bigint;
106
+ atomicMemoryUnlocked?: bigint;
107
+ atomicMemoryLocked?: bigint;
102
108
  };
103
109
  }
104
110
  interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type' | 'decimals' | 'coingeckoId'> {
package/dist/balance.d.ts CHANGED
@@ -77,15 +77,18 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
77
77
  availableDisplayValue?: string;
78
78
  availableCurrencyDisplayValue?: string;
79
79
  utxos?: PChainBalance;
80
+ /**
81
+ * All values are represented in `nAvax`
82
+ */
80
83
  balancePerType: {
81
- lockedStaked: number;
82
- lockedStakeable: number;
83
- lockedPlatform: number;
84
- atomicMemoryLocked: number;
85
- atomicMemoryUnlocked: number;
86
- unlockedUnstaked: number;
87
- unlockedStaked: number;
88
- pendingStaked: number;
84
+ lockedStaked?: bigint;
85
+ lockedStakeable?: bigint;
86
+ lockedPlatform?: bigint;
87
+ atomicMemoryLocked?: bigint;
88
+ atomicMemoryUnlocked?: bigint;
89
+ unlockedUnstaked?: bigint;
90
+ unlockedStaked?: bigint;
91
+ pendingStaked?: bigint;
89
92
  };
90
93
  }
91
94
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
@@ -94,11 +97,14 @@ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
94
97
  availableDisplayValue?: string;
95
98
  availableCurrencyDisplayValue?: string;
96
99
  utxos?: XChainBalances;
100
+ /**
101
+ * All values are represented in `nAvax`
102
+ */
97
103
  balancePerType: {
98
- locked: number;
99
- unlocked: number;
100
- atomicMemoryUnlocked: number;
101
- atomicMemoryLocked: number;
104
+ locked?: bigint;
105
+ unlocked?: bigint;
106
+ atomicMemoryUnlocked?: bigint;
107
+ atomicMemoryLocked?: bigint;
102
108
  };
103
109
  }
104
110
  interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type' | 'decimals' | 'coingeckoId'> {
@@ -6,4 +6,4 @@ exports.a = n;
6
6
  exports.b = r;
7
7
  exports.c = i;
8
8
  //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-VHJSM4WQ.cjs.map
9
+ //# sourceMappingURL=chunk-CMFKXC63.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAOO,IAAKA,OAEVA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,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,4BAhBnBA,OAAA,IA2EAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAyEAC,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';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\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}\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 NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem;\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 disclaimer?: string;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\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 actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinTransactionData = {\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 SigningData =\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinTransactionData;\n }\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n }\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\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\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 */\nexport type SigningResult = { signedData: string } | { txHash: string };\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAOO,IAAKA,OAEVA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,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,4BAhBnBA,OAAA,IA2EAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IA0EAC,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';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\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}\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 NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem;\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 disclaimer?: string;\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 actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinTransactionData = {\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 SigningData =\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinTransactionData;\n }\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n }\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\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: Extract<SigningData, { type: RpcMethod.ETH_SEND_TRANSACTION }> };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\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 */\nexport type SigningResult = { signedData: string } | { txHash: string };\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n"]}
@@ -2,4 +2,4 @@ var n=(e=>(e.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",e.ETH_SEND_TRANS
2
2
 
3
3
  export { n as a, r as b, i as c };
4
4
  //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-42BD75HF.js.map
5
+ //# sourceMappingURL=chunk-LJDGVTTJ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAOO,IAAKA,OAEVA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,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,4BAhBnBA,OAAA,IA2EAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAyEAC,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';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\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}\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 NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem;\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 disclaimer?: string;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\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 actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinTransactionData = {\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 SigningData =\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinTransactionData;\n }\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n }\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\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\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 */\nexport type SigningResult = { signedData: string } | { txHash: string };\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","DetailItemType","AlertType"],"mappings":"AAOO,IAAKA,OAEVA,EAAA,yBAA2B,0BAG3BA,EAAA,qBAAuB,sBACvBA,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,4BAhBnBA,OAAA,IA2EAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IA0EAC,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';\n\nexport enum RpcMethod {\n /* BTC */\n BITCOIN_SEND_TRANSACTION = 'bitcoin_sendTransaction',\n\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\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}\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 NODE_ID = 'nodeID',\n CURRENCY = 'currency',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem;\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 disclaimer?: string;\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 actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\n};\n\nexport type BitcoinTransactionData = {\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 SigningData =\n | {\n type: RpcMethod.BITCOIN_SEND_TRANSACTION;\n account: string;\n data: BitcoinTransactionData;\n }\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n data: TransactionRequest;\n }\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\nexport type EvmTxUpdateFn = (data: {\n maxFeeRate?: bigint;\n maxTipRate?: bigint;\n approvalLimit?: Hex; // as hexadecimal, 0x-prefixed\n}) => { displayData: DisplayData; signingData: Extract<SigningData, { type: RpcMethod.ETH_SEND_TRANSACTION }> };\n\nexport type BtcTxUpdateFn = (data: { feeRate?: number }) => {\n displayData: DisplayData;\n signingData: Extract<SigningData, { type: RpcMethod.BITCOIN_SEND_TRANSACTION }>;\n};\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;\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 */\nexport type SigningResult = { signedData: string } | { txHash: string };\n\nexport type ApprovalResponse =\n | {\n error: RpcError;\n }\n | SigningResult;\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n"]}
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./chunk-AILYKQEY.cjs');
4
4
  var chunkJQSZ7QKK_cjs = require('./chunk-JQSZ7QKK.cjs');
5
- var chunkVHJSM4WQ_cjs = require('./chunk-VHJSM4WQ.cjs');
5
+ var chunkCMFKXC63_cjs = require('./chunk-CMFKXC63.cjs');
6
6
  var chunkIQNJXPS3_cjs = require('./chunk-IQNJXPS3.cjs');
7
7
  var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
8
8
  var chunkB6DAZDIA_cjs = require('./chunk-B6DAZDIA.cjs');
@@ -23,15 +23,15 @@ Object.defineProperty(exports, 'EventNames', {
23
23
  });
24
24
  Object.defineProperty(exports, 'AlertType', {
25
25
  enumerable: true,
26
- get: function () { return chunkVHJSM4WQ_cjs.c; }
26
+ get: function () { return chunkCMFKXC63_cjs.c; }
27
27
  });
28
28
  Object.defineProperty(exports, 'DetailItemType', {
29
29
  enumerable: true,
30
- get: function () { return chunkVHJSM4WQ_cjs.b; }
30
+ get: function () { return chunkCMFKXC63_cjs.b; }
31
31
  });
32
32
  Object.defineProperty(exports, 'RpcMethod', {
33
33
  enumerable: true,
34
- get: function () { return chunkVHJSM4WQ_cjs.a; }
34
+ get: function () { return chunkCMFKXC63_cjs.a; }
35
35
  });
36
36
  Object.defineProperty(exports, 'TxType', {
37
37
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -5,7 +5,7 @@ export { Error } from './error.cjs';
5
5
  export { Manifest, parseManifest } from './manifest.cjs';
6
6
  export { AppInfo, ConstructorParams, Module } from './module.cjs';
7
7
  export { NetworkFees } from './network-fee.cjs';
8
- export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.cjs';
8
+ export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.cjs';
9
9
  export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
10
10
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
11
11
  export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.cjs';
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { Error } from './error.js';
5
5
  export { Manifest, parseManifest } from './manifest.js';
6
6
  export { AppInfo, ConstructorParams, Module } from './module.js';
7
7
  export { NetworkFees } from './network-fee.js';
8
- export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.js';
8
+ export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.js';
9
9
  export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.js';
10
10
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
11
11
  export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './chunk-7U2R34EQ.js';
2
2
  export { a as EventNames } from './chunk-4ZJ3LCH6.js';
3
- export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-42BD75HF.js';
3
+ export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-LJDGVTTJ.js';
4
4
  export { a as TxType } from './chunk-2SJQLDBB.js';
5
5
  export { a as TokenType } from './chunk-7Y6UGMPZ.js';
6
6
  export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-7JLXTNPE.js';
package/dist/rpc.cjs CHANGED
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkVHJSM4WQ_cjs = require('./chunk-VHJSM4WQ.cjs');
3
+ var chunkCMFKXC63_cjs = require('./chunk-CMFKXC63.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, 'AlertType', {
8
8
  enumerable: true,
9
- get: function () { return chunkVHJSM4WQ_cjs.c; }
9
+ get: function () { return chunkCMFKXC63_cjs.c; }
10
10
  });
11
11
  Object.defineProperty(exports, 'DetailItemType', {
12
12
  enumerable: true,
13
- get: function () { return chunkVHJSM4WQ_cjs.b; }
13
+ get: function () { return chunkCMFKXC63_cjs.b; }
14
14
  });
15
15
  Object.defineProperty(exports, 'RpcMethod', {
16
16
  enumerable: true,
17
- get: function () { return chunkVHJSM4WQ_cjs.a; }
17
+ get: function () { return chunkCMFKXC63_cjs.a; }
18
18
  });
19
19
  //# sourceMappingURL=out.js.map
20
20
  //# sourceMappingURL=rpc.cjs.map
package/dist/rpc.d.cts CHANGED
@@ -132,6 +132,7 @@ type DisplayData = {
132
132
  alert?: Alert;
133
133
  balanceChange?: BalanceChange;
134
134
  tokenApprovals?: TokenApprovals;
135
+ isSimulationSuccessful?: boolean;
135
136
  };
136
137
  declare enum AlertType {
137
138
  WARNING = "Warning",
@@ -199,10 +200,29 @@ type SigningData = {
199
200
  vm: 'EVM' | 'AVM' | 'PVM';
200
201
  ownSignatureIndices: [number, number][];
201
202
  };
203
+ type EvmTxUpdateFn = (data: {
204
+ maxFeeRate?: bigint;
205
+ maxTipRate?: bigint;
206
+ approvalLimit?: Hex;
207
+ }) => {
208
+ displayData: DisplayData;
209
+ signingData: Extract<SigningData, {
210
+ type: RpcMethod.ETH_SEND_TRANSACTION;
211
+ }>;
212
+ };
213
+ type BtcTxUpdateFn = (data: {
214
+ feeRate?: number;
215
+ }) => {
216
+ displayData: DisplayData;
217
+ signingData: Extract<SigningData, {
218
+ type: RpcMethod.BITCOIN_SEND_TRANSACTION;
219
+ }>;
220
+ };
202
221
  type ApprovalParams = {
203
222
  request: RpcRequest;
204
223
  displayData: DisplayData;
205
224
  signingData: SigningData;
225
+ updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;
206
226
  };
207
227
  /**
208
228
  * We want to accept both a signed data (tx/message) and a tx hash as a response
@@ -231,4 +251,4 @@ interface ApprovalController {
231
251
  onTransactionReverted: (txHash: Hex, requestId: string) => void;
232
252
  }
233
253
 
234
- export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
254
+ export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
package/dist/rpc.d.ts CHANGED
@@ -132,6 +132,7 @@ type DisplayData = {
132
132
  alert?: Alert;
133
133
  balanceChange?: BalanceChange;
134
134
  tokenApprovals?: TokenApprovals;
135
+ isSimulationSuccessful?: boolean;
135
136
  };
136
137
  declare enum AlertType {
137
138
  WARNING = "Warning",
@@ -199,10 +200,29 @@ type SigningData = {
199
200
  vm: 'EVM' | 'AVM' | 'PVM';
200
201
  ownSignatureIndices: [number, number][];
201
202
  };
203
+ type EvmTxUpdateFn = (data: {
204
+ maxFeeRate?: bigint;
205
+ maxTipRate?: bigint;
206
+ approvalLimit?: Hex;
207
+ }) => {
208
+ displayData: DisplayData;
209
+ signingData: Extract<SigningData, {
210
+ type: RpcMethod.ETH_SEND_TRANSACTION;
211
+ }>;
212
+ };
213
+ type BtcTxUpdateFn = (data: {
214
+ feeRate?: number;
215
+ }) => {
216
+ displayData: DisplayData;
217
+ signingData: Extract<SigningData, {
218
+ type: RpcMethod.BITCOIN_SEND_TRANSACTION;
219
+ }>;
220
+ };
202
221
  type ApprovalParams = {
203
222
  request: RpcRequest;
204
223
  displayData: DisplayData;
205
224
  signingData: SigningData;
225
+ updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;
206
226
  };
207
227
  /**
208
228
  * We want to accept both a signed data (tx/message) and a tx hash as a response
@@ -231,4 +251,4 @@ interface ApprovalController {
231
251
  onTransactionReverted: (txHash: Hex, requestId: string) => void;
232
252
  }
233
253
 
234
- export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
254
+ export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinTransactionData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
package/dist/rpc.js CHANGED
@@ -1,3 +1,3 @@
1
- export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-42BD75HF.js';
1
+ export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-LJDGVTTJ.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=rpc.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",