@dynamic-labs/starknet 0.19.0-alpha.1 → 0.19.0-alpha.11
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/CHANGELOG.md +217 -0
- package/package.json +7 -6
- package/src/constants.cjs +6 -6
- package/src/constants.d.ts +3 -3
- package/src/constants.js +6 -6
- package/src/index.cjs +1 -1
- package/src/index.d.ts +5 -5
- package/src/index.js +1 -1
- package/src/starknetWalletConnector.cjs +210 -198
- package/src/starknetWalletConnector.d.ts +50 -44
- package/src/starknetWalletConnector.js +207 -199
- package/src/types.d.ts +11 -11
- package/src/utils/convertors.cjs +27 -27
- package/src/utils/convertors.d.ts +2 -2
- package/src/utils/convertors.js +27 -27
- package/src/wallets/argentx.cjs +12 -12
- package/src/wallets/argentx.d.ts +7 -7
- package/src/wallets/argentx.js +12 -12
- package/src/wallets/braavos.cjs +24 -24
- package/src/wallets/braavos.d.ts +7 -7
- package/src/wallets/braavos.js +24 -24
package/src/wallets/argentx.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
2
2
|
import StarknetWalletConnector from '../starknetWalletConnector.js';
|
|
3
3
|
|
|
4
|
-
class ArgentX extends StarknetWalletConnector {
|
|
5
|
-
constructor(
|
|
6
|
-
super('Argent X', 'argentX',
|
|
7
|
-
}
|
|
8
|
-
getConnectedAccounts() {
|
|
9
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
const address = yield this.fetchPublicAddress();
|
|
11
|
-
if (!address)
|
|
12
|
-
return [];
|
|
13
|
-
return [address];
|
|
14
|
-
});
|
|
15
|
-
}
|
|
4
|
+
class ArgentX extends StarknetWalletConnector {
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
super('Argent X', 'argentX', opts);
|
|
7
|
+
}
|
|
8
|
+
getConnectedAccounts() {
|
|
9
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const address = yield this.fetchPublicAddress();
|
|
11
|
+
if (!address)
|
|
12
|
+
return [];
|
|
13
|
+
return [address];
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { ArgentX };
|
package/src/wallets/braavos.cjs
CHANGED
|
@@ -6,30 +6,30 @@ var _tslib = require('../../_virtual/_tslib.cjs');
|
|
|
6
6
|
var utils = require('@dynamic-labs/utils');
|
|
7
7
|
var starknetWalletConnector = require('../starknetWalletConnector.cjs');
|
|
8
8
|
|
|
9
|
-
class Braavos extends starknetWalletConnector {
|
|
10
|
-
constructor(
|
|
11
|
-
super('Braavos', 'braavos',
|
|
12
|
-
}
|
|
13
|
-
fetchPublicAddress() {
|
|
14
|
-
const _super = Object.create(null, {
|
|
15
|
-
fetchPublicAddress: { get: () => super.fetchPublicAddress }
|
|
16
|
-
});
|
|
17
|
-
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
if (this.isInstalledOnBrowser()) {
|
|
19
|
-
return _super.fetchPublicAddress.call(this);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* todo (1): update universal link with "https://starknet.app.link/" once it will be released.
|
|
23
|
-
* todo (2): understand if we really want to avoid using "starknet-deeplink" library.
|
|
24
|
-
*/
|
|
25
|
-
const url = window.location.toString().replace(/http(s)?:\/\//, '');
|
|
26
|
-
const targetUrl = `starknet://dapp/${url}`;
|
|
27
|
-
if (utils.isMobile()) {
|
|
28
|
-
window.location.assign(targetUrl);
|
|
29
|
-
}
|
|
30
|
-
return Promise.resolve(undefined);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
9
|
+
class Braavos extends starknetWalletConnector["default"] {
|
|
10
|
+
constructor(opts) {
|
|
11
|
+
super('Braavos', 'braavos', opts);
|
|
12
|
+
}
|
|
13
|
+
fetchPublicAddress() {
|
|
14
|
+
const _super = Object.create(null, {
|
|
15
|
+
fetchPublicAddress: { get: () => super.fetchPublicAddress }
|
|
16
|
+
});
|
|
17
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
if (this.isInstalledOnBrowser()) {
|
|
19
|
+
return _super.fetchPublicAddress.call(this);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* todo (1): update universal link with "https://starknet.app.link/" once it will be released.
|
|
23
|
+
* todo (2): understand if we really want to avoid using "starknet-deeplink" library.
|
|
24
|
+
*/
|
|
25
|
+
const url = window.location.toString().replace(/http(s)?:\/\//, '');
|
|
26
|
+
const targetUrl = `starknet://dapp/${url}`;
|
|
27
|
+
if (utils.isMobile()) {
|
|
28
|
+
window.location.assign(targetUrl);
|
|
29
|
+
}
|
|
30
|
+
return Promise.resolve(undefined);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
exports.Braavos = Braavos;
|
package/src/wallets/braavos.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
-
import StarknetProvider from '../starknetWalletConnector';
|
|
3
|
-
export declare class Braavos extends StarknetProvider implements WalletConnector {
|
|
4
|
-
constructor(
|
|
5
|
-
fetchPublicAddress(): Promise<string | undefined>;
|
|
6
|
-
}
|
|
7
|
-
export type BraavosWalletConnectorType = Braavos;
|
|
1
|
+
import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import StarknetProvider from '../starknetWalletConnector';
|
|
3
|
+
export declare class Braavos extends StarknetProvider implements WalletConnector {
|
|
4
|
+
constructor(opts: any);
|
|
5
|
+
fetchPublicAddress(): Promise<string | undefined>;
|
|
6
|
+
}
|
|
7
|
+
export type BraavosWalletConnectorType = Braavos;
|
package/src/wallets/braavos.js
CHANGED
|
@@ -2,30 +2,30 @@ import { __awaiter } from '../../_virtual/_tslib.js';
|
|
|
2
2
|
import { isMobile } from '@dynamic-labs/utils';
|
|
3
3
|
import StarknetWalletConnector from '../starknetWalletConnector.js';
|
|
4
4
|
|
|
5
|
-
class Braavos extends StarknetWalletConnector {
|
|
6
|
-
constructor(
|
|
7
|
-
super('Braavos', 'braavos',
|
|
8
|
-
}
|
|
9
|
-
fetchPublicAddress() {
|
|
10
|
-
const _super = Object.create(null, {
|
|
11
|
-
fetchPublicAddress: { get: () => super.fetchPublicAddress }
|
|
12
|
-
});
|
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
if (this.isInstalledOnBrowser()) {
|
|
15
|
-
return _super.fetchPublicAddress.call(this);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* todo (1): update universal link with "https://starknet.app.link/" once it will be released.
|
|
19
|
-
* todo (2): understand if we really want to avoid using "starknet-deeplink" library.
|
|
20
|
-
*/
|
|
21
|
-
const url = window.location.toString().replace(/http(s)?:\/\//, '');
|
|
22
|
-
const targetUrl = `starknet://dapp/${url}`;
|
|
23
|
-
if (isMobile()) {
|
|
24
|
-
window.location.assign(targetUrl);
|
|
25
|
-
}
|
|
26
|
-
return Promise.resolve(undefined);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
5
|
+
class Braavos extends StarknetWalletConnector {
|
|
6
|
+
constructor(opts) {
|
|
7
|
+
super('Braavos', 'braavos', opts);
|
|
8
|
+
}
|
|
9
|
+
fetchPublicAddress() {
|
|
10
|
+
const _super = Object.create(null, {
|
|
11
|
+
fetchPublicAddress: { get: () => super.fetchPublicAddress }
|
|
12
|
+
});
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
if (this.isInstalledOnBrowser()) {
|
|
15
|
+
return _super.fetchPublicAddress.call(this);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* todo (1): update universal link with "https://starknet.app.link/" once it will be released.
|
|
19
|
+
* todo (2): understand if we really want to avoid using "starknet-deeplink" library.
|
|
20
|
+
*/
|
|
21
|
+
const url = window.location.toString().replace(/http(s)?:\/\//, '');
|
|
22
|
+
const targetUrl = `starknet://dapp/${url}`;
|
|
23
|
+
if (isMobile()) {
|
|
24
|
+
window.location.assign(targetUrl);
|
|
25
|
+
}
|
|
26
|
+
return Promise.resolve(undefined);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { Braavos };
|