@otoplo/wallet-common 0.1.12 → 0.1.14
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/index.js +337 -319
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/persistence/datastore/db.d.ts +39 -0
- package/dist/types/persistence/datastore/db.d.ts.map +1 -0
- package/dist/types/persistence/datastore/index.d.ts +3 -0
- package/dist/types/persistence/datastore/index.d.ts.map +1 -0
- package/dist/types/persistence/datastore/kv.d.ts +34 -0
- package/dist/types/persistence/datastore/kv.d.ts.map +1 -0
- package/dist/types/persistence/index.d.ts +3 -0
- package/dist/types/persistence/index.d.ts.map +1 -0
- package/dist/types/persistence/wallet-db.d.ts +61 -0
- package/dist/types/persistence/wallet-db.d.ts.map +1 -0
- package/dist/types/services/asset.d.ts +19 -0
- package/dist/types/services/asset.d.ts.map +1 -0
- package/dist/types/services/cache.d.ts +14 -0
- package/dist/types/services/cache.d.ts.map +1 -0
- package/dist/types/services/discovery.d.ts +14 -0
- package/dist/types/services/discovery.d.ts.map +1 -0
- package/dist/types/services/index.d.ts +9 -0
- package/dist/types/services/index.d.ts.map +1 -0
- package/dist/types/services/key.d.ts +13 -0
- package/dist/types/services/key.d.ts.map +1 -0
- package/dist/types/services/rostrum.d.ts +32 -0
- package/dist/types/services/rostrum.d.ts.map +1 -0
- package/dist/types/services/session.d.ts +48 -0
- package/dist/types/services/session.d.ts.map +1 -0
- package/dist/types/services/transaction.d.ts +41 -0
- package/dist/types/services/transaction.d.ts.map +1 -0
- package/dist/types/services/tx-transformer.d.ts +22 -0
- package/dist/types/services/tx-transformer.d.ts.map +1 -0
- package/dist/types/services/wallet.d.ts +101 -0
- package/dist/types/services/wallet.d.ts.map +1 -0
- package/dist/types/state/hooks.d.ts +16 -0
- package/dist/types/state/hooks.d.ts.map +1 -0
- package/dist/types/state/index.d.ts +4 -0
- package/dist/types/state/index.d.ts.map +1 -0
- package/dist/types/state/slices/auth.d.ts +17 -0
- package/dist/types/state/slices/auth.d.ts.map +1 -0
- package/dist/types/state/slices/dapp.d.ts +29 -0
- package/dist/types/state/slices/dapp.d.ts.map +1 -0
- package/dist/types/state/slices/index.d.ts +7 -0
- package/dist/types/state/slices/index.d.ts.map +1 -0
- package/dist/types/state/slices/loader.d.ts +15 -0
- package/dist/types/state/slices/loader.d.ts.map +1 -0
- package/dist/types/state/slices/notifications.d.ts +142 -0
- package/dist/types/state/slices/notifications.d.ts.map +1 -0
- package/dist/types/state/slices/status.d.ts +62 -0
- package/dist/types/state/slices/status.d.ts.map +1 -0
- package/dist/types/state/slices/wallet.d.ts +1032 -0
- package/dist/types/state/slices/wallet.d.ts.map +1 -0
- package/dist/types/state/store.d.ts +23 -0
- package/dist/types/state/store.d.ts.map +1 -0
- package/dist/types/types/dapp.types.d.ts +19 -0
- package/dist/types/types/dapp.types.d.ts.map +1 -0
- package/dist/types/types/db.types.d.ts +128 -0
- package/dist/types/types/db.types.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/notification.types.d.ts +21 -0
- package/dist/types/types/notification.types.d.ts.map +1 -0
- package/dist/types/types/rostrum.types.d.ts +145 -0
- package/dist/types/types/rostrum.types.d.ts.map +1 -0
- package/dist/types/types/wallet.types.d.ts +54 -0
- package/dist/types/types/wallet.types.d.ts.map +1 -0
- package/dist/types/utils/asset.d.ts +9 -0
- package/dist/types/utils/asset.d.ts.map +1 -0
- package/dist/types/utils/common.d.ts +27 -0
- package/dist/types/utils/common.d.ts.map +1 -0
- package/dist/types/utils/enums.d.ts +20 -0
- package/dist/types/utils/enums.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +8 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/keypath.d.ts +5 -0
- package/dist/types/utils/keypath.d.ts.map +1 -0
- package/dist/types/utils/price.d.ts +42 -0
- package/dist/types/utils/price.d.ts.map +1 -0
- package/dist/types/utils/seed.d.ts +5 -0
- package/dist/types/utils/seed.d.ts.map +1 -0
- package/dist/types/utils/vault.d.ts +8 -0
- package/dist/types/utils/vault.d.ts.map +1 -0
- package/package.json +7 -6
- package/src/index.ts +1 -1
- package/src/utils/common.ts +20 -1
- package/dist/index.d.ts +0 -2278
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { SessionRequestType } from '../../utils';
|
|
3
|
+
import { DappRpcRequest } from '../../types';
|
|
4
|
+
export interface DappModalState {
|
|
5
|
+
modalType: SessionRequestType | null;
|
|
6
|
+
currentRequest: DappRpcRequest | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const dappModalActions: import('@reduxjs/toolkit').CaseReducerActions<{
|
|
9
|
+
showRequest(state: {
|
|
10
|
+
modalType: SessionRequestType | null;
|
|
11
|
+
currentRequest: {
|
|
12
|
+
type: SessionRequestType;
|
|
13
|
+
accountId: number;
|
|
14
|
+
sessionId: string;
|
|
15
|
+
request: any;
|
|
16
|
+
} | null;
|
|
17
|
+
}, action: PayloadAction<DappRpcRequest>): void;
|
|
18
|
+
clear(state: {
|
|
19
|
+
modalType: SessionRequestType | null;
|
|
20
|
+
currentRequest: {
|
|
21
|
+
type: SessionRequestType;
|
|
22
|
+
accountId: number;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
request: any;
|
|
25
|
+
} | null;
|
|
26
|
+
}): void;
|
|
27
|
+
}, "dappModal">;
|
|
28
|
+
export declare const dappModalReducer: import('redux').Reducer<DappModalState>;
|
|
29
|
+
//# sourceMappingURL=dapp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dapp.d.ts","sourceRoot":"","sources":["../../../../src/state/slices/dapp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACrC,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC;AAsBD,eAAO,MAAM,gBAAgB;;mBAxBhB,kBAAkB,GAAG,IAAI;;;;;;;eAaP,aAAa,CAAC,cAAc,CAAC;;mBAb/C,kBAAkB,GAAG,IAAI;;;;;;;;eAwBgB,CAAC;AACvD,eAAO,MAAM,gBAAgB,yCAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/state/slices/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
export interface LoaderState {
|
|
3
|
+
counter: number;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
text?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const loaderActions: import('@reduxjs/toolkit').CaseReducerActions<{
|
|
8
|
+
setLoader: (state: {
|
|
9
|
+
counter: number;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
text?: string | undefined;
|
|
12
|
+
}, action: PayloadAction<Omit<LoaderState, "counter">>) => void;
|
|
13
|
+
}, "loader">;
|
|
14
|
+
export declare const loaderReducer: import('redux').Reducer<LoaderState>;
|
|
15
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/state/slices/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAsBD,eAAO,MAAM,aAAa;;iBAzBf,MAAM;iBACN,OAAO;eACT,MAAM;eAYgB,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAW1B,CAAC;AACjD,eAAO,MAAM,aAAa,sCAAsB,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { AppNotification } from '../../types';
|
|
3
|
+
export interface NotificationsState {
|
|
4
|
+
wallet: Record<string, AppNotification>;
|
|
5
|
+
web3: Record<string, AppNotification>;
|
|
6
|
+
}
|
|
7
|
+
export declare const notificationsActions: import('@reduxjs/toolkit').CaseReducerActions<{
|
|
8
|
+
addNotification: (state: {
|
|
9
|
+
wallet: {
|
|
10
|
+
[x: string]: {
|
|
11
|
+
id: string;
|
|
12
|
+
type: "wallet" | "web3";
|
|
13
|
+
title: string;
|
|
14
|
+
message?: string | undefined;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
action?: {
|
|
17
|
+
type: "DAPP_REQUEST";
|
|
18
|
+
account: number;
|
|
19
|
+
sessionId: string;
|
|
20
|
+
payload: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: "DISPATCH";
|
|
23
|
+
actionType: string;
|
|
24
|
+
payload?: any;
|
|
25
|
+
} | {
|
|
26
|
+
type: "NONE";
|
|
27
|
+
} | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
web3: {
|
|
31
|
+
[x: string]: {
|
|
32
|
+
id: string;
|
|
33
|
+
type: "wallet" | "web3";
|
|
34
|
+
title: string;
|
|
35
|
+
message?: string | undefined;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
action?: {
|
|
38
|
+
type: "DAPP_REQUEST";
|
|
39
|
+
account: number;
|
|
40
|
+
sessionId: string;
|
|
41
|
+
payload: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: "DISPATCH";
|
|
44
|
+
actionType: string;
|
|
45
|
+
payload?: any;
|
|
46
|
+
} | {
|
|
47
|
+
type: "NONE";
|
|
48
|
+
} | undefined;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, action: PayloadAction<AppNotification>) => void;
|
|
52
|
+
removeNotification: (state: {
|
|
53
|
+
wallet: {
|
|
54
|
+
[x: string]: {
|
|
55
|
+
id: string;
|
|
56
|
+
type: "wallet" | "web3";
|
|
57
|
+
title: string;
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
createdAt: number;
|
|
60
|
+
action?: {
|
|
61
|
+
type: "DAPP_REQUEST";
|
|
62
|
+
account: number;
|
|
63
|
+
sessionId: string;
|
|
64
|
+
payload: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: "DISPATCH";
|
|
67
|
+
actionType: string;
|
|
68
|
+
payload?: any;
|
|
69
|
+
} | {
|
|
70
|
+
type: "NONE";
|
|
71
|
+
} | undefined;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
web3: {
|
|
75
|
+
[x: string]: {
|
|
76
|
+
id: string;
|
|
77
|
+
type: "wallet" | "web3";
|
|
78
|
+
title: string;
|
|
79
|
+
message?: string | undefined;
|
|
80
|
+
createdAt: number;
|
|
81
|
+
action?: {
|
|
82
|
+
type: "DAPP_REQUEST";
|
|
83
|
+
account: number;
|
|
84
|
+
sessionId: string;
|
|
85
|
+
payload: string;
|
|
86
|
+
} | {
|
|
87
|
+
type: "DISPATCH";
|
|
88
|
+
actionType: string;
|
|
89
|
+
payload?: any;
|
|
90
|
+
} | {
|
|
91
|
+
type: "NONE";
|
|
92
|
+
} | undefined;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}, action: PayloadAction<string>) => void;
|
|
96
|
+
clearAll: (state: {
|
|
97
|
+
wallet: {
|
|
98
|
+
[x: string]: {
|
|
99
|
+
id: string;
|
|
100
|
+
type: "wallet" | "web3";
|
|
101
|
+
title: string;
|
|
102
|
+
message?: string | undefined;
|
|
103
|
+
createdAt: number;
|
|
104
|
+
action?: {
|
|
105
|
+
type: "DAPP_REQUEST";
|
|
106
|
+
account: number;
|
|
107
|
+
sessionId: string;
|
|
108
|
+
payload: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: "DISPATCH";
|
|
111
|
+
actionType: string;
|
|
112
|
+
payload?: any;
|
|
113
|
+
} | {
|
|
114
|
+
type: "NONE";
|
|
115
|
+
} | undefined;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
web3: {
|
|
119
|
+
[x: string]: {
|
|
120
|
+
id: string;
|
|
121
|
+
type: "wallet" | "web3";
|
|
122
|
+
title: string;
|
|
123
|
+
message?: string | undefined;
|
|
124
|
+
createdAt: number;
|
|
125
|
+
action?: {
|
|
126
|
+
type: "DAPP_REQUEST";
|
|
127
|
+
account: number;
|
|
128
|
+
sessionId: string;
|
|
129
|
+
payload: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: "DISPATCH";
|
|
132
|
+
actionType: string;
|
|
133
|
+
payload?: any;
|
|
134
|
+
} | {
|
|
135
|
+
type: "NONE";
|
|
136
|
+
} | undefined;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}, action: PayloadAction<"wallet" | "web3" | "all">) => void;
|
|
140
|
+
}, "notifications">;
|
|
141
|
+
export declare const notificationsReducer: import('redux').Reducer<NotificationsState>;
|
|
142
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/state/slices/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACvC;AAmCD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAxBI,aAAa,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAO3B,aAAa,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAI/B,aAAa,CAAC,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;mBAaR,CAAC;AAC/D,eAAO,MAAM,oBAAoB,6CAA6B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { Price } from '../../types';
|
|
3
|
+
export interface StatusState {
|
|
4
|
+
status: "Online" | "Offline";
|
|
5
|
+
height: number;
|
|
6
|
+
price: Record<string, Price>;
|
|
7
|
+
hasNetwork: boolean;
|
|
8
|
+
isSuspended: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const fetchPrice: import('@reduxjs/toolkit').AsyncThunk<Record<string, Price>, void, import('@reduxjs/toolkit').AsyncThunkConfig>;
|
|
11
|
+
export declare const statusActions: import('@reduxjs/toolkit').CaseReducerActions<{
|
|
12
|
+
setHeight: (state: {
|
|
13
|
+
status: "Online" | "Offline";
|
|
14
|
+
height: number;
|
|
15
|
+
price: {
|
|
16
|
+
[x: string]: {
|
|
17
|
+
value: number;
|
|
18
|
+
change: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
hasNetwork: boolean;
|
|
22
|
+
isSuspended: boolean;
|
|
23
|
+
}, action: PayloadAction<number>) => void;
|
|
24
|
+
setOffline: (state: {
|
|
25
|
+
status: "Online" | "Offline";
|
|
26
|
+
height: number;
|
|
27
|
+
price: {
|
|
28
|
+
[x: string]: {
|
|
29
|
+
value: number;
|
|
30
|
+
change: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
hasNetwork: boolean;
|
|
34
|
+
isSuspended: boolean;
|
|
35
|
+
}) => void;
|
|
36
|
+
setHasNetwork: (state: {
|
|
37
|
+
status: "Online" | "Offline";
|
|
38
|
+
height: number;
|
|
39
|
+
price: {
|
|
40
|
+
[x: string]: {
|
|
41
|
+
value: number;
|
|
42
|
+
change: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
hasNetwork: boolean;
|
|
46
|
+
isSuspended: boolean;
|
|
47
|
+
}, action: PayloadAction<boolean>) => void;
|
|
48
|
+
setIsSuspended: (state: {
|
|
49
|
+
status: "Online" | "Offline";
|
|
50
|
+
height: number;
|
|
51
|
+
price: {
|
|
52
|
+
[x: string]: {
|
|
53
|
+
value: number;
|
|
54
|
+
change: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
hasNetwork: boolean;
|
|
58
|
+
isSuspended: boolean;
|
|
59
|
+
}, action: PayloadAction<boolean>) => void;
|
|
60
|
+
}, "status">;
|
|
61
|
+
export declare const statusReducer: import('redux').Reducer<StatusState>;
|
|
62
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/state/slices/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB;AAUD,eAAO,MAAM,UAAU,iHAcrB,CAAC;AAiCH,eAAO,MAAM,aAAa;;gBA9DhB,QAAQ,GAAG,SAAS;gBACpB,MAAM;;;;;;;oBAEF,OAAO;qBACN,OAAO;eA+BS,aAAa,CAAC,MAAM,CAAC;;gBAnC1C,QAAQ,GAAG,SAAS;gBACpB,MAAM;;;;;;;oBAEF,OAAO;qBACN,OAAO;;;gBAJZ,QAAQ,GAAG,SAAS;gBACpB,MAAM;;;;;;;oBAEF,OAAO;qBACN,OAAO;eAwCa,aAAa,CAAC,OAAO,CAAC;;gBA5C/C,QAAQ,GAAG,SAAS;gBACpB,MAAM;;;;;;;oBAEF,OAAO;qBACN,OAAO;eA2Cc,aAAa,CAAC,OAAO,CAAC;YAeV,CAAC;AACjD,eAAO,MAAM,aAAa,sCAAsB,CAAC"}
|