@avalabs/vm-module-types 0.12.1 → 1.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/balance.d.cts +2 -1
- package/dist/balance.d.ts +2 -1
- package/dist/chunk-2DSAT5RW.js +3 -0
- package/dist/{chunk-YB5EN6FL.cjs → chunk-ATL7CLLW.cjs} +1 -1
- package/dist/chunk-IQHOBS5Y.cjs +9 -0
- package/dist/chunk-IQHOBS5Y.cjs.map +1 -0
- package/dist/{chunk-A4YEBDMG.js → chunk-RINP3JFP.js} +2 -2
- package/dist/chunk-RINP3JFP.js.map +1 -0
- package/dist/{chunk-74SNNWSF.cjs → chunk-SYE3TX4L.cjs} +2 -2
- package/dist/chunk-SYE3TX4L.cjs.map +1 -0
- package/dist/chunk-T3QBBZUZ.js +5 -0
- package/dist/chunk-T3QBBZUZ.js.map +1 -0
- package/dist/coingecko.d.cts +4 -4
- package/dist/coingecko.d.ts +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/manifest.cjs +2 -2
- package/dist/manifest.d.cts +7 -0
- package/dist/manifest.d.ts +7 -0
- package/dist/manifest.js +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.d.cts +3 -3
- package/dist/module.d.ts +3 -3
- package/dist/module.js +1 -1
- package/dist/rpc-ab7acd4d.d.ts +334 -0
- package/dist/rpc-c6776d81.d.ts +334 -0
- package/dist/rpc.cjs +4 -4
- package/dist/rpc.d.cts +7 -275
- package/dist/rpc.d.ts +7 -275
- package/dist/rpc.js +1 -1
- package/dist/transaction-simulation.d.cts +10 -27
- package/dist/transaction-simulation.d.ts +10 -27
- package/package.json +4 -3
- package/dist/chunk-5R4OCUZW.js +0 -5
- package/dist/chunk-5R4OCUZW.js.map +0 -1
- package/dist/chunk-74SNNWSF.cjs.map +0 -1
- package/dist/chunk-A4YEBDMG.js.map +0 -1
- package/dist/chunk-GF7C4PA6.js +0 -3
- package/dist/chunk-RXEAQKSD.cjs +0 -9
- package/dist/chunk-RXEAQKSD.cjs.map +0 -1
- /package/dist/{chunk-GF7C4PA6.js.map → chunk-2DSAT5RW.js.map} +0 -0
- /package/dist/{chunk-YB5EN6FL.cjs.map → chunk-ATL7CLLW.cjs.map} +0 -0
package/dist/balance.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Network, Storage } from './common.cjs';
|
|
2
2
|
import { Error } from './error.cjs';
|
|
3
3
|
import { TokenType, NetworkContractToken, NetworkToken } from './token.cjs';
|
|
4
|
-
import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
|
|
4
|
+
import { Erc20TokenBalance, PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
|
|
5
5
|
|
|
6
6
|
type GetBalancesParams = {
|
|
7
7
|
addresses: string[];
|
|
@@ -42,6 +42,7 @@ interface TokenBalanceDataWithDecimals extends TokenBalanceData {
|
|
|
42
42
|
*/
|
|
43
43
|
type TokenWithBalanceERC20 = TokenBalanceDataWithDecimals & TokenMarketData & NetworkContractToken & {
|
|
44
44
|
type: TokenType.ERC20;
|
|
45
|
+
reputation: Erc20TokenBalance.tokenReputation | null;
|
|
45
46
|
};
|
|
46
47
|
type TokenWithBalanceEVM = NetworkTokenWithBalance | TokenWithBalanceERC20 | NftTokenWithBalance;
|
|
47
48
|
/**
|
package/dist/balance.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Network, Storage } from './common.js';
|
|
2
2
|
import { Error } from './error.js';
|
|
3
3
|
import { TokenType, NetworkContractToken, NetworkToken } from './token.js';
|
|
4
|
-
import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
|
|
4
|
+
import { Erc20TokenBalance, PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
|
|
5
5
|
|
|
6
6
|
type GetBalancesParams = {
|
|
7
7
|
addresses: string[];
|
|
@@ -42,6 +42,7 @@ interface TokenBalanceDataWithDecimals extends TokenBalanceData {
|
|
|
42
42
|
*/
|
|
43
43
|
type TokenWithBalanceERC20 = TokenBalanceDataWithDecimals & TokenMarketData & NetworkContractToken & {
|
|
44
44
|
type: TokenType.ERC20;
|
|
45
|
+
reputation: Erc20TokenBalance.tokenReputation | null;
|
|
45
46
|
};
|
|
46
47
|
type TokenWithBalanceEVM = NetworkTokenWithBalance | TokenWithBalanceERC20 | NftTokenWithBalance;
|
|
47
48
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
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.HVM_SIGN_TRANSACTION="hvm_signTransaction",t))(n||{}),i=(e=>(e.TEXT="text",e.ADDRESS="address",e.NODE_ID="nodeID",e.CURRENCY="currency",e.FUNDS_RECIPIENT="fundsRecipient",e.DATA="data",e.DATE="date",e.LINK="link",e))(i||{}),r=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(r||{});
|
|
4
|
+
|
|
5
|
+
exports.a = n;
|
|
6
|
+
exports.b = i;
|
|
7
|
+
exports.c = r;
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=chunk-IQHOBS5Y.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,4BAG7BA,EAAA,qBAAuB,sBArBbA,OAAA,IAgFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OARGA,OAAA,IA8FAC,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\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_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 FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 =\n | string\n | TextItem\n | AddressItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem;\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 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.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 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\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 onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { object, string, boolean } from 'zod';
|
|
2
2
|
|
|
3
|
-
var n=object({checksum:string(),location:object({npm:object({filePath:string(),packageName:string(),registry:string()})})}),o=object({name:string(),version:string(),description:string(),sources:object({module:n,provider:n.optional()}),network:object({chainIds:string().array(),namespaces:string().array()}),cointype:string(),permissions:object({rpc:object({dapps:boolean(),methods:string().array()})}),manifestVersion:string()}),c=r=>o.safeParse(r);
|
|
3
|
+
var n=object({checksum:string(),location:object({npm:object({filePath:string(),packageName:string(),registry:string()})})}),o=object({name:string(),version:string(),description:string(),sources:object({module:n,provider:n.optional()}),network:object({chainIds:string().array(),namespaces:string().array()}),cointype:string(),permissions:object({rpc:object({dapps:boolean(),methods:string().array(),nonRestrictedMethods:string().array()})}),manifestVersion:string()}),c=r=>o.safeParse(r);
|
|
4
4
|
|
|
5
5
|
export { c as a };
|
|
6
6
|
//# sourceMappingURL=out.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-RINP3JFP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/manifest.ts"],"names":["boolean","object","string","sourceSchema","manifestSchema","parseManifest","params"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,UAAAC,MAAiB,MAE3C,IAAMC,EAAeF,EAAO,CAC1B,SAAUC,EAAO,EACjB,SAAUD,EAAO,CACf,IAAKA,EAAO,CACV,SAAUC,EAAO,EACjB,YAAaA,EAAO,EACpB,SAAUA,EAAO,CACnB,CAAC,CACH,CAAC,CACH,CAAC,EAEKE,EAAiBH,EAAO,CAC5B,KAAMC,EAAO,EACb,QAASA,EAAO,EAChB,YAAaA,EAAO,EACpB,QAASD,EAAO,CACd,OAAQE,EACR,SAAUA,EAAa,SAAS,CAClC,CAAC,EACD,QAASF,EAAO,CACd,SAAUC,EAAO,EAAE,MAAM,EACzB,WAAYA,EAAO,EAAE,MAAM,CAC7B,CAAC,EACD,SAAUA,EAAO,EACjB,YAAaD,EAAO,CAClB,IAAKA,EAAO,CACV,MAAOD,EAAQ,EACf,QAASE,EAAO,EAAE,MAAM,EACxB,qBAAsBA,EAAO,EAAE,MAAM,CACvC,CAAC,CACH,CAAC,EACD,gBAAiBA,EAAO,CAC1B,CAAC,EAIYG,EAAiBC,GACrBF,EAAe,UAAUE,CAAM","sourcesContent":["import { boolean, object, string, z } from 'zod';\n\nconst sourceSchema = object({\n checksum: string(),\n location: object({\n npm: object({\n filePath: string(),\n packageName: string(),\n registry: string(),\n }),\n }),\n});\n\nconst manifestSchema = object({\n name: string(),\n version: string(),\n description: string(),\n sources: object({\n module: sourceSchema,\n provider: sourceSchema.optional(),\n }),\n network: object({\n chainIds: string().array(),\n namespaces: string().array(),\n }),\n cointype: string(),\n permissions: object({\n rpc: object({\n dapps: boolean(),\n methods: string().array(),\n nonRestrictedMethods: string().array(),\n }),\n }),\n manifestVersion: string(),\n});\n\nexport type Manifest = z.infer<typeof manifestSchema>;\n\nexport const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {\n return manifestSchema.safeParse(params);\n};\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
4
|
|
|
5
|
-
var n=zod.object({checksum:zod.string(),location:zod.object({npm:zod.object({filePath:zod.string(),packageName:zod.string(),registry:zod.string()})})}),o=zod.object({name:zod.string(),version:zod.string(),description:zod.string(),sources:zod.object({module:n,provider:n.optional()}),network:zod.object({chainIds:zod.string().array(),namespaces:zod.string().array()}),cointype:zod.string(),permissions:zod.object({rpc:zod.object({dapps:zod.boolean(),methods:zod.string().array()})}),manifestVersion:zod.string()}),c=r=>o.safeParse(r);
|
|
5
|
+
var n=zod.object({checksum:zod.string(),location:zod.object({npm:zod.object({filePath:zod.string(),packageName:zod.string(),registry:zod.string()})})}),o=zod.object({name:zod.string(),version:zod.string(),description:zod.string(),sources:zod.object({module:n,provider:n.optional()}),network:zod.object({chainIds:zod.string().array(),namespaces:zod.string().array()}),cointype:zod.string(),permissions:zod.object({rpc:zod.object({dapps:zod.boolean(),methods:zod.string().array(),nonRestrictedMethods:zod.string().array()})}),manifestVersion:zod.string()}),c=r=>o.safeParse(r);
|
|
6
6
|
|
|
7
7
|
exports.a = c;
|
|
8
8
|
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-SYE3TX4L.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/manifest.ts"],"names":["boolean","object","string","sourceSchema","manifestSchema","parseManifest","params"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,UAAAC,MAAiB,MAE3C,IAAMC,EAAeF,EAAO,CAC1B,SAAUC,EAAO,EACjB,SAAUD,EAAO,CACf,IAAKA,EAAO,CACV,SAAUC,EAAO,EACjB,YAAaA,EAAO,EACpB,SAAUA,EAAO,CACnB,CAAC,CACH,CAAC,CACH,CAAC,EAEKE,EAAiBH,EAAO,CAC5B,KAAMC,EAAO,EACb,QAASA,EAAO,EAChB,YAAaA,EAAO,EACpB,QAASD,EAAO,CACd,OAAQE,EACR,SAAUA,EAAa,SAAS,CAClC,CAAC,EACD,QAASF,EAAO,CACd,SAAUC,EAAO,EAAE,MAAM,EACzB,WAAYA,EAAO,EAAE,MAAM,CAC7B,CAAC,EACD,SAAUA,EAAO,EACjB,YAAaD,EAAO,CAClB,IAAKA,EAAO,CACV,MAAOD,EAAQ,EACf,QAASE,EAAO,EAAE,MAAM,EACxB,qBAAsBA,EAAO,EAAE,MAAM,CACvC,CAAC,CACH,CAAC,EACD,gBAAiBA,EAAO,CAC1B,CAAC,EAIYG,EAAiBC,GACrBF,EAAe,UAAUE,CAAM","sourcesContent":["import { boolean, object, string, z } from 'zod';\n\nconst sourceSchema = object({\n checksum: string(),\n location: object({\n npm: object({\n filePath: string(),\n packageName: string(),\n registry: string(),\n }),\n }),\n});\n\nconst manifestSchema = object({\n name: string(),\n version: string(),\n description: string(),\n sources: object({\n module: sourceSchema,\n provider: sourceSchema.optional(),\n }),\n network: object({\n chainIds: string().array(),\n namespaces: string().array(),\n }),\n cointype: string(),\n permissions: object({\n rpc: object({\n dapps: boolean(),\n methods: string().array(),\n nonRestrictedMethods: string().array(),\n }),\n }),\n manifestVersion: string(),\n});\n\nexport type Manifest = z.infer<typeof manifestSchema>;\n\nexport const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {\n return manifestSchema.safeParse(params);\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
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.HVM_SIGN_TRANSACTION="hvm_signTransaction",t))(n||{}),i=(e=>(e.TEXT="text",e.ADDRESS="address",e.NODE_ID="nodeID",e.CURRENCY="currency",e.FUNDS_RECIPIENT="fundsRecipient",e.DATA="data",e.DATE="date",e.LINK="link",e))(i||{}),r=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(r||{});
|
|
2
|
+
|
|
3
|
+
export { n as a, i as b, r as c };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-T3QBBZUZ.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,4BAG7BA,EAAA,qBAAuB,sBArBbA,OAAA,IAgFAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,SAAW,WACXA,EAAA,gBAAkB,iBAClBA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OARGA,OAAA,IA8FAC,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\n /* HVM */\n HVM_SIGN_TRANSACTION = 'hvm_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 FUNDS_RECIPIENT = 'fundsRecipient',\n DATA = 'data',\n DATE = 'date',\n LINK = 'link',\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 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 =\n | string\n | TextItem\n | AddressItem\n | NodeIDItem\n | CurrencyItem\n | DataItem\n | DateItem\n | LinkItem\n | FundsRecipientItem;\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 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.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 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\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 onTransactionConfirmed: (txHash: Hex, requestId: string) => void;\n onTransactionReverted: (txHash: Hex, requestId: string) => void;\n}\n\nexport interface BatchApprovalController extends ApprovalController {\n requestBatchApproval: (params: BatchApprovalParams) => Promise<BatchApprovalResponse>;\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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./chunk-AILYKQEY.cjs');
|
|
4
4
|
var chunkJUQZNXAX_cjs = require('./chunk-JUQZNXAX.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkIQHOBS5Y_cjs = require('./chunk-IQHOBS5Y.cjs');
|
|
6
6
|
var chunkPX3B6TJZ_cjs = require('./chunk-PX3B6TJZ.cjs');
|
|
7
7
|
var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
|
|
8
8
|
var chunkB6DAZDIA_cjs = require('./chunk-B6DAZDIA.cjs');
|
|
@@ -11,8 +11,8 @@ var chunk6JAA7W6A_cjs = require('./chunk-6JAA7W6A.cjs');
|
|
|
11
11
|
require('./chunk-JUV577XH.cjs');
|
|
12
12
|
var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
|
|
13
13
|
require('./chunk-SYVNOFCV.cjs');
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-
|
|
14
|
+
var chunkSYE3TX4L_cjs = require('./chunk-SYE3TX4L.cjs');
|
|
15
|
+
require('./chunk-ATL7CLLW.cjs');
|
|
16
16
|
var chunkIMMJESZ3_cjs = require('./chunk-IMMJESZ3.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
@@ -23,15 +23,15 @@ Object.defineProperty(exports, 'EventNames', {
|
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, 'AlertType', {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkIQHOBS5Y_cjs.c; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, 'DetailItemType', {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkIQHOBS5Y_cjs.b; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, 'RpcMethod', {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkIQHOBS5Y_cjs.a; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, 'TxType', {
|
|
37
37
|
enumerable: true,
|
|
@@ -67,7 +67,7 @@ Object.defineProperty(exports, 'SimplePriceResponseSchema', {
|
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, 'parseManifest', {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkSYE3TX4L_cjs.a; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, 'AppName', {
|
|
73
73
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -5,10 +5,9 @@ export { Error } from './error.cjs';
|
|
|
5
5
|
export { Manifest, parseManifest } from './manifest.cjs';
|
|
6
6
|
export { AppInfo, ConstructorParams, Module, NetworkFeeParam } from './module.cjs';
|
|
7
7
|
export { NetworkFees } from './network-fee.cjs';
|
|
8
|
-
export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinExecuteTxData, BitcoingSignTxData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, FundsRecipientItem, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.
|
|
8
|
+
export { A as AddressItem, p as Alert, o as AlertDetails, n as AlertType, H as ApprovalController, w as ApprovalParams, z as ApprovalResponse, J as BalanceChange, B as BaseDetailItem, I as BatchApprovalController, x as BatchApprovalParams, G as BatchApprovalResponse, q as BitcoinExecuteTxData, r as BitcoingSignTxData, u as BtcTxUpdateFn, C as CurrencyItem, D as DappInfo, i as DataItem, j as DateItem, l as DetailItem, g as DetailItemType, f as DetailSection, m as DisplayData, E as EvmTxBatchUpdateFn, t as EvmTxUpdateFn, F as FundsRecipientItem, k as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, N as NodeIDItem, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, s as SigningData_EthSendTx, v as SigningRequest, y as SigningResult, h as TextItem, P as TokenApproval, Q as TokenApprovals, K as TokenDiff, O as TokenDiffItem, U as TransactionSimulationResult, T as TypedData, e as TypedDataV1 } from './rpc-c6776d81.js';
|
|
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
|
-
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.cjs';
|
|
12
11
|
export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.cjs';
|
|
13
12
|
export { AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM } from './staking.cjs';
|
|
14
13
|
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.cjs';
|
|
@@ -16,6 +15,7 @@ import 'zod';
|
|
|
16
15
|
import '@avalabs/glacier-sdk';
|
|
17
16
|
import '@avalabs/core-wallets-sdk';
|
|
18
17
|
import 'hypersdk-client';
|
|
18
|
+
import '@solana/rpc';
|
|
19
19
|
import 'ethers';
|
|
20
20
|
import '@metamask/rpc-errors';
|
|
21
21
|
import 'events';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,9 @@ export { Error } from './error.js';
|
|
|
5
5
|
export { Manifest, parseManifest } from './manifest.js';
|
|
6
6
|
export { AppInfo, ConstructorParams, Module, NetworkFeeParam } from './module.js';
|
|
7
7
|
export { NetworkFees } from './network-fee.js';
|
|
8
|
-
export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinExecuteTxData, BitcoingSignTxData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, FundsRecipientItem, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 } from './rpc.js';
|
|
8
|
+
export { A as AddressItem, p as Alert, o as AlertDetails, n as AlertType, H as ApprovalController, w as ApprovalParams, z as ApprovalResponse, J as BalanceChange, B as BaseDetailItem, I as BatchApprovalController, x as BatchApprovalParams, G as BatchApprovalResponse, q as BitcoinExecuteTxData, r as BitcoingSignTxData, u as BtcTxUpdateFn, C as CurrencyItem, D as DappInfo, i as DataItem, j as DateItem, l as DetailItem, g as DetailItemType, f as DetailSection, m as DisplayData, E as EvmTxBatchUpdateFn, t as EvmTxUpdateFn, F as FundsRecipientItem, k as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, N as NodeIDItem, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, s as SigningData_EthSendTx, v as SigningRequest, y as SigningResult, h as TextItem, P as TokenApproval, Q as TokenApprovals, K as TokenDiff, O as TokenDiffItem, U as TransactionSimulationResult, T as TypedData, e as TypedDataV1 } from './rpc-ab7acd4d.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
|
-
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.js';
|
|
12
11
|
export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.js';
|
|
13
12
|
export { AddPermissionlessDelegatorTx, AddPermissionlessValidatorTx, AddSubnetValidatorTx, BaseTx, BlockchainDetails, ChainDetails, ConvertSubnetToL1Tx, CreateChainTx, CreateSubnetTx, DisableL1ValidatorTx, ExportImportTxDetails, ExportTx, FeeData, ImportTx, IncreaseL1ValidatorBalanceTx, L1Details, RegisterL1ValidatorTx, RemoveSubnetValidatorTx, SetL1ValidatorWeightTx, StakingDetails, SubnetDetails, TxBase, TxDetails, TxType, VM } from './staking.js';
|
|
14
13
|
export { AccountsChangedEventData, ChainAgnosticProvider, ChainChangedEventData, DomainMetadata, EIP6963ProviderDetail, EIP6963ProviderInfo, EventNames, JsonRpcRequestPayload, PartialBy, UnlockStateChangedEventData } from './provider.js';
|
|
@@ -16,6 +15,7 @@ import 'zod';
|
|
|
16
15
|
import '@avalabs/glacier-sdk';
|
|
17
16
|
import '@avalabs/core-wallets-sdk';
|
|
18
17
|
import 'hypersdk-client';
|
|
18
|
+
import '@solana/rpc';
|
|
19
19
|
import 'ethers';
|
|
20
20
|
import '@metamask/rpc-errors';
|
|
21
21
|
import 'events';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chunk-7U2R34EQ.js';
|
|
2
2
|
export { a as EventNames } from './chunk-GHQG4UY4.js';
|
|
3
|
-
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-
|
|
3
|
+
export { c as AlertType, b as DetailItemType, a as RpcMethod } from './chunk-T3QBBZUZ.js';
|
|
4
4
|
export { a as TxType } from './chunk-FGMDBV23.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';
|
|
@@ -9,8 +9,8 @@ export { a as WalletType } from './chunk-I5OST5LZ.js';
|
|
|
9
9
|
import './chunk-BHB5UV3J.js';
|
|
10
10
|
export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
|
|
11
11
|
import './chunk-REHORWPH.js';
|
|
12
|
-
export { a as parseManifest } from './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
export { a as parseManifest } from './chunk-RINP3JFP.js';
|
|
13
|
+
import './chunk-2DSAT5RW.js';
|
|
14
14
|
export { c as AppName, b as Environment, a as NetworkVMType } from './chunk-UN6P2KX4.js';
|
|
15
15
|
//# sourceMappingURL=out.js.map
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/manifest.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSYE3TX4L_cjs = require('./chunk-SYE3TX4L.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, 'parseManifest', {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkSYE3TX4L_cjs.a; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=out.js.map
|
|
12
12
|
//# sourceMappingURL=manifest.cjs.map
|
package/dist/manifest.d.cts
CHANGED
|
@@ -159,22 +159,27 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
159
159
|
rpc: z.ZodObject<{
|
|
160
160
|
dapps: z.ZodBoolean;
|
|
161
161
|
methods: z.ZodArray<z.ZodString, "many">;
|
|
162
|
+
nonRestrictedMethods: z.ZodArray<z.ZodString, "many">;
|
|
162
163
|
}, "strip", z.ZodTypeAny, {
|
|
163
164
|
dapps: boolean;
|
|
164
165
|
methods: string[];
|
|
166
|
+
nonRestrictedMethods: string[];
|
|
165
167
|
}, {
|
|
166
168
|
dapps: boolean;
|
|
167
169
|
methods: string[];
|
|
170
|
+
nonRestrictedMethods: string[];
|
|
168
171
|
}>;
|
|
169
172
|
}, "strip", z.ZodTypeAny, {
|
|
170
173
|
rpc: {
|
|
171
174
|
dapps: boolean;
|
|
172
175
|
methods: string[];
|
|
176
|
+
nonRestrictedMethods: string[];
|
|
173
177
|
};
|
|
174
178
|
}, {
|
|
175
179
|
rpc: {
|
|
176
180
|
dapps: boolean;
|
|
177
181
|
methods: string[];
|
|
182
|
+
nonRestrictedMethods: string[];
|
|
178
183
|
};
|
|
179
184
|
}>;
|
|
180
185
|
manifestVersion: z.ZodString;
|
|
@@ -213,6 +218,7 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
213
218
|
rpc: {
|
|
214
219
|
dapps: boolean;
|
|
215
220
|
methods: string[];
|
|
221
|
+
nonRestrictedMethods: string[];
|
|
216
222
|
};
|
|
217
223
|
};
|
|
218
224
|
manifestVersion: string;
|
|
@@ -251,6 +257,7 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
251
257
|
rpc: {
|
|
252
258
|
dapps: boolean;
|
|
253
259
|
methods: string[];
|
|
260
|
+
nonRestrictedMethods: string[];
|
|
254
261
|
};
|
|
255
262
|
};
|
|
256
263
|
manifestVersion: string;
|
package/dist/manifest.d.ts
CHANGED
|
@@ -159,22 +159,27 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
159
159
|
rpc: z.ZodObject<{
|
|
160
160
|
dapps: z.ZodBoolean;
|
|
161
161
|
methods: z.ZodArray<z.ZodString, "many">;
|
|
162
|
+
nonRestrictedMethods: z.ZodArray<z.ZodString, "many">;
|
|
162
163
|
}, "strip", z.ZodTypeAny, {
|
|
163
164
|
dapps: boolean;
|
|
164
165
|
methods: string[];
|
|
166
|
+
nonRestrictedMethods: string[];
|
|
165
167
|
}, {
|
|
166
168
|
dapps: boolean;
|
|
167
169
|
methods: string[];
|
|
170
|
+
nonRestrictedMethods: string[];
|
|
168
171
|
}>;
|
|
169
172
|
}, "strip", z.ZodTypeAny, {
|
|
170
173
|
rpc: {
|
|
171
174
|
dapps: boolean;
|
|
172
175
|
methods: string[];
|
|
176
|
+
nonRestrictedMethods: string[];
|
|
173
177
|
};
|
|
174
178
|
}, {
|
|
175
179
|
rpc: {
|
|
176
180
|
dapps: boolean;
|
|
177
181
|
methods: string[];
|
|
182
|
+
nonRestrictedMethods: string[];
|
|
178
183
|
};
|
|
179
184
|
}>;
|
|
180
185
|
manifestVersion: z.ZodString;
|
|
@@ -213,6 +218,7 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
213
218
|
rpc: {
|
|
214
219
|
dapps: boolean;
|
|
215
220
|
methods: string[];
|
|
221
|
+
nonRestrictedMethods: string[];
|
|
216
222
|
};
|
|
217
223
|
};
|
|
218
224
|
manifestVersion: string;
|
|
@@ -251,6 +257,7 @@ declare const manifestSchema: z.ZodObject<{
|
|
|
251
257
|
rpc: {
|
|
252
258
|
dapps: boolean;
|
|
253
259
|
methods: string[];
|
|
260
|
+
nonRestrictedMethods: string[];
|
|
254
261
|
};
|
|
255
262
|
};
|
|
256
263
|
manifestVersion: string;
|
package/dist/manifest.js
CHANGED
package/dist/module.cjs
CHANGED
package/dist/module.d.cts
CHANGED
|
@@ -4,16 +4,16 @@ 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 { ApprovalController, RpcRequest, RpcResponse } from './rpc.
|
|
7
|
+
import { H as ApprovalController, a as RpcRequest, c as RpcResponse } from './rpc-c6776d81.js';
|
|
8
8
|
import { NetworkContractToken } from './token.cjs';
|
|
9
9
|
import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.cjs';
|
|
10
10
|
import { HyperSDKClient } from 'hypersdk-client';
|
|
11
|
+
import { Rpc, SolanaRpcApiMainnet, SolanaRpcApiDevnet } from '@solana/rpc';
|
|
11
12
|
import './error.cjs';
|
|
12
13
|
import '@avalabs/glacier-sdk';
|
|
13
14
|
import 'zod';
|
|
14
15
|
import 'ethers';
|
|
15
16
|
import '@metamask/rpc-errors';
|
|
16
|
-
import './transaction-simulation.cjs';
|
|
17
17
|
|
|
18
18
|
type AppInfo = {
|
|
19
19
|
name: AppName;
|
|
@@ -28,7 +28,7 @@ type NetworkFeeParam = Network & {
|
|
|
28
28
|
caipId?: string;
|
|
29
29
|
};
|
|
30
30
|
interface Module {
|
|
31
|
-
getProvider: (network: Network) => Promise<JsonRpcBatchInternal | BitcoinProvider | Avalanche.JsonRpcProvider | HyperSDKClient
|
|
31
|
+
getProvider: (network: Network) => Promise<JsonRpcBatchInternal | BitcoinProvider | Avalanche.JsonRpcProvider | HyperSDKClient | Rpc<SolanaRpcApiMainnet | SolanaRpcApiDevnet>>;
|
|
32
32
|
getManifest: () => Manifest | undefined;
|
|
33
33
|
getBalances: (params: GetBalancesParams) => Promise<GetBalancesResponse>;
|
|
34
34
|
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
|
package/dist/module.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ 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 { ApprovalController, RpcRequest, RpcResponse } from './rpc.js';
|
|
7
|
+
import { H as ApprovalController, a as RpcRequest, c as RpcResponse } from './rpc-ab7acd4d.js';
|
|
8
8
|
import { NetworkContractToken } from './token.js';
|
|
9
9
|
import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.js';
|
|
10
10
|
import { HyperSDKClient } from 'hypersdk-client';
|
|
11
|
+
import { Rpc, SolanaRpcApiMainnet, SolanaRpcApiDevnet } from '@solana/rpc';
|
|
11
12
|
import './error.js';
|
|
12
13
|
import '@avalabs/glacier-sdk';
|
|
13
14
|
import 'zod';
|
|
14
15
|
import 'ethers';
|
|
15
16
|
import '@metamask/rpc-errors';
|
|
16
|
-
import './transaction-simulation.js';
|
|
17
17
|
|
|
18
18
|
type AppInfo = {
|
|
19
19
|
name: AppName;
|
|
@@ -28,7 +28,7 @@ type NetworkFeeParam = Network & {
|
|
|
28
28
|
caipId?: string;
|
|
29
29
|
};
|
|
30
30
|
interface Module {
|
|
31
|
-
getProvider: (network: Network) => Promise<JsonRpcBatchInternal | BitcoinProvider | Avalanche.JsonRpcProvider | HyperSDKClient
|
|
31
|
+
getProvider: (network: Network) => Promise<JsonRpcBatchInternal | BitcoinProvider | Avalanche.JsonRpcProvider | HyperSDKClient | Rpc<SolanaRpcApiMainnet | SolanaRpcApiDevnet>>;
|
|
32
32
|
getManifest: () => Manifest | undefined;
|
|
33
33
|
getBalances: (params: GetBalancesParams) => Promise<GetBalancesResponse>;
|
|
34
34
|
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
|
package/dist/module.js
CHANGED