@code-wallet/kikcode
Advanced tools
@@ -22,2 +22,3 @@ import { CurrencyCode } from "@code-wallet/currency"; | ||
| private isRequestPayment; | ||
| private isRequestPaymentWithFeesSupport; | ||
| /** | ||
@@ -24,0 +25,0 @@ * Validates the payload, throwing an error if invalid. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAKf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,cAAM,WAAW;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAM;IAExC;;;;OAIG;gBACS,GAAG,EAAE,kBAAkB;IAWnC,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,QAAQ;IAgBR;;;;OAIG;IACH,QAAQ,IAAI,UAAU;IA+BtB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;CA0BjD;AAED,OAAO,EACH,WAAW,EACX,QAAQ,GACX,CAAC"} | ||
| {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAKf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,cAAM,WAAW;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAM;IAExC;;;;OAIG;gBACS,GAAG,EAAE,kBAAkB;IAWnC,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,+BAA+B;IAIvC;;OAEG;IACH,QAAQ;IAgBR;;;;OAIG;IACH,QAAQ,IAAI,UAAU;IA+BtB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;CA0BjD;AAED,OAAO,EACH,WAAW,EACX,QAAQ,GACX,CAAC"} |
@@ -36,2 +36,5 @@ "use strict"; | ||
| } | ||
| isRequestPaymentWithFeesSupport() { | ||
| return this.kind === types_1.CodeKind.RequestPaymentWithFeesSupport && this.currency != null && this.amount != null; | ||
| } | ||
| /** | ||
@@ -63,3 +66,3 @@ * Validates the payload, throwing an error if invalid. | ||
| this.validate(); | ||
| if (this.isRequestPayment()) { | ||
| if (this.isRequestPayment() || this.isRequestPaymentWithFeesSupport()) { | ||
| // for Payment Request | ||
@@ -98,3 +101,3 @@ if (!this.currency) { | ||
| let currency; | ||
| if (kind === types_1.CodeKind.RequestPayment) { | ||
| if (kind === types_1.CodeKind.RequestPayment || kind === types_1.CodeKind.RequestPaymentWithFeesSupport) { | ||
| // for Payment Request | ||
@@ -101,0 +104,0 @@ const currencyIndex = data[1]; |
@@ -9,3 +9,4 @@ import { CurrencyCode } from '@code-wallet/currency'; | ||
| RequestPayment = 2, | ||
| RequestLogin = 3 | ||
| RequestLogin = 3, | ||
| RequestPaymentWithFeesSupport = 4 | ||
| } | ||
@@ -12,0 +13,0 @@ export interface CodePayloadOptions { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkErD;;GAEG;AACH,oBAAY,QAAQ;IAChB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,YAAY,IAAI;CACnB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B"} | ||
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkErD;;GAEG;AACH,oBAAY,QAAQ;IAChB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,YAAY,IAAI;IAChB,6BAA6B,IAAI;CACpC;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B"} |
@@ -76,2 +76,3 @@ "use strict"; | ||
| CodeKind[CodeKind["RequestLogin"] = 3] = "RequestLogin"; | ||
| CodeKind[CodeKind["RequestPaymentWithFeesSupport"] = 4] = "RequestPaymentWithFeesSupport"; | ||
| })(CodeKind || (exports.CodeKind = CodeKind = {})); |
@@ -22,2 +22,3 @@ import { CurrencyCode } from "@code-wallet/currency"; | ||
| private isRequestPayment; | ||
| private isRequestPaymentWithFeesSupport; | ||
| /** | ||
@@ -24,0 +25,0 @@ * Validates the payload, throwing an error if invalid. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAKf,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,SAA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GAAG,WAAW;CA0BjD;AAED,OAAO,EACH,WAAW,EACX,QAAQ,GACX,CAAC"} |
@@ -32,2 +32,5 @@ import { currencyCodeToIndex, indexToCurrencyCode, isValidCurrency, ErrInvalidCurrency } from "@code-wallet/currency"; | ||
| } | ||
| isRequestPaymentWithFeesSupport() { | ||
| return this.kind === CodeKind.RequestPaymentWithFeesSupport && this.currency != null && this.amount != null; | ||
| } | ||
| /** | ||
@@ -59,3 +62,3 @@ * Validates the payload, throwing an error if invalid. | ||
| this.validate(); | ||
| if (this.isRequestPayment()) { | ||
| if (this.isRequestPayment() || this.isRequestPaymentWithFeesSupport()) { | ||
| // for Payment Request | ||
@@ -94,3 +97,3 @@ if (!this.currency) { | ||
| let currency; | ||
| if (kind === CodeKind.RequestPayment) { | ||
| if (kind === CodeKind.RequestPayment || kind === CodeKind.RequestPaymentWithFeesSupport) { | ||
| // for Payment Request | ||
@@ -97,0 +100,0 @@ const currencyIndex = data[1]; |
@@ -9,3 +9,4 @@ import { CurrencyCode } from '@code-wallet/currency'; | ||
| RequestPayment = 2, | ||
| RequestLogin = 3 | ||
| RequestLogin = 3, | ||
| RequestPaymentWithFeesSupport = 4 | ||
| } | ||
@@ -12,0 +13,0 @@ export interface CodePayloadOptions { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkErD;;GAEG;AACH,oBAAY,QAAQ;IAChB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,YAAY,IAAI;CACnB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B"} | ||
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkErD;;GAEG;AACH,oBAAY,QAAQ;IAChB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,YAAY,IAAI;IAChB,6BAA6B,IAAI;CACpC;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B"} |
@@ -73,2 +73,3 @@ /* | ||
| CodeKind[CodeKind["RequestLogin"] = 3] = "RequestLogin"; | ||
| CodeKind[CodeKind["RequestPaymentWithFeesSupport"] = 4] = "RequestPaymentWithFeesSupport"; | ||
| })(CodeKind || (CodeKind = {})); |
+1
-1
| { | ||
| "name": "@code-wallet/kikcode", | ||
| "version": "1.0.2", | ||
| "version": "1.0.4", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
553077
0.19%7342
0.16%