@notabene/javascript-sdk 1.34.0 → 2.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/.gitlab-ci.yml +12 -1
  2. package/.husky/commit-msg +0 -0
  3. package/.husky/pre-commit +0 -0
  4. package/.husky/pre-push +1 -1
  5. package/.vscode/extensions.json +1 -5
  6. package/.vscode/settings.json +4 -4
  7. package/.yarn/releases/yarn-berry.cjs +925 -0
  8. package/.yarnrc.yml +3 -0
  9. package/README.md +126 -69
  10. package/api-extractor.json +434 -0
  11. package/dist/notabene.cjs +1 -0
  12. package/dist/notabene.d.ts +678 -0
  13. package/dist/notabene.js +187 -0
  14. package/dist/tsdoc-metadata.json +11 -0
  15. package/eslint.config.js +24 -0
  16. package/etc/javascript-sdk.api.md +363 -0
  17. package/index.html +137 -0
  18. package/package.json +27 -53
  19. package/src/__tests__/notabene.test.ts +116 -0
  20. package/src/arbitraries.ts +13 -0
  21. package/src/components/EmbeddedComponent.ts +110 -0
  22. package/src/components/__tests__/EmbeddedComponent.test.ts +160 -0
  23. package/src/ivms/types.ts +2 -0
  24. package/src/notabene.ts +173 -289
  25. package/src/types.ts +380 -49
  26. package/src/utils/MessageEventManager.ts +55 -0
  27. package/src/utils/__tests__/MessageEventManager.test.ts +95 -0
  28. package/src/utils/arbitraries.ts +21 -0
  29. package/src/utils/caip.ts +16 -0
  30. package/src/utils/urls.ts +15 -0
  31. package/temp/javascript-sdk.api.json +3509 -0
  32. package/temp/javascript-sdk.api.md +363 -0
  33. package/ts-out/src/__tests__/notabene.test.d.ts +1 -0
  34. package/ts-out/src/__tests__/notabene.test.js +88 -0
  35. package/ts-out/src/arbitraries.d.ts +4 -0
  36. package/ts-out/src/arbitraries.js +8 -0
  37. package/ts-out/src/components/EmbeddedComponent.d.ts +25 -0
  38. package/ts-out/src/components/EmbeddedComponent.js +87 -0
  39. package/ts-out/src/components/__tests__/EmbeddedComponent.test.d.ts +1 -0
  40. package/ts-out/src/components/__tests__/EmbeddedComponent.test.js +132 -0
  41. package/ts-out/src/ivms/types.d.ts +252 -0
  42. package/ts-out/src/ivms/types.js +1 -0
  43. package/ts-out/src/notabene.d.ts +35 -0
  44. package/ts-out/src/notabene.js +59 -0
  45. package/ts-out/src/types.d.ts +357 -0
  46. package/ts-out/src/types.js +85 -0
  47. package/ts-out/src/utils/MessageEventManager.d.ts +12 -0
  48. package/ts-out/src/utils/MessageEventManager.js +45 -0
  49. package/ts-out/src/utils/__tests__/MessageEventManager.test.d.ts +1 -0
  50. package/ts-out/src/utils/__tests__/MessageEventManager.test.js +73 -0
  51. package/ts-out/src/utils/arbitraries.d.ts +6 -0
  52. package/ts-out/src/utils/arbitraries.js +7 -0
  53. package/ts-out/src/utils/caip.d.ts +13 -0
  54. package/ts-out/src/utils/caip.js +15 -0
  55. package/ts-out/src/utils/urls.d.ts +1 -0
  56. package/ts-out/src/utils/urls.js +14 -0
  57. package/ts-out/tsconfig.tsbuildinfo +1 -0
  58. package/tsconfig.json +15 -11
  59. package/tsconfig.tsbuildinfo +1 -0
  60. package/vite.config.js +13 -0
  61. package/.envrc.template +0 -1
  62. package/.eslintignore +0 -3
  63. package/.eslintrc.js +0 -13
  64. package/.nvmrc +0 -1
  65. package/.tool-versions +0 -3
  66. package/dist/es/index.js +0 -1
  67. package/dist/lib/index.js +0 -376
  68. package/jest.config.js +0 -5
  69. package/public/index.html +0 -93
  70. package/public/js/.gitkeep +0 -0
  71. package/src/lib/index.ts +0 -2
  72. package/src/module/index.ts +0 -10
  73. package/src/zoidComponentProps.ts +0 -81
