@dynamic-labs-wallet/stellar 0.0.289 → 0.0.290

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
@@ -44,6 +44,7 @@ var ERROR_EXPORT_PRIVATE_KEY = 'Error exporting private key';
44
44
  var ERROR_SIGN_MESSAGE = 'Error signing message';
45
45
  var ERROR_ACCOUNT_ADDRESS_REQUIRED = 'Account address is required';
46
46
  var ERROR_SIGN_TRANSACTION = 'Error signing transaction';
47
+ var ERROR_CHAIN_ID_REQUIRED_LOCAL = 'Chain ID is required';
47
48
  var STELLAR_NETWORK_PASSPHRASES = {
48
49
  MAINNET: 'Public Global Stellar Network ; September 2015',
49
50
  TESTNET: 'Test SDF Network ; September 2015',
@@ -55,6 +56,20 @@ var STELLAR_NETWORK_PASSPHRASES = {
55
56
  FUTURENET: 'https://horizon-futurenet.stellar.org'
56
57
  };
57
58
 
59
+ /**
60
+ * Maps numeric chainId (used in policies) to network passphrase (used for transaction hashing)
61
+ * ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
62
+ */ var STELLAR_CHAIN_ID_TO_PASSPHRASE = {
63
+ '1': STELLAR_NETWORK_PASSPHRASES.MAINNET,
64
+ '2': STELLAR_NETWORK_PASSPHRASES.TESTNET,
65
+ '3': STELLAR_NETWORK_PASSPHRASES.FUTURENET
66
+ };
67
+ /**
68
+ * Gets the network passphrase from a numeric chainId, defaults to mainnet
69
+ */ var getNetworkPassphraseFromChainId = function(chainId) {
70
+ return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId] || STELLAR_NETWORK_PASSPHRASES.MAINNET;
71
+ };
72
+
58
73
  function _assert_this_initialized(self) {
59
74
  if (self === void 0) {
60
75
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -508,10 +523,10 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
508
523
  {
509
524
  key: "signTransaction",
510
525
  value: function signTransaction(param) {
511
- var senderAddress = param.senderAddress, transaction = param.transaction, _param_password = param.password, password = _param_password === void 0 ? undefined : _param_password, signedSessionId = param.signedSessionId, mfaToken = param.mfaToken, context = param.context, onError = param.onError;
526
+ var senderAddress = param.senderAddress, transaction = param.transaction, _param_password = param.password, password = _param_password === void 0 ? undefined : _param_password, signedSessionId = param.signedSessionId, mfaToken = param.mfaToken, chainId = param.chainId, context = param.context, onError = param.onError;
512
527
  var _this = this;
513
528
  return _async_to_generator(function() {
514
- var resolvedContext, signatureEd25519, formattedSignature, error;
529
+ var networkPassphrase, stellarTransaction, transactionHash, resolvedContext, signatureEd25519, formattedSignature, error;
515
530
  return _ts_generator(this, function(_state) {
516
531
  switch(_state.label){
517
532
  case 0:
@@ -528,9 +543,18 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
528
543
  ];
529
544
  case 1:
530
545
  _state.sent();
546
+ if (!chainId) {
547
+ throw new Error(ERROR_CHAIN_ID_REQUIRED_LOCAL);
548
+ }
549
+ // Get network passphrase from chainId and compute transaction hash
550
+ networkPassphrase = getNetworkPassphraseFromChainId(chainId);
551
+ stellarTransaction = stellarSdk.TransactionBuilder.fromXDR(transaction, networkPassphrase);
552
+ transactionHash = stellarTransaction.hash().toString('hex');
553
+ // Build context with XDR and chainId for policy validation
531
554
  resolvedContext = _object_spread_props(_object_spread({}, context), {
532
555
  stellarTransaction: {
533
- serializedTransaction: transaction
556
+ serializedTransaction: transaction,
557
+ chainId: chainId
534
558
  }
535
559
  });
536
560
  _state.label = 2;
@@ -544,7 +568,7 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
544
568
  return [
545
569
  4,
546
570
  _this.sign({
547
- message: transaction,
571
+ message: transactionHash,
548
572
  accountAddress: senderAddress,
549
573
  chainName: _this.chainName,
550
574
  password: password,
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AuthMode, DynamicWalletClient, ERROR_PASSWORD_MISMATCH, getMPCChainConfig } from '@dynamic-labs-wallet/browser';
2
- import { StrKey, Keypair } from '@stellar/stellar-sdk';
2
+ import { StrKey, Keypair, TransactionBuilder } from '@stellar/stellar-sdk';
3
3
  import * as sdkApiCore from '@dynamic-labs/sdk-api-core';
4
4
  export { sdkApiCore };
5
5
 
@@ -24,6 +24,7 @@ var ERROR_EXPORT_PRIVATE_KEY = 'Error exporting private key';
24
24
  var ERROR_SIGN_MESSAGE = 'Error signing message';
25
25
  var ERROR_ACCOUNT_ADDRESS_REQUIRED = 'Account address is required';
26
26
  var ERROR_SIGN_TRANSACTION = 'Error signing transaction';
27
+ var ERROR_CHAIN_ID_REQUIRED_LOCAL = 'Chain ID is required';
27
28
  var STELLAR_NETWORK_PASSPHRASES = {
28
29
  MAINNET: 'Public Global Stellar Network ; September 2015',
29
30
  TESTNET: 'Test SDF Network ; September 2015',
@@ -35,6 +36,20 @@ var STELLAR_NETWORK_PASSPHRASES = {
35
36
  FUTURENET: 'https://horizon-futurenet.stellar.org'
36
37
  };
37
38
 
39
+ /**
40
+ * Maps numeric chainId (used in policies) to network passphrase (used for transaction hashing)
41
+ * ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
42
+ */ var STELLAR_CHAIN_ID_TO_PASSPHRASE = {
43
+ '1': STELLAR_NETWORK_PASSPHRASES.MAINNET,
44
+ '2': STELLAR_NETWORK_PASSPHRASES.TESTNET,
45
+ '3': STELLAR_NETWORK_PASSPHRASES.FUTURENET
46
+ };
47
+ /**
48
+ * Gets the network passphrase from a numeric chainId, defaults to mainnet
49
+ */ var getNetworkPassphraseFromChainId = function(chainId) {
50
+ return STELLAR_CHAIN_ID_TO_PASSPHRASE[chainId] || STELLAR_NETWORK_PASSPHRASES.MAINNET;
51
+ };
52
+
38
53
  function _assert_this_initialized(self) {
39
54
  if (self === void 0) {
40
55
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -488,10 +503,10 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
488
503
  {
489
504
  key: "signTransaction",
490
505
  value: function signTransaction(param) {
491
- var senderAddress = param.senderAddress, transaction = param.transaction, _param_password = param.password, password = _param_password === void 0 ? undefined : _param_password, signedSessionId = param.signedSessionId, mfaToken = param.mfaToken, context = param.context, onError = param.onError;
506
+ var senderAddress = param.senderAddress, transaction = param.transaction, _param_password = param.password, password = _param_password === void 0 ? undefined : _param_password, signedSessionId = param.signedSessionId, mfaToken = param.mfaToken, chainId = param.chainId, context = param.context, onError = param.onError;
492
507
  var _this = this;
493
508
  return _async_to_generator(function() {
494
- var resolvedContext, signatureEd25519, formattedSignature, error;
509
+ var networkPassphrase, stellarTransaction, transactionHash, resolvedContext, signatureEd25519, formattedSignature, error;
495
510
  return _ts_generator(this, function(_state) {
496
511
  switch(_state.label){
497
512
  case 0:
@@ -508,9 +523,18 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
508
523
  ];
509
524
  case 1:
510
525
  _state.sent();
526
+ if (!chainId) {
527
+ throw new Error(ERROR_CHAIN_ID_REQUIRED_LOCAL);
528
+ }
529
+ // Get network passphrase from chainId and compute transaction hash
530
+ networkPassphrase = getNetworkPassphraseFromChainId(chainId);
531
+ stellarTransaction = TransactionBuilder.fromXDR(transaction, networkPassphrase);
532
+ transactionHash = stellarTransaction.hash().toString('hex');
533
+ // Build context with XDR and chainId for policy validation
511
534
  resolvedContext = _object_spread_props(_object_spread({}, context), {
512
535
  stellarTransaction: {
513
- serializedTransaction: transaction
536
+ serializedTransaction: transaction,
537
+ chainId: chainId
514
538
  }
515
539
  });
516
540
  _state.label = 2;
@@ -524,7 +548,7 @@ var DynamicStellarWalletClient = /*#__PURE__*/ function(DynamicWalletClient) {
524
548
  return [
525
549
  4,
526
550
  _this.sign({
527
- message: transaction,
551
+ message: transactionHash,
528
552
  accountAddress: senderAddress,
529
553
  chainName: _this.chainName,
530
554
  password: password,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/stellar",
3
- "version": "0.0.289",
3
+ "version": "0.0.290",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/browser": "0.0.289",
7
+ "@dynamic-labs-wallet/browser": "0.0.290",
8
8
  "@stellar/stellar-sdk": "^12.3.0",
9
9
  "@dynamic-labs/sdk-api-core": "^0.0.875"
10
10
  },
@@ -22,12 +22,14 @@ export declare class DynamicStellarWalletClient extends DynamicWalletClient {
22
22
  context?: SignMessageContext;
23
23
  onError?: (error: Error) => void;
24
24
  }): Promise<string>;
25
- signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, context, onError, }: {
25
+ signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, chainId, context, onError, }: {
26
26
  senderAddress: string;
27
+ /** XDR-encoded transaction envelope */
27
28
  transaction: string;
28
29
  password?: string;
29
30
  signedSessionId: string;
30
31
  mfaToken?: string;
32
+ chainId?: string;
31
33
  context?: SignMessageContext;
32
34
  onError?: (error: Error) => void;
33
35
  }): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAGnB,KAAK,cAAc,EACnB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAarE,qBAAa,0BAA2B,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,SAAS,aAAa;gBAG7B,EACE,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,EACV,gBAAgB,GACjB,EAAE,wBAAwB,EAC3B,eAAe,CAAC,EAAE,kCAAkC;IAmBhD,mBAAm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M;IAsBnD,iBAAiB;CAKxB"}
@@ -7,6 +7,7 @@ export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "Account address is requir
7
7
  export declare const ERROR_VERIFY_MESSAGE_SIGNATURE = "Error verifying message signature";
8
8
  export declare const ERROR_VERIFY_TRANSACTION_SIGNATURE = "Error verifying transaction signature";
9
9
  export declare const ERROR_SIGN_TRANSACTION = "Error signing transaction";
10
+ export declare const ERROR_CHAIN_ID_REQUIRED_LOCAL = "Chain ID is required";
10
11
  export declare const STELLAR_NETWORK_PASSPHRASES: {
11
12
  readonly MAINNET: "Public Global Stellar Network ; September 2015";
12
13
  readonly TESTNET: "Test SDF Network ; September 2015";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,0CAA0C,CAAC;AAEnF,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,8BAA8B,sCAAsC,CAAC;AAElF,eAAO,MAAM,kCAAkC,0CAA0C,CAAC;AAE1F,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEtE,iHAAiH;AACjH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAItD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,0CAA0C,CAAC;AAEnF,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,8BAA8B,sCAAsC,CAAC;AAElF,eAAO,MAAM,kCAAkC,0CAA0C,CAAC;AAE1F,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEtE,iHAAiH;AACjH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAItD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Maps numeric chainId (used in policies) to network passphrase (used for transaction hashing)
3
+ * ChainIds: '1' = pubnet (mainnet), '2' = testnet, '3' = futurenet
4
+ */
5
+ export declare const STELLAR_CHAIN_ID_TO_PASSPHRASE: Record<string, string>;
6
+ /**
7
+ * Gets the network passphrase from a numeric chainId, defaults to mainnet
8
+ */
9
+ export declare const getNetworkPassphraseFromChainId: (chainId: string) => string;
10
+ //# sourceMappingURL=getNetworkPassphrase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,MAEjE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './getNetworkPassphrase.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './deriveStellarAddress/index.js';
2
+ export * from './getNetworkPassphrase/index.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC"}