@dynamic-labs/types 3.0.0-alpha.13 → 3.0.0-alpha.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/CHANGELOG.md +37 -0
- package/package.json +1 -1
- package/src/index.cjs +2 -0
- package/src/index.js +1 -0
- package/src/wallets/BaseWallet.cjs +20 -0
- package/src/wallets/BaseWallet.d.ts +36 -0
- package/src/wallets/BaseWallet.js +16 -0
- package/src/wallets/index.d.ts +3 -0
- package/src/wallets/wallets.d.ts +21 -0
- package/src/wallets.d.ts +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2024-07-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove setPrimaryWallet in favor of useSwitchWallet (#6212)
|
|
8
|
+
* move getBalance method to wallet so it can be fetched for any wallet not just the active one (#6200)
|
|
9
|
+
* make Wallet a class instead of just a type (#6094)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add @dynamic-labs/solana-extension ([#6140](https://github.com/dynamic-labs/DynamicAuth/issues/6140)) ([c0e2a06](https://github.com/dynamic-labs/DynamicAuth/commit/c0e2a067dd83163094b58a15696df8654da47c65))
|
|
14
|
+
* add solana support for multi-asset ([#6222](https://github.com/dynamic-labs/DynamicAuth/issues/6222)) ([9660d79](https://github.com/dynamic-labs/DynamicAuth/commit/9660d7962f1fb01011d68397bb367fdfc5335ca9))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* allow closing re-connect wallet modal ([#6250](https://github.com/dynamic-labs/DynamicAuth/issues/6250)) ([55ba25b](https://github.com/dynamic-labs/DynamicAuth/commit/55ba25bd3e907629aaa26e788885bfa38f8fe350))
|
|
20
|
+
* move getBalance method to wallet so it can be fetched for any wallet not just the active one ([#6200](https://github.com/dynamic-labs/DynamicAuth/issues/6200)) ([ee94773](https://github.com/dynamic-labs/DynamicAuth/commit/ee94773df9b31462a325666760fcf1fc70dec68a))
|
|
21
|
+
* move getNameService method to wallet so name service data can be fetched for any wallet ([#6205](https://github.com/dynamic-labs/DynamicAuth/issues/6205)) ([6671ae9](https://github.com/dynamic-labs/DynamicAuth/commit/6671ae92532ffc1889e24519e75f47d336ac0da6))
|
|
22
|
+
* relax phone number length validation ([#6226](https://github.com/dynamic-labs/DynamicAuth/issues/6226)) ([f0969b4](https://github.com/dynamic-labs/DynamicAuth/commit/f0969b4fbdafde07125cddecb16b4bfd011ea65e))
|
|
23
|
+
* sdkHasLoaded flipping back to false with otp ([#6242](https://github.com/dynamic-labs/DynamicAuth/issues/6242)) ([32ad9dd](https://github.com/dynamic-labs/DynamicAuth/commit/32ad9dd2dae7775f494506773fb343fe1a249c65))
|
|
24
|
+
* send transaction demo undefined address/value ([#6248](https://github.com/dynamic-labs/DynamicAuth/issues/6248)) ([036a511](https://github.com/dynamic-labs/DynamicAuth/commit/036a511fb848ef461edd9b7a5d79d478b0f1cf23))
|
|
25
|
+
* set last active account on accountChange request ([#6218](https://github.com/dynamic-labs/DynamicAuth/issues/6218)) ([05797d2](https://github.com/dynamic-labs/DynamicAuth/commit/05797d292aab8b4de02555594d4d1bbd4c9543eb))
|
|
26
|
+
* show ledger toggle when linking wallet ([#6202](https://github.com/dynamic-labs/DynamicAuth/issues/6202)) ([a449c0b](https://github.com/dynamic-labs/DynamicAuth/commit/a449c0bfc4e3a75ccd7084b930c48fbd6c14f691))
|
|
27
|
+
* show user wallet in profile view on single wallet mode even if it's not primary ([#6187](https://github.com/dynamic-labs/DynamicAuth/issues/6187)) ([ffaaeb2](https://github.com/dynamic-labs/DynamicAuth/commit/ffaaeb2c6cbb2868a381d85451ae5574024156bb))
|
|
28
|
+
* stop auto-switching to connected secondary wallet if primary wallet is not connected ([#6196](https://github.com/dynamic-labs/DynamicAuth/issues/6196)) ([4e8bcd2](https://github.com/dynamic-labs/DynamicAuth/commit/4e8bcd2d02d3fca54a0ed29c45b386ae99266b84))
|
|
29
|
+
* stop coinbase and solflare popups when secondary ([#6225](https://github.com/dynamic-labs/DynamicAuth/issues/6225)) ([7e9c104](https://github.com/dynamic-labs/DynamicAuth/commit/7e9c1049a09c9fd513c9a2a746d6baac916f1bf4))
|
|
30
|
+
* stop sending double sign request on network switch ([e325709](https://github.com/dynamic-labs/DynamicAuth/commit/e325709bb5d2d1331fe16cc705398fc7b1cc292a))
|
|
31
|
+
* tunrkey solana signer accept uint8array message ([#6137](https://github.com/dynamic-labs/DynamicAuth/issues/6137)) ([70f89ce](https://github.com/dynamic-labs/DynamicAuth/commit/70f89ce0dafa4c99b318c9c5adce59083cd6d284))
|
|
32
|
+
* update formatting of phantom bitcoin publickey ([#6210](https://github.com/dynamic-labs/DynamicAuth/issues/6210)) ([f58cea9](https://github.com/dynamic-labs/DynamicAuth/commit/f58cea99333fd7c6af8f56f637ee32f1f7ce8d76))
|
|
33
|
+
* use white color in farcaster qr code when in dark mode ([#6245](https://github.com/dynamic-labs/DynamicAuth/issues/6245)) ([a91958d](https://github.com/dynamic-labs/DynamicAuth/commit/a91958d8773be138da8f54791c4c67866257bbad))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
* make Wallet a class instead of just a type ([#6094](https://github.com/dynamic-labs/DynamicAuth/issues/6094)) ([6dc4672](https://github.com/dynamic-labs/DynamicAuth/commit/6dc4672951cfadc22a6c569e74eae3485bd472f3))
|
|
37
|
+
* remove setPrimaryWallet in favor of useSwitchWallet ([#6212](https://github.com/dynamic-labs/DynamicAuth/issues/6212)) ([de125e1](https://github.com/dynamic-labs/DynamicAuth/commit/de125e1ebbc20507e4ec07f337f5f5fd13aabcbe))
|
|
38
|
+
|
|
2
39
|
## [3.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-06-27)
|
|
3
40
|
|
|
4
41
|
|
package/package.json
CHANGED
package/src/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
7
7
|
var index = require('./oauth/index.cjs');
|
|
8
|
+
var BaseWallet = require('./wallets/BaseWallet.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
@@ -16,3 +17,4 @@ Object.defineProperty(exports, 'SocialOAuthErrorCode', {
|
|
|
16
17
|
enumerable: true,
|
|
17
18
|
get: function () { return index.SocialOAuthErrorCode; }
|
|
18
19
|
});
|
|
20
|
+
exports.BaseWallet = BaseWallet.BaseWallet;
|
package/src/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
class BaseWallet {
|
|
7
|
+
constructor({ id, key, address, additionalAddresses = [], chain, network, isConnected, isAuthenticated, isPrimary = false, }) {
|
|
8
|
+
this.id = id;
|
|
9
|
+
this.key = key;
|
|
10
|
+
this.address = address;
|
|
11
|
+
this.additionalAddresses = additionalAddresses;
|
|
12
|
+
this.chain = chain;
|
|
13
|
+
this.network = network;
|
|
14
|
+
this.isConnected = isConnected;
|
|
15
|
+
this.isAuthenticated = isAuthenticated;
|
|
16
|
+
this.isPrimary = isPrimary;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.BaseWallet = BaseWallet;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WalletAdditionalAddress } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
export interface BaseWalletProps {
|
|
3
|
+
id: string;
|
|
4
|
+
key: string;
|
|
5
|
+
address: string;
|
|
6
|
+
/**
|
|
7
|
+
* Additional addresses associated to the wallet
|
|
8
|
+
* like ordinals and payment addresses for bitcoin wallets
|
|
9
|
+
*/
|
|
10
|
+
additionalAddresses?: WalletAdditionalAddress[];
|
|
11
|
+
chain: string;
|
|
12
|
+
network?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* If we are currently able to fetch information about this wallet from its provider.
|
|
15
|
+
* Will be false, for example, if you are connected through a browser extension and you lock it.
|
|
16
|
+
*/
|
|
17
|
+
isConnected: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If there is a current user, this will be true if and only if the user has signed this wallet
|
|
20
|
+
* to link it to their account
|
|
21
|
+
*/
|
|
22
|
+
isAuthenticated: boolean;
|
|
23
|
+
isPrimary?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class BaseWallet {
|
|
26
|
+
id: string;
|
|
27
|
+
key: string;
|
|
28
|
+
address: string;
|
|
29
|
+
additionalAddresses: WalletAdditionalAddress[];
|
|
30
|
+
chain: string;
|
|
31
|
+
network: string | number | undefined;
|
|
32
|
+
isConnected: boolean;
|
|
33
|
+
isAuthenticated: boolean;
|
|
34
|
+
isPrimary: boolean;
|
|
35
|
+
constructor({ id, key, address, additionalAddresses, chain, network, isConnected, isAuthenticated, isPrimary, }: BaseWalletProps);
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
class BaseWallet {
|
|
3
|
+
constructor({ id, key, address, additionalAddresses = [], chain, network, isConnected, isAuthenticated, isPrimary = false, }) {
|
|
4
|
+
this.id = id;
|
|
5
|
+
this.key = key;
|
|
6
|
+
this.address = address;
|
|
7
|
+
this.additionalAddresses = additionalAddresses;
|
|
8
|
+
this.chain = chain;
|
|
9
|
+
this.network = network;
|
|
10
|
+
this.isConnected = isConnected;
|
|
11
|
+
this.isAuthenticated = isAuthenticated;
|
|
12
|
+
this.isPrimary = isPrimary;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { BaseWallet };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IUITransaction } from '../transaction';
|
|
2
|
+
export type WalletUiUtils<TWalletConnector> = {
|
|
3
|
+
disabledConfirmationOnce: () => void;
|
|
4
|
+
sendTransaction: (walletConnector: TWalletConnector, transaction: IUITransaction) => Promise<string>;
|
|
5
|
+
signMessage: (props: {
|
|
6
|
+
handler: () => Promise<string>;
|
|
7
|
+
message: string | ArrayLike<number>;
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
enterPassword: (props: {
|
|
10
|
+
handler: (password: string) => Promise<void>;
|
|
11
|
+
closeView?: boolean;
|
|
12
|
+
}) => Promise<string>;
|
|
13
|
+
createPassword: (props: {
|
|
14
|
+
closeView?: boolean;
|
|
15
|
+
}) => Promise<string>;
|
|
16
|
+
syncWallet: (props: {
|
|
17
|
+
walletConnector: TWalletConnector;
|
|
18
|
+
activeAddress: string;
|
|
19
|
+
expectedAddress: string;
|
|
20
|
+
}) => Promise<void>;
|
|
21
|
+
};
|
package/src/wallets.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IUITransaction } from './transaction';
|
|
2
|
-
export type BaseWallet = {
|
|
3
|
-
address: string;
|
|
4
|
-
chain: string;
|
|
5
|
-
/**
|
|
6
|
-
* If we are currently able to fetch information about this wallet from its provider.
|
|
7
|
-
* Will be false, for example, if you are connected through a browser extension and you lock it.
|
|
8
|
-
*/
|
|
9
|
-
connected: boolean;
|
|
10
|
-
id: string;
|
|
11
|
-
network?: string | number;
|
|
12
|
-
/**
|
|
13
|
-
* If there is a current user, this will be true if and only if the user has signed this wallet
|
|
14
|
-
* to link it to their account
|
|
15
|
-
*/
|
|
16
|
-
authenticated: boolean;
|
|
17
|
-
};
|
|
18
|
-
export type WalletUiUtils<TWalletConnector> = {
|
|
19
|
-
disabledConfirmationOnce: () => void;
|
|
20
|
-
sendTransaction: (walletConnector: TWalletConnector, transaction: IUITransaction) => Promise<string>;
|
|
21
|
-
signMessage: (props: {
|
|
22
|
-
handler: () => Promise<string>;
|
|
23
|
-
message: string | ArrayLike<number>;
|
|
24
|
-
}) => Promise<string>;
|
|
25
|
-
enterPassword: (props: {
|
|
26
|
-
handler: (password: string) => Promise<void>;
|
|
27
|
-
closeView?: boolean;
|
|
28
|
-
}) => Promise<string>;
|
|
29
|
-
createPassword: (props: {
|
|
30
|
-
closeView?: boolean;
|
|
31
|
-
}) => Promise<string>;
|
|
32
|
-
};
|