@dynamic-labs-wallet/svm 0.0.215 → 0.0.217

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 CHANGED
@@ -21,7 +21,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
21
21
  *
22
22
  * @param thresholdSignatureScheme The threshold signature scheme to use
23
23
  * @returns The account address, public key hex, raw public key, and client key shares
24
- */ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
24
+ */ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, traceContext }) {
25
25
  try {
26
26
  let ceremonyCeremonyCompleteResolver;
27
27
  const ceremonyCompletePromise = new Promise((resolve)=>{
@@ -39,13 +39,13 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
39
39
  thresholdSignatureScheme,
40
40
  clientKeySharesBackupInfo: browser.getClientKeyShareBackupInfo()
41
41
  });
42
- this.logger.debug('walletMap updated for wallet', {
42
+ this.logger.debug('walletMap updated for wallet', _extends({
43
43
  context: {
44
44
  accountAddress,
45
45
  walletId,
46
46
  walletMap: this.walletMap
47
47
  }
48
- });
48
+ }, this.getTraceContext(traceContext)));
49
49
  ceremonyCeremonyCompleteResolver(undefined);
50
50
  }
51
51
  });
@@ -92,7 +92,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
92
92
  * @param message The message to sign (Uint8Array)
93
93
  * @param accountAddress Solana address (base58 encoded)
94
94
  * @param password The password for encrypted backup shares
95
- */ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError }) {
95
+ */ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError, traceContext }) {
96
96
  await this.verifyPassword({
97
97
  accountAddress,
98
98
  password,
@@ -113,7 +113,8 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
113
113
  context: {
114
114
  svmMessage: message
115
115
  },
116
- onError
116
+ onError,
117
+ traceContext
117
118
  });
118
119
  const base58Signature = bs58.encode(signatureEd25519);
119
120
  return base58Signature;
@@ -122,7 +123,7 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
122
123
  throw new Error(browser.ERROR_SIGN_MESSAGE);
123
124
  }
124
125
  }
125
- async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
126
+ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError, traceContext }) {
126
127
  await this.verifyPassword({
127
128
  accountAddress: senderAddress,
128
129
  password,
@@ -142,7 +143,8 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
142
143
  context
143
144
  });
144
145
  const signatureEd25519 = await this.sign(_extends({}, signParams, {
145
- onError
146
+ onError,
147
+ traceContext
146
148
  }));
147
149
  if (!signatureEd25519) {
148
150
  throw new Error('Signature is undefined');
package/index.esm.js CHANGED
@@ -19,7 +19,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
19
19
  *
20
20
  * @param thresholdSignatureScheme The threshold signature scheme to use
21
21
  * @returns The account address, public key hex, raw public key, and client key shares
22
- */ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId }) {
22
+ */ async createWalletAccount({ thresholdSignatureScheme, password = undefined, signedSessionId, traceContext }) {
23
23
  try {
24
24
  let ceremonyCeremonyCompleteResolver;
25
25
  const ceremonyCompletePromise = new Promise((resolve)=>{
@@ -37,13 +37,13 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
37
37
  thresholdSignatureScheme,
38
38
  clientKeySharesBackupInfo: getClientKeyShareBackupInfo()
39
39
  });
40
- this.logger.debug('walletMap updated for wallet', {
40
+ this.logger.debug('walletMap updated for wallet', _extends({
41
41
  context: {
42
42
  accountAddress,
43
43
  walletId,
44
44
  walletMap: this.walletMap
45
45
  }
46
- });
46
+ }, this.getTraceContext(traceContext)));
47
47
  ceremonyCeremonyCompleteResolver(undefined);
48
48
  }
49
49
  });
@@ -90,7 +90,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
90
90
  * @param message The message to sign (Uint8Array)
91
91
  * @param accountAddress Solana address (base58 encoded)
92
92
  * @param password The password for encrypted backup shares
