@reown/appkit-common-react-native 0.0.0-refactor-modal-migration-20241004184043 → 1.0.1

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 (79) hide show
  1. package/lib/commonjs/index.js +0 -64
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/utils/ConstantsUtil.js +1 -18
  4. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  5. package/lib/commonjs/utils/NetworkUtil.js +0 -3
  6. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  7. package/lib/module/index.js +0 -7
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/module/utils/ConstantsUtil.js +1 -18
  10. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  11. package/lib/module/utils/NetworkUtil.js +0 -3
  12. package/lib/module/utils/NetworkUtil.js.map +1 -1
  13. package/lib/typescript/index.d.ts +0 -7
  14. package/lib/typescript/index.d.ts.map +1 -1
  15. package/lib/typescript/utils/ConstantsUtil.d.ts +0 -3
  16. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  17. package/lib/typescript/utils/NetworkUtil.d.ts +0 -1
  18. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  19. package/package.json +4 -8
  20. package/readme.md +1 -1
  21. package/src/index.ts +0 -7
  22. package/src/utils/ConstantsUtil.ts +1 -19
  23. package/src/utils/NetworkUtil.ts +0 -8
  24. package/lib/commonjs/contracts/erc20.js +0 -41
  25. package/lib/commonjs/contracts/erc20.js.map +0 -1
  26. package/lib/commonjs/contracts/usdt.js +0 -38
  27. package/lib/commonjs/contracts/usdt.js.map +0 -1
  28. package/lib/commonjs/utils/ContractUtil.js +0 -18
  29. package/lib/commonjs/utils/ContractUtil.js.map +0 -1
  30. package/lib/commonjs/utils/DateUtil.js +0 -48
  31. package/lib/commonjs/utils/DateUtil.js.map +0 -1
  32. package/lib/commonjs/utils/NamesUtil.js +0 -13
  33. package/lib/commonjs/utils/NamesUtil.js.map +0 -1
  34. package/lib/commonjs/utils/NumberUtil.js +0 -33
  35. package/lib/commonjs/utils/NumberUtil.js.map +0 -1
  36. package/lib/commonjs/utils/StringUtil.js +0 -15
  37. package/lib/commonjs/utils/StringUtil.js.map +0 -1
  38. package/lib/commonjs/utils/TypeUtil.js +0 -2
  39. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  40. package/lib/module/contracts/erc20.js +0 -35
  41. package/lib/module/contracts/erc20.js.map +0 -1
  42. package/lib/module/contracts/usdt.js +0 -32
  43. package/lib/module/contracts/usdt.js.map +0 -1
  44. package/lib/module/utils/ContractUtil.js +0 -12
  45. package/lib/module/utils/ContractUtil.js.map +0 -1
  46. package/lib/module/utils/DateUtil.js +0 -41
  47. package/lib/module/utils/DateUtil.js.map +0 -1
  48. package/lib/module/utils/NamesUtil.js +0 -7
  49. package/lib/module/utils/NamesUtil.js.map +0 -1
  50. package/lib/module/utils/NumberUtil.js +0 -25
  51. package/lib/module/utils/NumberUtil.js.map +0 -1
  52. package/lib/module/utils/StringUtil.js +0 -9
  53. package/lib/module/utils/StringUtil.js.map +0 -1
  54. package/lib/module/utils/TypeUtil.js +0 -2
  55. package/lib/module/utils/TypeUtil.js.map +0 -1
  56. package/lib/typescript/contracts/erc20.d.ts +0 -14
  57. package/lib/typescript/contracts/erc20.d.ts.map +0 -1
  58. package/lib/typescript/contracts/usdt.d.ts +0 -14
  59. package/lib/typescript/contracts/usdt.d.ts.map +0 -1
  60. package/lib/typescript/utils/ContractUtil.d.ts +0 -16
  61. package/lib/typescript/utils/ContractUtil.d.ts.map +0 -1
  62. package/lib/typescript/utils/DateUtil.d.ts +0 -7
  63. package/lib/typescript/utils/DateUtil.d.ts.map +0 -1
  64. package/lib/typescript/utils/NamesUtil.d.ts +0 -4
  65. package/lib/typescript/utils/NamesUtil.d.ts.map +0 -1
  66. package/lib/typescript/utils/NumberUtil.d.ts +0 -13
  67. package/lib/typescript/utils/NumberUtil.d.ts.map +0 -1
  68. package/lib/typescript/utils/StringUtil.d.ts +0 -4
  69. package/lib/typescript/utils/StringUtil.d.ts.map +0 -1
  70. package/lib/typescript/utils/TypeUtil.d.ts +0 -83
  71. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  72. package/src/contracts/erc20.ts +0 -48
  73. package/src/contracts/usdt.ts +0 -43
  74. package/src/utils/ContractUtil.ts +0 -13
  75. package/src/utils/DateUtil.ts +0 -47
  76. package/src/utils/NamesUtil.ts +0 -10
  77. package/src/utils/NumberUtil.ts +0 -31
  78. package/src/utils/StringUtil.ts +0 -9
  79. package/src/utils/TypeUtil.ts +0 -104
