@dynamic-labs-wallet/node-evm 0.0.198 → 0.0.199
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/index.cjs.js +99 -23
- package/index.esm.js +87 -11
- package/package.json +8 -4
- package/src/client/client.d.ts.map +1 -1
- package/src/delegatedClient.d.ts.map +1 -1
- package/src/services/logger.d.ts +10 -0
- package/src/services/logger.d.ts.map +1 -0
package/index.cjs.js
CHANGED
|
@@ -4,13 +4,16 @@ var accounts = require('viem/accounts');
|
|
|
4
4
|
var node = require('@dynamic-labs-wallet/node');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
var utils = require('viem/utils');
|
|
7
|
+
var logger$1 = require('@dynamic-labs/logger');
|
|
8
|
+
var axios = require('axios');
|
|
9
|
+
var core = require('@dynamic-labs-wallet/core');
|
|
7
10
|
var chains = require('viem/chains');
|
|
8
11
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
|
-
var core = require('@dynamic-labs-sdk/client/core');
|
|
12
|
+
var core$1 = require('@dynamic-labs-sdk/client/core');
|
|
10
13
|
var viem$1 = require('@dynamic-labs-sdk/evm/viem');
|
|
11
14
|
var waas = require('@dynamic-labs-sdk/evm/waas');
|
|
12
15
|
var zerodev = require('@dynamic-labs-sdk/zerodev');
|
|
13
|
-
var core$
|
|
16
|
+
var core$2 = require('@dynamic-labs-sdk/zerodev/core');
|
|
14
17
|
var ecdsaValidator = require('@zerodev/ecdsa-validator');
|
|
15
18
|
var sdk = require('@zerodev/sdk');
|
|
16
19
|
|
|
@@ -69,6 +72,17 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
69
72
|
};
|
|
70
73
|
};
|
|
71
74
|
|
|
75
|
+
const logger = new logger$1.Logger('DynamicWaasWalletClient');
|
|
76
|
+
const logError = ({ message, error, context })=>{
|
|
77
|
+
if (error instanceof axios.AxiosError) {
|
|
78
|
+
core.handleAxiosError(error, message, context, logger);
|
|
79
|
+
}
|
|
80
|
+
logger.error('[DynamicWaasWalletClient] Error in node-evm client', {
|
|
81
|
+
error: error instanceof Error ? error.message : String(error),
|
|
82
|
+
context
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
72
86
|
/**
|
|
73
87
|
* Creates a delegated EVM wallet client for functional operations
|
|
74
88
|
*/ const createDelegatedEvmWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
|
|
@@ -107,7 +121,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
107
121
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
108
122
|
return serializedSignature;
|
|
109
123
|
} catch (error) {
|
|
110
|
-
|
|
124
|
+
logError({
|
|
125
|
+
message: 'Error in delegatedSignMessage',
|
|
126
|
+
error: error,
|
|
127
|
+
context: {
|
|
128
|
+
walletId
|
|
129
|
+
}
|
|
130
|
+
});
|
|
111
131
|
throw error;
|
|
112
132
|
}
|
|
113
133
|
};
|
|
@@ -144,7 +164,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
144
164
|
const serializedSignedTx = viem.serializeTransaction(signedTx);
|
|
145
165
|
return serializedSignedTx;
|
|
146
166
|
} catch (error) {
|
|
147
|
-
|
|
167
|
+
logError({
|
|
168
|
+
message: 'Error in delegatedSignTransaction',
|
|
169
|
+
error: error,
|
|
170
|
+
context: {
|
|
171
|
+
walletId
|
|
172
|
+
}
|
|
173
|
+
});
|
|
148
174
|
throw error;
|
|
149
175
|
}
|
|
150
176
|
};
|
|
@@ -170,7 +196,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
170
196
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
171
197
|
return serializedSignature;
|
|
172
198
|
} catch (error) {
|
|
173
|
-
|
|
199
|
+
logError({
|
|
200
|
+
message: 'Error in delegatedSignTypedData',
|
|
201
|
+
error: error,
|
|
202
|
+
context: {
|
|
203
|
+
walletId
|
|
204
|
+
}
|
|
205
|
+
});
|
|
174
206
|
throw error;
|
|
175
207
|
}
|
|
176
208
|
};
|
|
@@ -198,7 +230,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
198
230
|
const signature = viem.parseSignature(serializedSignature);
|
|
199
231
|
return signature;
|
|
200
232
|
} catch (error) {
|
|
201
|
-
|
|
233
|
+
logError({
|
|
234
|
+
message: 'Error in delegatedSignAuthorization',
|
|
235
|
+
error: error,
|
|
236
|
+
context: {
|
|
237
|
+
walletId
|
|
238
|
+
}
|
|
239
|
+
});
|
|
202
240
|
throw error;
|
|
203
241
|
}
|
|
204
242
|
};
|
|
@@ -422,7 +460,11 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
422
460
|
externalServerKeyShares
|
|
423
461
|
};
|
|
424
462
|
} catch (error) {
|
|
425
|
-
|
|
463
|
+
logError({
|
|
464
|
+
message: ERROR_CREATE_WALLET_ACCOUNT,
|
|
465
|
+
error: error,
|
|
466
|
+
context: {}
|
|
467
|
+
});
|
|
426
468
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
427
469
|
}
|
|
428
470
|
}
|
|
@@ -457,7 +499,13 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
457
499
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
458
500
|
return serializedSignature;
|
|
459
501
|
} catch (error) {
|
|
460
|
-
|
|
502
|
+
logError({
|
|
503
|
+
message: ERROR_SIGN_MESSAGE,
|
|
504
|
+
error: error,
|
|
505
|
+
context: {
|
|
506
|
+
accountAddress
|
|
507
|
+
}
|
|
508
|
+
});
|
|
461
509
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
462
510
|
}
|
|
463
511
|
}
|
|
@@ -495,7 +543,13 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
495
543
|
const signature = viem.parseSignature(serializedSignature);
|
|
496
544
|
return signature;
|
|
497
545
|
} catch (error) {
|
|
498
|
-
|
|
546
|
+
logError({
|
|
547
|
+
message: ERROR_SIGN_MESSAGE,
|
|
548
|
+
error: error,
|
|
549
|
+
context: {
|
|
550
|
+
accountAddress
|
|
551
|
+
}
|
|
552
|
+
});
|
|
499
553
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
500
554
|
}
|
|
501
555
|
}
|
|
@@ -528,7 +582,13 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
528
582
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
529
583
|
return serializedSignature;
|
|
530
584
|
} catch (error) {
|
|
531
|
-
|
|
585
|
+
logError({
|
|
586
|
+
message: ERROR_SIGN_TYPED_DATA,
|
|
587
|
+
error: error,
|
|
588
|
+
context: {
|
|
589
|
+
accountAddress
|
|
590
|
+
}
|
|
591
|
+
});
|
|
532
592
|
throw new Error(ERROR_SIGN_TYPED_DATA);
|
|
533
593
|
}
|
|
534
594
|
}
|
|
@@ -545,7 +605,13 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
545
605
|
});
|
|
546
606
|
return verified;
|
|
547
607
|
} catch (error) {
|
|
548
|
-
|
|
608
|
+
logError({
|
|
609
|
+
message: ERROR_VERIFY_MESSAGE_SIGNATURE,
|
|
610
|
+
error: error,
|
|
611
|
+
context: {
|
|
612
|
+
accountAddress
|
|
613
|
+
}
|
|
614
|
+
});
|
|
549
615
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
550
616
|
}
|
|
551
617
|
}
|
|
@@ -591,7 +657,13 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
591
657
|
const serializedSignedTx = viem.serializeTransaction(signedTx);
|
|
592
658
|
return serializedSignedTx;
|
|
593
659
|
} catch (error) {
|
|
594
|
-
|
|
660
|
+
logError({
|
|
661
|
+
message: 'Error signing transaction:',
|
|
662
|
+
error: error,
|
|
663
|
+
context: {
|
|
664
|
+
senderAddress
|
|
665
|
+
}
|
|
666
|
+
});
|
|
595
667
|
throw error;
|
|
596
668
|
}
|
|
597
669
|
}
|
|
@@ -666,7 +738,11 @@ class DynamicEvmWalletClient extends node.DynamicWalletClient {
|
|
|
666
738
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
667
739
|
},
|
|
668
740
|
onError: (e)=>{
|
|
669
|
-
|
|
741
|
+
logError({
|
|
742
|
+
message: 'importPrivateKey: onError',
|
|
743
|
+
error: e,
|
|
744
|
+
context: {}
|
|
745
|
+
});
|
|
670
746
|
onError == null ? void 0 : onError(e);
|
|
671
747
|
}
|
|
672
748
|
});
|
|
@@ -766,7 +842,7 @@ class DynamicEvmZeroDevClient {
|
|
|
766
842
|
*/ getNetworkData(networkId) {
|
|
767
843
|
const networksData = client.getNetworksData(this.dynamicClient);
|
|
768
844
|
const networkData = networksData.find((n)=>n.networkId === networkId);
|
|
769
|
-
core.assertDefined(networkData, `No network found with networkId: ${networkId}. Available networks: ${networksData.map((n)=>n.networkId).join(', ')}`);
|
|
845
|
+
core$1.assertDefined(networkData, `No network found with networkId: ${networkId}. Available networks: ${networksData.map((n)=>n.networkId).join(', ')}`);
|
|
770
846
|
return networkData;
|
|
771
847
|
}
|
|
772
848
|
async createKernelClientForAddress(options) {
|
|
@@ -780,7 +856,7 @@ class DynamicEvmZeroDevClient {
|
|
|
780
856
|
const activeNetworkData = this.getNetworkData(options.networkId);
|
|
781
857
|
const viemChain = viem$1.mapNetworkDataToViemChain(activeNetworkData);
|
|
782
858
|
var _options_bundlerRpc;
|
|
783
|
-
const bundlerRpc = (_options_bundlerRpc = options.bundlerRpc) != null ? _options_bundlerRpc : core$
|
|
859
|
+
const bundlerRpc = (_options_bundlerRpc = options.bundlerRpc) != null ? _options_bundlerRpc : core$2.getZerodevRpc({
|
|
784
860
|
bundlerProvider: options.bundlerProvider,
|
|
785
861
|
networkId: activeNetworkData.networkId,
|
|
786
862
|
rpcType: 'bundler'
|
|
@@ -795,13 +871,13 @@ class DynamicEvmZeroDevClient {
|
|
|
795
871
|
signer: viemSigner
|
|
796
872
|
});
|
|
797
873
|
var _options_paymasterRpc;
|
|
798
|
-
const paymasterRpc = (_options_paymasterRpc = options.paymasterRpc) != null ? _options_paymasterRpc : core$
|
|
874
|
+
const paymasterRpc = (_options_paymasterRpc = options.paymasterRpc) != null ? _options_paymasterRpc : core$2.getZerodevRpc({
|
|
799
875
|
bundlerProvider: options.bundlerProvider,
|
|
800
876
|
networkId: activeNetworkData.networkId,
|
|
801
877
|
rpcType: 'paymaster'
|
|
802
878
|
}, this.dynamicClient);
|
|
803
879
|
var _options_withSponsorship;
|
|
804
|
-
const paymasterConfig = ((_options_withSponsorship = options.withSponsorship) != null ? _options_withSponsorship : true) ? core$
|
|
880
|
+
const paymasterConfig = ((_options_withSponsorship = options.withSponsorship) != null ? _options_withSponsorship : true) ? core$2.getPaymasterConfig({
|
|
805
881
|
chain: viemChain,
|
|
806
882
|
gasTokenAddress: options.gasTokenAddress,
|
|
807
883
|
paymasterRpc
|
|
@@ -818,11 +894,11 @@ class DynamicEvmZeroDevClient {
|
|
|
818
894
|
return kernelClient;
|
|
819
895
|
}
|
|
820
896
|
async createKernelAccountWithCustomSigner({ publicClient, signer }) {
|
|
821
|
-
const zerodevProvider = core$
|
|
822
|
-
core.assertDefined(zerodevProvider, 'Zerodev provider is not enabled in project settings');
|
|
897
|
+
const zerodevProvider = core$2.getZerodevProviderFromSettings(this.dynamicClient);
|
|
898
|
+
core$1.assertDefined(zerodevProvider, 'Zerodev provider is not enabled in project settings');
|
|
823
899
|
const useEIP7702 = zerodevProvider.enableEIP7702;
|
|
824
900
|
const entryPointVersion = zerodevProvider.entryPointVersion;
|
|
825
|
-
const entryPoint = core$
|
|
901
|
+
const entryPoint = core$2.getEntryPoint(entryPointVersion);
|
|
826
902
|
if (useEIP7702) {
|
|
827
903
|
return sdk.createKernelAccount(publicClient, {
|
|
828
904
|
eip7702Account: signer,
|
|
@@ -831,14 +907,14 @@ class DynamicEvmZeroDevClient {
|
|
|
831
907
|
});
|
|
832
908
|
}
|
|
833
909
|
const kernelVersionValue = zerodevProvider.kernelVersion;
|
|
834
|
-
const kernelVersion = core$
|
|
910
|
+
const kernelVersion = core$2.getKernelVersion({
|
|
835
911
|
entryPoint,
|
|
836
912
|
kernelVersion: kernelVersionValue
|
|
837
913
|
});
|
|
838
914
|
var _zerodevProvider_enableKernelV3Migration;
|
|
839
915
|
const kernelV3MigrationEnabled = (_zerodevProvider_enableKernelV3Migration = zerodevProvider.enableKernelV3Migration) != null ? _zerodevProvider_enableKernelV3Migration : false;
|
|
840
916
|
if (kernelV3MigrationEnabled) {
|
|
841
|
-
const apiKernelVersion = core$
|
|
917
|
+
const apiKernelVersion = core$2.getKernelVersion({
|
|
842
918
|
entryPoint,
|
|
843
919
|
kernelVersion: zerodevProvider.kernelVersion
|
|
844
920
|
});
|
|
@@ -851,7 +927,7 @@ class DynamicEvmZeroDevClient {
|
|
|
851
927
|
signer
|
|
852
928
|
});
|
|
853
929
|
}
|
|
854
|
-
const validator = await core$
|
|
930
|
+
const validator = await core$2.getEcdsaValidator({
|
|
855
931
|
ecdsaProviderType: zerodevProvider.ecdsaProviderType,
|
|
856
932
|
entryPoint,
|
|
857
933
|
kernelVersion,
|
package/index.esm.js
CHANGED
|
@@ -2,6 +2,9 @@ import { toAccount } from 'viem/accounts';
|
|
|
2
2
|
import { MessageHash, createDelegatedWalletClient, delegatedSignMessage as delegatedSignMessage$1, revokeDelegation as revokeDelegation$1, DynamicWalletClient, getMPCChainConfig, getExternalServerKeyShareBackupInfo, WalletOperation } from '@dynamic-labs-wallet/node';
|
|
3
3
|
import { stringToHex, bytesToHex, size, concat, hashTypedData, serializeSignature, getAddress, serializeTransaction, parseSignature, createPublicClient, http, defineChain, createWalletClient } from 'viem';
|
|
4
4
|
import { hashAuthorization } from 'viem/utils';
|
|
5
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
6
|
+
import { AxiosError } from 'axios';
|
|
7
|
+
import { handleAxiosError } from '@dynamic-labs-wallet/core';
|
|
5
8
|
import { mainnet } from 'viem/chains';
|
|
6
9
|
import { initializeClient, refreshUser, getNetworksData, createDynamicClient } from '@dynamic-labs-sdk/client';
|
|
7
10
|
import { assertDefined } from '@dynamic-labs-sdk/client/core';
|
|
@@ -67,6 +70,17 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
67
70
|
};
|
|
68
71
|
};
|
|
69
72
|
|
|
73
|
+
const logger = new Logger('DynamicWaasWalletClient');
|
|
74
|
+
const logError = ({ message, error, context })=>{
|
|
75
|
+
if (error instanceof AxiosError) {
|
|
76
|
+
handleAxiosError(error, message, context, logger);
|
|
77
|
+
}
|
|
78
|
+
logger.error('[DynamicWaasWalletClient] Error in node-evm client', {
|
|
79
|
+
error: error instanceof Error ? error.message : String(error),
|
|
80
|
+
context
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
70
84
|
/**
|
|
71
85
|
* Creates a delegated EVM wallet client for functional operations
|
|
72
86
|
*/ const createDelegatedEvmWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
|
|
@@ -105,7 +119,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
105
119
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
106
120
|
return serializedSignature;
|
|
107
121
|
} catch (error) {
|
|
108
|
-
|
|
122
|
+
logError({
|
|
123
|
+
message: 'Error in delegatedSignMessage',
|
|
124
|
+
error: error,
|
|
125
|
+
context: {
|
|
126
|
+
walletId
|
|
127
|
+
}
|
|
128
|
+
});
|
|
109
129
|
throw error;
|
|
110
130
|
}
|
|
111
131
|
};
|
|
@@ -142,7 +162,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
142
162
|
const serializedSignedTx = serializeTransaction(signedTx);
|
|
143
163
|
return serializedSignedTx;
|
|
144
164
|
} catch (error) {
|
|
145
|
-
|
|
165
|
+
logError({
|
|
166
|
+
message: 'Error in delegatedSignTransaction',
|
|
167
|
+
error: error,
|
|
168
|
+
context: {
|
|
169
|
+
walletId
|
|
170
|
+
}
|
|
171
|
+
});
|
|
146
172
|
throw error;
|
|
147
173
|
}
|
|
148
174
|
};
|
|
@@ -168,7 +194,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
168
194
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
169
195
|
return serializedSignature;
|
|
170
196
|
} catch (error) {
|
|
171
|
-
|
|
197
|
+
logError({
|
|
198
|
+
message: 'Error in delegatedSignTypedData',
|
|
199
|
+
error: error,
|
|
200
|
+
context: {
|
|
201
|
+
walletId
|
|
202
|
+
}
|
|
203
|
+
});
|
|
172
204
|
throw error;
|
|
173
205
|
}
|
|
174
206
|
};
|
|
@@ -196,7 +228,13 @@ const deriveAccountAddress = ({ rawPublicKey })=>{
|
|
|
196
228
|
const signature = parseSignature(serializedSignature);
|
|
197
229
|
return signature;
|
|
198
230
|
} catch (error) {
|
|
199
|
-
|
|
231
|
+
logError({
|
|
232
|
+
message: 'Error in delegatedSignAuthorization',
|
|
233
|
+
error: error,
|
|
234
|
+
context: {
|
|
235
|
+
walletId
|
|
236
|
+
}
|
|
237
|
+
});
|
|
200
238
|
throw error;
|
|
201
239
|
}
|
|
202
240
|
};
|
|
@@ -420,7 +458,11 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
420
458
|
externalServerKeyShares
|
|
421
459
|
};
|
|
422
460
|
} catch (error) {
|
|
423
|
-
|
|
461
|
+
logError({
|
|
462
|
+
message: ERROR_CREATE_WALLET_ACCOUNT,
|
|
463
|
+
error: error,
|
|
464
|
+
context: {}
|
|
465
|
+
});
|
|
424
466
|
throw new Error(ERROR_CREATE_WALLET_ACCOUNT);
|
|
425
467
|
}
|
|
426
468
|
}
|
|
@@ -455,7 +497,13 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
455
497
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
456
498
|
return serializedSignature;
|
|
457
499
|
} catch (error) {
|
|
458
|
-
|
|
500
|
+
logError({
|
|
501
|
+
message: ERROR_SIGN_MESSAGE,
|
|
502
|
+
error: error,
|
|
503
|
+
context: {
|
|
504
|
+
accountAddress
|
|
505
|
+
}
|
|
506
|
+
});
|
|
459
507
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
460
508
|
}
|
|
461
509
|
}
|
|
@@ -493,7 +541,13 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
493
541
|
const signature = parseSignature(serializedSignature);
|
|
494
542
|
return signature;
|
|
495
543
|
} catch (error) {
|
|
496
|
-
|
|
544
|
+
logError({
|
|
545
|
+
message: ERROR_SIGN_MESSAGE,
|
|
546
|
+
error: error,
|
|
547
|
+
context: {
|
|
548
|
+
accountAddress
|
|
549
|
+
}
|
|
550
|
+
});
|
|
497
551
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
498
552
|
}
|
|
499
553
|
}
|
|
@@ -526,7 +580,13 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
526
580
|
const serializedSignature = serializeECDSASignature(signatureEcdsa);
|
|
527
581
|
return serializedSignature;
|
|
528
582
|
} catch (error) {
|
|
529
|
-
|
|
583
|
+
logError({
|
|
584
|
+
message: ERROR_SIGN_TYPED_DATA,
|
|
585
|
+
error: error,
|
|
586
|
+
context: {
|
|
587
|
+
accountAddress
|
|
588
|
+
}
|
|
589
|
+
});
|
|
530
590
|
throw new Error(ERROR_SIGN_TYPED_DATA);
|
|
531
591
|
}
|
|
532
592
|
}
|
|
@@ -543,7 +603,13 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
543
603
|
});
|
|
544
604
|
return verified;
|
|
545
605
|
} catch (error) {
|
|
546
|
-
|
|
606
|
+
logError({
|
|
607
|
+
message: ERROR_VERIFY_MESSAGE_SIGNATURE,
|
|
608
|
+
error: error,
|
|
609
|
+
context: {
|
|
610
|
+
accountAddress
|
|
611
|
+
}
|
|
612
|
+
});
|
|
547
613
|
throw new Error(ERROR_VERIFY_MESSAGE_SIGNATURE);
|
|
548
614
|
}
|
|
549
615
|
}
|
|
@@ -589,7 +655,13 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
589
655
|
const serializedSignedTx = serializeTransaction(signedTx);
|
|
590
656
|
return serializedSignedTx;
|
|
591
657
|
} catch (error) {
|
|
592
|
-
|
|
658
|
+
logError({
|
|
659
|
+
message: 'Error signing transaction:',
|
|
660
|
+
error: error,
|
|
661
|
+
context: {
|
|
662
|
+
senderAddress
|
|
663
|
+
}
|
|
664
|
+
});
|
|
593
665
|
throw error;
|
|
594
666
|
}
|
|
595
667
|
}
|
|
@@ -664,7 +736,11 @@ class DynamicEvmWalletClient extends DynamicWalletClient {
|
|
|
664
736
|
ceremonyCeremonyCompleteResolver(undefined);
|
|
665
737
|
},
|
|
666
738
|
onError: (e)=>{
|
|
667
|
-
|
|
739
|
+
logError({
|
|
740
|
+
message: 'importPrivateKey: onError',
|
|
741
|
+
error: e,
|
|
742
|
+
context: {}
|
|
743
|
+
});
|
|
668
744
|
onError == null ? void 0 : onError(e);
|
|
669
745
|
}
|
|
670
746
|
});
|
package/package.json
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-evm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.199",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.199",
|
|
8
|
+
"@dynamic-labs-wallet/node": "0.0.199",
|
|
9
|
+
"@dynamic-labs/logger": "^4.25.3",
|
|
8
10
|
"@dynamic-labs/sdk-api-core": "^0.0.801",
|
|
9
11
|
"@dynamic-labs-sdk/client": "^0.1.0-alpha.22",
|
|
10
12
|
"@dynamic-labs-sdk/zerodev": "^0.1.0-alpha.22",
|
|
11
13
|
"@dynamic-labs-sdk/evm": "^0.1.0-alpha.22",
|
|
12
14
|
"@zerodev/ecdsa-validator": "5.4.9",
|
|
13
|
-
"@zerodev/sdk": "5.4.36"
|
|
15
|
+
"@zerodev/sdk": "5.4.36",
|
|
16
|
+
"axios": "1.12.2"
|
|
14
17
|
},
|
|
15
18
|
"publishConfig": {
|
|
16
19
|
"access": "public"
|
|
@@ -20,7 +23,8 @@
|
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
22
25
|
"typescript": "^5.0.0",
|
|
23
|
-
"@types/node": "^20.0.0"
|
|
26
|
+
"@types/node": "^20.0.0",
|
|
27
|
+
"@types/http-errors": "^2.0.0"
|
|
24
28
|
},
|
|
25
29
|
"nx": {
|
|
26
30
|
"sourceRoot": "packages/node-evm/src",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EAGxB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAOV,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,KAAK,mBAAmB,EAGxB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B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,CAAC;KAClC,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;QAC/D,uBAAuB,EAAE,cAAc,EAAE,CAAC;KAC3C,CAAC;IAkEI,aAAa;CAOpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAErB,cAAc,EACf,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAErB,cAAc,EACf,MAAM,2BAA2B,CAAC;AAMnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACf,MAAM,MAAM,CAAC;AASd,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,sEAMxC,wBAAwB,KAAG,wBAe7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,wBAAwB,oEAQ7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,KACA,OAAO,CAAC,MAAM,CA8BhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,WAC3B,wBAAwB,sDAM7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,EAAE,uBAAuB,CAAC;CACtC,KACA,OAAO,CAAC,MAAM,CAkDhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,WACzB,wBAAwB,oDAM7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;CACtB,KACA,OAAO,CAAC,MAAM,CAiChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,WAC7B,wBAAwB,wDAM7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,GAAG,CAAC;CACpB,KACA,OAAO,CAAC,GAAG,CAmCb,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WACnB,wBAAwB,UACxB,GAAG,kBAGZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
2
|
+
export declare const logger: Logger;
|
|
3
|
+
declare const logError: ({ message, error, context, }: {
|
|
4
|
+
message: string;
|
|
5
|
+
error: Error;
|
|
6
|
+
context: Record<string, unknown>;
|
|
7
|
+
}) => void;
|
|
8
|
+
export { Logger } from '@dynamic-labs/logger';
|
|
9
|
+
export { logError };
|
|
10
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,eAAO,MAAM,MAAM,QAAwC,CAAC;AAE5D,QAAA,MAAM,QAAQ,iCAIX;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,KAAG,IAQH,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|