decentraland-dapps 23.26.0 → 23.27.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.
@@ -1,6 +1,7 @@
1
1
  import { AuthorizationState } from './reducer';
2
+ import { Authorization } from './types';
2
3
  export declare const getState: (state: any) => AuthorizationState;
3
- export declare const getData: (state: any) => import("./types").Authorization[];
4
+ export declare const getData: (state: any) => Authorization[];
4
5
  export declare const getLoading: (state: any) => import("../loading").LoadingState;
5
6
  export declare const isLoading: (state: any) => boolean;
6
7
  export declare const getError: (state: any) => string | null;
@@ -8,3 +9,4 @@ export declare const getAuthorizationFlowError: (state: any) => string | null;
8
9
  export declare const getTransactions: (state: any) => import("../transaction").Transaction[];
9
10
  export declare const getAllowTransactions: (state: any) => import("../transaction").Transaction[];
10
11
  export declare const getApproveTransactions: (state: any) => import("../transaction").Transaction[];
12
+ export declare const isAuthorizing: (state: any) => boolean;
@@ -1,6 +1,6 @@
1
1
  import { getTransactionsByType } from '../transaction/selectors';
2
2
  import { getAddress } from '../wallet/selectors';
3
- import { GRANT_TOKEN_SUCCESS } from './actions';
3
+ import { AUTHORIZATION_FLOW_REQUEST, GRANT_TOKEN_SUCCESS } from './actions';
4
4
  import { AuthorizationType } from './types';
5
5
  export const getState = state => state.authorization;
6
6
  export const getData = (state) => getState(state).data;
@@ -11,4 +11,5 @@ export const getAuthorizationFlowError = (state) => getState(state).authorizatio
11
11
  export const getTransactions = (state) => getTransactionsByType(state, getAddress(state) || '', GRANT_TOKEN_SUCCESS);
12
12
  export const getAllowTransactions = (state) => getTransactions(state).filter(transaction => transaction.payload.authorization.type === AuthorizationType.ALLOWANCE);
13
13
  export const getApproveTransactions = (state) => getTransactions(state).filter(transaction => transaction.payload.authorization.type === AuthorizationType.APPROVAL);
14
+ export const isAuthorizing = (state) => getLoading(state).some(loading => loading.type === AUTHORIZATION_FLOW_REQUEST);
14
15
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
-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CAAC,sBAAsB,CAAA;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAU,EAAE,EAAE,CAC5C,qBAAqB,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,mBAAmB,CAAC,CAAA;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAE,EAAE,CACjD,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAC3B,WAAW,CAAC,EAAE,CACZ,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,iBAAiB,CAAC,SAAS,CACzE,CAAA;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAE,EAAE,CACnD,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAC3B,WAAW,CAAC,EAAE,CACZ,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,iBAAiB,CAAC,QAAQ,CACxE,CAAA;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAU,EAAW,EAAE,CACnD,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,0BAA0B,CAAC,CAAA"}
@@ -18,3 +18,9 @@ export type Authorization = {
18
18
  chainId: ChainId;
19
19
  allowance?: string;
20
20
  };
21
+ export type AuthorizationOptions = {
22
+ requiredAllowance?: string;
23
+ currentAllowance?: string;
24
+ onAuthorized?: () => void;
25
+ traceId?: string;
26
+ };
@@ -6,5 +6,6 @@ export * from './getTargetNetworkProvider';
6
6
  export * from './sendTransaction';
7
7
  export * from './switchProviderChainId';
8
8
  export * from './transactionEvents';
9
+ export * from './providerChecks';
9
10
  export * from './types';
10
11
  export * from './urls';
@@ -6,6 +6,7 @@ export * from './getTargetNetworkProvider';
6
6
  export * from './sendTransaction';
7
7
  export * from './switchProviderChainId';
8
8
  export * from './transactionEvents';
9
+ export * from './providerChecks';
9
10
  export * from './types';
10
11
  export * from './urls';
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/wallet/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/wallet/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { Wallet } from '../types';
2
+ export declare function isWeb2Wallet(wallet: Wallet): boolean;
@@ -0,0 +1,6 @@
1
+ import { ProviderType } from '@dcl/schemas/dist/dapps/provider-type';
2
+ export function isWeb2Wallet(wallet) {
3
+ return (wallet.providerType === ProviderType.MAGIC ||
4
+ wallet.providerType === ProviderType.MAGIC_TEST);
5
+ }
6
+ //# sourceMappingURL=providerChecks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providerChecks.js","sourceRoot":"","sources":["../../../../src/modules/wallet/utils/providerChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAGpE,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,CACL,MAAM,CAAC,YAAY,KAAK,YAAY,CAAC,KAAK;QAC1C,MAAM,CAAC,YAAY,KAAK,YAAY,CAAC,UAAU,CAChD,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decentraland-dapps",
3
- "version": "23.26.0",
3
+ "version": "23.27.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -23,7 +23,7 @@
23
23
  "dcl-catalyst-client": "^21.1.0",
24
24
  "decentraland-connect": "^9.0.0",
25
25
  "decentraland-crypto-fetch": "^2.0.1",
26
- "decentraland-transactions": "^2.18.2",
26
+ "decentraland-transactions": "^2.18.3",
27
27
  "decentraland-ui": "^6.12.3",
28
28
  "decentraland-ui2": "^0.10.1",
29
29
  "ethers": "^5.7.2",