@dynamic-labs/tempo 4.73.0 → 4.74.0
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 +30 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/connectors/DynamicWaasTempoConnector/DynamicWaasTempoConnector.d.ts +3 -0
- package/src/index.cjs +4 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +2 -0
- package/src/wallet/TempoWallet.cjs +86 -0
- package/src/wallet/TempoWallet.d.ts +37 -0
- package/src/wallet/TempoWallet.js +82 -0
- package/src/wallet/index.d.ts +2 -0
- package/src/wallet/isTempoWallet/index.d.ts +1 -0
- package/src/wallet/isTempoWallet/isTempoWallet.cjs +14 -0
- package/src/wallet/isTempoWallet/isTempoWallet.d.ts +9 -0
- package/src/wallet/isTempoWallet/isTempoWallet.js +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.74.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.73.2...v4.74.0) (2026-04-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **client:** expose waitForReady() on SdkModule ([#10771](https://github.com/dynamic-labs/dynamic-auth/issues/10771)) ([8d94615](https://github.com/dynamic-labs/dynamic-auth/commit/8d946158ab284fe338c78cfba38504b1bca91cd7))
|
|
8
|
+
* **waas:** wire up signed session ID reverse channel ([#10577](https://github.com/dynamic-labs/dynamic-auth/issues/10577)) ([e07815f](https://github.com/dynamic-labs/dynamic-auth/commit/e07815ff370634c8a5a674cbf27bc79782a27f1a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **react-native:** keep WebView ref valid during URL reloads ([#10769](https://github.com/dynamic-labs/dynamic-auth/issues/10769)) ([691bef2](https://github.com/dynamic-labs/dynamic-auth/commit/691bef277c5190b7cd88d12f95e2b6fbfa827b64))
|
|
14
|
+
* require device registration before sdk is in logged in state ([#10831](https://github.com/dynamic-labs/dynamic-auth/issues/10831)) ([7ebae17](https://github.com/dynamic-labs/dynamic-auth/commit/7ebae17f01b9db59b88dd997d511ff84bd6b2d1a))
|
|
15
|
+
* **waas:** always prompt for password on cloud backup/export operations [DYNT-269] ([#10829](https://github.com/dynamic-labs/dynamic-auth/issues/10829)) ([5d2898b](https://github.com/dynamic-labs/dynamic-auth/commit/5d2898b9e6e06bbf13813b912b366f522fb66b70))
|
|
16
|
+
* **webview:** preserve secure storage key map during recovery clear ([#10770](https://github.com/dynamic-labs/dynamic-auth/issues/10770)) ([888bfe9](https://github.com/dynamic-labs/dynamic-auth/commit/888bfe9f27dd3b4751dddf2027a3e4d219130860))
|
|
17
|
+
|
|
18
|
+
### [4.73.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.73.1...v4.73.2) (2026-03-31)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* use initial URL for device registration redirect detection ([#10821](https://github.com/dynamic-labs/dynamic-auth/issues/10821)) ([dbec178](https://github.com/dynamic-labs/dynamic-auth/commit/dbec178e0bad9a7e99c529b79cb0fbe0fd347904))
|
|
24
|
+
|
|
25
|
+
### [4.73.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.73.0...v4.73.1) (2026-03-30)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **tempo:** add isTempoWallet type guard and TempoWallet class ([#10814](https://github.com/dynamic-labs/dynamic-auth/issues/10814)) ([1f2ec94](https://github.com/dynamic-labs/dynamic-auth/commit/1f2ec949bcfd25b2c460e07214041d06b172f12d))
|
|
31
|
+
|
|
2
32
|
## [4.73.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.72.0...v4.73.0) (2026-03-30)
|
|
3
33
|
|
|
4
34
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/tempo",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.74.0",
|
|
4
4
|
"description": "A React SDK for implementing Tempo wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.909",
|
|
22
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
23
|
-
"@dynamic-labs/ethereum-core": "4.
|
|
24
|
-
"@dynamic-labs/waas": "4.
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
26
|
-
"@dynamic-labs/logger": "4.
|
|
27
|
-
"@dynamic-labs/types": "4.
|
|
28
|
-
"@dynamic-labs/utils": "4.
|
|
22
|
+
"@dynamic-labs/wallet-connector-core": "4.74.0",
|
|
23
|
+
"@dynamic-labs/ethereum-core": "4.74.0",
|
|
24
|
+
"@dynamic-labs/waas": "4.74.0",
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.74.0",
|
|
26
|
+
"@dynamic-labs/logger": "4.74.0",
|
|
27
|
+
"@dynamic-labs/types": "4.74.0",
|
|
28
|
+
"@dynamic-labs/utils": "4.74.0",
|
|
29
29
|
"viem": "^2.45.3"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -44,6 +44,9 @@ declare const DynamicWaasTempoConnector_base: (abstract new (...args: any[]) =>
|
|
|
44
44
|
getPasswordIfNeeded({ accountAddress, }: {
|
|
45
45
|
accountAddress: string;
|
|
46
46
|
}): Promise<string | undefined>;
|
|
47
|
+
getPassword({ accountAddress, }: {
|
|
48
|
+
accountAddress: string;
|
|
49
|
+
}): Promise<string | undefined>;
|
|
47
50
|
setEnvironmentId(environmentId: string): void;
|
|
48
51
|
setBaseApiUrl(baseApiUrl: string): void;
|
|
49
52
|
setBaseClientKeysharesRelayApiUrl(baseClientKeysharesRelayApiUrl?: string | undefined): void;
|
package/src/index.cjs
CHANGED
|
@@ -7,6 +7,8 @@ var assertPackageVersion = require('@dynamic-labs/assert-package-version');
|
|
|
7
7
|
var _package = require('../package.cjs');
|
|
8
8
|
var index = require('./connectors/DynamicWaasTempoConnector/index.cjs');
|
|
9
9
|
var TempoWalletConnector = require('./connectors/TempoWalletConnector/TempoWalletConnector.cjs');
|
|
10
|
+
var TempoWallet = require('./wallet/TempoWallet.cjs');
|
|
11
|
+
var isTempoWallet = require('./wallet/isTempoWallet/isTempoWallet.cjs');
|
|
10
12
|
var DynamicWaasTempoConnector = require('./connectors/DynamicWaasTempoConnector/DynamicWaasTempoConnector.cjs');
|
|
11
13
|
|
|
12
14
|
assertPackageVersion.assertPackageVersion('@dynamic-labs/tempo', _package.version);
|
|
@@ -17,5 +19,7 @@ const TempoWalletConnectors = () => [
|
|
|
17
19
|
|
|
18
20
|
exports.DynamicWaasTempoConnectors = index.DynamicWaasTempoConnectors;
|
|
19
21
|
exports.TempoWalletConnector = TempoWalletConnector.TempoWalletConnector;
|
|
22
|
+
exports.TempoWallet = TempoWallet.TempoWallet;
|
|
23
|
+
exports.isTempoWallet = isTempoWallet.isTempoWallet;
|
|
20
24
|
exports.DynamicWaasTempoConnector = DynamicWaasTempoConnector.DynamicWaasTempoConnector;
|
|
21
25
|
exports.TempoWalletConnectors = TempoWalletConnectors;
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
export { TempoWalletConnector } from './connectors/TempoWalletConnector';
|
|
3
3
|
export type { TempoWalletConnectorOpts } from './connectors/TempoWalletConnector';
|
|
4
|
+
export { TempoWallet, isTempoWallet } from './wallet';
|
|
4
5
|
export declare const TempoWalletConnectors: () => WalletConnectorConstructor[];
|
|
5
6
|
export { DynamicWaasTempoConnector, DynamicWaasTempoConnectors, } from './connectors/DynamicWaasTempoConnector';
|
package/src/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
|
|
|
3
3
|
import { version } from '../package.js';
|
|
4
4
|
export { DynamicWaasTempoConnectors } from './connectors/DynamicWaasTempoConnector/index.js';
|
|
5
5
|
export { TempoWalletConnector } from './connectors/TempoWalletConnector/TempoWalletConnector.js';
|
|
6
|
+
export { TempoWallet } from './wallet/TempoWallet.js';
|
|
7
|
+
export { isTempoWallet } from './wallet/isTempoWallet/isTempoWallet.js';
|
|
6
8
|
import { DynamicWaasTempoConnector } from './connectors/DynamicWaasTempoConnector/DynamicWaasTempoConnector.js';
|
|
7
9
|
export { DynamicWaasTempoConnector } from './connectors/DynamicWaasTempoConnector/DynamicWaasTempoConnector.js';
|
|
8
10
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
|
+
var viem = require('viem');
|
|
8
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
|
+
|
|
10
|
+
const erc20Abi = [
|
|
11
|
+
{
|
|
12
|
+
constant: false,
|
|
13
|
+
inputs: [
|
|
14
|
+
{ name: '_to', type: 'address' },
|
|
15
|
+
{ name: '_value', type: 'uint256' },
|
|
16
|
+
],
|
|
17
|
+
name: 'transfer',
|
|
18
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
19
|
+
type: 'function',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
class TempoWallet extends walletConnectorCore.Wallet {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sends TIP-20 tokens on Tempo.
|
|
28
|
+
* Note: Tempo has no native token - all transfers must specify a token.
|
|
29
|
+
* @param amount - The amount of tokens to send.
|
|
30
|
+
* @param toAddress - The address to send the tokens to.
|
|
31
|
+
* @param token - The TIP-20 token to send.
|
|
32
|
+
* @param token.address - The address of the token contract.
|
|
33
|
+
* @param token.decimals - The decimals of the token (defaults to 18).
|
|
34
|
+
* @returns The transaction hash of the sent transaction.
|
|
35
|
+
*/
|
|
36
|
+
sendBalance(_a) {
|
|
37
|
+
return _tslib.__awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
|
|
38
|
+
var _b;
|
|
39
|
+
if (!(token === null || token === void 0 ? void 0 : token.address)) {
|
|
40
|
+
throw new Error('Tempo has no native token. Please specify a TIP-20 token address.');
|
|
41
|
+
}
|
|
42
|
+
const provider = yield this.getWalletClient();
|
|
43
|
+
const erc20Contract = viem.getContract({
|
|
44
|
+
abi: erc20Abi,
|
|
45
|
+
address: token.address,
|
|
46
|
+
client: provider,
|
|
47
|
+
});
|
|
48
|
+
const transfer = yield erc20Contract.write.transfer([
|
|
49
|
+
toAddress,
|
|
50
|
+
viem.parseUnits(amount, (_b = token.decimals) !== null && _b !== void 0 ? _b : 18),
|
|
51
|
+
]);
|
|
52
|
+
return transfer;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the public client.
|
|
57
|
+
* @returns A promise that resolves to the public client,
|
|
58
|
+
* or throws if the client cannot be retrieved.
|
|
59
|
+
*/
|
|
60
|
+
getPublicClient() {
|
|
61
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const client = yield this._connector.getPublicClient();
|
|
63
|
+
if (!client) {
|
|
64
|
+
throw new Error('Unable to retrieve PublicClient');
|
|
65
|
+
}
|
|
66
|
+
return client;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves the wallet client.
|
|
71
|
+
* @param chainId - (optional) Chain id to be used by the wallet client.
|
|
72
|
+
* @returns A promise that resolves to the wallet client,
|
|
73
|
+
* or throws if the client cannot be retrieved.
|
|
74
|
+
*/
|
|
75
|
+
getWalletClient(chainId) {
|
|
76
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const walletClient = yield this._connector.getWalletClient(chainId);
|
|
78
|
+
if (!walletClient) {
|
|
79
|
+
throw new Error('Unable to retrieve WalletClient');
|
|
80
|
+
}
|
|
81
|
+
return walletClient;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
exports.TempoWallet = TempoWallet;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
|
+
import { Wallet, WalletProps } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { TempoWalletConnector } from '../connectors/TempoWalletConnector';
|
|
4
|
+
export declare class TempoWallet extends Wallet<TempoWalletConnector> {
|
|
5
|
+
constructor(props: WalletProps<TempoWalletConnector>);
|
|
6
|
+
/**
|
|
7
|
+
* Sends TIP-20 tokens on Tempo.
|
|
8
|
+
* Note: Tempo has no native token - all transfers must specify a token.
|
|
9
|
+
* @param amount - The amount of tokens to send.
|
|
10
|
+
* @param toAddress - The address to send the tokens to.
|
|
11
|
+
* @param token - The TIP-20 token to send.
|
|
12
|
+
* @param token.address - The address of the token contract.
|
|
13
|
+
* @param token.decimals - The decimals of the token (defaults to 18).
|
|
14
|
+
* @returns The transaction hash of the sent transaction.
|
|
15
|
+
*/
|
|
16
|
+
sendBalance({ amount, toAddress, token, }: {
|
|
17
|
+
amount: string;
|
|
18
|
+
toAddress: string;
|
|
19
|
+
token?: {
|
|
20
|
+
address: string;
|
|
21
|
+
decimals?: number;
|
|
22
|
+
};
|
|
23
|
+
}): Promise<`0x${string}` | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the public client.
|
|
26
|
+
* @returns A promise that resolves to the public client,
|
|
27
|
+
* or throws if the client cannot be retrieved.
|
|
28
|
+
*/
|
|
29
|
+
getPublicClient(): Promise<PublicClient<Transport, Chain>>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the wallet client.
|
|
32
|
+
* @param chainId - (optional) Chain id to be used by the wallet client.
|
|
33
|
+
* @returns A promise that resolves to the wallet client,
|
|
34
|
+
* or throws if the client cannot be retrieved.
|
|
35
|
+
*/
|
|
36
|
+
getWalletClient(chainId?: string): Promise<WalletClient<Transport, Chain, Account>>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
|
+
import { getContract, parseUnits } from 'viem';
|
|
4
|
+
import { Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
|
|
6
|
+
const erc20Abi = [
|
|
7
|
+
{
|
|
8
|
+
constant: false,
|
|
9
|
+
inputs: [
|
|
10
|
+
{ name: '_to', type: 'address' },
|
|
11
|
+
{ name: '_value', type: 'uint256' },
|
|
12
|
+
],
|
|
13
|
+
name: 'transfer',
|
|
14
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
15
|
+
type: 'function',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
class TempoWallet extends Wallet {
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sends TIP-20 tokens on Tempo.
|
|
24
|
+
* Note: Tempo has no native token - all transfers must specify a token.
|
|
25
|
+
* @param amount - The amount of tokens to send.
|
|
26
|
+
* @param toAddress - The address to send the tokens to.
|
|
27
|
+
* @param token - The TIP-20 token to send.
|
|
28
|
+
* @param token.address - The address of the token contract.
|
|
29
|
+
* @param token.decimals - The decimals of the token (defaults to 18).
|
|
30
|
+
* @returns The transaction hash of the sent transaction.
|
|
31
|
+
*/
|
|
32
|
+
sendBalance(_a) {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* ({ amount, toAddress, token, }) {
|
|
34
|
+
var _b;
|
|
35
|
+
if (!(token === null || token === void 0 ? void 0 : token.address)) {
|
|
36
|
+
throw new Error('Tempo has no native token. Please specify a TIP-20 token address.');
|
|
37
|
+
}
|
|
38
|
+
const provider = yield this.getWalletClient();
|
|
39
|
+
const erc20Contract = getContract({
|
|
40
|
+
abi: erc20Abi,
|
|
41
|
+
address: token.address,
|
|
42
|
+
client: provider,
|
|
43
|
+
});
|
|
44
|
+
const transfer = yield erc20Contract.write.transfer([
|
|
45
|
+
toAddress,
|
|
46
|
+
parseUnits(amount, (_b = token.decimals) !== null && _b !== void 0 ? _b : 18),
|
|
47
|
+
]);
|
|
48
|
+
return transfer;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the public client.
|
|
53
|
+
* @returns A promise that resolves to the public client,
|
|
54
|
+
* or throws if the client cannot be retrieved.
|
|
55
|
+
*/
|
|
56
|
+
getPublicClient() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const client = yield this._connector.getPublicClient();
|
|
59
|
+
if (!client) {
|
|
60
|
+
throw new Error('Unable to retrieve PublicClient');
|
|
61
|
+
}
|
|
62
|
+
return client;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves the wallet client.
|
|
67
|
+
* @param chainId - (optional) Chain id to be used by the wallet client.
|
|
68
|
+
* @returns A promise that resolves to the wallet client,
|
|
69
|
+
* or throws if the client cannot be retrieved.
|
|
70
|
+
*/
|
|
71
|
+
getWalletClient(chainId) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const walletClient = yield this._connector.getWalletClient(chainId);
|
|
74
|
+
if (!walletClient) {
|
|
75
|
+
throw new Error('Unable to retrieve WalletClient');
|
|
76
|
+
}
|
|
77
|
+
return walletClient;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { TempoWallet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isTempoWallet';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to check if a wallet is a Tempo wallet
|
|
8
|
+
*
|
|
9
|
+
* @param wallet - The wallet to check
|
|
10
|
+
* @returns True if the wallet is a Tempo wallet
|
|
11
|
+
*/
|
|
12
|
+
const isTempoWallet = (wallet) => (wallet === null || wallet === void 0 ? void 0 : wallet.chain) === 'TEMPO';
|
|
13
|
+
|
|
14
|
+
exports.isTempoWallet = isTempoWallet;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { TempoWallet } from '../TempoWallet';
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a wallet is a Tempo wallet
|
|
5
|
+
*
|
|
6
|
+
* @param wallet - The wallet to check
|
|
7
|
+
* @returns True if the wallet is a Tempo wallet
|
|
8
|
+
*/
|
|
9
|
+
export declare const isTempoWallet: (wallet: Wallet | null | undefined) => wallet is TempoWallet;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/**
|
|
3
|
+
* Type guard to check if a wallet is a Tempo wallet
|
|
4
|
+
*
|
|
5
|
+
* @param wallet - The wallet to check
|
|
6
|
+
* @returns True if the wallet is a Tempo wallet
|
|
7
|
+
*/
|
|
8
|
+
const isTempoWallet = (wallet) => (wallet === null || wallet === void 0 ? void 0 : wallet.chain) === 'TEMPO';
|
|
9
|
+
|
|
10
|
+
export { isTempoWallet };
|