@tezos-x/octez.connect-dapp 5.0.0-beta.7 → 5.0.2
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/cjs/dapp-client/DAppClient.js +37 -21
- package/dist/cjs/dapp-client/DAppClient.js.map +1 -1
- package/dist/cjs/dapp-client/DAppClientOptions.d.ts +18 -10
- package/dist/cjs/dapp-client/DAppClientOptions.js.map +1 -1
- package/dist/esm/dapp-client/DAppClient.js +38 -22
- package/dist/esm/dapp-client/DAppClient.js.map +1 -1
- package/dist/esm/dapp-client/DAppClientOptions.d.ts +18 -10
- package/dist/esm/dapp-client/DAppClientOptions.js.map +1 -1
- package/dist/octez.connect.dapp.min.js +1 -1
- package/package.json +9 -9
|
@@ -130,16 +130,24 @@ export interface DAppClientOptions {
|
|
|
130
130
|
*/
|
|
131
131
|
enableMetrics?: boolean;
|
|
132
132
|
/**
|
|
133
|
-
* Minimum
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* `
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
133
|
+
* Minimum wallet version the dApp will accept. The gate is opt-in: it
|
|
134
|
+
* defaults to the lowest supported protocol version, so every wallet the
|
|
135
|
+
* SDK can talk to is accepted and upgrading the SDK never rejects existing
|
|
136
|
+
* v2/v3 wallets. Set `'4'` to require the v4 multi-network protocol. Must
|
|
137
|
+
* be a decimal-integer string in `[1, BEACON_VERSION]`; otherwise
|
|
138
|
+
* `InvalidRequiredMinimumVersionError` is thrown at construction. A wallet
|
|
139
|
+
* below this minimum is rejected with `VersionUnsupportedBeaconError` when
|
|
140
|
+
* a request is sent.
|
|
141
|
+
*
|
|
142
|
+
* The version compared against this minimum is the wallet's EFFECTIVE
|
|
143
|
+
* version, not the raw `peer.version`: legacy wallets echo the dApp's own
|
|
144
|
+
* version at pairing, so a declared version is only trusted when the
|
|
145
|
+
* pairing response carried the v5 `protocolVersion` capability marker —
|
|
146
|
+
* marker-less wallets that declared a version count as `'2'` (and are
|
|
147
|
+
* therefore rejected by a minimum of `'3'` or `'4'`, even though their
|
|
148
|
+
* echoed `peer.version` may read higher). A wallet that reports no version
|
|
149
|
+
* at all (WalletConnect pairings) is still treated as unknown and allowed,
|
|
150
|
+
* so those pairings keep working.
|
|
143
151
|
*/
|
|
144
152
|
requiredMinimumVersion?: string;
|
|
145
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DAppClientOptions.js","sourceRoot":"","sources":["../../../src/dapp-client/DAppClientOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { BeaconEvent, BeaconEventType, BeaconEventHandlerFunction } from '../events'\nimport { BlockExplorer } from '../utils/block-explorer'\nimport {\n Storage,\n NetworkType,\n ColorMode,\n NodeDistributions,\n AnalyticsInterface,\n Network\n} from '@tezos-x/octez.connect-types'\n\ntype RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>\n }[Keys]\n\n/**\n * @category DApp\n */\nexport interface DAppClientOptions {\n /**\n * Name of the application\n */\n name: string\n\n /**\n * Description of the application\n */\n description?: string\n\n /**\n * A URL to the icon of the application\n */\n iconUrl?: string\n\n /**\n * A URL to the website of the application\n */\n appUrl?: string\n\n /**\n * The storage that will be used by the SDK\n */\n storage?: Storage\n\n /**\n * An object that will be used to overwrite default event handler behaviour.\n *\n * If you plan to overwrite all default events, use \"disableDefaultEvents\" instead.\n *\n * This will overwrite the default event handler, so this can lead to unexpected behavior in some cases.\n * We recommend that you overwrite all handlers if you want to use your own UI.\n *\n * If you simply want to be notified of events happening, but do not want to overwrite the default behavior,\n * please use `subscribeToEvent()` on the DAppClient instead.\n */\n eventHandlers?: {\n [key in BeaconEvent]?: {\n handler: BeaconEventHandlerFunction<BeaconEventType[key]>\n }\n }\n\n /**\n * Disable all default Events and UI elements. If passed together with \"eventHandlers\",\n * the default eventHandlers will be removed, and the ones passed by the user will be added.\n */\n disableDefaultEvents?: boolean\n\n /**\n * A list of matrix nodes to connect to. If a non-empty array is passed, the default options will be overwritten.\n * One node will be randomly selected based on the local keypair and the other nodes will be used as a fallback in case the primary node goes down.\n *\n * Only provide the hostname, no https:// prefix. Eg. { [Regions.EU1]: ['matrix.example.com'] }\n */\n matrixNodes?: NodeDistributions\n\n /**\n * The block explorer used by the SDK\n */\n blockExplorer?: BlockExplorer\n\n /**\n * Indicates on which network the DApp is running on.\n */\n network?: Network\n\n /**\n * @deprecated Please use \"network\" instead.\n * Indicates on which network the DApp is planning to run. This is currently used to adjust the URLs of web-wallets in the pairing alert if they use different URLs for testnets.\n * You will still have to define the network you intend to use during the permission request.\n */\n preferredNetwork?: NetworkType\n\n /**\n * Set the color mode for the UI elements (alerts and toasts)\n */\n colorMode?: ColorMode\n\n /**\n * A URL to the Terms & Conditions page that will be displayed in the pairing modal\n */\n termsAndConditionsUrl?: string\n\n /**\n * A URL to the Privacy Policy page that will be displayed in the pairing modal\n */\n privacyPolicyUrl?: string\n\n /**\n * A list of contracts that the DApp is using. Allows to attach human readable error messages for to error codes\n */\n errorMessages?: Record<string, Record<string | number, string>>\n\n /**\n * Configuration that is passed to the WalletConnect transport.\n *\n * This is required to enable WalletConnect connections.\n */\n walletConnectOptions?: RequireAtLeastOne<{\n /**\n * The projectId of the application. Has to be obtained from https://cloud.walletconnect.com/\n */\n projectId?: string\n\n /**\n * The relay server to connect to\n */\n relayUrl?: string\n }>\n\n /**\n * Explicitly disable the WalletConnect transport.\n *\n * WalletConnect is opt-in (it is only built when `walletConnectOptions` is\n * provided). This additive flag lets a DApp that does provide\n * `walletConnectOptions` still turn the transport off without removing that\n * configuration. When `true`, no WalletConnect transport is constructed or\n * listened to. Absence preserves current behavior. Use it for environments\n * where the WalletConnect provider cannot run (e.g. a Firefox MV3\n * content-script compartment).\n */\n disableWalletConnect?: boolean\n\n /**\n * The analytics instance that will be used by the SDK\n */\n analytics?: AnalyticsInterface\n\n /**\n * The wallets that will be featured in the UI.\n */\n featuredWallets?: string[]\n\n /**\n * Automatically switch between apps on Mobile Devices (Enabled by Default)\n */\n enableAppSwitching?: boolean\n\n /**\n * Enable metrics tracking (Disabled by Default)\n */\n enableMetrics?: boolean\n\n /**\n * Minimum
|
|
1
|
+
{"version":3,"file":"DAppClientOptions.js","sourceRoot":"","sources":["../../../src/dapp-client/DAppClientOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { BeaconEvent, BeaconEventType, BeaconEventHandlerFunction } from '../events'\nimport { BlockExplorer } from '../utils/block-explorer'\nimport {\n Storage,\n NetworkType,\n ColorMode,\n NodeDistributions,\n AnalyticsInterface,\n Network\n} from '@tezos-x/octez.connect-types'\n\ntype RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>\n }[Keys]\n\n/**\n * @category DApp\n */\nexport interface DAppClientOptions {\n /**\n * Name of the application\n */\n name: string\n\n /**\n * Description of the application\n */\n description?: string\n\n /**\n * A URL to the icon of the application\n */\n iconUrl?: string\n\n /**\n * A URL to the website of the application\n */\n appUrl?: string\n\n /**\n * The storage that will be used by the SDK\n */\n storage?: Storage\n\n /**\n * An object that will be used to overwrite default event handler behaviour.\n *\n * If you plan to overwrite all default events, use \"disableDefaultEvents\" instead.\n *\n * This will overwrite the default event handler, so this can lead to unexpected behavior in some cases.\n * We recommend that you overwrite all handlers if you want to use your own UI.\n *\n * If you simply want to be notified of events happening, but do not want to overwrite the default behavior,\n * please use `subscribeToEvent()` on the DAppClient instead.\n */\n eventHandlers?: {\n [key in BeaconEvent]?: {\n handler: BeaconEventHandlerFunction<BeaconEventType[key]>\n }\n }\n\n /**\n * Disable all default Events and UI elements. If passed together with \"eventHandlers\",\n * the default eventHandlers will be removed, and the ones passed by the user will be added.\n */\n disableDefaultEvents?: boolean\n\n /**\n * A list of matrix nodes to connect to. If a non-empty array is passed, the default options will be overwritten.\n * One node will be randomly selected based on the local keypair and the other nodes will be used as a fallback in case the primary node goes down.\n *\n * Only provide the hostname, no https:// prefix. Eg. { [Regions.EU1]: ['matrix.example.com'] }\n */\n matrixNodes?: NodeDistributions\n\n /**\n * The block explorer used by the SDK\n */\n blockExplorer?: BlockExplorer\n\n /**\n * Indicates on which network the DApp is running on.\n */\n network?: Network\n\n /**\n * @deprecated Please use \"network\" instead.\n * Indicates on which network the DApp is planning to run. This is currently used to adjust the URLs of web-wallets in the pairing alert if they use different URLs for testnets.\n * You will still have to define the network you intend to use during the permission request.\n */\n preferredNetwork?: NetworkType\n\n /**\n * Set the color mode for the UI elements (alerts and toasts)\n */\n colorMode?: ColorMode\n\n /**\n * A URL to the Terms & Conditions page that will be displayed in the pairing modal\n */\n termsAndConditionsUrl?: string\n\n /**\n * A URL to the Privacy Policy page that will be displayed in the pairing modal\n */\n privacyPolicyUrl?: string\n\n /**\n * A list of contracts that the DApp is using. Allows to attach human readable error messages for to error codes\n */\n errorMessages?: Record<string, Record<string | number, string>>\n\n /**\n * Configuration that is passed to the WalletConnect transport.\n *\n * This is required to enable WalletConnect connections.\n */\n walletConnectOptions?: RequireAtLeastOne<{\n /**\n * The projectId of the application. Has to be obtained from https://cloud.walletconnect.com/\n */\n projectId?: string\n\n /**\n * The relay server to connect to\n */\n relayUrl?: string\n }>\n\n /**\n * Explicitly disable the WalletConnect transport.\n *\n * WalletConnect is opt-in (it is only built when `walletConnectOptions` is\n * provided). This additive flag lets a DApp that does provide\n * `walletConnectOptions` still turn the transport off without removing that\n * configuration. When `true`, no WalletConnect transport is constructed or\n * listened to. Absence preserves current behavior. Use it for environments\n * where the WalletConnect provider cannot run (e.g. a Firefox MV3\n * content-script compartment).\n */\n disableWalletConnect?: boolean\n\n /**\n * The analytics instance that will be used by the SDK\n */\n analytics?: AnalyticsInterface\n\n /**\n * The wallets that will be featured in the UI.\n */\n featuredWallets?: string[]\n\n /**\n * Automatically switch between apps on Mobile Devices (Enabled by Default)\n */\n enableAppSwitching?: boolean\n\n /**\n * Enable metrics tracking (Disabled by Default)\n */\n enableMetrics?: boolean\n\n /**\n * Minimum wallet version the dApp will accept. The gate is opt-in: it\n * defaults to the lowest supported protocol version, so every wallet the\n * SDK can talk to is accepted and upgrading the SDK never rejects existing\n * v2/v3 wallets. Set `'4'` to require the v4 multi-network protocol. Must\n * be a decimal-integer string in `[1, BEACON_VERSION]`; otherwise\n * `InvalidRequiredMinimumVersionError` is thrown at construction. A wallet\n * below this minimum is rejected with `VersionUnsupportedBeaconError` when\n * a request is sent.\n *\n * The version compared against this minimum is the wallet's EFFECTIVE\n * version, not the raw `peer.version`: legacy wallets echo the dApp's own\n * version at pairing, so a declared version is only trusted when the\n * pairing response carried the v5 `protocolVersion` capability marker —\n * marker-less wallets that declared a version count as `'2'` (and are\n * therefore rejected by a minimum of `'3'` or `'4'`, even though their\n * echoed `peer.version` may read higher). A wallet that reports no version\n * at all (WalletConnect pairings) is still treated as unknown and allowed,\n * so those pairings keep working.\n */\n requiredMinimumVersion?: string\n}\n"]}
|