@concordium/browser-wallet-api-helpers 3.3.0-alpha.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
CHANGED
|
@@ -2,10 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
### Unreleased
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
## 3.3.0
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
7
9
|
- Added `ContractSchema` for `sendSponsoredTransaction` entrypoint for sponsored contract updates
|
|
8
10
|
|
|
11
|
+
## 3.2.0
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Added `requestVerifiablePresentationV1` entrypoint to prove statements about identities and verifiable credentials with auditable anchor
|
|
16
|
+
|
|
17
|
+
## 3.1.0
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Updated handler `sendTransaction` with new payload type `TokenUpdatePayload`
|
|
22
|
+
|
|
9
23
|
## 3.0.1
|
|
10
24
|
|
|
11
25
|
### Fixed
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.concordiumHelpers=o():e.concordiumHelpers=o()}(self,(
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.concordiumHelpers=o():e.concordiumHelpers=o()}(self,()=>(()=>{"use strict";var e={488:(e,o,n)=>{Object.defineProperty(o,"__esModule",{value:!0});var t={detectConcordiumProvider:!0};Object.defineProperty(o,"detectConcordiumProvider",{enumerable:!0,get:function(){return i.detectConcordiumProvider}});var r=n(702);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in o&&o[e]===r[e]||Object.defineProperty(o,e,{enumerable:!0,get:function(){return r[e]}}))});var c=n(786);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in o&&o[e]===c[e]||Object.defineProperty(o,e,{enumerable:!0,get:function(){return c[e]}}))});var i=n(972)},702:(e,o)=>{var n,t;Object.defineProperty(o,"__esModule",{value:!0}),o.SchemaType=o.EventType=void 0,o.EventType=n,function(e){e.AccountChanged="accountChanged",e.AccountDisconnected="accountDisconnected",e.ChainChanged="chainChanged"}(n||(o.EventType=n={})),o.SchemaType=t,function(e){e.Module="module",e.Parameter="parameter"}(t||(o.SchemaType=t={}))},786:(e,o)=>{Object.defineProperty(o,"__esModule",{value:!0})},972:(e,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.detectConcordiumProvider=async function(e=5e3){return new Promise((o,n)=>{if(window.concordium)o(window.concordium);else{const t=setTimeout(()=>{window.concordium?o(window.concordium):n()},e);window.addEventListener("concordium#initialized",()=>{window.concordium&&(clearTimeout(t),o(window.concordium))},{once:!0})}})}}},o={};return function n(t){var r=o[t];if(void 0!==r)return r.exports;var c=o[t]={exports:{}};return e[t](c,c.exports,n),c.exports}(488)})());
|
|
2
2
|
//# sourceMappingURL=concordiumHelpers.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concordiumHelpers.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA2B,kBAAID,IAE/BD,EAAwB,kBAAIC,GAC7B,CATD,CASGK,
|
|
1
|
+
{"version":3,"file":"concordiumHelpers.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA2B,kBAAID,IAE/BD,EAAwB,kBAAIC,GAC7B,CATD,CASGK,KAAM,I,mPCTT,4NACA,4NACA,Y,cCCO,IAAIC,EAMAC,E,+FALX,SAAWD,GACPA,EAAS,eAAqB,iBAC9BA,EAAS,oBAA0B,sBACnCA,EAAS,aAAmB,cAHhC,EAIGA,IAAc,EAAAA,UAAAA,EAAY,CAAC,I,eAE9B,SAAWC,GACPA,EAAU,OAAa,SACvBA,EAAU,UAAgB,WAF9B,EAGGA,IAAe,EAAAA,WAAAA,EAAa,CAAC,G,wJCPzBC,eAAwCC,EAAU,KACrD,OAAO,IAAIC,QAAQ,CAACC,EAASC,KACzB,GAAIC,OAAOC,WACPH,EAAQE,OAAOC,gBAEd,CACD,MAAMC,EAAIC,WAAW,KACbH,OAAOC,WACPH,EAAQE,OAAOC,YAGfF,KAELH,GACHI,OAAOI,iBAAiB,yBAA0B,KAC1CJ,OAAOC,aACPI,aAAaH,GACbJ,EAAQE,OAAOC,cAEpB,CAAEK,MAAM,GACd,GAER,C,GC3BGC,EAA2B,CAAC,E,OAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAatB,QAGrB,IAAIC,EAASkB,EAAyBE,GAAY,CAGjDrB,QAAS,CAAC,GAOX,OAHAwB,EAAoBH,GAAUpB,EAAQA,EAAOD,QAASoB,GAG/CnB,EAAOD,OACf,CCnB0BoB,CAAoB,I","sources":["webpack:///webpack/universalModuleDefinition","webpack:///./lib/index.js","webpack:///./lib/wallet-api-types.js","webpack:///./lib/detector.js","webpack:///webpack/bootstrap","webpack:///webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"concordiumHelpers\"] = factory();\n\telse\n\t\troot[\"concordiumHelpers\"] = factory();\n})(self, () => {\nreturn ","export * from './wallet-api-types';\nexport * from './util';\nexport { detectConcordiumProvider } from './detector';\n","/**\n * An enumeration of the events that can be emitted by the WalletApi.\n */\nexport var EventType;\n(function (EventType) {\n EventType[\"AccountChanged\"] = \"accountChanged\";\n EventType[\"AccountDisconnected\"] = \"accountDisconnected\";\n EventType[\"ChainChanged\"] = \"chainChanged\";\n})(EventType || (EventType = {}));\nexport var SchemaType;\n(function (SchemaType) {\n SchemaType[\"Module\"] = \"module\";\n SchemaType[\"Parameter\"] = \"parameter\";\n})(SchemaType || (SchemaType = {}));\n","/**\n * Detect the Concordium browser wallet API by waiting for it to have been successfully injected\n * into the window so that it is ready for use.\n * @param timeout determines how long to wait before rejecting if the Concordium provider is not available, in milliseconds.\n * @returns a promise containing the Concordium Wallet provider API.\n */\nexport async function detectConcordiumProvider(timeout = 5000) {\n return new Promise((resolve, reject) => {\n if (window.concordium) {\n resolve(window.concordium);\n }\n else {\n const t = setTimeout(() => {\n if (window.concordium) {\n resolve(window.concordium);\n }\n else {\n reject();\n }\n }, timeout);\n window.addEventListener('concordium#initialized', () => {\n if (window.concordium) {\n clearTimeout(t);\n resolve(window.concordium);\n }\n }, { once: true });\n }\n });\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(488);\n"],"names":["root","factory","exports","module","define","amd","self","EventType","SchemaType","async","timeout","Promise","resolve","reject","window","concordium","t","setTimeout","addEventListener","clearTimeout","once","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
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';
|
|
3
3
|
import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
|
|
4
4
|
import { LaxNumberEnumValue, LaxStringEnumValue } from './util';
|
|
5
5
|
export interface MetadataUrl {
|
|
@@ -176,18 +176,18 @@ interface MainWalletApi {
|
|
|
176
176
|
* Note that if the user rejects signing the transaction, this will throw an error.
|
|
177
177
|
* @param accountAddress the address of the account that should sign the transaction
|
|
178
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.
|
|
179
181
|
*/
|
|
180
|
-
sendSponsoredTransaction(accountAddress: AccountAddressSource, transaction:
|
|
182
|
+
sendSponsoredTransaction(accountAddress: AccountAddressSource, transaction: Transaction.Signable<Payload.UpdateContract | Payload.InitContract>, contractSchema: ContractSchema): Promise<string>;
|
|
181
183
|
/**
|
|
182
184
|
* Sends a transaction signed by sponsor to the Concordium Wallet and awaits the users action.
|
|
183
185
|
* Note that a header is sent, and constructed by the sponsor.
|
|
184
186
|
* Note that if the user rejects signing the transaction, this will throw an error.
|
|
185
187
|
* @param accountAddress the address of the account that should sign the transaction
|
|
186
188
|
* @param transaction the sponsored transaction with header to be signed and sent.
|
|
187
|
-
* @param [contractSchema] A schema describing how to deserialize the contract parameter in the payload.
|
|
188
|
-
* This is only required for smart contract transactions, in order to enable users to verify the details of the transaction they are signing.
|
|
189
189
|
*/
|
|
190
|
-
sendSponsoredTransaction(accountAddress: AccountAddressSource, transaction: SignableTransaction
|
|
190
|
+
sendSponsoredTransaction(accountAddress: AccountAddressSource, transaction: SignableTransaction): Promise<string>;
|
|
191
191
|
/**
|
|
192
192
|
* Sends a message to the Concordium Wallet and awaits the users action. If the user signs the message, this will resolve to the signature.
|
|
193
193
|
* Note that if the user rejects signing the message, this will throw an error.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@concordium/browser-wallet-api-helpers",
|
|
3
|
-
"version": "3.3.0
|
|
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": {
|