@dynamic-labs-sdk/tempo 0.0.0 → 1.41.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/README.md +97 -0
- package/dist/TempoNetworkProvider.types.d.ts +12 -0
- package/dist/TempoNetworkProvider.types.d.ts.map +1 -0
- package/dist/TempoWalletAccount.types.d.ts +12 -0
- package/dist/TempoWalletAccount.types.d.ts.map +1 -0
- package/dist/TempoWalletProvider.types.d.ts +48 -0
- package/dist/TempoWalletProvider.types.d.ts.map +1 -0
- package/dist/addTempoExtension/addTempoExtension.d.ts +24 -0
- package/dist/addTempoExtension/addTempoExtension.d.ts.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/errors/InvalidTempoNetworkError/InvalidTempoNetworkError.d.ts +19 -0
- package/dist/errors/InvalidTempoNetworkError/InvalidTempoNetworkError.d.ts.map +1 -0
- package/dist/errors/InvalidTempoNetworkError/index.d.ts +2 -0
- package/dist/errors/InvalidTempoNetworkError/index.d.ts.map +1 -0
- package/dist/errors/TempoBusinessAccountTransactionNotSupportedError/TempoBusinessAccountTransactionNotSupportedError.d.ts +17 -0
- package/dist/errors/TempoBusinessAccountTransactionNotSupportedError/TempoBusinessAccountTransactionNotSupportedError.d.ts.map +1 -0
- package/dist/errors/TempoBusinessAccountTransactionNotSupportedError/index.d.ts +2 -0
- package/dist/errors/TempoBusinessAccountTransactionNotSupportedError/index.d.ts.map +1 -0
- package/dist/errors/TempoNativeTokenError/TempoNativeTokenError.d.ts +17 -0
- package/dist/errors/TempoNativeTokenError/TempoNativeTokenError.d.ts.map +1 -0
- package/dist/errors/TempoRawMessageNotUtf8Error/TempoRawMessageNotUtf8Error.d.ts +17 -0
- package/dist/errors/TempoRawMessageNotUtf8Error/TempoRawMessageNotUtf8Error.d.ts.map +1 -0
- package/dist/errors/TempoRawMessageNotUtf8Error/index.d.ts +2 -0
- package/dist/errors/TempoRawMessageNotUtf8Error/index.d.ts.map +1 -0
- package/dist/errors/TempoTransactionValidationError/TempoTransactionValidationError.d.ts +19 -0
- package/dist/errors/TempoTransactionValidationError/TempoTransactionValidationError.d.ts.map +1 -0
- package/dist/errors/TempoTransactionValidationError/index.d.ts +2 -0
- package/dist/errors/TempoTransactionValidationError/index.d.ts.map +1 -0
- package/dist/errors/TempoTypedDataNotSupportedError/TempoTypedDataNotSupportedError.d.ts +17 -0
- package/dist/errors/TempoTypedDataNotSupportedError/TempoTypedDataNotSupportedError.d.ts.map +1 -0
- package/dist/errors/TempoTypedDataNotSupportedError/index.d.ts +2 -0
- package/dist/errors/TempoTypedDataNotSupportedError/index.d.ts.map +1 -0
- package/dist/exports/index.d.ts +12 -0
- package/dist/exports/index.d.ts.map +1 -0
- package/dist/exports/waas.d.ts +9 -0
- package/dist/exports/waas.d.ts.map +1 -0
- package/dist/getTempoPublicClient/getTempoPublicClient.d.ts +28 -0
- package/dist/getTempoPublicClient/getTempoPublicClient.d.ts.map +1 -0
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +57 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/isTempoNetworkProvider/isTempoNetworkProvider.d.ts +17 -0
- package/dist/isTempoNetworkProvider/isTempoNetworkProvider.d.ts.map +1 -0
- package/dist/isTempoWalletAccount/isTempoWalletAccount.d.ts +19 -0
- package/dist/isTempoWalletAccount/isTempoWalletAccount.d.ts.map +1 -0
- package/dist/isTempoWalletProvider/isTempoWalletProvider.d.ts +21 -0
- package/dist/isTempoWalletProvider/isTempoWalletProvider.d.ts.map +1 -0
- package/dist/registerTempoNetworkProviderBuilder/registerTempoNetworkProviderBuilder.d.ts +4 -0
- package/dist/registerTempoNetworkProviderBuilder/registerTempoNetworkProviderBuilder.d.ts.map +1 -0
- package/dist/sendTip20Transaction/sendTip20Transaction.d.ts +40 -0
- package/dist/sendTip20Transaction/sendTip20Transaction.d.ts.map +1 -0
- package/dist/tempoChainIds-Ce9YCriF.cjs +301 -0
- package/dist/tempoChainIds-Ce9YCriF.cjs.map +1 -0
- package/dist/tempoChainIds-Dt0jiwLT.esm.js +236 -0
- package/dist/tempoChainIds-Dt0jiwLT.esm.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/utils/createTempoNetworkProvider/createTempoNetworkProvider.d.ts +5 -0
- package/dist/utils/createTempoNetworkProvider/createTempoNetworkProvider.d.ts.map +1 -0
- package/dist/utils/mapNetworkDataToViemChain/index.d.ts +2 -0
- package/dist/utils/mapNetworkDataToViemChain/index.d.ts.map +1 -0
- package/dist/utils/mapNetworkDataToViemChain/mapNetworkDataToViemChain.d.ts +19 -0
- package/dist/utils/mapNetworkDataToViemChain/mapNetworkDataToViemChain.d.ts.map +1 -0
- package/dist/utils/tempoChainIds/tempoChainIds.d.ts +22 -0
- package/dist/utils/tempoChainIds/tempoChainIds.d.ts.map +1 -0
- package/dist/utils/tempoConfirmTransaction/index.d.ts +2 -0
- package/dist/utils/tempoConfirmTransaction/index.d.ts.map +1 -0
- package/dist/utils/tempoConfirmTransaction/tempoConfirmTransaction.d.ts +21 -0
- package/dist/utils/tempoConfirmTransaction/tempoConfirmTransaction.d.ts.map +1 -0
- package/dist/utils/tempoTransferAmount/index.d.ts +2 -0
- package/dist/utils/tempoTransferAmount/index.d.ts.map +1 -0
- package/dist/utils/tempoTransferAmount/tempoTransferAmount.d.ts +37 -0
- package/dist/utils/tempoTransferAmount/tempoTransferAmount.d.ts.map +1 -0
- package/dist/waas/WaasTempoWalletProvider.types.d.ts +23 -0
- package/dist/waas/WaasTempoWalletProvider.types.d.ts.map +1 -0
- package/dist/waas/addWaasTempoExtension/addWaasTempoExtension.d.ts +21 -0
- package/dist/waas/addWaasTempoExtension/addWaasTempoExtension.d.ts.map +1 -0
- package/dist/waas/addWaasTempoExtension/index.d.ts +2 -0
- package/dist/waas/addWaasTempoExtension/index.d.ts.map +1 -0
- package/dist/waas/sendTempoTransaction/index.d.ts +2 -0
- package/dist/waas/sendTempoTransaction/index.d.ts.map +1 -0
- package/dist/waas/sendTempoTransaction/sendTempoTransaction.d.ts +42 -0
- package/dist/waas/sendTempoTransaction/sendTempoTransaction.d.ts.map +1 -0
- package/dist/waas/utils/assertValidTempoTransactionCalls/assertValidTempoTransactionCalls.d.ts +18 -0
- package/dist/waas/utils/assertValidTempoTransactionCalls/assertValidTempoTransactionCalls.d.ts.map +1 -0
- package/dist/waas/utils/assertValidTempoTransactionCalls/index.d.ts +2 -0
- package/dist/waas/utils/assertValidTempoTransactionCalls/index.d.ts.map +1 -0
- package/dist/waas/utils/assertValidTempoTransactionRequest/assertValidTempoTransactionRequest.d.ts +41 -0
- package/dist/waas/utils/assertValidTempoTransactionRequest/assertValidTempoTransactionRequest.d.ts.map +1 -0
- package/dist/waas/utils/assertValidTempoTransactionRequest/index.d.ts +3 -0
- package/dist/waas/utils/assertValidTempoTransactionRequest/index.d.ts.map +1 -0
- package/dist/waas/utils/createViemWalletClientForWaasTempo/createViemWalletClientForWaasTempo.d.ts +41 -0
- package/dist/waas/utils/createViemWalletClientForWaasTempo/createViemWalletClientForWaasTempo.d.ts.map +1 -0
- package/dist/waas/utils/createViemWalletClientForWaasTempo/index.d.ts +2 -0
- package/dist/waas/utils/createViemWalletClientForWaasTempo/index.d.ts.map +1 -0
- package/dist/waas/utils/createWalletProviderForWaasTempo/createWalletProviderForWaasTempo.d.ts +23 -0
- package/dist/waas/utils/createWalletProviderForWaasTempo/createWalletProviderForWaasTempo.d.ts.map +1 -0
- package/dist/waas/utils/createWalletProviderForWaasTempo/index.d.ts +2 -0
- package/dist/waas/utils/createWalletProviderForWaasTempo/index.d.ts.map +1 -0
- package/dist/waas/utils/isBusinessAccountWalletAccount/index.d.ts +2 -0
- package/dist/waas/utils/isBusinessAccountWalletAccount/index.d.ts.map +1 -0
- package/dist/waas/utils/isBusinessAccountWalletAccount/isBusinessAccountWalletAccount.d.ts +23 -0
- package/dist/waas/utils/isBusinessAccountWalletAccount/isBusinessAccountWalletAccount.d.ts.map +1 -0
- package/dist/waas/utils/serializeTempoTransactionForWaas/index.d.ts +3 -0
- package/dist/waas/utils/serializeTempoTransactionForWaas/index.d.ts.map +1 -0
- package/dist/waas/utils/serializeTempoTransactionForWaas/serializeTempoTransactionForWaas.d.ts +57 -0
- package/dist/waas/utils/serializeTempoTransactionForWaas/serializeTempoTransactionForWaas.d.ts.map +1 -0
- package/dist/waas/utils/signMessage/index.d.ts +2 -0
- package/dist/waas/utils/signMessage/index.d.ts.map +1 -0
- package/dist/waas/utils/signMessage/signMessage.d.ts +38 -0
- package/dist/waas/utils/signMessage/signMessage.d.ts.map +1 -0
- package/dist/waas/utils/signRawMessage/index.d.ts +2 -0
- package/dist/waas/utils/signRawMessage/index.d.ts.map +1 -0
- package/dist/waas/utils/signRawMessage/signRawMessage.d.ts +37 -0
- package/dist/waas/utils/signRawMessage/signRawMessage.d.ts.map +1 -0
- package/dist/waas.cjs +758 -0
- package/dist/waas.cjs.map +1 -0
- package/dist/waas.esm.js +754 -0
- package/dist/waas.esm.js.map +1 -0
- package/package.json +46 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DynamicClient, NetworkData } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { TempoNetworkProvider } from '../../TempoNetworkProvider.types';
|
|
3
|
+
/** @notInstrumented */
|
|
4
|
+
export declare const createTempoNetworkProvider: (networkData: NetworkData, client: DynamicClient) => TempoNetworkProvider;
|
|
5
|
+
//# sourceMappingURL=createTempoNetworkProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTempoNetworkProvider.d.ts","sourceRoot":"","sources":["../../../src/utils/createTempoNetworkProvider/createTempoNetworkProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,uBAAuB;AACvB,eAAO,MAAM,0BAA0B,gBACxB,WAAW,UAIhB,aAAa,KACpB,oBAGD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/mapNetworkDataToViemChain/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NetworkData } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { Chain } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a viem Chain object from a NetworkData object.
|
|
5
|
+
* This is a local implementation (not re-exported from EVM) so that the Chain
|
|
6
|
+
* type is always resolved from the same viem instance used by Tempo's viem clients.
|
|
7
|
+
*
|
|
8
|
+
* @param networkData - The network data to convert.
|
|
9
|
+
* @returns The viem chain for the network.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const chain = mapNetworkDataToViemChain(networkData);
|
|
13
|
+
* ```
|
|
14
|
+
* @see getTempoPublicClient
|
|
15
|
+
* @see isTempoChainId
|
|
16
|
+
* @notInstrumented
|
|
17
|
+
*/
|
|
18
|
+
export declare const mapNetworkDataToViemChain: (networkData: NetworkData) => Chain;
|
|
19
|
+
//# sourceMappingURL=mapNetworkDataToViemChain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapNetworkDataToViemChain.d.ts","sourceRoot":"","sources":["../../../src/utils/mapNetworkDataToViemChain/mapNetworkDataToViemChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,gBAAiB,WAAW,KAAG,KAenE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable protocol-level chain IDs for all Tempo networks.
|
|
3
|
+
* Used by isTempoChainId to identify Tempo chains.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TEMPO_CHAIN_IDS: readonly [4217, 42429, 42431];
|
|
6
|
+
/**
|
|
7
|
+
* Returns true if networkId belongs to a Tempo network.
|
|
8
|
+
* Tempo is EVM-compatible but has no native token and uses custom transaction formats.
|
|
9
|
+
*
|
|
10
|
+
* @param networkId - The network id to check, as a string or number.
|
|
11
|
+
* @returns Whether the network id is one of the Tempo network ids.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* isTempoChainId('4217'); // true
|
|
15
|
+
* isTempoChainId(1); // false
|
|
16
|
+
* ```
|
|
17
|
+
* @see TEMPO_CHAIN_IDS
|
|
18
|
+
* @see isTempoNetworkProvider
|
|
19
|
+
* @notInstrumented
|
|
20
|
+
*/
|
|
21
|
+
export declare const isTempoChainId: (networkId: string | number) => boolean;
|
|
22
|
+
//# sourceMappingURL=tempoChainIds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempoChainIds.d.ts","sourceRoot":"","sources":["../../../src/utils/tempoChainIds/tempoChainIds.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,eAAe,+BAAgC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,cAAe,MAAM,GAAG,MAAM,KAAG,OAGzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/tempoConfirmTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ConfirmTransactionParams } from '@dynamic-labs-sdk/client/core';
|
|
2
|
+
import type { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
3
|
+
/**
|
|
4
|
+
* Waits until a transaction sent from a Tempo wallet account is included in a
|
|
5
|
+
* block.
|
|
6
|
+
*
|
|
7
|
+
* @param params.transactionHash - The hash of the transaction to wait for.
|
|
8
|
+
* @param params.walletAccount - The Tempo wallet account that sent it.
|
|
9
|
+
* @param client - The Dynamic client instance.
|
|
10
|
+
* @returns Nothing. Resolves once the transaction receipt is available.
|
|
11
|
+
* @throws {InvalidParamError} If the wallet account is not a Tempo wallet account.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* await tempoConfirmTransaction({ transactionHash, walletAccount }, client);
|
|
15
|
+
* ```
|
|
16
|
+
* @see tempoTransferAmount
|
|
17
|
+
* @see getTempoPublicClient
|
|
18
|
+
* @notInstrumented
|
|
19
|
+
*/
|
|
20
|
+
export declare const tempoConfirmTransaction: ({ transactionHash, walletAccount }: ConfirmTransactionParams, client: DynamicClient) => Promise<void>;
|
|
21
|
+
//# sourceMappingURL=tempoConfirmTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempoConfirmTransaction.d.ts","sourceRoot":"","sources":["../../../src/utils/tempoConfirmTransaction/tempoConfirmTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,uCACE,wBAAwB,UACpD,aAAa,KACpB,OAAO,CAAC,IAAI,CASd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/tempoTransferAmount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TransferAmountParams } from '@dynamic-labs-sdk/client/core';
|
|
2
|
+
import type { CreateTempoViemWalletClient } from '../../TempoWalletProvider.types';
|
|
3
|
+
type TempoTransferAmountParams = TransferAmountParams & {
|
|
4
|
+
createViemWalletClient: CreateTempoViemWalletClient;
|
|
5
|
+
};
|
|
6
|
+
type TempoTransferAmountResult = {
|
|
7
|
+
transactionHash: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Transfers a TIP-20 token from a Tempo wallet account. Tempo has no native
|
|
11
|
+
* token, so the token is required.
|
|
12
|
+
*
|
|
13
|
+
* @param params.amount - Human-readable amount, e.g. '1.5'.
|
|
14
|
+
* @param params.recipient - Recipient address.
|
|
15
|
+
* @param params.token - The TIP-20 token to transfer.
|
|
16
|
+
* @param params.walletAccount - The Tempo wallet account that sends.
|
|
17
|
+
* @param params.createViemWalletClient - Creates the viem wallet client that signs.
|
|
18
|
+
* @returns The transaction hash.
|
|
19
|
+
* @throws {InvalidParamError} If the wallet account is not a Tempo wallet account.
|
|
20
|
+
* @throws {TempoNativeTokenError} If no token is provided.
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const { transactionHash } = await tempoTransferAmount({
|
|
24
|
+
* amount: '1.5',
|
|
25
|
+
* createViemWalletClient,
|
|
26
|
+
* recipient: '0xRecipient',
|
|
27
|
+
* token: { address: '0xTip20Token', decimals: 6 },
|
|
28
|
+
* walletAccount,
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
* @see sendTip20Transaction
|
|
32
|
+
* @see tempoConfirmTransaction
|
|
33
|
+
* @notInstrumented
|
|
34
|
+
*/
|
|
35
|
+
export declare const tempoTransferAmount: ({ amount, createViemWalletClient, recipient, token, walletAccount, }: TempoTransferAmountParams) => Promise<TempoTransferAmountResult>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=tempoTransferAmount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempoTransferAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/tempoTransferAmount/tempoTransferAmount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAK1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,KAAK,yBAAyB,GAAG,oBAAoB,GAAG;IACtD,sBAAsB,EAAE,2BAA2B,CAAC;CACrD,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB,yEAM7B,yBAAyB,KAAG,OAAO,CAAC,yBAAyB,CAiB/D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WaasProvider, WaasSignMessageWithApprovalQuorum } from '@dynamic-labs-sdk/client/waas/core';
|
|
2
|
+
import type { CreateTempoViemWalletClient, TempoWalletProvider } from '../TempoWalletProvider.types';
|
|
3
|
+
/**
|
|
4
|
+
* Embedded wallet provider for the Tempo chain. Combines the embedded wallet
|
|
5
|
+
* capabilities with the Tempo wallet provider shape, signs messages with
|
|
6
|
+
* signing-quorum support, and creates viem wallet clients that sign Tempo
|
|
7
|
+
* transactions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const walletProvider: WaasTempoWalletProvider = createWalletProviderForWaasTempo({
|
|
12
|
+
* dynamicClient,
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see TempoWalletProvider
|
|
17
|
+
* @see addWaasTempoExtension
|
|
18
|
+
*/
|
|
19
|
+
export type WaasTempoWalletProvider = Omit<WaasProvider, 'signMessage'> & Omit<TempoWalletProvider, 'createViemWalletClient' | 'signMessage'> & {
|
|
20
|
+
createViemWalletClient: CreateTempoViemWalletClient;
|
|
21
|
+
signMessage: WaasSignMessageWithApprovalQuorum;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=WaasTempoWalletProvider.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaasTempoWalletProvider.types.d.ts","sourceRoot":"","sources":["../../src/waas/WaasTempoWalletProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iCAAiC,EAClC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,GACrE,IAAI,CAAC,mBAAmB,EAAE,wBAAwB,GAAG,aAAa,CAAC,GAAG;IACpE,sBAAsB,EAAE,2BAA2B,CAAC;IACpD,WAAW,EAAE,iCAAiC,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Registry key for the Tempo embedded wallet extension registered by addWaasTempoExtension. */
|
|
2
|
+
export declare const WAAS_TEMPO_EXTENSION_KEY = "waasTempo";
|
|
3
|
+
/**
|
|
4
|
+
* Registers Tempo embedded wallet support with the Dynamic client: the Tempo
|
|
5
|
+
* network provider and the embedded wallet provider for Tempo.
|
|
6
|
+
* Calling it more than once is safe: later calls do nothing.
|
|
7
|
+
*
|
|
8
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple clients.
|
|
9
|
+
* @returns Nothing. The extension is registered on the client.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { addWaasTempoExtension } from '@dynamic-labs-sdk/tempo/waas';
|
|
13
|
+
*
|
|
14
|
+
* addWaasTempoExtension(dynamicClient);
|
|
15
|
+
* ```
|
|
16
|
+
* @see addTempoExtension
|
|
17
|
+
* @see isTempoWalletAccount
|
|
18
|
+
* @notInstrumented
|
|
19
|
+
*/
|
|
20
|
+
export declare const addWaasTempoExtension: (client?: import("@dynamic-labs-sdk/client").DynamicClient) => void;
|
|
21
|
+
//# sourceMappingURL=addWaasTempoExtension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addWaasTempoExtension.d.ts","sourceRoot":"","sources":["../../../src/waas/addWaasTempoExtension/addWaasTempoExtension.ts"],"names":[],"mappings":"AAWA,gGAAgG;AAChG,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,iEAAkC,IAkBnE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/waas/addWaasTempoExtension/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/waas/sendTempoTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { WalletAccount } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { TempoTransactionRequest } from '../utils/assertValidTempoTransactionRequest';
|
|
3
|
+
type SendTempoTransactionParams = Pick<TempoTransactionRequest, 'calls' | 'feeToken' | 'gas' | 'nonceKey' | 'validAfter' | 'validBefore'> & {
|
|
4
|
+
walletAccount: WalletAccount;
|
|
5
|
+
};
|
|
6
|
+
type SendTempoTransactionResult = {
|
|
7
|
+
transactionHash: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sends a Tempo transaction from a Tempo embedded wallet, including the
|
|
11
|
+
* Tempo-only fields: batched calls, a fee token, a nonce key and a validity
|
|
12
|
+
* window. Use it when a plain viem `sendTransaction` cannot express the
|
|
13
|
+
* transaction.
|
|
14
|
+
*
|
|
15
|
+
* @param params.walletAccount - The Tempo embedded wallet account that sends.
|
|
16
|
+
* @param params.calls - The calls the transaction executes atomically.
|
|
17
|
+
* @param [params.feeToken] - TIP-20 token address used to pay the fee.
|
|
18
|
+
* @param [params.gas] - Gas limit. Defaults to a buffered estimate.
|
|
19
|
+
* @param [params.nonceKey] - Nonce key selecting a parallel nonce lane.
|
|
20
|
+
* @param [params.validAfter] - Unix timestamp after which the transaction is valid.
|
|
21
|
+
* @param [params.validBefore] - Unix timestamp after which the transaction expires.
|
|
22
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple clients.
|
|
23
|
+
* @returns The transaction hash.
|
|
24
|
+
* @throws {InvalidParamError} If the wallet account is not a Tempo wallet account.
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const { transactionHash } = await sendTempoTransaction({
|
|
28
|
+
* calls: [
|
|
29
|
+
* { data: transferData, to: tokenAddress },
|
|
30
|
+
* { data: approveData, to: tokenAddress },
|
|
31
|
+
* ],
|
|
32
|
+
* feeToken: tokenAddress,
|
|
33
|
+
* walletAccount,
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
* @see sendTip20Transaction
|
|
37
|
+
* @see getTempoPublicClient
|
|
38
|
+
* @notInstrumented
|
|
39
|
+
*/
|
|
40
|
+
export declare const sendTempoTransaction: ({ walletAccount, ...transaction }: SendTempoTransactionParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<SendTempoTransactionResult>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=sendTempoTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTempoTransaction.d.ts","sourceRoot":"","sources":["../../../src/waas/sendTempoTransaction/sendTempoTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAE3F,KAAK,0BAA0B,GAAG,IAAI,CACpC,uBAAuB,EACvB,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CACzE,GAAG;IACF,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,sCACI,0BAA0B,gEAE5D,OAAO,CAAC,0BAA0B,CAgCpC,CAAC"}
|
package/dist/waas/utils/assertValidTempoTransactionCalls/assertValidTempoTransactionCalls.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TempoTransactionCall } from '../serializeTempoTransactionForWaas';
|
|
2
|
+
/**
|
|
3
|
+
* Rejects malformed calls before they reach the signer, which would otherwise
|
|
4
|
+
* fail with an opaque parsing error.
|
|
5
|
+
*
|
|
6
|
+
* @param params.calls - The Tempo calls to validate.
|
|
7
|
+
* @returns Nothing. Throws on malformed input.
|
|
8
|
+
* @throws {TempoTransactionValidationError} If a call is malformed or the batch is empty.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* assertValidTempoTransactionCalls({ calls: [{ to, data, value }] });
|
|
12
|
+
* ```
|
|
13
|
+
* @notInstrumented
|
|
14
|
+
*/
|
|
15
|
+
export declare const assertValidTempoTransactionCalls: ({ calls, }: {
|
|
16
|
+
calls: readonly TempoTransactionCall[];
|
|
17
|
+
}) => void;
|
|
18
|
+
//# sourceMappingURL=assertValidTempoTransactionCalls.d.ts.map
|
package/dist/waas/utils/assertValidTempoTransactionCalls/assertValidTempoTransactionCalls.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertValidTempoTransactionCalls.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/assertValidTempoTransactionCalls/assertValidTempoTransactionCalls.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gCAAgC,eAE1C;IACD,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACxC,KAAG,IAoBH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/assertValidTempoTransactionCalls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/waas/utils/assertValidTempoTransactionRequest/assertValidTempoTransactionRequest.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Hex, TransactionSerializable } from 'viem';
|
|
2
|
+
import type { TempoTransactionCall } from '../serializeTempoTransactionForWaas';
|
|
3
|
+
/**
|
|
4
|
+
* A Tempo transaction request. Extends the standard viem transaction with the
|
|
5
|
+
* Tempo fields: batched `calls`, `feeToken`, `nonceKey` (2D nonce) and
|
|
6
|
+
* `validAfter` / `validBefore` expirations.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const transaction: TempoTransactionRequest = {
|
|
11
|
+
* calls: [{ to: '0xabc', data: '0xa9059cbb' }],
|
|
12
|
+
* feeToken: '0xdef',
|
|
13
|
+
* };
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type TempoTransactionRequest = TransactionSerializable & {
|
|
17
|
+
calls?: readonly TempoTransactionCall[];
|
|
18
|
+
feeToken?: Hex;
|
|
19
|
+
nonceKey?: bigint;
|
|
20
|
+
validAfter?: number;
|
|
21
|
+
validBefore?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Rejects malformed Tempo transaction fields before they reach the signer,
|
|
25
|
+
* which would otherwise fail with an opaque parsing error.
|
|
26
|
+
*
|
|
27
|
+
* @param params.transaction - The Tempo transaction request to validate.
|
|
28
|
+
* @param params.chainId - The chain id of the active Tempo network.
|
|
29
|
+
* @returns Nothing. Throws on malformed input.
|
|
30
|
+
* @throws {TempoTransactionValidationError} If a field is malformed or inconsistent.
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* assertValidTempoTransactionRequest({ transaction, chainId: 4217 });
|
|
34
|
+
* ```
|
|
35
|
+
* @notInstrumented
|
|
36
|
+
*/
|
|
37
|
+
export declare const assertValidTempoTransactionRequest: ({ transaction, chainId, }: {
|
|
38
|
+
chainId: number;
|
|
39
|
+
transaction: TempoTransactionRequest;
|
|
40
|
+
}) => void;
|
|
41
|
+
//# sourceMappingURL=assertValidTempoTransactionRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertValidTempoTransactionRequest.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/assertValidTempoTransactionRequest/assertValidTempoTransactionRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,MAAM,CAAC;AAGzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,GAAG;IAC9D,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kCAAkC,8BAG5C;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,uBAAuB,CAAC;CACtC,KAAG,IA8CH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/assertValidTempoTransactionRequest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAC1F,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/waas/utils/createViemWalletClientForWaasTempo/createViemWalletClientForWaasTempo.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type DynamicClient, type WalletAccount } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { WaasProvider } from '@dynamic-labs-sdk/client/waas/core';
|
|
3
|
+
import type { Account, Chain, HttpTransportConfig, Transport, WalletClient, WalletClientConfig } from 'viem';
|
|
4
|
+
type CreateViemWalletClientForWaasTempoParams = {
|
|
5
|
+
httpTransportConfig?: HttpTransportConfig;
|
|
6
|
+
viemWalletClientConfig?: Omit<WalletClientConfig, 'account' | 'chain' | 'transport'>;
|
|
7
|
+
waasProvider: WaasProvider;
|
|
8
|
+
walletAccount: WalletAccount;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates a viem wallet client for a Tempo embedded wallet account.
|
|
12
|
+
*
|
|
13
|
+
* Transactions are signed as Tempo transactions: batched `calls`, `feeToken`,
|
|
14
|
+
* `nonceKey` and `validAfter` / `validBefore` pass through to the signer. Gas
|
|
15
|
+
* is the larger of the caller's value and a 30% buffered estimate with a 300k
|
|
16
|
+
* floor, fees are at least the network gas price, and the nonce is the next
|
|
17
|
+
* one on the requested nonce lane.
|
|
18
|
+
*
|
|
19
|
+
* @param params.waasProvider - The embedded wallet provider that signs.
|
|
20
|
+
* @param params.walletAccount - The Tempo embedded wallet account that signs.
|
|
21
|
+
* @param [params.httpTransportConfig] - Optional viem HTTP transport config.
|
|
22
|
+
* @param [params.viemWalletClientConfig] - Optional extra viem client config.
|
|
23
|
+
* @param client - The Dynamic client instance.
|
|
24
|
+
* @returns A viem wallet client bound to the Tempo account.
|
|
25
|
+
* @throws If no active network data exists for the wallet account.
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const walletClient = await createViemWalletClientForWaasTempo(
|
|
29
|
+
* { waasProvider, walletAccount },
|
|
30
|
+
* client
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
* const hash = await walletClient.sendTransaction({ to, data });
|
|
34
|
+
* ```
|
|
35
|
+
* @see serializeTempoTransactionForWaas
|
|
36
|
+
* @see createWalletProviderForWaasTempo
|
|
37
|
+
* @notInstrumented
|
|
38
|
+
*/
|
|
39
|
+
export declare const createViemWalletClientForWaasTempo: ({ waasProvider, walletAccount, httpTransportConfig, viemWalletClientConfig, }: CreateViemWalletClientForWaasTempoParams, dynamicClient: DynamicClient) => Promise<WalletClient<Transport, Chain, Account>>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=createViemWalletClientForWaasTempo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createViemWalletClientForWaasTempo.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/createViemWalletClientForWaasTempo/createViemWalletClientForWaasTempo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EAEL,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,kBAAkB,EACnB,MAAM,MAAM,CAAC;AAiDd,KAAK,wCAAwC,GAAG;IAC9C,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,sBAAsB,CAAC,EAAE,IAAI,CAC3B,kBAAkB,EAClB,SAAS,GAAG,OAAO,GAAG,WAAW,CAClC,CAAC;IACF,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,eAAO,MAAM,kCAAkC,kFAM1C,wCAAwC,iBAC5B,aAAa,KAC3B,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAmLjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/createViemWalletClientForWaasTempo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/waas/utils/createWalletProviderForWaasTempo/createWalletProviderForWaasTempo.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { WaasTempoWalletProvider } from '../../WaasTempoWalletProvider.types';
|
|
3
|
+
type CreateWalletProviderForWaasTempoParams = {
|
|
4
|
+
dynamicClient: DynamicClient;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Creates the embedded wallet provider for the Tempo chain.
|
|
8
|
+
*
|
|
9
|
+
* @param params.dynamicClient - The Dynamic client the provider is bound to.
|
|
10
|
+
* @returns A wallet provider that signs with Tempo embedded wallets.
|
|
11
|
+
* @throws {InvalidTempoNetworkError} When the returned provider is asked to switch to a network that is not a Tempo network.
|
|
12
|
+
* @throws {TempoBusinessAccountTransactionNotSupportedError} When the returned provider is asked to sign a transaction with a business-account wallet.
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const walletProvider = createWalletProviderForWaasTempo({ dynamicClient });
|
|
16
|
+
* ```
|
|
17
|
+
* @see addWaasTempoExtension
|
|
18
|
+
* @see WaasTempoWalletProvider
|
|
19
|
+
* @notInstrumented
|
|
20
|
+
*/
|
|
21
|
+
export declare const createWalletProviderForWaasTempo: ({ dynamicClient, }: CreateWalletProviderForWaasTempoParams) => WaasTempoWalletProvider;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=createWalletProviderForWaasTempo.d.ts.map
|
package/dist/waas/utils/createWalletProviderForWaasTempo/createWalletProviderForWaasTempo.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createWalletProviderForWaasTempo.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/createWalletProviderForWaasTempo/createWalletProviderForWaasTempo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAqB9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAMnF,KAAK,sCAAsC,GAAG;IAC5C,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gCAAgC,uBAE1C,sCAAsC,KAAG,uBAwG3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/createWalletProviderForWaasTempo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/isBusinessAccountWalletAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WalletAccount } from '@dynamic-labs-sdk/client';
|
|
2
|
+
type BusinessAccountWalletAccount = WalletAccount & {
|
|
3
|
+
businessAccountId: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Type guard — returns true if the wallet account belongs to a business
|
|
7
|
+
* account, meaning its signatures need a signing-quorum approval.
|
|
8
|
+
*
|
|
9
|
+
* @param walletAccount - The wallet account to check.
|
|
10
|
+
* @returns Whether the wallet account has a business account id.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* if (isBusinessAccountWalletAccount(walletAccount)) {
|
|
14
|
+
* console.log(walletAccount.businessAccountId);
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
* @see signMessage
|
|
18
|
+
* @see signRawMessage
|
|
19
|
+
* @notInstrumented
|
|
20
|
+
*/
|
|
21
|
+
export declare const isBusinessAccountWalletAccount: (walletAccount: WalletAccount) => walletAccount is BusinessAccountWalletAccount;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=isBusinessAccountWalletAccount.d.ts.map
|
package/dist/waas/utils/isBusinessAccountWalletAccount/isBusinessAccountWalletAccount.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBusinessAccountWalletAccount.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/isBusinessAccountWalletAccount/isBusinessAccountWalletAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,4BAA4B,GAAG,aAAa,GAAG;IAClD,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,kBAC1B,aAAa,KAC3B,aAAa,IAAI,4BAGoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/serializeTempoTransactionForWaas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,YAAY,EACV,sCAAsC,EACtC,oBAAoB,GACrB,MAAM,oCAAoC,CAAC"}
|
package/dist/waas/utils/serializeTempoTransactionForWaas/serializeTempoTransactionForWaas.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* A single call inside a Tempo transaction.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const call: TempoTransactionCall = { data: '0xa9059cbb', to: '0xabc' };
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @see TempoTransactionRequest
|
|
11
|
+
* @see sendTip20Transaction
|
|
12
|
+
*/
|
|
13
|
+
export type TempoTransactionCall = {
|
|
14
|
+
data?: Hex;
|
|
15
|
+
to?: Hex;
|
|
16
|
+
value?: bigint;
|
|
17
|
+
};
|
|
18
|
+
export type SerializeTempoTransactionForWaasParams = {
|
|
19
|
+
/** Calls executed atomically by the transaction, one entry per batched call. */
|
|
20
|
+
calls: readonly TempoTransactionCall[];
|
|
21
|
+
chainId: number;
|
|
22
|
+
/** TIP-20 token address used to pay the fee. */
|
|
23
|
+
feeToken?: Hex;
|
|
24
|
+
gas: bigint;
|
|
25
|
+
maxFeePerGas: bigint;
|
|
26
|
+
maxPriorityFeePerGas: bigint;
|
|
27
|
+
nonce: number;
|
|
28
|
+
/** 2D nonce key selecting the parallel nonce lane. */
|
|
29
|
+
nonceKey?: bigint;
|
|
30
|
+
/** Unix timestamp after which the transaction becomes valid. */
|
|
31
|
+
validAfter?: number;
|
|
32
|
+
/** Unix timestamp after which the transaction expires. */
|
|
33
|
+
validBefore?: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Serializes a Tempo transaction to the JSON an embedded wallet signs.
|
|
37
|
+
* BigInt values are written as decimal strings because JSON has no BigInt type.
|
|
38
|
+
*
|
|
39
|
+
* @param params - The Tempo transaction fields to serialize.
|
|
40
|
+
* @returns The JSON-encoded transaction.
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const transaction = serializeTempoTransactionForWaas({
|
|
44
|
+
* calls: [{ to: '0xabc', value: 1n }],
|
|
45
|
+
* chainId: 4217,
|
|
46
|
+
* gas: 300_000n,
|
|
47
|
+
* maxFeePerGas: 1_000n,
|
|
48
|
+
* maxPriorityFeePerGas: 100n,
|
|
49
|
+
* nonce: 0,
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
* @see addWaasTempoExtension
|
|
53
|
+
* @see createWalletProviderForWaasTempo
|
|
54
|
+
* @notInstrumented
|
|
55
|
+
*/
|
|
56
|
+
export declare const serializeTempoTransactionForWaas: ({ calls, chainId, feeToken, gas, maxFeePerGas, maxPriorityFeePerGas, nonce, nonceKey, validAfter, validBefore, }: SerializeTempoTransactionForWaasParams) => string;
|
|
57
|
+
//# sourceMappingURL=serializeTempoTransactionForWaas.d.ts.map
|
package/dist/waas/utils/serializeTempoTransactionForWaas/serializeTempoTransactionForWaas.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeTempoTransactionForWaas.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/serializeTempoTransactionForWaas/serializeTempoTransactionForWaas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,gFAAgF;IAChF,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,gCAAgC,qHAW1C,sCAAsC,KAAG,MAgBzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/signMessage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type DynamicClient, type WalletAccount } from '@dynamic-labs-sdk/client';
|
|
2
|
+
import type { ApprovalQuorumRequestContext, WaasProvider } from '@dynamic-labs-sdk/client/waas/core';
|
|
3
|
+
type SignMessageParams = {
|
|
4
|
+
approvalQuorum?: ApprovalQuorumRequestContext;
|
|
5
|
+
message: string;
|
|
6
|
+
waasProvider: WaasProvider;
|
|
7
|
+
walletAccount: WalletAccount;
|
|
8
|
+
};
|
|
9
|
+
type SignMessageResult = {
|
|
10
|
+
signature: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Signs a message with a Tempo embedded wallet account.
|
|
14
|
+
*
|
|
15
|
+
* For a business-account wallet, this first prepares and signs the quorum
|
|
16
|
+
* intent for the message. Personal wallets pass `approvalQuorum` through
|
|
17
|
+
* unchanged.
|
|
18
|
+
*
|
|
19
|
+
* @param params.approvalQuorum - A signed intent from an earlier `SigningConsentRequiredError`, when retrying.
|
|
20
|
+
* @param params.message - The message to sign.
|
|
21
|
+
* @param params.waasProvider - The WaaS provider that prepares the intent and signs.
|
|
22
|
+
* @param params.walletAccount - The wallet account that signs the message.
|
|
23
|
+
* @param client - The Dynamic client holding the current session key.
|
|
24
|
+
* @returns The signature.
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const { signature } = await signMessage(
|
|
28
|
+
* { message, waasProvider, walletAccount },
|
|
29
|
+
* client
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
* @see {@link prepareSigningQuorumApproval} for the quorum intent step.
|
|
33
|
+
* @see {@link isSigningConsentRequiredError} for handling an unmet signing quorum.
|
|
34
|
+
* @notInstrumented
|
|
35
|
+
*/
|
|
36
|
+
export declare const signMessage: ({ approvalQuorum, message, waasProvider, walletAccount }: SignMessageParams, client: DynamicClient) => Promise<SignMessageResult>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=signMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/signMessage/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,4BAA4B,EAC5B,YAAY,EACb,MAAM,oCAAoC,CAAC;AAI5C,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,KAAK,iBAAiB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW,6DACoC,iBAAiB,UACnE,aAAa,KACpB,OAAO,CAAC,iBAAiB,CAiB3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/waas/utils/signRawMessage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|