93
- */ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError }) {
93
+ */ async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken, onError, traceContext }) {
94
94
  await this.verifyPassword({
95
95
  accountAddress,
96
96
  password,
@@ -111,7 +111,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
111
111
  context: {
112
112
  svmMessage: message
113
113
  },
114
- onError
114
+ onError,
115
+ traceContext
115
116
  });
116
117
  const base58Signature = bs58.encode(signatureEd25519);
117
118
  return base58Signature;
@@ -120,7 +121,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
120
121
  throw new Error(ERROR_SIGN_MESSAGE);
121
122
  }
122
123
  }
123
- async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError }) {
124
+ async signTransaction({ senderAddress, transaction, password = undefined, signedSessionId, mfaToken, chainId, context, onError, traceContext }) {
124
125
  await this.verifyPassword({
125
126
  accountAddress: senderAddress,
126
127
  password,
@@ -140,7 +141,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
140
141
  context
141
142
  });
142
143
  const signatureEd25519 = await this.sign(_extends({}, signParams, {
143
- onError
144
+ onError,
145
+ traceContext
144
146
  }));
145
147
  if (!signatureEd25519) {
146
148
  throw new Error('Signature is undefined');
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/svm",
3
- "version": "0.0.215",
3
+ "version": "0.0.217",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/browser": "0.0.215",
7
+ "@dynamic-labs-wallet/browser": "0.0.217",
8
8
  "@solana/web3.js": "^1.98.2",
9
9
  "bs58": "^6.0.0",
10
10
  "@dynamic-labs/sdk-api-core": "^0.0.818"
@@ -1,4 +1,4 @@
1
- import { DynamicWalletClient, type DynamicWalletClientProps, type Ed25519KeygenResult, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/browser';
1
+ import { DynamicWalletClient, type DynamicWalletClientProps, type Ed25519KeygenResult, type ThresholdSignatureScheme, type TraceContext } from '@dynamic-labs-wallet/browser';
2
2
  import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
3
3
  export declare class DynamicSvmWalletClient extends DynamicWalletClient {
4
4
  readonly chainName = "SVM";
@@ -10,10 +10,11 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
10
10
  * @param thresholdSignatureScheme The threshold signature scheme to use
11
11
  * @returns The account address, public key hex, raw public key, and client key shares
12
12
  */
13
- createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, }: {
13
+ createWalletAccount({ thresholdSignatureScheme, password, signedSessionId, traceContext, }: {
14
14
  thresholdSignatureScheme: ThresholdSignatureScheme;
15
15
  password?: string;
16
16
  signedSessionId: string;
17
+ traceContext?: TraceContext;
17
18
  }): Promise<{
18
19
  accountAddress: string;
19
20
  rawPublicKey: Uint8Array | string;
@@ -28,15 +29,16 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
28
29
  * @param accountAddress Solana address (base58 encoded)
29
30
  * @param password The password for encrypted backup shares
30
31
  */
31
- signMessage({ message, accountAddress, password, signedSessionId, mfaToken, onError, }: {
32
+ signMessage({ message, accountAddress, password, signedSessionId, mfaToken, onError, traceContext, }: {
32
33
  message: string;
33
34
  accountAddress: string;
34
35
  password?: string;
35
36
  signedSessionId: string;
36
37
  mfaToken?: string;
37
38
  onError?: (error: Error) => void;
39
+ traceContext?: TraceContext;
38
40
  }): Promise<string>;
39
- signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError, }: {
41
+ signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError, traceContext, }: {
40
42
  senderAddress: string;
41
43
  transaction: string;
42
44
  password?: string;
@@ -45,6 +47,7 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
45
47
  chainId?: string;
46
48
  context?: SignMessageContext;
47
49
  onError?: (error: Error) => void;
50
+ traceContext?: TraceContext;
48
51
  }): Promise<string>;
49
52
  private prepareTransactionForSigning;
50
53
  private buildSignParams;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/svm/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,wBAAwB,EAM7B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAG9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAkBrE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,EACV,gBAAgB,GACjB,EAAE,wBAAwB;IAe3B;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,eAAe,GAChB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC;KACnC,CAAC;IA2EI,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU;;;IAY5D;;;;;;OAMG;IACG,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,EACd,QAAoB,EACpB,eAAe,EACf,QAAQ,EACR,OAAO,GACR,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE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