package/jest.config.js DELETED
@@ -1,5 +0,0 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- };
package/public/index.html DELETED
@@ -1,93 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- ​
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
- <title>Notabene Widget Example</title>
9
- <script id="notabene" async src="http://localhost:3002/js/notabene.js"></script>
10
- <script>
11
- document.querySelector('#notabene').addEventListener('load', function () {
12
- const nb = new Notabene({
13
- widget: 'http://localhost:8080',
14
- container: '#container',
15
- authToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE2NzI2ODY0ODMsImV4cCI6bnVsbCwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL2FwaS5ub3RhYmVuZS5pZC9zY2hlbWFzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJBY2Nlc3NUb2tlbiJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJub25jZSI6ImFlZDY4YjllLWUxODEtNDRkMy1hOTdkLTYyODBjODA0NDZlMiIsInNjb3BlIjoiY3VzdG9tZXIifX0sInN1YiI6ImRpZDpldGhyOjB4YzZiMGRiYTRjOGYzNmQ3NjQxYjU4MjEwYzg1ZjI3Mjk1NDcyZmQxMyIsImlzcyI6ImRpZDpldGhyOjB4YzZiMGRiYTRjOGYzNmQ3NjQxYjU4MjEwYzg1ZjI3Mjk1NDcyZmQxMyJ9.-qdoEeJrRcYvtleGJhPDXD-crS0xDLjz3idUevEZKCevD64wjFugKaSP5ncenRSPVezHTNHdIRWlh7Cy6gX8jwE',
16
- onValidStateChange: (isValid) => {
17
- console.log(nb.tx);
18
- if(isValid){
19
- console.log('tx: %o',nb.tx)
20
- }
21
- },
22
- onError: (err) => {
23
- // If any errors are encountered, this function will be called.
24
- console.error(err.message);
25
- },
26
- vaspDID: 'did:ethr:0x8e73ea19a72e89f20339f5a9e4cda8e4b230455c',
27
- theme:{
28
- // primaryColor: '#fff',
29
- // primaryFontColor: '#fff',
30
- // secondaryFontColor: '#fff',
31
- // backgroundColor: 'black',
32
- // mode: 'dark',
33
- },
34
- // transactionTypeAllowed: 'VASP_2_VASP_ONLY',
35
- nonCustodialDeclarationType: 'DECLARATION',
36
- optInFeatures: ['REUSE_ADDRESS_OWNERSHIP_PROOF'],
37
-
38
- // @deprecated
39
- // beneficiaryDetails: ['beneficiaryNationalIdentification'],
40
-
41
- // fieldsProps: {
42
- // nationalIdentification: {
43
- // forceDisplay: true,
44
- // },
45
- // dateAndPlaceOfBirth: {
46
- // forceDisplay: true,
47
- // },
48
- // geographicAddress: {
49
- // forceDisplay: true,
50
- // optional: true
51
- // },
52
- // counterparty: {
53
- // optional: true
54
- // }
55
- // }
56
- fallbacks: [{flow: "WALLET_NOT_SUPPORTED", action: "REJECT"}]
57
- });
58
- nb.setTransaction({
59
- transactionAsset: 'BTC',
60
- // originatorAccountNumber: '0xdc0fF33a148031FasdfD1DE1e18e23456b25E1d8',
61
- beneficiaryAccountNumber: '0x8e73ea19a72e89f20339f5a9e4cda8e4b230455c',
62
- transactionAmount: '400000000000',
63
- });
64
-
65
- switch (window.location.hash.substr(1)) {
66
- case "post_deposit":
67
- nb.renderWidget('POST_DEPOSIT');
68
- break;
69
- case "withdrawal":
70
- default:
71
- nb.renderWidget('WITHDRAWAL');
72
- break;
73
- }
74
- });
75
- </script>
76
- </head>
77
- ​
78
- <body>
79
- <div id="container">
80
- </body>
81
- ​
82
- </html>
83
-
84
- <style>
85
- body{
86
- margin: 0;
87
- padding: 0;
88
- }
89
- #container{
90
- max-width: 100vw;
91
-
92
- }
93
- </style>
File without changes
package/src/lib/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as Notabene } from '../notabene';
2
- export * from '../types';
@@ -1,10 +0,0 @@
1
- import Notabene from '../notabene';
2
- export * from '../types';
3
-
4
- declare global {
5
- interface Window {
6
- Notabene: typeof Notabene;
7
- }
8
- }
9
-
10
- if (window) window.Notabene = Notabene;
@@ -1,81 +0,0 @@
1
- const generalProps = {
2
- vaspDID: {
3
- type: 'string',
4
- required: true,
5
- },
6
- transaction: {
7
- type: 'object',
8
- required: false,
9
- },
10
- error: {
11
- type: 'object',
12
- required: false,
13
- },
14
- onError: {
15
- type: 'function',
16
- required: true,
17
- },
18
- storeTransaction: {
19
- type: 'function',
20
- required: true,
21
- },
22
- theme: {
23
- type: 'object',
24
- required: false,
25
- },
26
- dictionary: {
27
- type: 'object',
28
- required: false,
29
- },
30
- transactionTypeAllowed: {
31
- type: 'string',
32
- required: false,
33
- },
34
- nonCustodialDeclarationType: {
35
- type: 'string',
36
- required: false,
37
- },
38
- beneficiaryDetails: {
39
- type: 'array',
40
- required: false,
41
- },
42
- fieldsProps: {
43
- type: 'object',
44
- required: false,
45
- },
46
- fallbacks: {
47
- type: 'array',
48
- required: false,
49
- },
50
- optInFeatures: {
51
- type: 'array',
52
- required: false,
53
- },
54
- };
55
-
56
- export const widgetProps = {
57
- ...generalProps,
58
- onRequireAdditionalInformation: {
59
- type: 'function',
60
- required: true,
61
- },
62
- onValidStateChange: {
63
- type: 'function',
64
- required: true,
65
- },
66
- };
67
-
68
- export const popupProps = {
69
- ...generalProps,
70
- close: {
71
- type: 'function',
72
- },
73
- popupOpen: {
74
- type: 'boolean',
75
- required: true,
76
- },
77
- setPopupOpen: {
78
- type: 'function',
79
- required: true,
80
- },
81
- };