@metamask/keyring-api 23.0.0 → 23.1.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/CHANGELOG.md +22 -8
- package/README.md +0 -9
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +1 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +1 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/transaction.cjs +5 -0
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +12 -6
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +12 -6
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +5 -0
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +1 -1
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +1 -1
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs.map +1 -1
- package/dist/events.d.cts +3 -3
- package/dist/events.d.mts +3 -3
- package/dist/rpc.d.cts +5 -4
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +5 -4
- package/dist/rpc.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.cjs.map +1 -1
- package/dist/v2/api/create-account/bip44.d.cts +1 -1
- package/dist/v2/api/create-account/bip44.d.cts.map +1 -1
- package/dist/v2/api/create-account/bip44.d.mts +1 -1
- package/dist/v2/api/create-account/bip44.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.mjs.map +1 -1
- package/dist/v2/api/create-account/custom.cjs.map +1 -1
- package/dist/v2/api/create-account/custom.d.cts +1 -1
- package/dist/v2/api/create-account/custom.d.cts.map +1 -1
- package/dist/v2/api/create-account/custom.d.mts +1 -1
- package/dist/v2/api/create-account/custom.d.mts.map +1 -1
- package/dist/v2/api/create-account/custom.mjs.map +1 -1
- package/dist/v2/api/create-account/index.cjs.map +1 -1
- package/dist/v2/api/create-account/index.d.cts +1 -1
- package/dist/v2/api/create-account/index.d.cts.map +1 -1
- package/dist/v2/api/create-account/index.d.mts +1 -1
- package/dist/v2/api/create-account/index.d.mts.map +1 -1
- package/dist/v2/api/create-account/index.mjs.map +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -1
- package/dist/v2/api/create-account/private-key.d.cts +1 -1
- package/dist/v2/api/create-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/create-account/private-key.d.mts +1 -1
- package/dist/v2/api/create-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/create-account/private-key.mjs.map +1 -1
- package/dist/v2/api/export-account/index.cjs.map +1 -1
- package/dist/v2/api/export-account/index.d.cts +1 -1
- package/dist/v2/api/export-account/index.d.cts.map +1 -1
- package/dist/v2/api/export-account/index.d.mts +1 -1
- package/dist/v2/api/export-account/index.d.mts.map +1 -1
- package/dist/v2/api/export-account/index.mjs.map +1 -1
- package/dist/v2/api/export-account/private-key.cjs.map +1 -1
- package/dist/v2/api/export-account/private-key.d.cts +1 -1
- package/dist/v2/api/export-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/export-account/private-key.d.mts +1 -1
- package/dist/v2/api/export-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/export-account/private-key.mjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.cjs +1 -1
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -1
- package/dist/v2/api/keyring-capabilities.mjs +1 -1
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -1
- package/dist/v2/api/keyring-rpc.cjs +2 -2
- package/dist/v2/api/keyring-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -1
- package/dist/v2/api/keyring-rpc.d.mts.map +1 -1
- package/dist/v2/api/keyring-rpc.mjs +2 -2
- package/dist/v2/api/keyring-rpc.mjs.map +1 -1
- package/dist/v2/api/keyring.cjs.map +1 -1
- package/dist/v2/api/keyring.d.cts +2 -2
- package/dist/v2/api/keyring.d.cts.map +1 -1
- package/dist/v2/api/keyring.d.mts +2 -2
- package/dist/v2/api/keyring.d.mts.map +1 -1
- package/dist/v2/api/keyring.mjs.map +1 -1
- package/dist/v2/api/private-key.cjs.map +1 -1
- package/dist/v2/api/private-key.d.cts +1 -1
- package/dist/v2/api/private-key.d.cts.map +1 -1
- package/dist/v2/api/private-key.d.mts +1 -1
- package/dist/v2/api/private-key.d.mts.map +1 -1
- package/dist/v2/api/private-key.mjs.map +1 -1
- package/package.json +20 -19
- package/v2.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [23.1.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `TransactionType.TokenApprove` for token approval transactions ([#537](https://github.com/MetaMask/accounts/pull/537))
|
|
15
|
+
|
|
16
|
+
## [23.0.1]
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Workaround Browserify subpath export for `/v2` ([#516](https://github.com/MetaMask/accounts/pull/516))
|
|
21
|
+
|
|
10
22
|
## [23.0.0]
|
|
11
23
|
|
|
12
24
|
### Added
|
|
@@ -24,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
36
|
- `KeyringCapabilities`, `KeyringType`, account creation options (except `CreateAccountOptions`), and account export options are now exclusively available from `@metamask/keyring-api/v2`.
|
|
25
37
|
- `CreateAccountOptions` and its subtypes (`Bip44CreateAccountOptions`, `PrivateKeyCreateAccountOptions`, `CustomCreateAccountOptions`) remain available from both `@metamask/keyring-api` and `@metamask/keyring-api/v2`.
|
|
26
38
|
- Improve return type of `isKeyringRpcMethod` to use type predicate `method is KeyringRpcMethod` ([#408](https://github.com/MetaMask/accounts/pull/408))
|
|
27
|
-
- Bump `@metamask/utils` from `^11.1.0` to `^11.11.0` ([#489](https://github.com/MetaMask/accounts/pull/489), [#483](https://github.com/MetaMask/accounts/pull/483))
|
|
39
|
+
- Bump `@metamask/utils` from `^11.1.0` to `^11.11.0` ([#489](https://github.com/MetaMask/accounts/pull/489)), ([#483](https://github.com/MetaMask/accounts/pull/483))
|
|
28
40
|
|
|
29
41
|
## [22.0.0]
|
|
30
42
|
|
|
@@ -118,12 +130,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
118
130
|
|
|
119
131
|
### Added
|
|
120
132
|
|
|
121
|
-
- **BREAKING:** Add new bitcoin methods to `BtcMethod` enum ([#355](https://github.com/
|
|
133
|
+
- **BREAKING:** Add new bitcoin methods to `BtcMethod` enum ([#355](https://github.com/MetaMask/accounts/pull/355)), ([#356](https://github.com/MetaMask/accounts/pull/356))
|
|
122
134
|
- This change was not properly reported as breaking on the `20.1.1`.
|
|
123
135
|
|
|
124
136
|
### Removed
|
|
125
137
|
|
|
126
|
-
- **BREAKING:** Remove `BtcMethod.SendBitcoin` method ([#355](https://github.com/
|
|
138
|
+
- **BREAKING:** Remove `BtcMethod.SendBitcoin` method ([#355](https://github.com/MetaMask/accounts/pull/355))
|
|
127
139
|
- This change was not properly reported as breaking on the `20.1.1`.
|
|
128
140
|
|
|
129
141
|
## [20.1.1]
|
|
@@ -142,7 +154,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
142
154
|
|
|
143
155
|
### Changed
|
|
144
156
|
|
|
145
|
-
- **BREAKING:** Add generic account type ([#323](https://github.com/
|
|
157
|
+
- **BREAKING:** Add generic account type ([#323](https://github.com/MetaMask/accounts/pull/323))
|
|
146
158
|
- This change was not properly reported as breaking on the `19.1.0`.
|
|
147
159
|
- The `KeyringAccountType` union now has a new member type `any:account`.
|
|
148
160
|
|
|
@@ -150,7 +162,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
150
162
|
|
|
151
163
|
### Added
|
|
152
164
|
|
|
153
|
-
- Add generic account type ([#318](https://github.com/
|
|
165
|
+
- Add generic account type ([#318](https://github.com/MetaMask/accounts/pull/318))
|
|
154
166
|
- This account type can be used during the integration of new chains.
|
|
155
167
|
- It's allowed only in Flask builds of MetaMask clients.
|
|
156
168
|
|
|
@@ -337,7 +349,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
337
349
|
### Changed
|
|
338
350
|
|
|
339
351
|
- Bump `sinon` and `@types/sinon` to latest versions ([#51](https://github.com/MetaMask/accounts/pull/51))
|
|
340
|
-
- Add `syncpack` and sync dependencies ([#53](https://github.com/
|
|
352
|
+
- Add `syncpack` and sync dependencies ([#53](https://github.com/MetaMask/accounts/pull/53))
|
|
341
353
|
|
|
342
354
|
## [8.1.2]
|
|
343
355
|
|
|
@@ -387,7 +399,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
387
399
|
|
|
388
400
|
### Changed
|
|
389
401
|
|
|
390
|
-
- **BREAKING:** Revert
|
|
402
|
+
- **BREAKING:** Revert allow multiple address per account ([#342](https://github.com/MetaMask/keyring-api/pull/342)).
|
|
391
403
|
|
|
392
404
|
## [7.0.0]
|
|
393
405
|
|
|
@@ -737,7 +749,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
737
749
|
- SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
|
|
738
750
|
- Helper functions to create keyring handler in the snap.
|
|
739
751
|
|
|
740
|
-
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.
|
|
752
|
+
[Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.1.0...HEAD
|
|
753
|
+
[23.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.1...@metamask/keyring-api@23.1.0
|
|
754
|
+
[23.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@23.0.0...@metamask/keyring-api@23.0.1
|
|
741
755
|
[23.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@22.0.0...@metamask/keyring-api@23.0.0
|
|
742
756
|
[22.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.6.0...@metamask/keyring-api@22.0.0
|
|
743
757
|
[21.6.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.5.0...@metamask/keyring-api@21.6.0
|
package/README.md
CHANGED
|
@@ -88,7 +88,6 @@ these instruction assume that you are already familiar with the process of
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Where:
|
|
91
|
-
|
|
92
91
|
- `id` is unique identifier for the request.
|
|
93
92
|
|
|
94
93
|
- `scope` is the CAIP-2 chain ID of the selected chain. Currently, this
|
|
@@ -117,7 +116,6 @@ these instruction assume that you are already familiar with the process of
|
|
|
117
116
|
3. **Notify MetaMask about events:**
|
|
118
117
|
|
|
119
118
|
The following actions must be notified to MetaMask:
|
|
120
|
-
|
|
121
119
|
1. When an account is created:
|
|
122
120
|
|
|
123
121
|
```typescript
|
|
@@ -374,35 +372,28 @@ Run `yarn lint` to run the linter, or run `yarn lint:fix` to run the linter and
|
|
|
374
372
|
The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) and [`action-publish-release`](https://github.com/MetaMask/action-publish-release) are used to automate the release process; see those repositories for more information about how they work.
|
|
375
373
|
|
|
376
374
|
1. Choose a release version.
|
|
377
|
-
|
|
378
375
|
- The release version should be chosen according to SemVer. Analyze the changes to see whether they include any breaking changes, new features, or deprecations, then choose the appropriate SemVer version. See [the SemVer specification](https://semver.org/) for more information.
|
|
379
376
|
|
|
380
377
|
2. If this release is backporting changes onto a previous release, then ensure there is a major version branch for that version (e.g. `1.x` for a `v1` backport release).
|
|
381
|
-
|
|
382
378
|
- The major version branch should be set to the most recent release with that major version. For example, when backporting a `v1.0.2` release, you'd want to ensure there was a `1.x` branch that was set to the `v1.0.1` tag.
|
|
383
379
|
|
|
384
380
|
3. Trigger the [`workflow_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event [manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) for the `Create Release Pull Request` action to create the release PR.
|
|
385
|
-
|
|
386
381
|
- For a backport release, the base branch should be the major version branch that you ensured existed in step 2. For a normal release, the base branch should be the main branch for that repository (which should be the default value).
|
|
387
382
|
- This should trigger the [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) workflow to create the release PR.
|
|
388
383
|
|
|
389
384
|
4. Update the changelog to move each change entry into the appropriate change category ([See here](https://keepachangelog.com/en/1.0.0/#types) for the full list of change categories, and the correct ordering), and edit them to be more easily understood by users of the package.
|
|
390
|
-
|
|
391
385
|
- Generally any changes that don't affect consumers of the package (e.g. lockfile changes or development environment changes) are omitted. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
|
|
392
386
|
- Try to explain each change in terms that users of the package would understand (e.g. avoid referencing internal variables/concepts).
|
|
393
387
|
- Consolidate related changes into one change entry if it makes it easier to explain.
|
|
394
388
|
- Run `yarn auto-changelog validate --prettier --rc` to check that the changelog is correctly formatted.
|
|
395
389
|
|
|
396
390
|
5. Review and QA the release.
|
|
397
|
-
|
|
398
391
|
- If changes are made to the base branch, the release branch will need to be updated with these changes and review/QA will need to restart again. As such, it's probably best to avoid merging other PRs into the base branch while review is underway.
|
|
399
392
|
|
|
400
393
|
6. Squash & Merge the release.
|
|
401
|
-
|
|
402
394
|
- This should trigger the [`action-publish-release`](https://github.com/MetaMask/action-publish-release) workflow to tag the final release commit and publish the release on GitHub.
|
|
403
395
|
|
|
404
396
|
7. Publish the release on npm.
|
|
405
|
-
|
|
406
397
|
- Wait for the `publish-release` GitHub Action workflow to finish. This should trigger a second job (`publish-npm`), which will wait for a run approval by the [`npm publishers`](https://github.com/orgs/MetaMask/teams/npm-publishers) team.
|
|
407
398
|
- Approve the `publish-npm` job (or ask somebody on the npm publishers team to approve it for you).
|
|
408
399
|
- Once the `publish-npm` job has finished, check npm to verify that it has been published.
|
package/dist/api/keyring.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\
|
|
1
|
+
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { CreateAccountOptions } from '../v2/api';\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional). The\n * 'metamask' internal options needs to be re-emitted during `notify:*` events.\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(\n options?: Record<string, Json> & MetaMaskOptions,\n ): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts?(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Discover accounts.\n *\n * This method is called by the client to allow the keyring to discover\n * existing accounts based on the provided scopes and entropy source ID. Are\n * considered existing accounts, accounts that have at least one transaction,\n * as per BIP-44.\n *\n * The `groupIndex` is used to group accounts with the same value. In\n * strictly BIP-44 wallets, it matches `account_index`, but in wallets that\n * deviate from BIP-44 recommendations, it may align with a different path\n * level for compatibility.\n *\n * @param scopes - The list of scopes for account discovery.\n * @param entropySource - The ID of the entropy source used to derive the accounts.\n * @param groupIndex - The group index that should be used to derive the accounts.\n * @returns A promise resolving to a list of discovered accounts.\n */\n discoverAccounts?(\n scopes: CaipChainId[],\n entropySource: EntropySourceId,\n groupIndex: number,\n ): Promise<DiscoveredAccount[]>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Set the selected accounts.\n *\n * @param accounts - The accounts to set as selected.\n */\n setSelectedAccounts?(accounts: AccountId[]): Promise<void>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
|
package/dist/api/keyring.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AccountId, JsonRpcRequest } from "@metamask/keyring-utils";
|
|
2
2
|
import type { Json } from "@metamask/utils";
|
|
3
|
+
import type { CreateAccountOptions } from "../v2/api/index.cjs";
|
|
3
4
|
import type { KeyringAccount } from "./account.cjs";
|
|
4
5
|
import type { ResolvedAccountAddress } from "./address.cjs";
|
|
5
6
|
import type { Balance } from "./balance.cjs";
|
|
@@ -12,7 +13,6 @@ import type { Paginated, Pagination } from "./pagination.cjs";
|
|
|
12
13
|
import type { KeyringRequest } from "./request.cjs";
|
|
13
14
|
import type { KeyringResponse } from "./response.cjs";
|
|
14
15
|
import type { Transaction } from "./transaction.cjs";
|
|
15
|
-
import type { CreateAccountOptions } from "../v2/api/index.cjs";
|
|
16
16
|
/**
|
|
17
17
|
* Keyring interface.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAkB;AACxD,OAAO,KAAK,EA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
import type { Json } from "@metamask/utils";
|
|
3
|
+
import type { CreateAccountOptions } from "../v2/api/index.mjs";
|
|
3
4
|
import type { KeyringAccount } from "./account.mjs";
|
|
4
5
|
import type { ResolvedAccountAddress } from "./address.mjs";
|
|
5
6
|
import type { Balance } from "./balance.mjs";
|
|
@@ -12,7 +13,6 @@ import type { Paginated, Pagination } from "./pagination.mjs";
|
|
|
12
13
|
import type { KeyringRequest } from "./request.mjs";
|
|
13
14
|
import type { KeyringResponse } from "./response.mjs";
|
|
14
15
|
import type { Transaction } from "./transaction.mjs";
|
|
15
|
-
import type { CreateAccountOptions } from "../v2/api/index.mjs";
|
|
16
16
|
/**
|
|
17
17
|
* Keyring interface.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gCAAgC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAkB;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAe;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAoB;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAiB;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAkB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,yBAAqB;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAkB;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAmB;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;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;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExD;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;;;;;OAQG;IACH,UAAU,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjE;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC"}
|
package/dist/api/keyring.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\
|
|
1
|
+
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../src/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId, JsonRpcRequest } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { CreateAccountOptions } from '../v2/api';\nimport type { KeyringAccount } from './account';\nimport type { ResolvedAccountAddress } from './address';\nimport type { Balance } from './balance';\nimport type { CaipChainId, CaipAssetType, CaipAssetTypeOrId } from './caip';\nimport type { DiscoveredAccount } from './discovery';\nimport type { EntropySourceId } from './entropy';\nimport type { KeyringAccountData } from './export';\nimport type { MetaMaskOptions } from './options';\nimport type { Paginated, Pagination } from './pagination';\nimport type { KeyringRequest } from './request';\nimport type { KeyringResponse } from './response';\nimport type { Transaction } from './transaction';\n\n/**\n * Keyring interface.\n *\n * Represents the functionality and operations related to managing accounts and\n * handling requests.\n */\nexport type Keyring = {\n /**\n * List accounts.\n *\n * Retrieves an array of KeyringAccount objects representing the available\n * accounts.\n *\n * @returns A promise that resolves to an array of KeyringAccount objects.\n */\n listAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Get an account.\n *\n * Retrieves the KeyringAccount object for the given account ID.\n *\n * @param id - The ID of the account to retrieve.\n * @returns A promise that resolves to the KeyringAccount object if found, or\n * undefined otherwise.\n */\n getAccount(id: string): Promise<KeyringAccount | undefined>;\n\n /**\n * Create an account.\n *\n * Creates a new account with optional, keyring-defined, account options.\n *\n * @param options - Keyring-defined options for the account (optional). The\n * 'metamask' internal options needs to be re-emitted during `notify:*` events.\n * @returns A promise that resolves to the newly created KeyringAccount\n * object without any private information.\n */\n createAccount(\n options?: Record<string, Json> & MetaMaskOptions,\n ): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts?(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Lists the assets of an account (fungibles and non-fungibles) represented\n * by their respective CAIP-19:\n * - Asset types for fungibles assets.\n * - Asset IDs for non-fungible ones.\n *\n * @param id - The ID of the account to list the assets for.\n * @returns A promise that resolves to list of assets for that account.\n */\n listAccountAssets?(id: string): Promise<CaipAssetTypeOrId[]>;\n\n /**\n * Lists the transactions of an account, paginated and ordered by the most\n * recent first.\n *\n * The pagination options are used to limit the number of transactions in the\n * response and to iterate over the results.\n *\n * @param id - The ID of the account to list the transactions for.\n * @param pagination - The pagination options.\n * @returns A promise that resolves to the next page of transactions.\n */\n listAccountTransactions?(\n id: string,\n pagination: Pagination,\n ): Promise<Paginated<Transaction>>;\n\n /**\n * Discover accounts.\n *\n * This method is called by the client to allow the keyring to discover\n * existing accounts based on the provided scopes and entropy source ID. Are\n * considered existing accounts, accounts that have at least one transaction,\n * as per BIP-44.\n *\n * The `groupIndex` is used to group accounts with the same value. In\n * strictly BIP-44 wallets, it matches `account_index`, but in wallets that\n * deviate from BIP-44 recommendations, it may align with a different path\n * level for compatibility.\n *\n * @param scopes - The list of scopes for account discovery.\n * @param entropySource - The ID of the entropy source used to derive the accounts.\n * @param groupIndex - The group index that should be used to derive the accounts.\n * @returns A promise resolving to a list of discovered accounts.\n */\n discoverAccounts?(\n scopes: CaipChainId[],\n entropySource: EntropySourceId,\n groupIndex: number,\n ): Promise<DiscoveredAccount[]>;\n\n /**\n * Retrieve the balances of a given account.\n *\n * This method fetches the balances of specified assets for a given account\n * ID. It returns a promise that resolves to an object where the keys are\n * asset types and the values are balance objects containing the amount and\n * unit.\n *\n * @example\n * ```ts\n * await keyring.getAccountBalances(\n * '43550276-c7d6-4fac-87c7-00390ad0ce90',\n * ['bip122:000000000019d6689c085ae165831e93/slip44:0']\n * );\n * // Returns something similar to:\n * // {\n * // 'bip122:000000000019d6689c085ae165831e93/slip44:0': {\n * // amount: '0.0001',\n * // unit: 'BTC',\n * // }\n * // }\n * ```\n * @param id - ID of the account to retrieve the balances for.\n * @param assets - Array of asset types (CAIP-19) to retrieve balances for.\n * @returns A promise that resolves to an object mapping asset types to their\n * respective balances.\n */\n getAccountBalances?(\n id: string,\n assets: CaipAssetType[],\n ): Promise<Record<CaipAssetType, Balance>>;\n\n /**\n * Resolves the address of an account from a signing request.\n *\n * This is required by the routing system of MetaMask to dispatch\n * incoming non-EVM dapp signing requests.\n *\n * @param scope - Request's scope (CAIP-2).\n * @param request - Signing request object.\n * @returns A Promise that resolves to the account address that must\n * be used to process this signing request, or null if none candidates\n * could be found.\n */\n resolveAccountAddress?(\n scope: CaipChainId,\n request: JsonRpcRequest,\n ): Promise<ResolvedAccountAddress | null>;\n\n /**\n * Set the selected accounts.\n *\n * @param accounts - The accounts to set as selected.\n */\n setSelectedAccounts?(accounts: AccountId[]): Promise<void>;\n\n /**\n * Filter supported chains for a given account.\n *\n * @param id - ID of the account to be checked.\n * @param chains - List of chains (CAIP-2) to be checked.\n * @returns A Promise that resolves to a filtered list of CAIP-2 IDs\n * representing the supported chains.\n */\n filterAccountChains(id: string, chains: string[]): Promise<string[]>;\n\n /**\n * Update an account.\n *\n * Updates the account with the given account object. Does nothing if the\n * account does not exist.\n *\n * @param account - The updated account object.\n * @returns A promise that resolves when the account is successfully updated.\n */\n updateAccount(account: KeyringAccount): Promise<void>;\n\n /**\n * Delete an account from the keyring.\n *\n * Deletes the account with the given ID from the keyring.\n *\n * @param id - The ID of the account to delete.\n * @returns A promise that resolves when the account is successfully deleted.\n */\n deleteAccount(id: string): Promise<void>;\n\n /**\n * Exports an account's private key.\n *\n * If the keyring cannot export a private key, this function should throw an\n * error.\n *\n * @param id - The ID of the account to export.\n * @returns A promise that resolves to the exported account.\n */\n exportAccount?(id: string): Promise<KeyringAccountData>;\n\n /**\n * List all submitted requests.\n *\n * Retrieves an array of KeyringRequest objects representing the submitted\n * requests.\n *\n * @returns A promise that resolves to an array of KeyringRequest objects.\n */\n listRequests?(): Promise<KeyringRequest[]>;\n\n /**\n * Get a request.\n *\n * Retrieves the KeyringRequest object for the given request ID.\n *\n * @param id - The ID of the request to retrieve.\n * @returns A promise that resolves to the KeyringRequest object if found, or\n * undefined otherwise.\n */\n getRequest?(id: string): Promise<KeyringRequest | undefined>;\n\n /**\n * Submit a request.\n *\n * Submits the given KeyringRequest object.\n *\n * @param request - The KeyringRequest object to submit.\n * @returns A promise that resolves to the request response.\n */\n submitRequest(request: KeyringRequest): Promise<KeyringResponse>;\n\n /**\n * Approve a request.\n *\n * Approves the request with the given ID and sets the response if provided.\n *\n * @param id - The ID of the request to approve.\n * @param data - The response to the request (optional).\n * @returns A promise that resolves when the request is successfully\n * approved.\n */\n approveRequest?(id: string, data?: Record<string, Json>): Promise<void>;\n\n /**\n * Reject a request.\n *\n * Rejects the request with the given ID.\n *\n * @param id - The ID of the request to reject.\n * @returns A promise that resolves when the request is successfully\n * rejected.\n */\n rejectRequest?(id: string): Promise<void>;\n};\n"]}
|
package/dist/api/transaction.cjs
CHANGED
|
@@ -149,6 +149,10 @@ var TransactionType;
|
|
|
149
149
|
* Represents a stake withdrawal transaction.
|
|
150
150
|
*/
|
|
151
151
|
TransactionType["StakeWithdraw"] = "stake:withdraw";
|
|
152
|
+
/**
|
|
153
|
+
* Represents a token approval transaction.
|
|
154
|
+
*/
|
|
155
|
+
TransactionType["TokenApprove"] = "token:approve";
|
|
152
156
|
/**
|
|
153
157
|
* The transaction type is unknown. It's not possible to determine the
|
|
154
158
|
* transaction type based on the information available.
|
|
@@ -325,6 +329,7 @@ exports.TransactionStruct = (0, keyring_utils_1.object)({
|
|
|
325
329
|
`${TransactionType.BridgeReceive}`,
|
|
326
330
|
`${TransactionType.StakeDeposit}`,
|
|
327
331
|
`${TransactionType.StakeWithdraw}`,
|
|
332
|
+
`${TransactionType.TokenApprove}`,
|
|
328
333
|
`${TransactionType.Unknown}`,
|
|
329
334
|
]),
|
|
330
335
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":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AGG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin and\n * security assessment. This field is optional and may not be present for all\n * transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"transaction.cjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":";;;AACA,2DAA4E;AAE5E,uDAA+E;AAE/E,uCAAsC;AACtC,qCAA2C;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,iBAAiB,GAAG,IAAA,sBAAM,EAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,KAAK,EAAE,IAAA,sBAAQ,EAAC,mBAAW,CAAC;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;;;;;OAMG;IACH,wBAAa,CAAA;IAEb;;;;;OAKG;IACH,gCAAqB,CAAA;AACvB,CAAC,EAjBW,OAAO,uBAAP,OAAO,QAiBlB;AAED;;GAEG;AACH,MAAM,SAAS,GAAG,IAAA,sBAAM,EAAC;IACvB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,E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CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,OAAO,EAAE;KAC7B,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE9B;;OAEG;IACH,EAAE,EAAE,IAAA,mBAAK,EAAC,iBAAiB,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,IAAA,mBAAK,EAAC,8BAAsB,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,EAAE,IAAA,6BAAa,EAAC,gCAAwB,CAAC;CACjD,CAAC,CAAC;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,yBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * Represents a token approval transaction.\n */\n TokenApprove = 'token:approve',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.TokenApprove}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin and\n * security assessment. This field is optional and may not be present for all\n * transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
|
|
@@ -84,6 +84,10 @@ export declare enum TransactionType {
|
|
|
84
84
|
* Represents a stake withdrawal transaction.
|
|
85
85
|
*/
|
|
86
86
|
StakeWithdraw = "stake:withdraw",
|
|
87
|
+
/**
|
|
88
|
+
* Represents a token approval transaction.
|
|
89
|
+
*/
|
|
90
|
+
TokenApprove = "token:approve",
|
|
87
91
|
/**
|
|
88
92
|
* The transaction type is unknown. It's not possible to determine the
|
|
89
93
|
* transaction type based on the information available.
|
|
@@ -226,7 +230,7 @@ export declare const TransactionEventStruct: import("@metamask/superstruct").Str
|
|
|
226
230
|
* ```
|
|
227
231
|
*/
|
|
228
232
|
export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
229
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
233
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
230
234
|
id: string;
|
|
231
235
|
from: {
|
|
232
236
|
address: string;
|
|
@@ -308,7 +312,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
308
312
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
309
313
|
* details on the UI.
|
|
310
314
|
*/
|
|
311
|
-
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw", {
|
|
315
|
+
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
|
|
312
316
|
unknown: "unknown";
|
|
313
317
|
send: "send";
|
|
314
318
|
receive: "receive";
|
|
@@ -317,6 +321,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
317
321
|
"bridge:receive": "bridge:receive";
|
|
318
322
|
"stake:deposit": "stake:deposit";
|
|
319
323
|
"stake:withdraw": "stake:withdraw";
|
|
324
|
+
"token:approve": "token:approve";
|
|
320
325
|
}>;
|
|
321
326
|
/**
|
|
322
327
|
* Transaction sender addresses and amounts.
|
|
@@ -547,7 +552,7 @@ export type Transaction = Infer<typeof TransactionStruct>;
|
|
|
547
552
|
*/
|
|
548
553
|
export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
|
|
549
554
|
data: {
|
|
550
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
555
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
551
556
|
id: string;
|
|
552
557
|
from: {
|
|
553
558
|
address: string;
|
|
@@ -604,7 +609,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
604
609
|
* List of transactions.
|
|
605
610
|
*/
|
|
606
611
|
data: import("@metamask/superstruct").Struct<{
|
|
607
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
612
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
608
613
|
id: string;
|
|
609
614
|
from: {
|
|
610
615
|
address: string;
|
|
@@ -655,7 +660,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
655
660
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
656
661
|
};
|
|
657
662
|
}[], import("@metamask/superstruct").Struct<{
|
|
658
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
663
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
659
664
|
id: string;
|
|
660
665
|
from: {
|
|
661
666
|
address: string;
|
|
@@ -737,7 +742,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
737
742
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
738
743
|
* details on the UI.
|
|
739
744
|
*/
|
|
740
|
-
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw", {
|
|
745
|
+
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
|
|
741
746
|
unknown: "unknown";
|
|
742
747
|
send: "send";
|
|
743
748
|
receive: "receive";
|
|
@@ -746,6 +751,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
746
751
|
"bridge:receive": "bridge:receive";
|
|
747
752
|
"stake:deposit": "stake:deposit";
|
|
748
753
|
"stake:withdraw": "stake:withdraw";
|
|
754
|
+
"token:approve": "token:approve";
|
|
749
755
|
}>;
|
|
750
756
|
/**
|
|
751
757
|
* Transaction sender addresses and amounts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.cts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gCAAgC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAiD9C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,SAAS,cAAc;I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;;;;;IAwNH;;;OAGG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CACxC,OAAO,sBAAsB,EAC7B,SAAS,CAAC,WAAW,CAAC,CACvB,CAAC"}
|
|
@@ -84,6 +84,10 @@ export declare enum TransactionType {
|
|
|
84
84
|
* Represents a stake withdrawal transaction.
|
|
85
85
|
*/
|
|
86
86
|
StakeWithdraw = "stake:withdraw",
|
|
87
|
+
/**
|
|
88
|
+
* Represents a token approval transaction.
|
|
89
|
+
*/
|
|
90
|
+
TokenApprove = "token:approve",
|
|
87
91
|
/**
|
|
88
92
|
* The transaction type is unknown. It's not possible to determine the
|
|
89
93
|
* transaction type based on the information available.
|
|
@@ -226,7 +230,7 @@ export declare const TransactionEventStruct: import("@metamask/superstruct").Str
|
|
|
226
230
|
* ```
|
|
227
231
|
*/
|
|
228
232
|
export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
229
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
233
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
230
234
|
id: string;
|
|
231
235
|
from: {
|
|
232
236
|
address: string;
|
|
@@ -308,7 +312,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
308
312
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
309
313
|
* details on the UI.
|
|
310
314
|
*/
|
|
311
|
-
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw", {
|
|
315
|
+
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
|
|
312
316
|
unknown: "unknown";
|
|
313
317
|
send: "send";
|
|
314
318
|
receive: "receive";
|
|
@@ -317,6 +321,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
317
321
|
"bridge:receive": "bridge:receive";
|
|
318
322
|
"stake:deposit": "stake:deposit";
|
|
319
323
|
"stake:withdraw": "stake:withdraw";
|
|
324
|
+
"token:approve": "token:approve";
|
|
320
325
|
}>;
|
|
321
326
|
/**
|
|
322
327
|
* Transaction sender addresses and amounts.
|
|
@@ -547,7 +552,7 @@ export type Transaction = Infer<typeof TransactionStruct>;
|
|
|
547
552
|
*/
|
|
548
553
|
export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
|
|
549
554
|
data: {
|
|
550
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
555
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
551
556
|
id: string;
|
|
552
557
|
from: {
|
|
553
558
|
address: string;
|
|
@@ -604,7 +609,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
604
609
|
* List of transactions.
|
|
605
610
|
*/
|
|
606
611
|
data: import("@metamask/superstruct").Struct<{
|
|
607
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
612
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
608
613
|
id: string;
|
|
609
614
|
from: {
|
|
610
615
|
address: string;
|
|
@@ -655,7 +660,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
655
660
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
656
661
|
};
|
|
657
662
|
}[], import("@metamask/superstruct").Struct<{
|
|
658
|
-
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
|
|
663
|
+
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve";
|
|
659
664
|
id: string;
|
|
660
665
|
from: {
|
|
661
666
|
address: string;
|
|
@@ -737,7 +742,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
737
742
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
738
743
|
* details on the UI.
|
|
739
744
|
*/
|
|
740
|
-
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw", {
|
|
745
|
+
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve", {
|
|
741
746
|
unknown: "unknown";
|
|
742
747
|
send: "send";
|
|
743
748
|
receive: "receive";
|
|
@@ -746,6 +751,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
746
751
|
"bridge:receive": "bridge:receive";
|
|
747
752
|
"stake:deposit": "stake:deposit";
|
|
748
753
|
"stake:withdraw": "stake:withdraw";
|
|
754
|
+
"token:approve": "token:approve";
|
|
749
755
|
}>;
|
|
750
756
|
/**
|
|
751
757
|
* Transaction sender addresses and amounts.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gCAAgC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAiD9C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IAC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;;;;;YAQH;;eAEG;;;QAqIH;;;;;;WAMG;;;;;YAhLH;;;;;eAKG;;YAGH;;;eAGG;;;;;;;;IAwNH;;;OAGG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CACxC,OAAO,sBAAsB,EAC7B,SAAS,CAAC,WAAW,CAAC,CACvB,CAAC"}
|
package/dist/api/transaction.mjs
CHANGED
|
@@ -146,6 +146,10 @@ export var TransactionType;
|
|
|
146
146
|
* Represents a stake withdrawal transaction.
|
|
147
147
|
*/
|
|
148
148
|
TransactionType["StakeWithdraw"] = "stake:withdraw";
|
|
149
|
+
/**
|
|
150
|
+
* Represents a token approval transaction.
|
|
151
|
+
*/
|
|
152
|
+
TransactionType["TokenApprove"] = "token:approve";
|
|
149
153
|
/**
|
|
150
154
|
* The transaction type is unknown. It's not possible to determine the
|
|
151
155
|
* transaction type based on the information available.
|
|
@@ -322,6 +326,7 @@ export const TransactionStruct = object({
|
|
|
322
326
|
`${TransactionType.BridgeReceive}`,
|
|
323
327
|
`${TransactionType.StakeDeposit}`,
|
|
324
328
|
`${TransactionType.StakeWithdraw}`,
|
|
329
|
+
`${TransactionType.TokenApprove}`,
|
|
325
330
|
`${TransactionType.Unknown}`,
|
|
326
331
|
]),
|
|
327
332
|
/**
|