@dynamic-labs/embedded-wallet-solana 3.0.0-alpha.63 → 3.0.0-alpha.65

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/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
 
2
+ ## [3.0.0-alpha.65](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.64...v3.0.0-alpha.65) (2024-09-11)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * gracefully handle errors when trying to find solana tx destination ([#6847](https://github.com/dynamic-labs/DynamicAuth/issues/6847)) ([19359ad](https://github.com/dynamic-labs/DynamicAuth/commit/19359ad40b16af0edb822d1fc6643fecdbc89adf))
8
+
9
+ ## [3.0.0-alpha.64](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.63...v3.0.0-alpha.64) (2024-09-10)
10
+
11
+
12
+ ### Features
13
+
14
+ * add solana ledger check for connect-only ([#6833](https://github.com/dynamic-labs/DynamicAuth/issues/6833)) ([4829122](https://github.com/dynamic-labs/DynamicAuth/commit/4829122bbd1e04b9b02f8686df5dd5a6d2ae6c1c))
15
+
2
16
  ## [3.0.0-alpha.63](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.62...v3.0.0-alpha.63) (2024-09-10)
3
17
 
4
18
 
package/package.cjs CHANGED
@@ -3,12 +3,12 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "3.0.0-alpha.63";
6
+ var version = "3.0.0-alpha.65";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.526",
9
- "@dynamic-labs/utils": "3.0.0-alpha.63",
10
- "@dynamic-labs/logger": "3.0.0-alpha.63",
11
- "@dynamic-labs/types": "3.0.0-alpha.63",
9
+ "@dynamic-labs/utils": "3.0.0-alpha.65",
10
+ "@dynamic-labs/logger": "3.0.0-alpha.65",
11
+ "@dynamic-labs/types": "3.0.0-alpha.65",
12
12
  eventemitter3: "5.0.1",
13
13
  "@solana/spl-token": "0.4.6",
14
14
  "@solana/web3.js": "1.92.1",
package/package.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client'
2
- var version = "3.0.0-alpha.63";
2
+ var version = "3.0.0-alpha.65";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.526",
5
- "@dynamic-labs/utils": "3.0.0-alpha.63",
6
- "@dynamic-labs/logger": "3.0.0-alpha.63",
7
- "@dynamic-labs/types": "3.0.0-alpha.63",
5
+ "@dynamic-labs/utils": "3.0.0-alpha.65",
6
+ "@dynamic-labs/logger": "3.0.0-alpha.65",
7
+ "@dynamic-labs/types": "3.0.0-alpha.65",
8
8
  eventemitter3: "5.0.1",
9
9
  "@solana/spl-token": "0.4.6",
10
10
  "@solana/web3.js": "1.92.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/embedded-wallet-solana",
3
- "version": "3.0.0-alpha.63",
3
+ "version": "3.0.0-alpha.65",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@dynamic-labs/sdk-api-core": "0.0.526",
30
- "@dynamic-labs/utils": "3.0.0-alpha.63",
31
- "@dynamic-labs/logger": "3.0.0-alpha.63",
32
- "@dynamic-labs/types": "3.0.0-alpha.63",
30
+ "@dynamic-labs/utils": "3.0.0-alpha.65",
31
+ "@dynamic-labs/logger": "3.0.0-alpha.65",
32
+ "@dynamic-labs/types": "3.0.0-alpha.65",
33
33
  "eventemitter3": "5.0.1",
34
34
  "@solana/spl-token": "0.4.6",
35
35
  "@solana/web3.js": "1.92.1",
@@ -37,12 +37,12 @@
37
37
  "@turnkey/iframe-stamper": "2.0.0",
38
38
  "@turnkey/solana": "0.3.9",
39
39
  "@turnkey/webauthn-stamper": "0.5.0",
40
- "@dynamic-labs/embedded-wallet": "3.0.0-alpha.63",
41
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.63",
42
- "@dynamic-labs/solana-core": "3.0.0-alpha.63",
43
- "@dynamic-labs/wallet-book": "3.0.0-alpha.63",
44
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.63",
45
- "@dynamic-labs/webauthn": "3.0.0-alpha.63",
40
+ "@dynamic-labs/embedded-wallet": "3.0.0-alpha.65",
41
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.65",
42
+ "@dynamic-labs/solana-core": "3.0.0-alpha.65",
43
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.65",
44
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.65",
45
+ "@dynamic-labs/webauthn": "3.0.0-alpha.65",
46
46
  "react-dom": "18.2.0",
47
47
  "viem": "2.9.25"
48
48
  },
@@ -51,94 +51,100 @@ const decodeTransaction = (transaction, connection, thisAddress) => _tslib.__awa
51
51
  if (!transaction) {
52
52
  throw new utils.DynamicError('Transaction is required');
53
53
  }
54
- let decodedInstructions = [];
55
- if ('version' in transaction) {
56
- const lookupTableAddresses = transaction.message.addressTableLookups.map((lookup) => new web3_js.PublicKey(lookup.accountKey));
57
- // For non-simple SOL transfers, we need to fetch the lookup table accounts
58
- if (lookupTableAddresses.length > 0) {
59
- const lookupTables = yield Promise.all(lookupTableAddresses.map((address) => connection.getAddressLookupTable(address)));
60
- const lookupTableAccounts = lookupTables
61
- .filter((result) => result !== null)
62
- .map((result) => result.value);
63
- if (lookupTableAccounts.length > 0) {
64
- decodedInstructions = web3_js.TransactionMessage.decompile(transaction.message, {
65
- addressLookupTableAccounts: lookupTableAccounts,
66
- }).instructions;
54
+ try {
55
+ let decodedInstructions = [];
56
+ if ('version' in transaction) {
57
+ const lookupTableAddresses = transaction.message.addressTableLookups.map((lookup) => new web3_js.PublicKey(lookup.accountKey));
58
+ // For non-simple SOL transfers, we need to fetch the lookup table accounts
59
+ if (lookupTableAddresses.length > 0) {
60
+ const lookupTables = yield Promise.all(lookupTableAddresses.map((address) => connection.getAddressLookupTable(address)));
61
+ const lookupTableAccounts = lookupTables
62
+ .filter((result) => result !== null)
63
+ .map((result) => result.value);
64
+ if (lookupTableAccounts.length > 0) {
65
+ decodedInstructions = web3_js.TransactionMessage.decompile(transaction.message, {
66
+ addressLookupTableAccounts: lookupTableAccounts,
67
+ }).instructions;
68
+ }
69
+ }
70
+ else {
71
+ decodedInstructions = web3_js.TransactionMessage.decompile(transaction.message).instructions;
67
72
  }
68
73
  }
74
+ else if (!transaction.instructions) {
75
+ decodedInstructions = (_g = web3_js.Transaction.from(Buffer.from(transaction.serialize()))) === null || _g === void 0 ? void 0 : _g.instructions;
76
+ }
69
77
  else {
70
- decodedInstructions = web3_js.TransactionMessage.decompile(transaction.message).instructions;
78
+ decodedInstructions = transaction.instructions;
71
79
  }
72
- }
73
- else if (!transaction.instructions) {
74
- decodedInstructions = (_g = web3_js.Transaction.from(Buffer.from(transaction.serialize()))) === null || _g === void 0 ? void 0 : _g.instructions;
75
- }
76
- else {
77
- decodedInstructions = transaction.instructions;
78
- }
79
- if (!(decodedInstructions === null || decodedInstructions === void 0 ? void 0 : decodedInstructions.length)) {
80
- throw new utils.DynamicError('Bad formatted instruction');
81
- }
82
- const solTransfers = decodedInstructions.filter((instruction) => instruction.programId.equals(web3_js.SystemProgram.programId));
83
- // Non-SPL transfers, just SOL
84
- if (solTransfers.length > 0) {
85
- return solTransfers.map((decodedInstruction) => {
86
- let decodedTransferInstruction;
87
- try {
88
- decodedTransferInstruction =
89
- web3_js.SystemInstruction.decodeTransfer(decodedInstruction);
90
- }
91
- catch (e) {
92
- return { from: thisAddress, to: 'Unknown' };
93
- }
94
- return {
95
- from: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.fromPubkey.toBase58(),
96
- to: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.toPubkey.toBase58(),
97
- };
98
- });
99
- }
100
- // SPL transfers
101
- let splTransfers = yield Promise.all(decodedInstructions.map((instruction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
102
- var _h, _j, _k, _l, _m, _o, _p;
103
- if (instruction.programId.equals(splToken.TOKEN_PROGRAM_ID)) {
104
- const decodedTokenInstruction = splToken.decodeTransferInstructionUnchecked(instruction);
105
- const { source, destination } = decodedTokenInstruction.keys;
106
- if (destination) {
107
- // For contract interactions, e.g., swaps, the destination is the turnkey address, flip sender and receiver
108
- if ((destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58()) === thisAddress) {
80
+ if (!(decodedInstructions === null || decodedInstructions === void 0 ? void 0 : decodedInstructions.length)) {
81
+ throw new utils.DynamicError('Bad formatted instruction');
82
+ }
83
+ const solTransfers = decodedInstructions.filter((instruction) => instruction.programId.equals(web3_js.SystemProgram.programId));
84
+ // Non-SPL transfers, just SOL
85
+ if (solTransfers.length > 0) {
86
+ return solTransfers.map((decodedInstruction) => {
87
+ let decodedTransferInstruction;
88
+ try {
89
+ decodedTransferInstruction =
90
+ web3_js.SystemInstruction.decodeTransfer(decodedInstruction);
91
+ }
92
+ catch (e) {
93
+ return { from: thisAddress, to: 'Unknown' };
94
+ }
95
+ return {
96
+ from: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.fromPubkey.toBase58(),
97
+ to: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.toPubkey.toBase58(),
98
+ };
99
+ });
100
+ }
101
+ // SPL transfers
102
+ let splTransfers = yield Promise.all(decodedInstructions.map((instruction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
103
+ var _h, _j, _k, _l, _m, _o, _p;
104
+ if (instruction.programId.equals(splToken.TOKEN_PROGRAM_ID)) {
105
+ const decodedTokenInstruction = splToken.decodeTransferInstructionUnchecked(instruction);
106
+ const { source, destination } = decodedTokenInstruction.keys;
107
+ if (destination) {
108
+ // For contract interactions, e.g., swaps, the destination is the turnkey address, flip sender and receiver
109
+ if ((destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58()) === thisAddress) {
110
+ return {
111
+ from: thisAddress,
112
+ to: source === null || source === void 0 ? void 0 : source.pubkey.toBase58(),
113
+ };
114
+ }
115
+ // Pure SPL transfers, get the address from the destination token account to display to user
116
+ const destinationAccountInfo = yield connection.getParsedAccountInfo(destination.pubkey);
117
+ const isTokenAccount = ((_k = (_j = (_h = destinationAccountInfo.value) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.parsed) === null || _k === void 0 ? void 0 : _k.type) === 'account';
118
+ const destinationOwner = isTokenAccount
119
+ ? (_p = (_o = (_m = (_l = destinationAccountInfo.value) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.parsed) === null || _o === void 0 ? void 0 : _o.info) === null || _p === void 0 ? void 0 : _p.owner
120
+ : null;
121
+ const toAddress = destinationOwner
122
+ ? destinationOwner
123
+ : destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58();
109
124
  return {
110
125
  from: thisAddress,
111
- to: source === null || source === void 0 ? void 0 : source.pubkey.toBase58(),
126
+ to: toAddress,
112
127
  };
113
128
  }
114
- // Pure SPL transfers, get the address from the destination token account to display to user
115
- const destinationAccountInfo = yield connection.getParsedAccountInfo(destination.pubkey);
116
- const isTokenAccount = ((_k = (_j = (_h = destinationAccountInfo.value) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.parsed) === null || _k === void 0 ? void 0 : _k.type) === 'account';
117
- const destinationOwner = isTokenAccount
118
- ? (_p = (_o = (_m = (_l = destinationAccountInfo.value) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.parsed) === null || _o === void 0 ? void 0 : _o.info) === null || _p === void 0 ? void 0 : _p.owner
119
- : null;
120
- const toAddress = destinationOwner
121
- ? destinationOwner
122
- : destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58();
123
- return {
124
- from: thisAddress,
125
- to: toAddress,
126
- };
127
129
  }
128
- }
129
- return null;
130
- })));
131
- splTransfers = splTransfers.filter((transfer) => transfer !== null);
132
- if (splTransfers === null || splTransfers === void 0 ? void 0 : splTransfers.length)
133
- return splTransfers;
134
- // Return program IDs for non-SOL and non-SPL transfers
135
- const noTransferDestinations = decodedInstructions.map((instruction) => ({
136
- from: thisAddress,
137
- to: instruction.programId.toBase58(),
138
- }));
139
- if (noTransferDestinations.length)
140
- return noTransferDestinations;
141
- return { from: thisAddress, to: 'Unknown' };
130
+ return null;
131
+ })));
132
+ splTransfers = splTransfers.filter((transfer) => transfer !== null);
133
+ if (splTransfers === null || splTransfers === void 0 ? void 0 : splTransfers.length)
134
+ return splTransfers;
135
+ // Return program IDs for non-SOL and non-SPL transfers
136
+ const noTransferDestinations = decodedInstructions.map((instruction) => ({
137
+ from: thisAddress,
138
+ to: instruction.programId.toBase58(),
139
+ }));
140
+ if (noTransferDestinations.length)
141
+ return noTransferDestinations;
142
+ return { from: thisAddress, to: 'Unknown' };
143
+ }
144
+ catch (error) {
145
+ walletConnectorCore.logger.warn('[decodeTransaction]', error);
146
+ return { from: thisAddress, to: 'Unknown' };
147
+ }
142
148
  });
143
149
  const summarizeTransactionDecodedData = (transactionsData) => {
144
150
  const recipients = new Set();
@@ -47,94 +47,100 @@ const decodeTransaction = (transaction, connection, thisAddress) => __awaiter(vo
47
47
  if (!transaction) {
48
48
  throw new DynamicError('Transaction is required');
49
49
  }
50
- let decodedInstructions = [];
51
- if ('version' in transaction) {
52
- const lookupTableAddresses = transaction.message.addressTableLookups.map((lookup) => new PublicKey(lookup.accountKey));
53
- // For non-simple SOL transfers, we need to fetch the lookup table accounts
54
- if (lookupTableAddresses.length > 0) {
55
- const lookupTables = yield Promise.all(lookupTableAddresses.map((address) => connection.getAddressLookupTable(address)));
56
- const lookupTableAccounts = lookupTables
57
- .filter((result) => result !== null)
58
- .map((result) => result.value);
59
- if (lookupTableAccounts.length > 0) {
60
- decodedInstructions = TransactionMessage.decompile(transaction.message, {
61
- addressLookupTableAccounts: lookupTableAccounts,
62
- }).instructions;
50
+ try {
51
+ let decodedInstructions = [];
52
+ if ('version' in transaction) {
53
+ const lookupTableAddresses = transaction.message.addressTableLookups.map((lookup) => new PublicKey(lookup.accountKey));
54
+ // For non-simple SOL transfers, we need to fetch the lookup table accounts
55
+ if (lookupTableAddresses.length > 0) {
56
+ const lookupTables = yield Promise.all(lookupTableAddresses.map((address) => connection.getAddressLookupTable(address)));
57
+ const lookupTableAccounts = lookupTables
58
+ .filter((result) => result !== null)
59
+ .map((result) => result.value);
60
+ if (lookupTableAccounts.length > 0) {
61
+ decodedInstructions = TransactionMessage.decompile(transaction.message, {
62
+ addressLookupTableAccounts: lookupTableAccounts,
63
+ }).instructions;
64
+ }
65
+ }
66
+ else {
67
+ decodedInstructions = TransactionMessage.decompile(transaction.message).instructions;
63
68
  }
64
69
  }
70
+ else if (!transaction.instructions) {
71
+ decodedInstructions = (_g = Transaction.from(Buffer.from(transaction.serialize()))) === null || _g === void 0 ? void 0 : _g.instructions;
72
+ }
65
73
  else {
66
- decodedInstructions = TransactionMessage.decompile(transaction.message).instructions;
74
+ decodedInstructions = transaction.instructions;
67
75
  }
68
- }
69
- else if (!transaction.instructions) {
70
- decodedInstructions = (_g = Transaction.from(Buffer.from(transaction.serialize()))) === null || _g === void 0 ? void 0 : _g.instructions;
71
- }
72
- else {
73
- decodedInstructions = transaction.instructions;
74
- }
75
- if (!(decodedInstructions === null || decodedInstructions === void 0 ? void 0 : decodedInstructions.length)) {
76
- throw new DynamicError('Bad formatted instruction');
77
- }
78
- const solTransfers = decodedInstructions.filter((instruction) => instruction.programId.equals(SystemProgram.programId));
79
- // Non-SPL transfers, just SOL
80
- if (solTransfers.length > 0) {
81
- return solTransfers.map((decodedInstruction) => {
82
- let decodedTransferInstruction;
83
- try {
84
- decodedTransferInstruction =
85
- SystemInstruction.decodeTransfer(decodedInstruction);
86
- }
87
- catch (e) {
88
- return { from: thisAddress, to: 'Unknown' };
89
- }
90
- return {
91
- from: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.fromPubkey.toBase58(),
92
- to: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.toPubkey.toBase58(),
93
- };
94
- });
95
- }
96
- // SPL transfers
97
- let splTransfers = yield Promise.all(decodedInstructions.map((instruction) => __awaiter(void 0, void 0, void 0, function* () {
98
- var _h, _j, _k, _l, _m, _o, _p;
99
- if (instruction.programId.equals(TOKEN_PROGRAM_ID)) {
100
- const decodedTokenInstruction = decodeTransferInstructionUnchecked(instruction);
101
- const { source, destination } = decodedTokenInstruction.keys;
102
- if (destination) {
103
- // For contract interactions, e.g., swaps, the destination is the turnkey address, flip sender and receiver
104
- if ((destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58()) === thisAddress) {
76
+ if (!(decodedInstructions === null || decodedInstructions === void 0 ? void 0 : decodedInstructions.length)) {
77
+ throw new DynamicError('Bad formatted instruction');
78
+ }
79
+ const solTransfers = decodedInstructions.filter((instruction) => instruction.programId.equals(SystemProgram.programId));
80
+ // Non-SPL transfers, just SOL
81
+ if (solTransfers.length > 0) {
82
+ return solTransfers.map((decodedInstruction) => {
83
+ let decodedTransferInstruction;
84
+ try {
85
+ decodedTransferInstruction =
86
+ SystemInstruction.decodeTransfer(decodedInstruction);
87
+ }
88
+ catch (e) {
89
+ return { from: thisAddress, to: 'Unknown' };
90
+ }
91
+ return {
92
+ from: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.fromPubkey.toBase58(),
93
+ to: decodedTransferInstruction === null || decodedTransferInstruction === void 0 ? void 0 : decodedTransferInstruction.toPubkey.toBase58(),
94
+ };
95
+ });
96
+ }
97
+ // SPL transfers
98
+ let splTransfers = yield Promise.all(decodedInstructions.map((instruction) => __awaiter(void 0, void 0, void 0, function* () {
99
+ var _h, _j, _k, _l, _m, _o, _p;
100
+ if (instruction.programId.equals(TOKEN_PROGRAM_ID)) {
101
+ const decodedTokenInstruction = decodeTransferInstructionUnchecked(instruction);
102
+ const { source, destination } = decodedTokenInstruction.keys;
103
+ if (destination) {
104
+ // For contract interactions, e.g., swaps, the destination is the turnkey address, flip sender and receiver
105
+ if ((destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58()) === thisAddress) {
106
+ return {
107
+ from: thisAddress,
108
+ to: source === null || source === void 0 ? void 0 : source.pubkey.toBase58(),
109
+ };
110
+ }
111
+ // Pure SPL transfers, get the address from the destination token account to display to user
112
+ const destinationAccountInfo = yield connection.getParsedAccountInfo(destination.pubkey);
113
+ const isTokenAccount = ((_k = (_j = (_h = destinationAccountInfo.value) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.parsed) === null || _k === void 0 ? void 0 : _k.type) === 'account';
114
+ const destinationOwner = isTokenAccount
115
+ ? (_p = (_o = (_m = (_l = destinationAccountInfo.value) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.parsed) === null || _o === void 0 ? void 0 : _o.info) === null || _p === void 0 ? void 0 : _p.owner
116
+ : null;
117
+ const toAddress = destinationOwner
118
+ ? destinationOwner
119
+ : destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58();
105
120
  return {
106
121
  from: thisAddress,
107
- to: source === null || source === void 0 ? void 0 : source.pubkey.toBase58(),
122
+ to: toAddress,
108
123
  };
109
124
  }
110
- // Pure SPL transfers, get the address from the destination token account to display to user
111
- const destinationAccountInfo = yield connection.getParsedAccountInfo(destination.pubkey);
112
- const isTokenAccount = ((_k = (_j = (_h = destinationAccountInfo.value) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.parsed) === null || _k === void 0 ? void 0 : _k.type) === 'account';
113
- const destinationOwner = isTokenAccount
114
- ? (_p = (_o = (_m = (_l = destinationAccountInfo.value) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.parsed) === null || _o === void 0 ? void 0 : _o.info) === null || _p === void 0 ? void 0 : _p.owner
115
- : null;
116
- const toAddress = destinationOwner
117
- ? destinationOwner
118
- : destination === null || destination === void 0 ? void 0 : destination.pubkey.toBase58();
119
- return {
120
- from: thisAddress,
121
- to: toAddress,
122
- };
123
125
  }
124
- }
125
- return null;
126
- })));
127
- splTransfers = splTransfers.filter((transfer) => transfer !== null);
128
- if (splTransfers === null || splTransfers === void 0 ? void 0 : splTransfers.length)
129
- return splTransfers;
130
- // Return program IDs for non-SOL and non-SPL transfers
131
- const noTransferDestinations = decodedInstructions.map((instruction) => ({
132
- from: thisAddress,
133
- to: instruction.programId.toBase58(),
134
- }));
135
- if (noTransferDestinations.length)
136
- return noTransferDestinations;
137
- return { from: thisAddress, to: 'Unknown' };
126
+ return null;
127
+ })));
128
+ splTransfers = splTransfers.filter((transfer) => transfer !== null);
129
+ if (splTransfers === null || splTransfers === void 0 ? void 0 : splTransfers.length)
130
+ return splTransfers;
131
+ // Return program IDs for non-SOL and non-SPL transfers
132
+ const noTransferDestinations = decodedInstructions.map((instruction) => ({
133
+ from: thisAddress,
134
+ to: instruction.programId.toBase58(),
135
+ }));
136
+ if (noTransferDestinations.length)
137
+ return noTransferDestinations;
138
+ return { from: thisAddress, to: 'Unknown' };
139
+ }
140
+ catch (error) {
141
+ logger.warn('[decodeTransaction]', error);
142
+ return { from: thisAddress, to: 'Unknown' };
143
+ }
138
144
  });
139
145
  const summarizeTransactionDecodedData = (transactionsData) => {
140
146
  const recipients = new Set();