@dynamic-labs-wallet/browser-wallet-client 1.1.78 → 1.1.79

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 CHANGED
@@ -26,6 +26,7 @@ const isTransactionIntent = (intent)=>intent.operation.kind === 'transaction';
26
26
  const isSvmTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'SVM';
27
27
  const isEvmTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'EVM';
28
28
  const isTronTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'TRON';
29
+ const isStellarTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'STELLAR';
29
30
  const isBtcTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'BTC';
30
31
  const assertMatches = (matches, message)=>{
31
32
  if (!matches) throw new Error(message);
@@ -62,6 +63,10 @@ const assertTronTransactionMatchesRequest = (intent, request)=>{
62
63
  // the approved operation, so the contract fields are not re-derived here.
63
64
  assertMatches(request.chainName === 'TRON' && Boolean(request.chainId) && operation.chainId === toDecimalChainId(request.chainId) && request.refreshLimits === undefined && !request.refreshableNonce && intent.limits === undefined && hasLifetime(intent.lifetime, 'expiration') && operation.from === request.accountAddress, 'Prepared TRON transaction signing intent is malformed');
64
65
  };
66
+ const assertStellarTransactionMatchesRequest = (intent, request)=>{
67
+ const { operation } = intent;
68
+ assertMatches(request.chainName === 'STELLAR' && Boolean(request.chainId) && operation.chainId === request.chainId && request.refreshLimits === undefined && !request.refreshableNonce && intent.limits === undefined && hasLifetime(intent.lifetime, 'expiration') && operation.source === request.accountAddress, 'Prepared Stellar transaction signing intent is malformed');
69
+ };
65
70
  const BTC_HASH = /^[0-9a-f]{64}$/;
66
71
  const DECIMAL = /^(0|[1-9]\d*)$/;
67
72
  const HEX_BYTES = /^(?:[0-9a-f]{2})*$/;
@@ -92,6 +97,7 @@ const assertTransactionIntentMatchesRequest = (intent, request)=>{
92
97
  }
93
98
  if (isSvmTransactionIntent(intent)) return assertSvmTransactionMatchesRequest(intent, request);
94
99
  if (isTronTransactionIntent(intent)) return assertTronTransactionMatchesRequest(intent, request);
100
+ if (isStellarTransactionIntent(intent)) return assertStellarTransactionMatchesRequest(intent, request);
95
101
  if (isBtcTransactionIntent(intent)) return assertBtcTransactionMatchesRequest(intent, request);
96
102
  if (!isEvmTransactionIntent(intent)) {
97
103
  throw new Error('Unsupported transaction signing intent');
package/index.esm.js CHANGED
@@ -25,6 +25,7 @@ const isTransactionIntent = (intent)=>intent.operation.kind === 'transaction';
25
25
  const isSvmTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'SVM';
26
26
  const isEvmTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'EVM';
27
27
  const isTronTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'TRON';
28
+ const isStellarTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'STELLAR';
28
29
  const isBtcTransactionIntent = (intent)=>intent.operation.kind === 'transaction' && intent.operation.chainName === 'BTC';
29
30
  const assertMatches = (matches, message)=>{
30
31
  if (!matches) throw new Error(message);
@@ -61,6 +62,10 @@ const assertTronTransactionMatchesRequest = (intent, request)=>{
61
62
  // the approved operation, so the contract fields are not re-derived here.
62
63
  assertMatches(request.chainName === 'TRON' && Boolean(request.chainId) && operation.chainId === toDecimalChainId(request.chainId) && request.refreshLimits === undefined && !request.refreshableNonce && intent.limits === undefined && hasLifetime(intent.lifetime, 'expiration') && operation.from === request.accountAddress, 'Prepared TRON transaction signing intent is malformed');
63
64
  };
65
+ const assertStellarTransactionMatchesRequest = (intent, request)=>{
66
+ const { operation } = intent;
67
+ assertMatches(request.chainName === 'STELLAR' && Boolean(request.chainId) && operation.chainId === request.chainId && request.refreshLimits === undefined && !request.refreshableNonce && intent.limits === undefined && hasLifetime(intent.lifetime, 'expiration') && operation.source === request.accountAddress, 'Prepared Stellar transaction signing intent is malformed');
68
+ };
64
69
  const BTC_HASH = /^[0-9a-f]{64}$/;
65
70
  const DECIMAL = /^(0|[1-9]\d*)$/;
66
71
  const HEX_BYTES = /^(?:[0-9a-f]{2})*$/;
@@ -91,6 +96,7 @@ const assertTransactionIntentMatchesRequest = (intent, request)=>{
91
96
  }
92
97
  if (isSvmTransactionIntent(intent)) return assertSvmTransactionMatchesRequest(intent, request);
93
98
  if (isTronTransactionIntent(intent)) return assertTronTransactionMatchesRequest(intent, request);
99
+ if (isStellarTransactionIntent(intent)) return assertStellarTransactionMatchesRequest(intent, request);
94
100
  if (isBtcTransactionIntent(intent)) return assertBtcTransactionMatchesRequest(intent, request);
95
101
  if (!isEvmTransactionIntent(intent)) {
96
102
  throw new Error('Unsupported transaction signing intent');
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser-wallet-client",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "1.1.78",
7
+ "@dynamic-labs-wallet/core": "1.1.79",
8
8
  "@dynamic-labs/logger": "^5.9.4",
9
9
  "@dynamic-labs/message-transport": "^5.9.1"
10
10
  },
@@ -1 +1 @@
1
- {"version":3,"file":"assertPreparedSigningIntentMatchesRequest.d.ts","sourceRoot":"","sources":["../../packages/src/assertPreparedSigningIntentMatchesRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,2BAA2B,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAqPhH,eAAO,MAAM,yCAAyC,0CAInD;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,2BAA2B,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,KAAG,IAQH,CAAC"}
1
+ {"version":3,"file":"assertPreparedSigningIntentMatchesRequest.d.ts","sourceRoot":"","sources":["../../packages/src/assertPreparedSigningIntentMatchesRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,2BAA2B,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AA4QhH,eAAO,MAAM,yCAAyC,0CAInD;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,2BAA2B,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,KAAG,IAQH,CAAC"}