@dfx.swiss/react 1.3.0-beta.99 → 1.3.1-beta.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/dist/contexts/asset.context.js +2 -2
- package/dist/contexts/asset.context.js.map +1 -1
- package/dist/contexts/auth.context.d.ts +2 -2
- package/dist/contexts/auth.context.d.ts.map +1 -1
- package/dist/contexts/auth.context.js +23 -19
- package/dist/contexts/auth.context.js.map +1 -1
- package/dist/contexts/bank-account.context.d.ts +2 -1
- package/dist/contexts/bank-account.context.d.ts.map +1 -1
- package/dist/contexts/bank-account.context.js +58 -35
- package/dist/contexts/bank-account.context.js.map +1 -1
- package/dist/contexts/payment-routes.context.d.ts +6 -2
- package/dist/contexts/payment-routes.context.d.ts.map +1 -1
- package/dist/contexts/payment-routes.context.js +55 -5
- package/dist/contexts/payment-routes.context.js.map +1 -1
- package/dist/contexts/session.context.d.ts +2 -2
- package/dist/contexts/session.context.d.ts.map +1 -1
- package/dist/contexts/session.context.js +7 -15
- package/dist/contexts/session.context.js.map +1 -1
- package/dist/contexts/support.context.js +1 -1
- package/dist/contexts/support.context.js.map +1 -1
- package/dist/contexts/user.context.d.ts +7 -2
- package/dist/contexts/user.context.d.ts.map +1 -1
- package/dist/contexts/user.context.js +180 -164
- package/dist/contexts/user.context.js.map +1 -1
- package/dist/definitions/aml.d.ts +2 -0
- package/dist/definitions/aml.d.ts.map +1 -0
- package/dist/definitions/aml.js +2 -0
- package/dist/definitions/aml.js.map +1 -0
- package/dist/definitions/asset.d.ts +2 -32
- package/dist/definitions/asset.d.ts.map +1 -1
- package/dist/definitions/asset.js +1 -11
- package/dist/definitions/asset.js.map +1 -1
- package/dist/definitions/auth.d.ts +2 -25
- package/dist/definitions/auth.d.ts.map +1 -1
- package/dist/definitions/auth.js +1 -9
- package/dist/definitions/auth.js.map +1 -1
- package/dist/definitions/bank-account.d.ts +2 -12
- package/dist/definitions/bank-account.d.ts.map +1 -1
- package/dist/definitions/bank-account.js +1 -5
- package/dist/definitions/bank-account.js.map +1 -1
- package/dist/definitions/bank.d.ts +2 -9
- package/dist/definitions/bank.d.ts.map +1 -1
- package/dist/definitions/bank.js +1 -3
- package/dist/definitions/bank.js.map +1 -1
- package/dist/definitions/blockchain.d.ts +1 -16
- package/dist/definitions/blockchain.d.ts.map +1 -1
- package/dist/definitions/blockchain.js +1 -17
- package/dist/definitions/blockchain.js.map +1 -1
- package/dist/definitions/buy.d.ts +2 -55
- package/dist/definitions/buy.d.ts.map +1 -1
- package/dist/definitions/buy.js +1 -4
- package/dist/definitions/buy.js.map +1 -1
- package/dist/definitions/country.d.ts +2 -13
- package/dist/definitions/country.d.ts.map +1 -1
- package/dist/definitions/country.js +1 -1
- package/dist/definitions/country.js.map +1 -1
- package/dist/definitions/error.d.ts +2 -4
- package/dist/definitions/error.d.ts.map +1 -1
- package/dist/definitions/error.js +1 -1
- package/dist/definitions/error.js.map +1 -1
- package/dist/definitions/fees.d.ts +1 -9
- package/dist/definitions/fees.d.ts.map +1 -1
- package/dist/definitions/fiat.d.ts +2 -13
- package/dist/definitions/fiat.d.ts.map +1 -1
- package/dist/definitions/fiat.js +1 -1
- package/dist/definitions/fiat.js.map +1 -1
- package/dist/definitions/file.d.ts +2 -0
- package/dist/definitions/file.d.ts.map +1 -0
- package/dist/definitions/file.js +2 -0
- package/dist/definitions/file.js.map +1 -0
- package/dist/definitions/jwt.d.ts +2 -20
- package/dist/definitions/jwt.d.ts.map +1 -1
- package/dist/definitions/jwt.js +1 -11
- package/dist/definitions/jwt.js.map +1 -1
- package/dist/definitions/kyc.d.ts +2 -274
- package/dist/definitions/kyc.d.ts.map +1 -1
- package/dist/definitions/kyc.js +1 -179
- package/dist/definitions/kyc.js.map +1 -1
- package/dist/definitions/language.d.ts +2 -10
- package/dist/definitions/language.d.ts.map +1 -1
- package/dist/definitions/language.js +1 -1
- package/dist/definitions/language.js.map +1 -1
- package/dist/definitions/price-step.d.ts +1 -7
- package/dist/definitions/price-step.d.ts.map +1 -1
- package/dist/definitions/route.d.ts +2 -132
- package/dist/definitions/route.d.ts.map +1 -1
- package/dist/definitions/route.js +1 -24
- package/dist/definitions/route.js.map +1 -1
- package/dist/definitions/sell.d.ts +2 -47
- package/dist/definitions/sell.d.ts.map +1 -1
- package/dist/definitions/sell.js +1 -1
- package/dist/definitions/sell.js.map +1 -1
- package/dist/definitions/session.d.ts +1 -9
- package/dist/definitions/session.d.ts.map +1 -1
- package/dist/definitions/settings.d.ts +2 -9
- package/dist/definitions/settings.d.ts.map +1 -1
- package/dist/definitions/settings.js +1 -1
- package/dist/definitions/settings.js.map +1 -1
- package/dist/definitions/support.d.ts +2 -100
- package/dist/definitions/support.d.ts.map +1 -1
- package/dist/definitions/support.js +1 -37
- package/dist/definitions/support.js.map +1 -1
- package/dist/definitions/swap.d.ts +2 -39
- package/dist/definitions/swap.d.ts.map +1 -1
- package/dist/definitions/swap.js +1 -1
- package/dist/definitions/swap.js.map +1 -1
- package/dist/definitions/transaction.d.ts +2 -156
- package/dist/definitions/transaction.d.ts.map +1 -1
- package/dist/definitions/transaction.js +1 -86
- package/dist/definitions/transaction.js.map +1 -1
- package/dist/definitions/user.d.ts +2 -86
- package/dist/definitions/user.d.ts.map +1 -1
- package/dist/definitions/user.js +1 -19
- package/dist/definitions/user.js.map +1 -1
- package/dist/hooks/api-session.hook.d.ts +3 -2
- package/dist/hooks/api-session.hook.d.ts.map +1 -1
- package/dist/hooks/api-session.hook.js +30 -38
- package/dist/hooks/api-session.hook.js.map +1 -1
- package/dist/hooks/api.hook.d.ts +7 -1
- package/dist/hooks/api.hook.d.ts.map +1 -1
- package/dist/hooks/api.hook.js +57 -26
- package/dist/hooks/api.hook.js.map +1 -1
- package/dist/hooks/asset.hook.d.ts.map +1 -1
- package/dist/hooks/asset.hook.js +19 -20
- package/dist/hooks/asset.hook.js.map +1 -1
- package/dist/hooks/auth.hook.d.ts +5 -5
- package/dist/hooks/auth.hook.d.ts.map +1 -1
- package/dist/hooks/auth.hook.js +76 -60
- package/dist/hooks/auth.hook.js.map +1 -1
- package/dist/hooks/bank-account.hook.d.ts +2 -0
- package/dist/hooks/bank-account.hook.d.ts.map +1 -1
- package/dist/hooks/bank-account.hook.js +17 -22
- package/dist/hooks/bank-account.hook.js.map +1 -1
- package/dist/hooks/buy.hook.d.ts +3 -2
- package/dist/hooks/buy.hook.d.ts.map +1 -1
- package/dist/hooks/buy.hook.js +17 -14
- package/dist/hooks/buy.hook.js.map +1 -1
- package/dist/hooks/country.hook.js +7 -8
- package/dist/hooks/country.hook.js.map +1 -1
- package/dist/hooks/fiat.hook.d.ts.map +1 -1
- package/dist/hooks/fiat.hook.js +18 -16
- package/dist/hooks/fiat.hook.js.map +1 -1
- package/dist/hooks/kyc.hook.d.ts +20 -9
- package/dist/hooks/kyc.hook.d.ts.map +1 -1
- package/dist/hooks/kyc.hook.js +216 -156
- package/dist/hooks/kyc.hook.js.map +1 -1
- package/dist/hooks/language.hook.d.ts.map +1 -1
- package/dist/hooks/language.hook.js +12 -12
- package/dist/hooks/language.hook.js.map +1 -1
- package/dist/hooks/payment-routes.hook.d.ts +9 -1
- package/dist/hooks/payment-routes.hook.d.ts.map +1 -1
- package/dist/hooks/payment-routes.hook.js +139 -71
- package/dist/hooks/payment-routes.hook.js.map +1 -1
- package/dist/hooks/sell.hook.d.ts +4 -2
- package/dist/hooks/sell.hook.d.ts.map +1 -1
- package/dist/hooks/sell.hook.js +19 -6
- package/dist/hooks/sell.hook.js.map +1 -1
- package/dist/hooks/settings.hook.js +7 -8
- package/dist/hooks/settings.hook.js.map +1 -1
- package/dist/hooks/store.hook.d.ts +1 -1
- package/dist/hooks/store.hook.d.ts.map +1 -1
- package/dist/hooks/store.hook.js +4 -15
- package/dist/hooks/store.hook.js.map +1 -1
- package/dist/hooks/support.hook.d.ts.map +1 -1
- package/dist/hooks/support.hook.js +40 -49
- package/dist/hooks/support.hook.js.map +1 -1
- package/dist/hooks/swap.hook.d.ts +4 -2
- package/dist/hooks/swap.hook.d.ts.map +1 -1
- package/dist/hooks/swap.hook.js +16 -8
- package/dist/hooks/swap.hook.js.map +1 -1
- package/dist/hooks/transaction.hook.d.ts +3 -0
- package/dist/hooks/transaction.hook.d.ts.map +1 -1
- package/dist/hooks/transaction.hook.js +115 -104
- package/dist/hooks/transaction.hook.js.map +1 -1
- package/dist/hooks/user.hook.d.ts +4 -2
- package/dist/hooks/user.hook.d.ts.map +1 -1
- package/dist/hooks/user.hook.js +24 -3
- package/dist/hooks/user.hook.js.map +1 -1
- package/dist/index.d.ts +21 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +1 -17
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -65
- package/dist/utils.js.map +1 -1
- package/dist/validations.d.ts +2 -26
- package/dist/validations.d.ts.map +1 -1
- package/dist/validations.js +1 -79
- package/dist/validations.js.map +1 -1
- package/package.json +11 -4
- package/dist/definitions/blocked-iban.json +0 -1
- package/dist/definitions/lnurl.d.ts +0 -19
- package/dist/definitions/lnurl.d.ts.map +0 -1
- package/dist/definitions/lnurl.js +0 -2
- package/dist/definitions/lnurl.js.map +0 -1
- package/dist/hooks/lnurl.hook.d.ts +0 -6
- package/dist/hooks/lnurl.hook.d.ts.map +0 -1
- package/dist/hooks/lnurl.hook.js +0 -56
- package/dist/hooks/lnurl.hook.js.map +0 -1
package/dist/utils.d.ts
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
[K in keyof T]: T[K] extends U ? K : never;
|
|
3
|
-
}[keyof T];
|
|
4
|
-
export declare class Utils {
|
|
5
|
-
static groupBy<T, U>(list: T[], key: KeyType<T, U>): Map<U, T[]>;
|
|
6
|
-
static createRules(rules: any): any;
|
|
7
|
-
private static updateObject;
|
|
8
|
-
static formatAmount(amount?: number, decimals?: number): string;
|
|
9
|
-
static formatAmountCrypto(amount: number, decimals?: number): string;
|
|
10
|
-
static formatIban(iban?: string): string | null;
|
|
11
|
-
static isJwt(jwt?: string): boolean;
|
|
12
|
-
static buildQueryParams(params: {
|
|
13
|
-
[key: string]: string | number | undefined;
|
|
14
|
-
}): string;
|
|
15
|
-
static toBase64(file: File): Promise<string | undefined>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
export { Utils } from '@dfx.swiss/core';
|
|
18
2
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,66 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import * as IbanTools from 'ibantools';
|
|
13
|
-
var Utils = /** @class */ (function () {
|
|
14
|
-
function Utils() {
|
|
15
|
-
}
|
|
16
|
-
Utils.groupBy = function (list, key) {
|
|
17
|
-
return list.reduce(function (map, item) { var _a; return map.set(item[key], ((_a = map.get(item[key])) !== null && _a !== void 0 ? _a : []).concat(item)); }, new Map());
|
|
18
|
-
};
|
|
19
|
-
Utils.createRules = function (rules) {
|
|
20
|
-
for (var property in rules) {
|
|
21
|
-
if (rules[property] instanceof Array) {
|
|
22
|
-
rules[property] = rules[property].reduce(function (prev, curr) { return Utils.updateObject(prev, curr); }, {});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return rules;
|
|
26
|
-
};
|
|
27
|
-
Utils.updateObject = function (obj, update) {
|
|
28
|
-
return obj ? __assign(__assign({}, obj), update) : undefined;
|
|
29
|
-
};
|
|
30
|
-
Utils.formatAmount = function (amount, decimals) {
|
|
31
|
-
var _a;
|
|
32
|
-
if (decimals === void 0) { decimals = 2; }
|
|
33
|
-
return (_a = amount === null || amount === void 0 ? void 0 : amount.toFixed(decimals).replace(/\B(?=(\d{3})+(?!\d))/g, ' ')) !== null && _a !== void 0 ? _a : '';
|
|
34
|
-
};
|
|
35
|
-
Utils.formatAmountCrypto = function (amount, decimals) {
|
|
36
|
-
if (decimals === void 0) { decimals = 5; }
|
|
37
|
-
var r = (+amount.toPrecision(decimals)).toFixed(decimals);
|
|
38
|
-
if (r.match(/\./)) {
|
|
39
|
-
r = r.replace(/\.?0+$/, '');
|
|
40
|
-
}
|
|
41
|
-
return r;
|
|
42
|
-
};
|
|
43
|
-
Utils.formatIban = function (iban) {
|
|
44
|
-
return IbanTools.friendlyFormatIBAN(iban);
|
|
45
|
-
};
|
|
46
|
-
Utils.isJwt = function (jwt) {
|
|
47
|
-
return jwt ? /^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(jwt) : false;
|
|
48
|
-
};
|
|
49
|
-
Utils.buildQueryParams = function (params) {
|
|
50
|
-
return Object.keys(params)
|
|
51
|
-
.filter(function (key) { return params[key] !== undefined; })
|
|
52
|
-
.map(function (key) { return "".concat(key, "=").concat(encodeURIComponent(params[key])); })
|
|
53
|
-
.join('&');
|
|
54
|
-
};
|
|
55
|
-
Utils.toBase64 = function (file) {
|
|
56
|
-
return new Promise(function (resolve, reject) {
|
|
57
|
-
var reader = new FileReader();
|
|
58
|
-
reader.readAsDataURL(file);
|
|
59
|
-
reader.onload = function () { return resolve(reader.result ? reader.result : undefined); };
|
|
60
|
-
reader.onerror = function (e) { return reject(e); };
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
return Utils;
|
|
64
|
-
}());
|
|
65
|
-
export { Utils };
|
|
1
|
+
export { Utils } from '@dfx.swiss/core';
|
|
66
2
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/validations.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export type RequiredRule
|
|
3
|
-
required: {
|
|
4
|
-
value: boolean;
|
|
5
|
-
message: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export type PatternRule = {
|
|
9
|
-
pattern: {
|
|
10
|
-
value: RegExp;
|
|
11
|
-
message: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type CustomRule = {
|
|
15
|
-
validate: (value: any) => string | true;
|
|
16
|
-
};
|
|
17
|
-
export type ValidationRule = RequiredRule | PatternRule | CustomRule;
|
|
18
|
-
declare class ValidationsClass {
|
|
19
|
-
get Required(): RequiredRule;
|
|
20
|
-
get Mail(): PatternRule;
|
|
21
|
-
get Phone(): CustomRule;
|
|
22
|
-
Iban(countries: Country[]): CustomRule;
|
|
23
|
-
Custom(validator: (value: any) => true | string): CustomRule;
|
|
24
|
-
}
|
|
25
|
-
declare const Validations: ValidationsClass;
|
|
26
|
-
export default Validations;
|
|
1
|
+
export { Validations as default } from '@dfx.swiss/core';
|
|
2
|
+
export type { RequiredRule, PatternRule, CustomRule, ValidationRule } from '@dfx.swiss/core';
|
|
27
3
|
//# sourceMappingURL=validations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/validations.js
CHANGED
|
@@ -1,80 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import BlockedIbans from './definitions/blocked-iban.json';
|
|
3
|
-
import PhoneNumber from 'libphonenumber-js';
|
|
4
|
-
var regex = {
|
|
5
|
-
Mail: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
6
|
-
};
|
|
7
|
-
var ValidationsClass = /** @class */ (function () {
|
|
8
|
-
function ValidationsClass() {
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(ValidationsClass.prototype, "Required", {
|
|
11
|
-
get: function () {
|
|
12
|
-
return {
|
|
13
|
-
required: {
|
|
14
|
-
value: true,
|
|
15
|
-
message: 'required',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
enumerable: false,
|
|
20
|
-
configurable: true
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(ValidationsClass.prototype, "Mail", {
|
|
23
|
-
get: function () {
|
|
24
|
-
return {
|
|
25
|
-
pattern: {
|
|
26
|
-
value: regex.Mail,
|
|
27
|
-
message: 'pattern',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
enumerable: false,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(ValidationsClass.prototype, "Phone", {
|
|
35
|
-
get: function () {
|
|
36
|
-
return this.Custom(function (number) {
|
|
37
|
-
var _a;
|
|
38
|
-
try {
|
|
39
|
-
if (number) {
|
|
40
|
-
if (!number.match(/^\+\d/))
|
|
41
|
-
return 'code_and_number';
|
|
42
|
-
if (!((_a = PhoneNumber(number)) === null || _a === void 0 ? void 0 : _a.isValid()))
|
|
43
|
-
return 'pattern';
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
catch (_b) {
|
|
48
|
-
return 'pattern';
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
enumerable: false,
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
ValidationsClass.prototype.Iban = function (countries) {
|
|
56
|
-
return this.Custom(function (iban) {
|
|
57
|
-
iban = iban.split(' ').join('');
|
|
58
|
-
// check country
|
|
59
|
-
var allowedCountries = countries.map(function (c) { return c.symbol.toLowerCase(); });
|
|
60
|
-
if (iban.length >= 2 && !allowedCountries.find(function (c) { return iban.toLowerCase().startsWith(c); })) {
|
|
61
|
-
return 'iban_country_blocked';
|
|
62
|
-
}
|
|
63
|
-
// check blocked IBANs
|
|
64
|
-
var blockedIbans = BlockedIbans.map(function (i) { return i.split(' ').join('').toLowerCase(); });
|
|
65
|
-
if (blockedIbans.some(function (i) { return iban.toLowerCase().match(i) != null; })) {
|
|
66
|
-
return 'iban_blocked';
|
|
67
|
-
}
|
|
68
|
-
return IbanTools.validateIBAN(iban).valid ? true : 'pattern';
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
ValidationsClass.prototype.Custom = function (validator) {
|
|
72
|
-
return {
|
|
73
|
-
validate: validator,
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
return ValidationsClass;
|
|
77
|
-
}());
|
|
78
|
-
var Validations = new ValidationsClass();
|
|
79
|
-
export default Validations;
|
|
1
|
+
export { Validations as default } from '@dfx.swiss/core';
|
|
80
2
|
//# sourceMappingURL=validations.js.map
|
package/dist/validations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@dfx.swiss/react",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1-beta.0",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/DFXswiss/packages.git"
|
|
9
|
+
},
|
|
6
10
|
"publishConfig": {
|
|
7
11
|
"access": "public"
|
|
8
12
|
},
|
|
@@ -14,14 +18,17 @@
|
|
|
14
18
|
"scripts": {
|
|
15
19
|
"build": "tsc -b ./tsconfig.build.json",
|
|
16
20
|
"clean": "rm -rf ./dist/ && rm -rf ./tsconfig.build.tsbuildinfo",
|
|
21
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
22
|
+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
23
|
+
"format": "prettier --write src",
|
|
24
|
+
"format:check": "prettier --check src",
|
|
17
25
|
"pack": "npm pack"
|
|
18
26
|
},
|
|
19
27
|
"dependencies": {
|
|
20
|
-
"
|
|
28
|
+
"@dfx.swiss/core": "^0.2.1-beta.0",
|
|
21
29
|
"jwt-decode": "^3.1.2",
|
|
22
|
-
"libphonenumber-js": "^1.10.39",
|
|
23
30
|
"react": "^18.2.0",
|
|
24
31
|
"typescript": "^4.9.3"
|
|
25
32
|
},
|
|
26
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "b266566277640faf53fa13b577daf3fbfae25a77"
|
|
27
34
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
["LT..37800000", "AT..14200200", "AT..20602099", "LT..60378000", "CH8008635008770000647"]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Blockchain } from './blockchain';
|
|
2
|
-
export declare const LnUrlUrl: {
|
|
3
|
-
get: string;
|
|
4
|
-
};
|
|
5
|
-
export type TransferMethod = Blockchain;
|
|
6
|
-
export interface TransferInfo {
|
|
7
|
-
asset: string;
|
|
8
|
-
amount: number;
|
|
9
|
-
method: TransferMethod;
|
|
10
|
-
}
|
|
11
|
-
export interface PaymentLinkPayRequest {
|
|
12
|
-
tag: string;
|
|
13
|
-
callback: string;
|
|
14
|
-
minSendable: number;
|
|
15
|
-
maxSendable: number;
|
|
16
|
-
metadata: string;
|
|
17
|
-
transferAmounts: TransferInfo[];
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=lnurl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lnurl.d.ts","sourceRoot":"","sources":["../../src/definitions/lnurl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,QAAQ;;CAAoB,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,YAAY,EAAE,CAAC;CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lnurl.js","sourceRoot":"","sources":["../../src/definitions/lnurl.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lnurl.hook.d.ts","sourceRoot":"","sources":["../../src/hooks/lnurl.hook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAY,MAAM,sBAAsB,CAAC;AAEvE,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACjE;AAED,wBAAgB,QAAQ,IAAI,cAAc,CAgBzC"}
|
package/dist/hooks/lnurl.hook.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { useMemo } from 'react';
|
|
38
|
-
import { useApi } from './api.hook';
|
|
39
|
-
import { LnUrlUrl } from '../definitions/lnurl';
|
|
40
|
-
export function useLnUrl() {
|
|
41
|
-
var call = useApi().call;
|
|
42
|
-
function getLnUrlPayment(id) {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
44
|
-
return __generator(this, function (_a) {
|
|
45
|
-
return [2 /*return*/, call({
|
|
46
|
-
url: "".concat(LnUrlUrl.get, "/").concat(id),
|
|
47
|
-
method: 'GET',
|
|
48
|
-
})];
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return useMemo(function () { return ({
|
|
53
|
-
getLnUrlPayment: getLnUrlPayment,
|
|
54
|
-
}); }, [call]);
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=lnurl.hook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lnurl.hook.js","sourceRoot":"","sources":["../../src/hooks/lnurl.hook.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAyB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMvE,MAAM,UAAU,QAAQ;IACd,IAAA,IAAI,GAAK,MAAM,EAAE,KAAb,CAAc;IAE1B,SAAe,eAAe,CAAC,EAAU;;;gBACvC,sBAAO,IAAI,CAAwB;wBACjC,GAAG,EAAE,UAAG,QAAQ,CAAC,GAAG,cAAI,EAAE,CAAE;wBAC5B,MAAM,EAAE,KAAK;qBACd,CAAC,EAAC;;;KACJ;IAED,OAAO,OAAO,CACZ,cAAM,OAAA,CAAC;QACL,eAAe,iBAAA;KAChB,CAAC,EAFI,CAEJ,EACF,CAAC,IAAI,CAAC,CACP,CAAC;AACJ,CAAC"}
|