@concordium/browser-wallet-api-helpers 3.2.0 → 3.3.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 +12 -2
- package/lib/wallet-api-types.d.ts +26 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
### Unreleased
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 3.3.0
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `ContractSchema` for `sendSponsoredTransaction` entrypoint for sponsored contract updates
|
|
10
|
+
|
|
11
|
+
## 3.2.0
|
|
12
|
+
|
|
13
|
+
### Added
|
|
6
14
|
|
|
7
15
|
- Added `requestVerifiablePresentationV1` entrypoint to prove statements about identities and verifiable credentials with auditable anchor
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
## 3.1.0
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
10
20
|
|
|
11
21
|
- Updated handler `sendTransaction` with new payload type `TokenUpdatePayload`
|
|
12
22
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AccountAddress, AccountTransactionInput, AccountTransactionSignature, AccountTransactionType, Base58String, Base64String, ConfigureBakerPayload, ConfigureDelegationPayload, ContractAddress, ContractName, CredentialStatements, CredentialSubject, DeployModulePayload, EntrypointName, HexString, IdProofOutput, IdStatement, InitContractInput, Payload, RegisterDataPayload, SchemaVersion, SimpleTransferPayload, SimpleTransferWithMemoPayload, TokenUpdatePayload, Transaction, UpdateContractInput, UpdateCredentialsInput, VerifiablePresentation, VerifiablePresentationV1, VerificationRequestV1 } from '@concordium/web-sdk';
|
|
2
3
|
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
|
3
4
|
import { LaxNumberEnumValue, LaxStringEnumValue } from './util';
|
|
4
5
|
export interface MetadataUrl {
|
|
@@ -60,6 +61,20 @@ export type SchemaWithContext = {
|
|
|
60
61
|
};
|
|
61
62
|
export type AccountAddressSource = Base58String | AccountAddress.Type;
|
|
62
63
|
export type SchemaSource = Base64String | SchemaWithContext;
|
|
64
|
+
export type ModuleSchema = {
|
|
65
|
+
type: 'ModuleSchema';
|
|
66
|
+
value: Buffer;
|
|
67
|
+
version?: SchemaVersion;
|
|
68
|
+
};
|
|
69
|
+
export type TypeSchema = {
|
|
70
|
+
type: 'TypeSchema';
|
|
71
|
+
value: Buffer;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Discriminated union type for contract invocation schemas.
|
|
75
|
+
* Is used to select the correct method for encoding the invocation parameters using the schema.
|
|
76
|
+
*/
|
|
77
|
+
export type ContractSchema = ModuleSchema | TypeSchema;
|
|
63
78
|
type EventListener<Args extends any[]> = (...args: Args) => void;
|
|
64
79
|
interface Listeners<T extends EventType, Args extends any[]> {
|
|
65
80
|
on(eventName: T | `${T}`, listener: EventListener<Args>): this;
|
|
@@ -155,6 +170,16 @@ interface MainWalletApi {
|
|
|
155
170
|
* @param payload the payload of the transaction to be signed and sent. Note that for smart contract transactions, the payload should not contain the parameters, those should instead be provided in the subsequent argument instead.
|
|
156
171
|
*/
|
|
157
172
|
sendTransaction(accountAddress: AccountAddressSource, type: LaxNumberEnumValue<AccountTransactionType.ConfigureDelegation>, payload: ConfigureDelegationPayload): Promise<string>;
|
|
173
|
+
/**
|
|
174
|
+
* Sends a transaction signed by sponsor to the Concordium Wallet and awaits the users action.
|
|
175
|
+
* Note that a header is sent, and constructed by the sponsor.
|
|
176
|
+
* Note that if the user rejects signing the transaction, this will throw an error.
|
|
177
|
+
* @param accountAddress the address of the account that should sign the transaction
|
|
178
|
+
* @param transaction the sponsored transaction with header to be signed and sent.
|
|
179
|
+
* @param contractSchema A schema describing how to deserialize the contract parameter in the payload.
|
|
180
|
+
* This is only required for smart contract transactions, in order to enable users to verify the details of the transaction they are signing.
|
|
181
|
+
*/
|
|
182
|
+
sendSponsoredTransaction(accountAddress: AccountAddressSource, transaction: Transaction.Signable<Payload.UpdateContract | Payload.InitContract>, contractSchema: ContractSchema): Promise<string>;
|
|
158
183
|
/**
|
|
159
184
|
* Sends a transaction signed by sponsor to the Concordium Wallet and awaits the users action.
|
|
160
185
|
* Note that a header is sent, and constructed by the sponsor.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@concordium/browser-wallet-api-helpers",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"packageManager": "yarn@3.2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"webpack-cli": "^4.9.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@concordium/web-sdk": "^12.0.
|
|
43
|
+
"@concordium/web-sdk": "^12.0.2",
|
|
44
44
|
"@protobuf-ts/runtime-rpc": "^2.9.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|