@@ -1,35 +0,0 @@
1
- export const erc20ABI = [{
2
- type: 'function',
3
- name: 'transfer',
4
- stateMutability: 'nonpayable',
5
- inputs: [{
6
- name: '_to',
7
- type: 'address'
8
- }, {
9
- name: '_value',
10
- type: 'uint256'
11
- }],
12
- outputs: [{
13
- name: '',
14
- type: 'bool'
15
- }]
16
- }, {
17
- type: 'function',
18
- name: 'transferFrom',
19
- stateMutability: 'nonpayable',
20
- inputs: [{
21
- name: '_from',
22
- type: 'address'
23
- }, {
24
- name: '_to',
25
- type: 'address'
26
- }, {
27
- name: '_value',
28
- type: 'uint256'
29
- }],
30
- outputs: [{
31
- name: '',
32
- type: 'bool'
33
- }]
34
- }];
35
- //# sourceMappingURL=erc20.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["erc20ABI","type","name","stateMutability","inputs","outputs"],"sourceRoot":"../../../src","sources":["contracts/erc20.ts"],"mappings":"AAAA,OAAO,MAAMA,QAAQ,GAAG,CACtB;EACEC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,UAAU;EAChBC,eAAe,EAAE,YAAY;EAC7BC,MAAM,EAAE,CACN;IACEF,IAAI,EAAE,KAAK;IACXD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE;EACR,CAAC,CACF;EACDI,OAAO,EAAE,CACP;IACEH,IAAI,EAAE,EAAE;IACRD,IAAI,EAAE;EACR,CAAC;AAEL,CAAC,EACD;EACEA,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,cAAc;EACpBC,eAAe,EAAE,YAAY;EAC7BC,MAAM,EAAE,CACN;IACEF,IAAI,EAAE,OAAO;IACbD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,KAAK;IACXD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE;EACR,CAAC,CACF;EACDI,OAAO,EAAE,CACP;IACEH,IAAI,EAAE,EAAE;IACRD,IAAI,EAAE;EACR,CAAC;AAEL,CAAC,CACF"}
@@ -1,32 +0,0 @@
1
- export const usdtABI = [{
2
- type: 'function',
3
- name: 'transfer',
4
- stateMutability: 'nonpayable',
5
- inputs: [{
6
- name: 'recipient',
7
- type: 'address'
8
- }, {
9
- name: 'amount',
10
- type: 'uint256'
11
- }],
12
- outputs: []
13
- }, {
14
- type: 'function',
15
- name: 'transferFrom',
16
- stateMutability: 'nonpayable',
17
- inputs: [{
18
- name: 'sender',
19
- type: 'address'
20
- }, {
21
- name: 'recipient',
22
- type: 'address'
23
- }, {
24
- name: 'amount',
25
- type: 'uint256'
26
- }],
27
- outputs: [{
28
- name: '',
29
- type: 'bool'
30
- }]
31
- }];
32
- //# sourceMappingURL=usdt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["usdtABI","type","name","stateMutability","inputs","outputs"],"sourceRoot":"../../../src","sources":["contracts/usdt.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,CACrB;EACEC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,UAAU;EAChBC,eAAe,EAAE,YAAY;EAC7BC,MAAM,EAAE,CACN;IACEF,IAAI,EAAE,WAAW;IACjBD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE;EACR,CAAC,CACF;EACDI,OAAO,EAAE;AACX,CAAC,EACD;EACEJ,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,cAAc;EACpBC,eAAe,EAAE,YAAY;EAC7BC,MAAM,EAAE,CACN;IACEF,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,WAAW;IACjBD,IAAI,EAAE;EACR,CAAC,EACD;IACEC,IAAI,EAAE,QAAQ;IACdD,IAAI,EAAE;EACR,CAAC,CACF;EACDI,OAAO,EAAE,CACP;IACEH,IAAI,EAAE,EAAE;IACRD,IAAI,EAAE;EACR,CAAC;AAEL,CAAC,CACF"}
@@ -1,12 +0,0 @@
1
- import { erc20ABI } from '../contracts/erc20';
2
- import { usdtABI } from '../contracts/usdt';
3
- import { ConstantsUtil } from './ConstantsUtil';
4
- export const ContractUtil = {
5
- getERC20Abi: tokenAddress => {
6
- if (ConstantsUtil.USDT_CONTRACT_ADDRESSES.includes(tokenAddress)) {
7
- return usdtABI;
8
- }
9
- return erc20ABI;
10
- }
11
- };
12
- //# sourceMappingURL=ContractUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["erc20ABI","usdtABI","ConstantsUtil","ContractUtil","getERC20Abi","tokenAddress","USDT_CONTRACT_ADDRESSES","includes"],"sourceRoot":"../../../src","sources":["utils/ContractUtil.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,aAAa,QAAQ,iBAAiB;AAE/C,OAAO,MAAMC,YAAY,GAAG;EAC1BC,WAAW,EAAGC,YAAoB,IAAK;IACrC,IAAIH,aAAa,CAACI,uBAAuB,CAACC,QAAQ,CAACF,YAAY,CAAC,EAAE;MAChE,OAAOJ,OAAO;IAChB;IAEA,OAAOD,QAAQ;EACjB;AACF,CAAC"}
@@ -1,41 +0,0 @@
1
- import dayjs from 'dayjs';
2
- import englishLocale from 'dayjs/locale/en.js';
3
- import relativeTime from 'dayjs/plugin/relativeTime.js';
4
- import updateLocale from 'dayjs/plugin/updateLocale.js';
5
- dayjs.extend(relativeTime);
6
- dayjs.extend(updateLocale);
7
- const localeObject = {
8
- ...englishLocale,
9
- name: 'en-web3-modal',
10
- relativeTime: {
11
- future: 'in %s',
12
- past: '%s ago',
13
- s: '%d sec',
14
- m: '1 min',
15
- mm: '%d min',
16
- h: '1 hr',
17
- hh: '%d hrs',
18
- d: '1 d',
19
- dd: '%d d',
20
- M: '1 mo',
21
- MM: '%d mo',
22
- y: '1 yr',
23
- yy: '%d yr'
24
- }
25
- };
26
- dayjs.locale('en-appkit', localeObject);
27
- export const DateUtil = {
28
- getYear(date = new Date().toISOString()) {
29
- return dayjs(date).year();
30
- },
31
- getRelativeDateFromNow(date) {
32
- return dayjs(date).locale('en-appkit').fromNow(true);
33
- },
34
- formatDate(date, format = 'DD MMM') {
35
- return dayjs(date).format(format);
36
- },
37
- getMonth(month) {
38
- return dayjs().month(month).format('MMMM');
39
- }
40
- };
41
- //# sourceMappingURL=DateUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["dayjs","englishLocale","relativeTime","updateLocale","extend","localeObject","name","future","past","s","m","mm","h","hh","d","dd","M","MM","y","yy","locale","DateUtil","getYear","date","Date","toISOString","year","getRelativeDateFromNow","fromNow","formatDate","format","getMonth","month"],"sourceRoot":"../../../src","sources":["utils/DateUtil.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,aAAa,MAAM,oBAAoB;AAC9C,OAAOC,YAAY,MAAM,8BAA8B;AACvD,OAAOC,YAAY,MAAM,8BAA8B;AAEvDH,KAAK,CAACI,MAAM,CAACF,YAAY,CAAC;AAC1BF,KAAK,CAACI,MAAM,CAACD,YAAY,CAAC;AAE1B,MAAME,YAAY,GAAG;EACnB,GAAGJ,aAAa;EAChBK,IAAI,EAAE,eAAe;EACrBJ,YAAY,EAAE;IACZK,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,CAAC,EAAE,QAAQ;IACXC,CAAC,EAAE,OAAO;IACVC,EAAE,EAAE,QAAQ;IACZC,CAAC,EAAE,MAAM;IACTC,EAAE,EAAE,QAAQ;IACZC,CAAC,EAAE,KAAK;IACRC,EAAE,EAAE,MAAM;IACVC,CAAC,EAAE,MAAM;IACTC,EAAE,EAAE,OAAO;IACXC,CAAC,EAAE,MAAM;IACTC,EAAE,EAAE;EACN;AACF,CAAC;AAEDnB,KAAK,CAACoB,MAAM,CAAC,WAAW,EAAEf,YAAY,CAAC;AAEvC,OAAO,MAAMgB,QAAQ,GAAG;EACtBC,OAAOA,CAACC,IAAY,GAAG,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,EAAE;IAC/C,OAAOzB,KAAK,CAACuB,IAAI,CAAC,CAACG,IAAI,CAAC,CAAC;EAC3B,CAAC;EAEDC,sBAAsBA,CAACJ,IAAqB,EAAE;IAC5C,OAAOvB,KAAK,CAACuB,IAAI,CAAC,CAACH,MAAM,CAAC,WAAW,CAAC,CAACQ,OAAO,CAAC,IAAI,CAAC;EACtD,CAAC;EAEDC,UAAUA,CAACN,IAAqB,EAAEO,MAAM,GAAG,QAAQ,EAAE;IACnD,OAAO9B,KAAK,CAACuB,IAAI,CAAC,CAACO,MAAM,CAACA,MAAM,CAAC;EACnC,CAAC;EAEDC,QAAQA,CAACC,KAAa,EAAE;IACtB,OAAOhC,KAAK,CAAC,CAAC,CAACgC,KAAK,CAACA,KAAK,CAAC,CAACF,MAAM,CAAC,MAAM,CAAC;EAC5C;AACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ConstantsUtil } from './ConstantsUtil';
2
- export const NamesUtil = {
3
- isReownName(value) {
4
- return value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX_LEGACY) || value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX);
5
- }
6
- };
7
- //# sourceMappingURL=NamesUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ConstantsUtil","NamesUtil","isReownName","value","endsWith","WC_NAME_SUFFIX_LEGACY","WC_NAME_SUFFIX"],"sourceRoot":"../../../src","sources":["utils/NamesUtil.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,OAAO,MAAMC,SAAS,GAAG;EACvBC,WAAWA,CAACC,KAAa,EAAE;IACzB,OACEA,KAAK,EAAEC,QAAQ,CAACJ,aAAa,CAACK,qBAAqB,CAAC,IACpDF,KAAK,EAAEC,QAAQ,CAACJ,aAAa,CAACM,cAAc,CAAC;EAEjD;AACF,CAAC"}
@@ -1,25 +0,0 @@
1
- import * as BigNumber from 'bignumber.js';
2
- export const NumberUtil = {
3
- bigNumber(value) {
4
- return new BigNumber.BigNumber(value);
5
- },
6
- /**
7
- * Multiply two numbers represented as strings with BigNumber to handle decimals correctly
8
- * @param a string
9
- * @param b string
10
- * @returns
11
- */
12
- multiply(a, b) {
13
- if (a === undefined || b === undefined) {
14
- return BigNumber.BigNumber(0);
15
- }
16
- const aBigNumber = new BigNumber.BigNumber(a);
17
- const bBigNumber = new BigNumber.BigNumber(b);
18
- return aBigNumber.multipliedBy(bBigNumber);
19
- },
20
- roundNumber(number, threshold, fixed) {
21
- const roundedNumber = number.toString().length >= threshold ? Number(number).toFixed(fixed) : number;
22
- return roundedNumber;
23
- }
24
- };
25
- //# sourceMappingURL=NumberUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BigNumber","NumberUtil","bigNumber","value","multiply","a","b","undefined","aBigNumber","bBigNumber","multipliedBy","roundNumber","number","threshold","fixed","roundedNumber","toString","length","Number","toFixed"],"sourceRoot":"../../../src","sources":["utils/NumberUtil.ts"],"mappings":"AAAA,OAAO,KAAKA,SAAS,MAAM,cAAc;AAEzC,OAAO,MAAMC,UAAU,GAAG;EACxBC,SAASA,CAACC,KAAgC,EAAE;IAC1C,OAAO,IAAIH,SAAS,CAACA,SAAS,CAACG,KAAK,CAAC;EACvC,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEC,QAAQA,CAACC,CAAwC,EAAEC,CAAwC,EAAE;IAC3F,IAAID,CAAC,KAAKE,SAAS,IAAID,CAAC,KAAKC,SAAS,EAAE;MACtC,OAAOP,SAAS,CAACA,SAAS,CAAC,CAAC,CAAC;IAC/B;IAEA,MAAMQ,UAAU,GAAG,IAAIR,SAAS,CAACA,SAAS,CAACK,CAAC,CAAC;IAC7C,MAAMI,UAAU,GAAG,IAAIT,SAAS,CAACA,SAAS,CAACM,CAAC,CAAC;IAE7C,OAAOE,UAAU,CAACE,YAAY,CAACD,UAAU,CAAC;EAC5C,CAAC;EAEDE,WAAWA,CAACC,MAAc,EAAEC,SAAiB,EAAEC,KAAa,EAAE;IAC5D,MAAMC,aAAa,GACjBH,MAAM,CAACI,QAAQ,CAAC,CAAC,CAACC,MAAM,IAAIJ,SAAS,GAAGK,MAAM,CAACN,MAAM,CAAC,CAACO,OAAO,CAACL,KAAK,CAAC,GAAGF,MAAM;IAEhF,OAAOG,aAAa;EACtB;AACF,CAAC"}
@@ -1,9 +0,0 @@
1
- export const StringUtil = {
2
- capitalize(value) {
3
- if (!value) {
4
- return '';
5
- }
6
- return value.charAt(0).toUpperCase() + value.slice(1);
7
- }
8
- };
9
- //# sourceMappingURL=StringUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StringUtil","capitalize","value","charAt","toUpperCase","slice"],"sourceRoot":"../../../src","sources":["utils/StringUtil.ts"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACxBC,UAAUA,CAACC,KAAc,EAAE;IACzB,IAAI,CAACA,KAAK,EAAE;MACV,OAAO,EAAE;IACX;IAEA,OAAOA,KAAK,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,KAAK,CAACG,KAAK,CAAC,CAAC,CAAC;EACvD;AACF,CAAC"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=TypeUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/TypeUtil.ts"],"mappings":""}
@@ -1,14 +0,0 @@
1
- export declare const erc20ABI: {
2
- type: string;
3
- name: string;
4
- stateMutability: string;
5
- inputs: {
6
- name: string;
7
- type: string;
8
- }[];
9
- outputs: {
10
- name: string;
11
- type: string;
12
- }[];
13
- }[];
14
- //# sourceMappingURL=erc20.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../../src/contracts/erc20.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;GA+CpB,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const usdtABI: {
2
- type: string;
3
- name: string;
4
- stateMutability: string;
5
- inputs: {
6
- name: string;
7
- type: string;
8
- }[];
9
- outputs: {
10
- name: string;
11
- type: string;
12
- }[];
13
- }[];
14
- //# sourceMappingURL=usdt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usdt.d.ts","sourceRoot":"","sources":["../../../src/contracts/usdt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;GA0CnB,CAAC"}
@@ -1,16 +0,0 @@
1
- export declare const ContractUtil: {
2
- getERC20Abi: (tokenAddress: string) => {
3
- type: string;
4
- name: string;
5
- stateMutability: string;
6
- inputs: {
7
- name: string;
8
- type: string;
9
- }[];
10
- outputs: {
11
- name: string;
12
- type: string;
13
- }[];
14
- }[];
15
- };
16
- //# sourceMappingURL=ContractUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContractUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ContractUtil.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;gCACK,MAAM;;;;;;;;;;;;;CAOnC,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const DateUtil: {
2
- getYear(date?: string): number;
3
- getRelativeDateFromNow(date: string | number): string;
4
- formatDate(date: string | number, format?: string): string;
5
- getMonth(month: number): string;
6
- };
7
- //# sourceMappingURL=DateUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/DateUtil.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,QAAQ;mBACL,MAAM;iCAIS,MAAM,GAAG,MAAM;qBAI3B,MAAM,GAAG,MAAM;oBAIhB,MAAM;CAGvB,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const NamesUtil: {
2
- isReownName(value: string): boolean;
3
- };
4
- //# sourceMappingURL=NamesUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NamesUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NamesUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;uBACD,MAAM;CAM1B,CAAC"}
@@ -1,13 +0,0 @@
1
- import * as BigNumber from 'bignumber.js';
2
- export declare const NumberUtil: {
3
- bigNumber(value: BigNumber.BigNumber.Value): BigNumber.BigNumber;
4
- /**
5
- * Multiply two numbers represented as strings with BigNumber to handle decimals correctly
6
- * @param a string
7
- * @param b string
8
- * @returns
9
- */
10
- multiply(a: BigNumber.BigNumber.Value | undefined, b: BigNumber.BigNumber.Value | undefined): BigNumber.BigNumber;
11
- roundNumber(number: number, threshold: number, fixed: number): string | number;
12
- };
13
- //# sourceMappingURL=NumberUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NumberUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,UAAU;qBACJ,mBAAmB,CAAC,KAAK;IAI1C;;;;;OAKG;gBACS,mBAAmB,CAAC,KAAK,GAAG,SAAS,KAAK,mBAAmB,CAAC,KAAK,GAAG,SAAS;wBAWvE,MAAM,aAAa,MAAM,SAAS,MAAM;CAM7D,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const StringUtil: {
2
- capitalize(value?: string): string;
3
- };
4
- //# sourceMappingURL=StringUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM;CAO1B,CAAC"}
@@ -1,83 +0,0 @@
1
- export type CaipNetworkId = `${ChainNamespace}:${ChainId}`;
2
- export type CaipAddress = `${ChainNamespace}:${ChainId}:${string}`;
3
- export type ChainId = string | number;
4
- export type ChainNamespace = 'eip155';
5
- export interface Balance {
6
- name: string;
7
- symbol: string;
8
- chainId: string;
9
- address?: string;
10
- value?: number;
11
- price: number;
12
- quantity: BalanceQuantity;
13
- iconUrl: string;
14
- }
15
- type BalanceQuantity = {
16
- decimals: string;
17
- numeric: string;
18
- };
19
- export type TransactionStatus = 'confirmed' | 'failed' | 'pending';
20
- export type TransactionDirection = 'in' | 'out' | 'self';
21
- export type TransactionImage = {
22
- type: 'FUNGIBLE' | 'NFT' | undefined;
23
- url: string | undefined;
24
- };
25
- export interface Transaction {
26
- id: string;
27
- metadata: TransactionMetadata;
28
- transfers: TransactionTransfer[];
29
- }
30
- export interface TransactionMetadata {
31
- application: {
32
- iconUrl: string | null;
33
- name: string | null;
34
- };
35
- operationType: string;
36
- hash: string;
37
- minedAt: string;
38
- sentFrom: string;
39
- sentTo: string;
40
- status: TransactionStatus;
41
- nonce: number;
42
- chain?: string;
43
- }
44
- export interface TransactionTransfer {
45
- fungible_info?: {
46
- name?: string;
47
- symbol?: string;
48
- icon?: {
49
- url: string;
50
- };
51
- };
52
- nft_info?: TransactionNftInfo;
53
- direction: TransactionDirection;
54
- quantity: TransactionQuantity;
55
- value?: number;
56
- price?: number;
57
- }
58
- export interface TransactionNftInfo {
59
- name?: string;
60
- content?: TransactionContent;
61
- flags: TransactionNftInfoFlags;
62
- }
63
- export interface TransactionNftInfoFlags {
64
- is_spam: boolean;
65
- }
66
- export interface TransactionContent {
67
- preview?: TransactionPreview;
68
- detail?: TransactionDetail;
69
- }
70
- export interface TransactionPreview {
71
- url: string;
72
- content_type?: null;
73
- }
74
- export interface TransactionDetail {
75
- url: string;
76
- content_type?: null;
77
- }
78
- export interface TransactionQuantity {
79
- numeric: string;
80
- }
81
- export type SocialProvider = 'google' | 'github' | 'apple' | 'facebook' | 'x' | 'discord' | 'farcaster';
82
- export {};
83
- //# sourceMappingURL=TypeUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/TypeUtil.ts"],"names":[],"mappings":"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"}
@@ -1,48 +0,0 @@
1
- export const erc20ABI = [
2
- {
3
- type: 'function',
4
- name: 'transfer',
5
- stateMutability: 'nonpayable',
6
- inputs: [
7
- {
8
- name: '_to',
9
- type: 'address'
10
- },
11
- {
12
- name: '_value',
13
- type: 'uint256'
14
- }
15
- ],
16
- outputs: [
17
- {
18
- name: '',
19
- type: 'bool'
20
- }
21
- ]
22
- },
23
- {
24
- type: 'function',
25
- name: 'transferFrom',
26
- stateMutability: 'nonpayable',
27
- inputs: [
28
- {
29
- name: '_from',
30
- type: 'address'
31
- },
32
- {
33
- name: '_to',
34
- type: 'address'
35
- },
36
- {
37
- name: '_value',
38
- type: 'uint256'
39
- }
40
- ],
41
- outputs: [
42
- {
43
- name: '',
44
- type: 'bool'
45
- }
46
- ]
47
- }
48
- ];
@@ -1,43 +0,0 @@
1
- export const usdtABI = [
2
- {
3
- type: 'function',
4
- name: 'transfer',
5
- stateMutability: 'nonpayable',
6
- inputs: [
7
- {
8
- name: 'recipient',
9
- type: 'address'
10
- },
11
- {
12
- name: 'amount',
13
- type: 'uint256'
14
- }
15
- ],
16
- outputs: []
17
- },
18
- {
19
- type: 'function',
20
- name: 'transferFrom',
21
- stateMutability: 'nonpayable',
22
- inputs: [
23
- {
24
- name: 'sender',
25
- type: 'address'
26
- },
27
- {
28
- name: 'recipient',
29
- type: 'address'
30
- },
31
- {
32
- name: 'amount',
33
- type: 'uint256'
34
- }
35
- ],
36
- outputs: [
37
- {
38
- name: '',
39
- type: 'bool'
40
- }
41
- ]
42
- }
43
- ];
@@ -1,13 +0,0 @@
1
- import { erc20ABI } from '../contracts/erc20';
2
- import { usdtABI } from '../contracts/usdt';
3
- import { ConstantsUtil } from './ConstantsUtil';
4
-
5
- export const ContractUtil = {
6
- getERC20Abi: (tokenAddress: string) => {
7
- if (ConstantsUtil.USDT_CONTRACT_ADDRESSES.includes(tokenAddress)) {
8
- return usdtABI;
9
- }
10
-
11
- return erc20ABI;
12
- }
13
- };
@@ -1,47 +0,0 @@
1
- import dayjs from 'dayjs';
2
- import englishLocale from 'dayjs/locale/en.js';
3
- import relativeTime from 'dayjs/plugin/relativeTime.js';
4
- import updateLocale from 'dayjs/plugin/updateLocale.js';
5
-
6
- dayjs.extend(relativeTime);
7
- dayjs.extend(updateLocale);
8
-
9
- const localeObject = {
10
- ...englishLocale,
11
- name: 'en-web3-modal',
12
- relativeTime: {
13
- future: 'in %s',
14
- past: '%s ago',
15
- s: '%d sec',
16
- m: '1 min',
17
- mm: '%d min',
18
- h: '1 hr',
19
- hh: '%d hrs',
20
- d: '1 d',
21
- dd: '%d d',
22
- M: '1 mo',
23
- MM: '%d mo',
24
- y: '1 yr',
25
- yy: '%d yr'
26
- }
27
- };
28
-
29
- dayjs.locale('en-appkit', localeObject);
30
-
31
- export const DateUtil = {
32
- getYear(date: string = new Date().toISOString()) {
33
- return dayjs(date).year();
34
- },
35
-
36
- getRelativeDateFromNow(date: string | number) {
37
- return dayjs(date).locale('en-appkit').fromNow(true);
38
- },
39
-
40
- formatDate(date: string | number, format = 'DD MMM') {
41
- return dayjs(date).format(format);
42
- },
43
-
44
- getMonth(month: number) {
45
- return dayjs().month(month).format('MMMM');
46
- }
47
- };
@@ -1,10 +0,0 @@
1
- import { ConstantsUtil } from './ConstantsUtil';
2
-
3
- export const NamesUtil = {
4
- isReownName(value: string) {
5
- return (
6
- value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX_LEGACY) ||
7
- value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX)
8
- );
9
- }
10
- };
@@ -1,31 +0,0 @@
1
- import * as BigNumber from 'bignumber.js';
2
-
3
- export const NumberUtil = {
4
- bigNumber(value: BigNumber.BigNumber.Value) {
5
- return new BigNumber.BigNumber(value);
6
- },
7
-
8
- /**
9
- * Multiply two numbers represented as strings with BigNumber to handle decimals correctly
10
- * @param a string
11
- * @param b string
12
- * @returns
13
- */
14
- multiply(a: BigNumber.BigNumber.Value | undefined, b: BigNumber.BigNumber.Value | undefined) {
15
- if (a === undefined || b === undefined) {
16
- return BigNumber.BigNumber(0);
17
- }
18
-
19
- const aBigNumber = new BigNumber.BigNumber(a);
20
- const bBigNumber = new BigNumber.BigNumber(b);
21
-
22
- return aBigNumber.multipliedBy(bBigNumber);
23
- },
24
-
25
- roundNumber(number: number, threshold: number, fixed: number) {
26
- const roundedNumber =
27
- number.toString().length >= threshold ? Number(number).toFixed(fixed) : number;
28
-
29
- return roundedNumber;
30
- }
31
- };
@@ -1,9 +0,0 @@
1
- export const StringUtil = {
2
- capitalize(value?: string) {
3
- if (!value) {
4
- return '';
5
- }
6
-
7
- return value.charAt(0).toUpperCase() + value.slice(1);
8
- }
9
- };