@concordium/browser-wallet-api-helpers 2.0.0 → 2.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/README.md +1 -1
- package/lib/wallet-api-types.d.ts +14 -1
- package/package.json +35 -35
- package/CHANGELOG.md +0 -39
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ const signature = await provider.signMessage(
|
|
|
138
138
|
|
|
139
139
|
### Add CIS-2 Tokens
|
|
140
140
|
|
|
141
|
-
It is possible to suggest CIS-2 tokens to be added to
|
|
141
|
+
It is possible to suggest CIS-2 tokens to be added to an account's display. This method returns a `Promise` resolving with a list containing the ids of the tokens that were added.
|
|
142
142
|
|
|
143
143
|
If the wallet is locked, or you have not connected with the wallet (or previously been whitelisted) or if the user rejects signing the meesage, the `Promise` will reject.
|
|
144
144
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountTransactionPayload, AccountTransactionSignature, AccountTransactionType, InitContractPayload, JsonRpcClient, SchemaVersion, UpdateContractPayload } from '@concordium/web-sdk';
|
|
1
|
+
import type { AccountTransactionPayload, AccountTransactionSignature, AccountTransactionType, InitContractPayload, JsonRpcClient, SchemaVersion, UpdateContractPayload, IdStatement, IdProofOutput } from '@concordium/web-sdk';
|
|
2
2
|
declare type SendTransactionPayload = Exclude<AccountTransactionPayload, UpdateContractPayload | InitContractPayload> | Omit<UpdateContractPayload, 'message'> | Omit<InitContractPayload, 'param'>;
|
|
3
3
|
/**
|
|
4
4
|
* An enumeration of the events that can be emitted by the WalletApi.
|
|
@@ -58,8 +58,21 @@ interface MainWalletApi {
|
|
|
58
58
|
* Request that the user adds the specified tokens for a given contract to the wallet.
|
|
59
59
|
* Returns which of the given tokens the user accepted to add the tokens into the wallet.
|
|
60
60
|
* Note that this will throw an error if the dApp is not connected with the accountAddress.
|
|
61
|
+
* @param accountAddress the address of the account whose display the tokens should be added to.
|
|
62
|
+
* @param tokenIds the list of ids, for the tokens that should be added.
|
|
63
|
+
* @param contractIndex the index of the CIS-2 contract which the tokens are in.
|
|
64
|
+
* @param contractSubindex the subindex of the CIS-2 contract which the tokens are in.
|
|
65
|
+
* @returns a list containing the ids of the tokens that was added to the wallet.
|
|
61
66
|
*/
|
|
62
67
|
addCIS2Tokens(accountAddress: string, tokenIds: string[], contractIndex: bigint, contractSubindex?: bigint): Promise<string[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Request that the user provides a proof for the given statement.
|
|
70
|
+
* @param accountAddress the address of the account that should prove the statement.
|
|
71
|
+
* @param statement the id statement that should be proven.
|
|
72
|
+
* @param challenge bytes chosen by the verifier. Should be HEX encoded.
|
|
73
|
+
* @returns The id proof and the id of the credential used to prove it.
|
|
74
|
+
*/
|
|
75
|
+
requestIdProof(accountAddress: string, statement: IdStatement, challenge: string): Promise<IdProofOutput>;
|
|
63
76
|
}
|
|
64
77
|
export declare type WalletApi = MainWalletApi & EventListeners;
|
|
65
78
|
export {};
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
2
|
+
"name": "@concordium/browser-wallet-api-helpers",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"packageManager": "yarn@3.2.0",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"browser": "lib/concordiumHelpers.min.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"/lib/**/*"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/Concordium/concordium-browser-wallet"
|
|
15
|
+
},
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Concordium Software",
|
|
18
|
+
"email": "support@concordium.software",
|
|
19
|
+
"url": "https://concordium.com"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@concordium/web-sdk": "^3.1.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/core": "^7.17.10",
|
|
26
|
+
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
|
|
27
|
+
"@babel/plugin-transform-runtime": "^7.12.1",
|
|
28
|
+
"@babel/preset-env": "^7.12.1",
|
|
29
|
+
"typescript": "^4.3.5",
|
|
30
|
+
"webpack": "^5.72.0",
|
|
31
|
+
"webpack-cli": "^4.9.2"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc && webpack"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 2.0.0
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
|
|
7
|
-
- Entrypoint to suggest CIS-2 tokens to be added to the connected account's view.
|
|
8
|
-
|
|
9
|
-
### (Breaking) Changed
|
|
10
|
-
|
|
11
|
-
- Updated web-sdk to version 3, which changes field names in some transaction payloads for sendTransaction entrypoint.
|
|
12
|
-
|
|
13
|
-
## 1.0.0
|
|
14
|
-
|
|
15
|
-
### Changed
|
|
16
|
-
|
|
17
|
-
- Fixed broken link + typos in README
|
|
18
|
-
- Removed parameters from smart contract types' payloads, due the wallet ignoring it in favor of separate arguments.
|
|
19
|
-
|
|
20
|
-
## 0.2.0
|
|
21
|
-
|
|
22
|
-
### Added
|
|
23
|
-
|
|
24
|
-
- Expose a JSON-RPC client, using the wallet's current JSON-RPC server.
|
|
25
|
-
- `getMostRecentlySelectedAccount` method. This method allows dApps to get the most prioritized account without using `connect`. In a future release it will be updated to actually return the most recently selected account.
|
|
26
|
-
|
|
27
|
-
### (Breaking) Changed
|
|
28
|
-
|
|
29
|
-
- Updated API of sendTransaction and signMessage to require the account address.
|
|
30
|
-
- Updated API to include an 'accountDisconnected' event.
|
|
31
|
-
|
|
32
|
-
## 0.1.1
|
|
33
|
-
|
|
34
|
-
- sendTransaction can now take a 5th argument, which is the schema's version. This will allow V1 contract parameters to be serialized.
|
|
35
|
-
|
|
36
|
-
## 0.1.0
|
|
37
|
-
|
|
38
|
-
- Initialized from the old browser-wallet-api-types package.
|
|
39
|
-
- Added method for detecting the injected Concordium browser wallet API.
|