@strkfarm/sdk 1.0.13 → 1.0.15
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/cli.js +3 -2
- package/dist/cli.mjs +4 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.mjs +4 -3
- package/package.json +1 -1
- package/src/utils/store.ts +4 -3
package/dist/cli.js
CHANGED
|
@@ -392,7 +392,7 @@ var Store = class _Store {
|
|
|
392
392
|
logger.warn(`This not stored anywhere, please you backup this password for future use`);
|
|
393
393
|
logger.warn(`\u26A0\uFE0F=========================================\u26A0\uFE0F`);
|
|
394
394
|
}
|
|
395
|
-
getAccount(accountKey) {
|
|
395
|
+
getAccount(accountKey, txVersion = import_starknet5.constants.TRANSACTION_VERSION.V2) {
|
|
396
396
|
const accounts = this.loadAccounts();
|
|
397
397
|
logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
|
|
398
398
|
const data = accounts[accountKey];
|
|
@@ -401,7 +401,8 @@ var Store = class _Store {
|
|
|
401
401
|
}
|
|
402
402
|
logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
|
|
403
403
|
logger.verbose(`Address: ${data.address}`);
|
|
404
|
-
|
|
404
|
+
const acc = new import_starknet5.Account(this.config.provider, data.address, data.pk, void 0, txVersion);
|
|
405
|
+
return acc;
|
|
405
406
|
}
|
|
406
407
|
addAccount(accountKey, address, pk) {
|
|
407
408
|
const allAccounts = this.getAllAccounts();
|
package/dist/cli.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import inquirer from "inquirer";
|
|
|
12
12
|
|
|
13
13
|
// src/utils/store.ts
|
|
14
14
|
import fs, { readFileSync, writeFileSync } from "fs";
|
|
15
|
-
import { Account } from "starknet";
|
|
15
|
+
import { Account, constants } from "starknet";
|
|
16
16
|
import * as crypto2 from "crypto";
|
|
17
17
|
|
|
18
18
|
// src/utils/encrypt.ts
|
|
@@ -375,7 +375,7 @@ var Store = class _Store {
|
|
|
375
375
|
logger.warn(`This not stored anywhere, please you backup this password for future use`);
|
|
376
376
|
logger.warn(`\u26A0\uFE0F=========================================\u26A0\uFE0F`);
|
|
377
377
|
}
|
|
378
|
-
getAccount(accountKey) {
|
|
378
|
+
getAccount(accountKey, txVersion = constants.TRANSACTION_VERSION.V2) {
|
|
379
379
|
const accounts = this.loadAccounts();
|
|
380
380
|
logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
|
|
381
381
|
const data = accounts[accountKey];
|
|
@@ -384,7 +384,8 @@ var Store = class _Store {
|
|
|
384
384
|
}
|
|
385
385
|
logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
|
|
386
386
|
logger.verbose(`Address: ${data.address}`);
|
|
387
|
-
|
|
387
|
+
const acc = new Account(this.config.provider, data.address, data.pk, void 0, txVersion);
|
|
388
|
+
return acc;
|
|
388
389
|
}
|
|
389
390
|
addAccount(accountKey, address, pk) {
|
|
390
391
|
const allAccounts = this.getAllAccounts();
|
package/dist/index.d.ts
CHANGED
|
@@ -315,7 +315,7 @@ declare class Store {
|
|
|
315
315
|
private encryptor;
|
|
316
316
|
constructor(config: IConfig, storeConfig: StoreConfig);
|
|
317
317
|
static logPassword(password: string): void;
|
|
318
|
-
getAccount(accountKey: string): Account;
|
|
318
|
+
getAccount(accountKey: string, txVersion?: "0x2" | "0x3"): Account;
|
|
319
319
|
addAccount(accountKey: string, address: string, pk: string): void;
|
|
320
320
|
private getAccountFilePath;
|
|
321
321
|
private getAllAccounts;
|
package/dist/index.js
CHANGED
|
@@ -862,7 +862,7 @@ var Store = class _Store {
|
|
|
862
862
|
logger.warn(`This not stored anywhere, please you backup this password for future use`);
|
|
863
863
|
logger.warn(`\u26A0\uFE0F=========================================\u26A0\uFE0F`);
|
|
864
864
|
}
|
|
865
|
-
getAccount(accountKey) {
|
|
865
|
+
getAccount(accountKey, txVersion = import_starknet5.constants.TRANSACTION_VERSION.V2) {
|
|
866
866
|
const accounts = this.loadAccounts();
|
|
867
867
|
logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
|
|
868
868
|
const data = accounts[accountKey];
|
|
@@ -871,7 +871,8 @@ var Store = class _Store {
|
|
|
871
871
|
}
|
|
872
872
|
logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
|
|
873
873
|
logger.verbose(`Address: ${data.address}`);
|
|
874
|
-
|
|
874
|
+
const acc = new import_starknet5.Account(this.config.provider, data.address, data.pk, void 0, txVersion);
|
|
875
|
+
return acc;
|
|
875
876
|
}
|
|
876
877
|
addAccount(accountKey, address, pk) {
|
|
877
878
|
const allAccounts = this.getAllAccounts();
|
package/dist/index.mjs
CHANGED
|
@@ -730,7 +730,7 @@ var TelegramNotif = class {
|
|
|
730
730
|
|
|
731
731
|
// src/utils/store.ts
|
|
732
732
|
import fs, { readFileSync, writeFileSync } from "fs";
|
|
733
|
-
import { Account } from "starknet";
|
|
733
|
+
import { Account, constants } from "starknet";
|
|
734
734
|
import * as crypto2 from "crypto";
|
|
735
735
|
|
|
736
736
|
// src/utils/encrypt.ts
|
|
@@ -815,7 +815,7 @@ var Store = class _Store {
|
|
|
815
815
|
logger.warn(`This not stored anywhere, please you backup this password for future use`);
|
|
816
816
|
logger.warn(`\u26A0\uFE0F=========================================\u26A0\uFE0F`);
|
|
817
817
|
}
|
|
818
|
-
getAccount(accountKey) {
|
|
818
|
+
getAccount(accountKey, txVersion = constants.TRANSACTION_VERSION.V2) {
|
|
819
819
|
const accounts = this.loadAccounts();
|
|
820
820
|
logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
|
|
821
821
|
const data = accounts[accountKey];
|
|
@@ -824,7 +824,8 @@ var Store = class _Store {
|
|
|
824
824
|
}
|
|
825
825
|
logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
|
|
826
826
|
logger.verbose(`Address: ${data.address}`);
|
|
827
|
-
|
|
827
|
+
const acc = new Account(this.config.provider, data.address, data.pk, void 0, txVersion);
|
|
828
|
+
return acc;
|
|
828
829
|
}
|
|
829
830
|
addAccount(accountKey, address, pk) {
|
|
830
831
|
const allAccounts = this.getAllAccounts();
|
package/package.json
CHANGED
package/src/utils/store.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConfig, Network } from '@/interfaces/common';
|
|
2
2
|
import fs, { readFileSync, writeFileSync } from 'fs';
|
|
3
|
-
import { Account } from 'starknet';
|
|
3
|
+
import { Account, constants } from 'starknet';
|
|
4
4
|
import * as crypto from 'crypto';
|
|
5
5
|
import { PasswordJsonCryptoUtil } from './encrypt';
|
|
6
6
|
import { logger } from '..';
|
|
@@ -96,7 +96,7 @@ export class Store {
|
|
|
96
96
|
logger.warn(`⚠️=========================================⚠️`);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
getAccount(accountKey: string) {
|
|
99
|
+
getAccount(accountKey: string, txVersion: "0x2" | "0x3" = constants.TRANSACTION_VERSION.V2) {
|
|
100
100
|
const accounts = this.loadAccounts();
|
|
101
101
|
logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
|
|
102
102
|
const data = accounts[accountKey];
|
|
@@ -105,7 +105,8 @@ export class Store {
|
|
|
105
105
|
}
|
|
106
106
|
logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
|
|
107
107
|
logger.verbose(`Address: ${data.address}`);
|
|
108
|
-
|
|
108
|
+
const acc = new Account(<any>this.config.provider, data.address, data.pk, undefined, txVersion);
|
|
109
|
+
return acc;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
addAccount(accountKey: string, address: string, pk: string) {
|