@dynamic-labs-wallet/node-svm 0.0.309 → 0.0.311
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 +9 -19
- package/index.esm.js +10 -20
- package/package.json +3 -6
- package/src/client/client.d.ts +1 -1
- package/src/client/client.d.ts.map +1 -1
- package/src/delegatedClient.d.ts.map +1 -1
- package/src/services/logger.d.ts +0 -10
- package/src/services/logger.d.ts.map +0 -1
package/index.cjs.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var node = require('@dynamic-labs-wallet/node');
|
|
4
4
|
var web3_js = require('@solana/web3.js');
|
|
5
|
-
var logger$1 = require('@dynamic-labs/logger');
|
|
6
|
-
var axios = require('axios');
|
|
7
|
-
var core = require('@dynamic-labs-wallet/core');
|
|
8
5
|
|
|
9
6
|
function _extends() {
|
|
10
7
|
_extends = Object.assign || function assign(target) {
|
|
@@ -86,17 +83,7 @@ function decodeBase58(str) {
|
|
|
86
83
|
return out;
|
|
87
84
|
}
|
|
88
85
|
|
|
89
|
-
const
|
|
90
|
-
const logError = ({ message, error, context })=>{
|
|
91
|
-
if (error instanceof axios.AxiosError) {
|
|
92
|
-
core.handleAxiosError(error, message, context, logger);
|
|
93
|
-
}
|
|
94
|
-
logger.error('[DynamicWaasWalletClient] Error in node-svm client', {
|
|
95
|
-
error: error instanceof Error ? error.message : String(error),
|
|
96
|
-
context
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
|
|
86
|
+
const logError$1 = node.createLogError('node-svm');
|
|
100
87
|
// Helper: normalize bytes to hex without triggering Buffer.from(string, encoding) overload
|
|
101
88
|
const toHex = (bytes)=>(Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes)).toString('hex');
|
|
102
89
|
class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
@@ -160,7 +147,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
160
147
|
externalServerKeyShares
|
|
161
148
|
};
|
|
162
149
|
} catch (error) {
|
|
163
|
-
logError({
|
|
150
|
+
logError$1({
|
|
164
151
|
message: ERROR_CREATE_WALLET_ACCOUNT,
|
|
165
152
|
error: error,
|
|
166
153
|
context: {}
|
|
@@ -211,7 +198,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
211
198
|
});
|
|
212
199
|
return encodeBase58(signatureEd25519);
|
|
213
200
|
} catch (error) {
|
|
214
|
-
logError({
|
|
201
|
+
logError$1({
|
|
215
202
|
message: 'Error signing message:',
|
|
216
203
|
error: error,
|
|
217
204
|
context: {
|
|
@@ -262,7 +249,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
262
249
|
}
|
|
263
250
|
return encodeBase58(signatureEd25519);
|
|
264
251
|
} catch (error) {
|
|
265
|
-
logError({
|
|
252
|
+
logError$1({
|
|
266
253
|
message: 'Error in signTransaction:',
|
|
267
254
|
error: error,
|
|
268
255
|
context: {
|
|
@@ -389,12 +376,14 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
389
376
|
const svmWallets = wallets.filter((wallet)=>wallet.chainName === 'solana');
|
|
390
377
|
return svmWallets;
|
|
391
378
|
}
|
|
392
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator }){
|
|
379
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator, logger, debug }){
|
|
393
380
|
super({
|
|
394
381
|
environmentId,
|
|
395
382
|
baseApiUrl,
|
|
396
383
|
baseMPCRelayApiUrl,
|
|
397
|
-
enableMPCAccelerator
|
|
384
|
+
enableMPCAccelerator,
|
|
385
|
+
logger,
|
|
386
|
+
debug
|
|
398
387
|
}), this.chainName = 'SVM';
|
|
399
388
|
}
|
|
400
389
|
}
|
|
@@ -447,6 +436,7 @@ async function sendTransaction({ signedTransaction, rpcUrl = 'https://api.devnet
|
|
|
447
436
|
return txid;
|
|
448
437
|
}
|
|
449
438
|
|
|
439
|
+
const logError = node.createLogError('node-svm');
|
|
450
440
|
/**
|
|
451
441
|
* Creates a delegated SVM wallet client for functional operations
|
|
452
442
|
*/ const createDelegatedSvmWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
|
package/index.esm.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { DynamicWalletClient, getMPCChainConfig, getExternalServerKeyShareBackupInfo, WalletOperation, SOLANA_RPC_URL, createDelegatedWalletClient, delegatedSignMessage as delegatedSignMessage$1, revokeDelegation as revokeDelegation$1 } from '@dynamic-labs-wallet/node';
|
|
1
|
+
import { createLogError, DynamicWalletClient, getMPCChainConfig, getExternalServerKeyShareBackupInfo, WalletOperation, SOLANA_RPC_URL, createDelegatedWalletClient, delegatedSignMessage as delegatedSignMessage$1, revokeDelegation as revokeDelegation$1 } from '@dynamic-labs-wallet/node';
|
|
2
2
|
import { PublicKey, VersionedTransaction, Keypair, Connection, Transaction, SystemProgram } from '@solana/web3.js';
|
|
3
|
-
import { Logger } from '@dynamic-labs/logger';
|
|
4
|
-
import { AxiosError } from 'axios';
|
|
5
|
-
import { handleAxiosError } from '@dynamic-labs-wallet/core';
|
|
6
3
|
|
|
7
4
|
function _extends() {
|
|
8
5
|
_extends = Object.assign || function assign(target) {
|
|
@@ -84,17 +81,7 @@ function decodeBase58(str) {
|
|
|
84
81
|
return out;
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
const
|
|
88
|
-
const logError = ({ message, error, context })=>{
|
|
89
|
-
if (error instanceof AxiosError) {
|
|
90
|
-
handleAxiosError(error, message, context, logger);
|
|
91
|
-
}
|
|
92
|
-
logger.error('[DynamicWaasWalletClient] Error in node-svm client', {
|
|
93
|
-
error: error instanceof Error ? error.message : String(error),
|
|
94
|
-
context
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
|
|
84
|
+
const logError$1 = createLogError('node-svm');
|
|
98
85
|
// Helper: normalize bytes to hex without triggering Buffer.from(string, encoding) overload
|
|
99
86
|
const toHex = (bytes)=>(Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes)).toString('hex');
|
|
100
87
|
class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
@@ -158,7 +145,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
158
145
|
externalServerKeyShares
|
|
159
146
|
};
|
|
160
147
|
} catch (error) {
|
|
161
|
-
logError({
|
|
148
|
+
logError$1({
|
|
162
149
|
message: ERROR_CREATE_WALLET_ACCOUNT,
|
|
163
150
|
error: error,
|
|
164
151
|
context: {}
|
|
@@ -209,7 +196,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
209
196
|
});
|
|
210
197
|
return encodeBase58(signatureEd25519);
|
|
211
198
|
} catch (error) {
|
|
212
|
-
logError({
|
|
199
|
+
logError$1({
|
|
213
200
|
message: 'Error signing message:',
|
|
214
201
|
error: error,
|
|
215
202
|
context: {
|
|
@@ -260,7 +247,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
260
247
|
}
|
|
261
248
|
return encodeBase58(signatureEd25519);
|
|
262
249
|
} catch (error) {
|
|
263
|
-
logError({
|
|
250
|
+
logError$1({
|
|
264
251
|
message: 'Error in signTransaction:',
|
|
265
252
|
error: error,
|
|
266
253
|
context: {
|
|
@@ -387,12 +374,14 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
387
374
|
const svmWallets = wallets.filter((wallet)=>wallet.chainName === 'solana');
|
|
388
375
|
return svmWallets;
|
|
389
376
|
}
|
|
390
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator }){
|
|
377
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator, logger, debug }){
|
|
391
378
|
super({
|
|
392
379
|
environmentId,
|
|
393
380
|
baseApiUrl,
|
|
394
381
|
baseMPCRelayApiUrl,
|
|
395
|
-
enableMPCAccelerator
|
|
382
|
+
enableMPCAccelerator,
|
|
383
|
+
logger,
|
|
384
|
+
debug
|
|
396
385
|
}), this.chainName = 'SVM';
|
|
397
386
|
}
|
|
398
387
|
}
|
|
@@ -445,6 +434,7 @@ async function sendTransaction({ signedTransaction, rpcUrl = 'https://api.devnet
|
|
|
445
434
|
return txid;
|
|
446
435
|
}
|
|
447
436
|
|
|
437
|
+
const logError = createLogError('node-svm');
|
|
448
438
|
/**
|
|
449
439
|
* Creates a delegated SVM wallet client for functional operations
|
|
450
440
|
*/ const createDelegatedSvmWalletClient = ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug = false })=>{
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.311",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/
|
|
8
|
-
"@
|
|
9
|
-
"@dynamic-labs/logger": "^4.25.3",
|
|
10
|
-
"@solana/web3.js": "^1.98.2",
|
|
11
|
-
"axios": "1.13.5"
|
|
7
|
+
"@dynamic-labs-wallet/node": "0.0.311",
|
|
8
|
+
"@solana/web3.js": "^1.98.2"
|
|
12
9
|
},
|
|
13
10
|
"publishConfig": {
|
|
14
11
|
"access": "public"
|
package/src/client/client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
|
3
3
|
export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
4
4
|
readonly chainName = "SVM";
|
|
5
5
|
accountAddress?: string;
|
|
6
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator }: DynamicWalletClientProps);
|
|
6
|
+
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator, logger, debug, }: DynamicWalletClientProps);
|
|
7
7
|
/**
|
|
8
8
|
* Creates a wallet account on the Solana chain
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAI7B,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,KAAK,WAAW,EAAE,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAU7F,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,KAAK,GACN,EAAE,wBAAwB;IAW3B;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,0BAAkC,GACnC,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;KACtC,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC;QAClC,uBAAuB,EAAE,cAAc,EAAE,CAAC;KAC3C,CAAC;IAsEI,oBAAoB,CAAC,YAAY,EAAE,MA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,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;KACtC,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;QAC9C,uBAAuB,EAAE,cAAc,EAAE,CAAC;KAC3C,CAAC;IA2DI,aAAa;CAKpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAa,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMlE,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,+DAO7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,KACA,OAAO,CAAC,MAAM,CAwBhB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,wBAAwB,WAC3B,wBAAwB,qEAO7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,EAAE,oBAAoB,GAAG,WAAW,CAAC;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,KACA,OAAO,CAAC,oBAAoB,GAAG,WAAW,CAmE5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WAAkB,wBAAwB,UAAU,GAAG,kBAEnF,CAAC"}
|
package/src/services/logger.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|