@coopenomics/desktop 2025.5.5 → 2025.5.14-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.
- package/index.html +21 -2
- package/package.json +5 -5
- package/src/entities/Registrator/model/store.ts +16 -11
- package/src/entities/Wallet/api/index.ts +5 -3
- package/src/features/Agreementer/SignAgreementDialog/model/index.ts +5 -3
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +1 -1
- package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -9
- package/src/features/Decision/CreateProject/model/index.ts +1 -1
- package/src/features/Decision/VoteAgainstDecision/model/index.ts +14 -2
- package/src/features/Decision/VoteForDecision/model/index.ts +9 -5
- package/src/features/FreeDecision/CreateProject/model/index.ts +1 -1
- package/src/features/Meet/CloseMeetWithDecision/model/index.ts +13 -13
- package/src/features/Meet/CreateMeet/model/index.ts +1 -1
- package/src/features/Meet/RestartMeet/model/index.ts +6 -3
- package/src/features/Request/AcceptRequest/api/index.ts +3 -10
- package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +4 -9
- package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +6 -11
- package/src/features/Request/ConfirmSupplyOnRequest/ui/ConfirmSupplyOnRequestButton.vue +1 -1
- package/src/features/Request/CreateChildOrder/model/index.ts +35 -30
- package/src/features/Request/CreateChildOrder/ui/CreateChildOrderButton/CreateChildOrderButton.vue +20 -15
- package/src/features/Request/DisputeOnRequest/api/index.ts +19 -24
- package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
- package/src/features/Request/RecieveOnRequest/api/index.ts +6 -11
- package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
- package/src/features/Request/SupplyOnRequest/api/index.ts +18 -27
- package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +7 -5
- package/src/features/User/CreateUser/api/index.ts +28 -10
- package/src/features/User/CreateUser/model/index.ts +39 -31
- package/src/pages/Cooperative/ListOfAgenda/ui/ListOfAgendaQuestions.vue +8 -8
- package/src/pages/Cooperative/ListOfParticipants/ui/ListOfParticipantsPage.vue +3 -3
- package/src/pages/Registrator/SignUp/EmailInput.vue +0 -7
- package/src/pages/Union/ConnectionAgreement/ConnectionAgreementPage.vue +1 -1
- package/src/processes/init-app/index.ts +2 -0
- package/src/processes/process-decisions/index.ts +32 -29
- package/src/processes/select-branch/index.ts +1 -1
- package/src/shared/api/indexDB.ts +0 -1
- package/src/shared/lib/document/model/const.ts +30 -0
- package/src/shared/lib/document/model/entity.ts +33 -21
- package/src/shared/lib/document/model/index.ts +1 -1
- package/src/shared/lib/document/model/types.ts +2 -3
- package/src/shared/lib/types/document/index.ts +11 -13
- package/src/shared/lib/types/user/IUserData.ts +5 -6
- package/src/shared/lib/types/user/index.ts +1 -11
- package/src/shared/lib/utils/account.ts +24 -0
- package/src/shared/lib/utils/index.ts +2 -0
- package/src/shared/lib/utils/theme.ts +30 -0
- package/src/shared/store/index.ts +9 -5
- package/src/shared/ui/BaseDocument/BaseDocument.vue +43 -42
- package/src/shared/ui/ComplexDocument/ComplexDocument.vue +7 -5
- package/src/shared/ui/ToogleDarkLight/ToogleDarkLight.vue +8 -1
- package/src/shared/ui/ZodForm/ZodForm.vue +1 -1
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentsTable.vue +3 -2
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/ListOfPaymentsWidget.vue +9 -10
- package/src/widgets/Meets/MeetDetailsVoting/model.ts +4 -4
- package/src/widgets/Participants/ui/ParticipantCard.vue +17 -9
- package/src/widgets/Participants/ui/ParticipantDetails.vue +7 -6
- package/src/widgets/Participants/ui/ParticipantsTable.vue +29 -23
- package/src/widgets/Questions/ui/QuestionsTable/QuestionsTable.vue +8 -8
- package/src/widgets/RequireAgreements/ui/RequireAgreements.vue +1 -1
@@ -10,6 +10,7 @@ import { useVoteAgainstDecision } from 'src/features/Decision/VoteAgainstDecisio
|
|
10
10
|
import { computed } from 'vue'
|
11
11
|
import { useAgendaStore } from 'src/entities/Agenda/model'
|
12
12
|
import type { IAgenda } from 'src/entities/Agenda/model'
|
13
|
+
import { DigitalDocument } from 'src/shared/lib/document'
|
13
14
|
|
14
15
|
/**
|
15
16
|
* Процесс обработки решений
|
@@ -19,7 +20,7 @@ export function useDecisionProcessor() {
|
|
19
20
|
const { info } = useSystemStore()
|
20
21
|
const session = useSessionStore()
|
21
22
|
const agendaStore = useAgendaStore()
|
22
|
-
|
23
|
+
|
23
24
|
// Данные повестки и состояние загрузки
|
24
25
|
const decisions = computed(() => agendaStore.agenda)
|
25
26
|
const loading = computed(() => agendaStore.loading)
|
@@ -47,11 +48,11 @@ export function useDecisionProcessor() {
|
|
47
48
|
if (row.documents?.statement?.documentAggregate?.rawDocument?.full_title) {
|
48
49
|
return row.documents.statement.documentAggregate.rawDocument.full_title
|
49
50
|
}
|
50
|
-
|
51
|
+
|
51
52
|
if (row.documents?.decision?.documentAggregate?.rawDocument?.full_title) {
|
52
53
|
return row.documents.decision.documentAggregate.rawDocument.full_title
|
53
54
|
}
|
54
|
-
|
55
|
+
|
55
56
|
// Поддержка исходного формата для таблицы
|
56
57
|
if (row.table?.statement?.meta && typeof row.table.statement.meta === 'string') {
|
57
58
|
try {
|
@@ -61,7 +62,7 @@ export function useDecisionProcessor() {
|
|
61
62
|
// Игнорируем ошибку парсинга JSON
|
62
63
|
}
|
63
64
|
}
|
64
|
-
|
65
|
+
|
65
66
|
return 'Вопрос без заголовка'
|
66
67
|
}
|
67
68
|
|
@@ -85,16 +86,16 @@ export function useDecisionProcessor() {
|
|
85
86
|
if (row.documents?.statement?.documentAggregate?.rawDocument?.hash) {
|
86
87
|
return row.documents.statement.documentAggregate.rawDocument.hash
|
87
88
|
}
|
88
|
-
|
89
|
+
|
89
90
|
if (row.documents?.decision?.documentAggregate?.rawDocument?.hash) {
|
90
91
|
return row.documents.decision.documentAggregate.rawDocument.hash
|
91
92
|
}
|
92
|
-
|
93
|
+
|
93
94
|
// Поддержка исходного формата для таблицы
|
94
95
|
if (row.table?.statement?.hash) {
|
95
96
|
return row.table.statement.hash
|
96
97
|
}
|
97
|
-
|
98
|
+
|
98
99
|
return null
|
99
100
|
}
|
100
101
|
|
@@ -105,7 +106,7 @@ export function useDecisionProcessor() {
|
|
105
106
|
if (!row.table?.id || !row.table?.username || !row.table?.type) {
|
106
107
|
throw new Error('Некорректные данные решения')
|
107
108
|
}
|
108
|
-
|
109
|
+
|
109
110
|
const decision_id = Number(row.table.id)
|
110
111
|
const username = row.table.username
|
111
112
|
const type = row.table.type
|
@@ -157,27 +158,22 @@ export function useDecisionProcessor() {
|
|
157
158
|
if (!row.table?.id) {
|
158
159
|
throw new Error('Некорректные данные решения')
|
159
160
|
}
|
160
|
-
|
161
|
+
|
161
162
|
const decision_id = Number(row.table.id)
|
162
163
|
|
163
164
|
// Генерируем документ решения
|
164
165
|
const document = await generateDecisionDocument(row)
|
165
166
|
|
166
|
-
//
|
167
|
-
const
|
168
|
-
const
|
169
|
-
hash: document.hash,
|
170
|
-
meta: JSON.stringify(document.meta),
|
171
|
-
signature: signed_hash_of_document.signature,
|
172
|
-
public_key: signed_hash_of_document.public_key,
|
173
|
-
}
|
167
|
+
// Создаем экземпляр класса DigitalDocument и подписываем документ
|
168
|
+
const digitalDocument = new DigitalDocument(document)
|
169
|
+
const signedDocument = await digitalDocument.sign(session.username)
|
174
170
|
|
175
171
|
// Подготавливаем данные для транзакций
|
176
172
|
const authorizeData: SovietContract.Actions.Decisions.Authorize.IAuthorize = {
|
177
173
|
coopname: info.coopname,
|
178
174
|
chairman: session.username,
|
179
175
|
decision_id,
|
180
|
-
document:
|
176
|
+
document: {...signedDocument, meta: JSON.stringify(signedDocument.meta)},
|
181
177
|
}
|
182
178
|
|
183
179
|
const execData: SovietContract.Actions.Decisions.Exec.IExec = {
|
@@ -218,22 +214,29 @@ export function useDecisionProcessor() {
|
|
218
214
|
/**
|
219
215
|
* Голосовать "за" решение
|
220
216
|
*/
|
221
|
-
async function voteForDecision(
|
222
|
-
|
223
|
-
|
224
|
-
|
217
|
+
async function voteForDecision(row: IAgenda) {
|
218
|
+
if (!row.table?.id) {
|
219
|
+
throw new Error('Не удалось получить ID решения');
|
220
|
+
}
|
221
|
+
|
222
|
+
const decision_id = Number(row.table.id);
|
223
|
+
const { voteForDecision: vote } = useVoteForDecision();
|
224
|
+
await vote(decision_id);
|
225
|
+
return true;
|
225
226
|
}
|
226
227
|
|
227
228
|
/**
|
228
229
|
* Голосовать "против" решения
|
229
230
|
*/
|
230
|
-
async function voteAgainstDecision(
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
231
|
+
async function voteAgainstDecision(row: IAgenda) {
|
232
|
+
if (!row.table?.id) {
|
233
|
+
throw new Error('Не удалось получить ID решения');
|
234
|
+
}
|
235
|
+
|
236
|
+
const decision_id = Number(row.table.id);
|
237
|
+
const { voteAgainstDecision } = useVoteAgainstDecision();
|
238
|
+
await voteAgainstDecision(decision_id);
|
239
|
+
return true;
|
237
240
|
}
|
238
241
|
|
239
242
|
/**
|
@@ -47,7 +47,7 @@ export function useSelectBranchProcess() {
|
|
47
47
|
const sign = async () => {
|
48
48
|
try {
|
49
49
|
isSubmitting.value = true
|
50
|
-
const doc = await digitalDocument.sign()
|
50
|
+
const doc = await digitalDocument.sign<Cooperative.Registry.SelectBranchStatement.Meta>(session.username)
|
51
51
|
|
52
52
|
await selectBranch({
|
53
53
|
braname: selectedBranch.value,
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import type { IDocument } from '../../types/document';
|
2
|
+
|
3
|
+
export const fakeDocument: IDocument = {
|
4
|
+
version: '1.0.0',
|
5
|
+
hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
6
|
+
doc_hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
7
|
+
meta_hash: 'ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF1234567890',
|
8
|
+
meta: {
|
9
|
+
block_num: 1,
|
10
|
+
coopname: 'voskhod',
|
11
|
+
created_at: new Date().toISOString(),
|
12
|
+
generator: 'generator',
|
13
|
+
lang: 'ru',
|
14
|
+
links: [],
|
15
|
+
registry_id: 1,
|
16
|
+
timezone: 'Europe/Moscow',
|
17
|
+
title: 'Фейковый документ',
|
18
|
+
username: 'tester',
|
19
|
+
version: '1.0.0',
|
20
|
+
},
|
21
|
+
signatures: [{
|
22
|
+
id: 1,
|
23
|
+
signed_hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
24
|
+
signer: 'tester',
|
25
|
+
public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
|
26
|
+
signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
|
27
|
+
signed_at: new Date().toISOString(),
|
28
|
+
meta: ''
|
29
|
+
}]
|
30
|
+
};
|
@@ -1,28 +1,36 @@
|
|
1
1
|
import type { IGenerate, IGeneratedDocument } from './types'
|
2
2
|
import { api } from '../api';
|
3
3
|
import { useGlobalStore } from 'src/shared/store';
|
4
|
-
import type {
|
4
|
+
import type { IDocument, IMetaDocument } from 'src/shared/lib/types/document';
|
5
5
|
import type { Cooperative } from 'cooptypes';
|
6
|
+
import { Classes } from '@coopenomics/sdk';
|
6
7
|
|
7
8
|
export type ZGeneratedDocument = Cooperative.Document.ZGeneratedDocument
|
8
9
|
|
9
10
|
export const useSignDocument = () => {
|
10
11
|
const globalStore = useGlobalStore()
|
11
12
|
|
12
|
-
|
13
|
+
/**
|
14
|
+
* Подписывает документ
|
15
|
+
*/
|
16
|
+
const signDocument = async(
|
17
|
+
document: ZGeneratedDocument,
|
18
|
+
account: string,
|
19
|
+
signatureId = 1,
|
20
|
+
): Promise<Cooperative.Document.ISignedDocument2> => {
|
13
21
|
if (!document)
|
14
22
|
throw new Error('Документ на подпись не предоставлен')
|
15
23
|
|
16
|
-
const
|
24
|
+
const wifKey = globalStore.wif?.toString();
|
25
|
+
if (!wifKey)
|
26
|
+
throw new Error('Приватный ключ не установлен');
|
17
27
|
|
18
|
-
|
19
|
-
|
20
|
-
meta: document.meta,
|
21
|
-
public_key: digital_signature.public_key,
|
22
|
-
signature: digital_signature.signature,
|
23
|
-
}
|
28
|
+
// Используем класс из SDK для подписи
|
29
|
+
const docSigner = new Classes.Document(wifKey);
|
24
30
|
|
25
|
-
|
31
|
+
|
32
|
+
// Получаем доступ к Document классу из SDK
|
33
|
+
return await docSigner.signDocument(document, account, signatureId);
|
26
34
|
}
|
27
35
|
|
28
36
|
return {
|
@@ -32,7 +40,7 @@ export const useSignDocument = () => {
|
|
32
40
|
|
33
41
|
export class DigitalDocument {
|
34
42
|
public data: IGeneratedDocument | undefined
|
35
|
-
public signedDocument:
|
43
|
+
public signedDocument: IDocument | undefined
|
36
44
|
|
37
45
|
constructor(document?: IGeneratedDocument){
|
38
46
|
this.data = document
|
@@ -43,22 +51,26 @@ export class DigitalDocument {
|
|
43
51
|
return this.data;
|
44
52
|
}
|
45
53
|
|
46
|
-
|
54
|
+
/**
|
55
|
+
* Подписывает документ
|
56
|
+
*/
|
57
|
+
async sign<T extends IMetaDocument>(account: string, signatureId = 1): Promise<IDocument<T>> {
|
47
58
|
const globalStore = useGlobalStore()
|
48
59
|
if (!this.data)
|
49
60
|
throw new Error('Ошибка генерации документа')
|
50
61
|
|
51
|
-
const
|
62
|
+
const wifKey = globalStore.wif?.toString();
|
63
|
+
if (!wifKey)
|
64
|
+
throw new Error('Приватный ключ не установлен');
|
52
65
|
|
53
|
-
|
54
|
-
|
55
|
-
meta: this.data.meta,
|
56
|
-
public_key: digital_signature.public_key,
|
57
|
-
signature: digital_signature.signature,
|
58
|
-
};
|
66
|
+
// Используем класс из SDK для подписи
|
67
|
+
const docSigner = new Classes.Document(wifKey);
|
59
68
|
|
60
|
-
|
69
|
+
// Подписываем документ с использованием SDK
|
70
|
+
const signedDoc = await docSigner.signDocument<T>(this.data, account, signatureId);
|
61
71
|
|
62
|
-
|
72
|
+
this.signedDocument = signedDoc;
|
63
73
|
|
74
|
+
return signedDoc;
|
75
|
+
}
|
64
76
|
}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { Cooperative } from 'cooptypes';
|
2
2
|
|
3
|
-
export type IGeneratedDocument = Cooperative.Document.
|
3
|
+
export type IGeneratedDocument = Cooperative.Document.ZGeneratedDocument;
|
4
4
|
export type IGenerate = Cooperative.Document.IGenerate;
|
5
5
|
export type IGenerateJoinCoop = Cooperative.Document.IGenerateJoinCoop;
|
6
6
|
export type IGenerateJoinCoopDecision =
|
7
7
|
Cooperative.Document.IGenerateJoinCoopDecision;
|
8
|
-
|
9
|
-
// export type IGenerateWalletAgreement = Cooperative.Document.IGenerateWalletAgreement
|
8
|
+
export type IGenerateWalletAgreement = Cooperative.Document.IGenerateWalletAgreement;
|
@@ -1,15 +1,13 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Zeus } from '@coopenomics/sdk/index';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
hash: string;
|
12
|
-
meta: string;
|
13
|
-
public_key: string;
|
14
|
-
signature: string;
|
3
|
+
// Добавляю реэкспорты типов документов
|
4
|
+
export type IChainDocument2 = Zeus.ModelTypes['SignedBlockchainDocument']
|
5
|
+
export type ISignedDocument = Zeus.ModelTypes['SignedDigitalDocumentInput']
|
6
|
+
export type ISignatureInfo = Zeus.ModelTypes['SignatureInfo']
|
7
|
+
export type IMetaDocument<T = any> = Zeus.ModelTypes['MetaDocumentInput'] & T
|
8
|
+
export type IComplexDocument = Zeus.ModelTypes['DocumentPackageAggregate']
|
9
|
+
export type IDocument<T = any> = Omit<Zeus.ModelTypes['SignedDigitalDocumentInput'], 'meta'> & {
|
10
|
+
meta: IMetaDocument<T>
|
15
11
|
}
|
12
|
+
// Для обратной совместимости
|
13
|
+
export type IObjectedDocument = IDocument;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { Mutations } from '@coopenomics/sdk';
|
1
2
|
import { Cooperative } from 'cooptypes';
|
2
3
|
|
3
4
|
export type IEntrepreneurData = Cooperative.Users.IEntrepreneurData;
|
@@ -20,9 +21,7 @@ export interface IUserData {
|
|
20
21
|
|
21
22
|
|
22
23
|
|
23
|
-
export
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
organization_data?: ICreateOrganizationData & {bank_account: Cooperative.Payments.IBankAccount};
|
28
|
-
}
|
24
|
+
export type IRegisterAccount = Mutations.Accounts.RegisterAccount.IInput['data'];
|
25
|
+
export type IRegisteredAccountResult = Mutations.Accounts.RegisterAccount.IOutput[typeof Mutations.Accounts.RegisterAccount.name];
|
26
|
+
|
27
|
+
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { IObjectedDocument } from '../document';
|
2
1
|
import { Cooperative } from 'cooptypes';
|
3
2
|
|
4
3
|
export interface IKeyPair {
|
@@ -12,7 +11,7 @@ export interface IGeneratedAccount extends IKeyPair {
|
|
12
11
|
|
13
12
|
export interface IToken {
|
14
13
|
token: string;
|
15
|
-
expires:
|
14
|
+
expires: unknown;
|
16
15
|
}
|
17
16
|
|
18
17
|
export interface ITokens {
|
@@ -42,12 +41,3 @@ export interface ICreatedUser {
|
|
42
41
|
user: IUser;
|
43
42
|
tokens: ITokens;
|
44
43
|
}
|
45
|
-
|
46
|
-
export interface ISendStatement {
|
47
|
-
username: string;
|
48
|
-
statement: IObjectedDocument;
|
49
|
-
wallet_agreement: IObjectedDocument;
|
50
|
-
privacy_agreement: IObjectedDocument;
|
51
|
-
signature_agreement: IObjectedDocument;
|
52
|
-
user_agreement: IObjectedDocument;
|
53
|
-
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import {
|
2
|
+
AccountTypes,
|
3
|
+
type IAccount,
|
4
|
+
} from 'src/entities/Account/types'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Функция для получения отформатированного имени участника
|
8
|
+
* @param account - объект аккаунта пользователя
|
9
|
+
* @returns форматированное имя/наименование
|
10
|
+
*/
|
11
|
+
export const getName = (account: IAccount) => {
|
12
|
+
const d = account.private_account
|
13
|
+
if (!d) return ''
|
14
|
+
switch (d.type) {
|
15
|
+
case AccountTypes.individual:
|
16
|
+
return `${d.individual_data?.last_name} ${d.individual_data?.first_name} ${d.individual_data?.middle_name}`
|
17
|
+
case AccountTypes.entrepreneur:
|
18
|
+
return `ИП ${d.entrepreneur_data?.last_name} ${d.entrepreneur_data?.first_name} ${d.entrepreneur_data?.middle_name}`
|
19
|
+
case AccountTypes.organization:
|
20
|
+
return d.organization_data?.short_name
|
21
|
+
default:
|
22
|
+
return ''
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { LocalStorage } from 'quasar';
|
2
|
+
import { Dark } from 'quasar';
|
3
|
+
|
4
|
+
const THEME_KEY = 'theme-mode';
|
5
|
+
|
6
|
+
export function saveThemeToStorage(isDark: boolean) {
|
7
|
+
if (process.env.CLIENT) {
|
8
|
+
LocalStorage.set(THEME_KEY, isDark ? 'dark' : 'light');
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
export function getThemeFromStorage(): 'dark' | 'light' | null {
|
13
|
+
if (process.env.CLIENT) {
|
14
|
+
const saved = LocalStorage.getItem(THEME_KEY);
|
15
|
+
if (saved === 'dark' || saved === 'light') return saved;
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
|
21
|
+
export function applyThemeFromStorage() {
|
22
|
+
if (process.env.CLIENT) {
|
23
|
+
const saved = getThemeFromStorage();
|
24
|
+
if (saved === 'dark') {
|
25
|
+
Dark.set(true);
|
26
|
+
} else if (saved === 'light') {
|
27
|
+
Dark.set(false);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -4,7 +4,6 @@ import { defineStore } from 'pinia';
|
|
4
4
|
import { ref, Ref } from 'vue';
|
5
5
|
import { decrypt, encrypt, hashSHA256 } from '../api/crypto';
|
6
6
|
import { IMessageSignature } from '../lib/types/crypto';
|
7
|
-
import { useSessionStore } from 'src/entities/Session';
|
8
7
|
import { TransactResult } from '@wharfkit/session';
|
9
8
|
import { readBlockchain } from '../api';
|
10
9
|
import { ITokens } from '../lib/types/user';
|
@@ -82,6 +81,9 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
82
81
|
client.setToken(tokens.value.access.token)
|
83
82
|
}
|
84
83
|
|
84
|
+
if (decryptedKey && decryptedUsername) {
|
85
|
+
client.setWif(decryptedUsername, decryptedKey)
|
86
|
+
}
|
85
87
|
|
86
88
|
} catch (error: any) {
|
87
89
|
await setToIndexedDB(info.coopname, 'store', 'encryptedKey', '');
|
@@ -161,16 +163,18 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
161
163
|
};
|
162
164
|
|
163
165
|
const sendAction = async (action: any, broadcast: boolean) => {
|
164
|
-
|
166
|
+
// Получаем хранилище сессии с помощью импорта, избегая циклической зависимости
|
167
|
+
const sessionStore = (await import('src/entities/Session')).useSessionStore();
|
165
168
|
const formedAction = await formActionFromAbi(action);
|
166
169
|
|
167
|
-
return
|
170
|
+
return sessionStore.session?.transact({
|
168
171
|
action: formedAction,
|
169
172
|
}, { broadcast });
|
170
173
|
};
|
171
174
|
|
172
175
|
const sendActions = async (actions: any[], broadcast: boolean) => {
|
173
|
-
|
176
|
+
// Получаем хранилище сессии с помощью импорта, избегая циклической зависимости
|
177
|
+
const sessionStore = (await import('src/entities/Session')).useSessionStore();
|
174
178
|
const data: Action[] = [];
|
175
179
|
|
176
180
|
for (const action of actions) {
|
@@ -178,7 +182,7 @@ export const useGlobalStore = defineStore('global', (): IGlobalStore => {
|
|
178
182
|
data.push(formedAction);
|
179
183
|
}
|
180
184
|
|
181
|
-
return
|
185
|
+
return sessionStore.session?.transact({
|
182
186
|
actions: data,
|
183
187
|
}, { broadcast });
|
184
188
|
};
|