@dynamic-labs-wallet/svm 0.0.32 → 0.0.33
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 +29 -83
- package/index.esm.js +31 -85
- package/package.json +3 -3
- package/src/svm/svm.d.ts +4 -8
- package/src/svm/svm.d.ts.map +1 -1
- package/src/svm/utils.d.ts +4 -4
- package/src/svm/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -3,66 +3,25 @@
|
|
|
3
3
|
var browser = require('@dynamic-labs-wallet/browser');
|
|
4
4
|
var bs58 = require('bs58');
|
|
5
5
|
var web3_js = require('@solana/web3.js');
|
|
6
|
-
|
|
6
|
+
require('@dynamic-labs-wallet/core');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const addSignatureToTransaction = ({ transaction, signature })=>{
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
async function createSolanaTransaction({ senderSolanaAddress, amount, to, rpcUrl = 'https://api.devnet.solana.com' }) {
|
|
19
|
-
try {
|
|
20
|
-
const connection = new web3_js.Connection(rpcUrl != null ? rpcUrl : 'https://api.devnet.solana.com');
|
|
21
|
-
const balance = await getBalance({
|
|
22
|
-
address: senderSolanaAddress,
|
|
23
|
-
rpcUrl
|
|
24
|
-
});
|
|
25
|
-
if (balance < amount * 1e9) {
|
|
26
|
-
throw new Error('Insufficient balance');
|
|
10
|
+
if (transaction instanceof web3_js.Transaction) {
|
|
11
|
+
transaction.addSignature(transaction.feePayer, Buffer.from(signature));
|
|
12
|
+
} else {
|
|
13
|
+
// For versioned transactions, we should add the signature to the fee payer
|
|
14
|
+
// which is always the first account in the static account keys
|
|
15
|
+
// TODO: see if this works for sponsored transactions
|
|
16
|
+
const feePayer = transaction.message.staticAccountKeys[0];
|
|
17
|
+
transaction.addSignature(feePayer, Buffer.from(signature));
|
|
27
18
|
}
|
|
28
|
-
|
|
29
|
-
const transaction = new web3_js.Transaction().add(web3_js.SystemProgram.transfer({
|
|
30
|
-
fromPubkey: fromPubkey,
|
|
31
|
-
toPubkey: new web3_js.PublicKey(to),
|
|
32
|
-
lamports: amount * 1e9
|
|
33
|
-
}));
|
|
34
|
-
const { blockhash } = await connection.getLatestBlockhash();
|
|
35
|
-
transaction.recentBlockhash = blockhash;
|
|
36
|
-
transaction.feePayer = fromPubkey;
|
|
37
|
-
const serializedTransaction = transaction.serializeMessage();
|
|
38
|
-
return {
|
|
39
|
-
transaction,
|
|
40
|
-
serializedTransaction
|
|
41
|
-
};
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.error('Error in creating transaction:', error);
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function finalizeTransaction({ transaction, signature }) {
|
|
48
|
-
try {
|
|
49
|
-
transaction.addSignature(transaction.feePayer, Buffer.from(signature));
|
|
50
|
-
return new Uint8Array(transaction.serialize());
|
|
19
|
+
return transaction;
|
|
51
20
|
} catch (error) {
|
|
52
21
|
console.error('Error in finalizing transaction:', error);
|
|
53
22
|
throw error;
|
|
54
23
|
}
|
|
55
|
-
}
|
|
56
|
-
async function sendTransaction({ signedTransaction, rpcUrl = 'https://api.devnet.solana.com' }) {
|
|
57
|
-
try {
|
|
58
|
-
const connection = new web3_js.Connection(rpcUrl != null ? rpcUrl : 'https://api.devnet.solana.com');
|
|
59
|
-
const txid = await connection.sendRawTransaction(Buffer.from(signedTransaction));
|
|
60
|
-
return txid;
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.error('Error in sending transaction:', error);
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
24
|
+
};
|
|
66
25
|
|
|
67
26
|
class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
68
27
|
/**
|
|
@@ -93,7 +52,8 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
93
52
|
walletId: newWalletId,
|
|
94
53
|
chainName: this.chainName,
|
|
95
54
|
clientKeyShares: clientKeyShares,
|
|
96
|
-
thresholdSignatureScheme
|
|
55
|
+
thresholdSignatureScheme,
|
|
56
|
+
clientKeySharesBackupInfo: browser.getClientKeyShareBackupInfo()
|
|
97
57
|
};
|
|
98
58
|
await this.storeEncryptedBackupByWallet({
|
|
99
59
|
accountAddress,
|
|
@@ -158,20 +118,18 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
158
118
|
// console.log('verified', verified);
|
|
159
119
|
// return verified;
|
|
160
120
|
// }
|
|
161
|
-
async signTransaction({ senderAddress,
|
|
121
|
+
async signTransaction({ senderAddress, transaction }) {
|
|
162
122
|
try {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
123
|
+
let messageToSign;
|
|
124
|
+
if (transaction instanceof web3_js.VersionedTransaction) {
|
|
125
|
+
// For versioned transactions, we need to sign the message directly
|
|
126
|
+
const messageBytes = transaction.message.serialize();
|
|
127
|
+
messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
128
|
+
} else {
|
|
129
|
+
// For legacy transactions, serialize the message
|
|
130
|
+
const messageBytes = transaction.serializeMessage();
|
|
131
|
+
messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
171
132
|
}
|
|
172
|
-
const rawMessageToSign = new Uint8Array(serializedTransaction);
|
|
173
|
-
//convert raw bites to hex to send to server
|
|
174
|
-
const messageToSign = Buffer.from(rawMessageToSign).toString('hex');
|
|
175
133
|
const signatureEd25519 = await this.sign({
|
|
176
134
|
message: messageToSign,
|
|
177
135
|
accountAddress: senderAddress,
|
|
@@ -180,26 +138,13 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
180
138
|
if (!signatureEd25519) {
|
|
181
139
|
throw new Error('Signature is undefined');
|
|
182
140
|
}
|
|
183
|
-
const signedTransaction =
|
|
141
|
+
const signedTransaction = addSignatureToTransaction({
|
|
184
142
|
transaction,
|
|
185
143
|
signature: signatureEd25519
|
|
186
144
|
});
|
|
187
|
-
|
|
188
|
-
throw new Error('Signed transaction is undefined');
|
|
189
|
-
}
|
|
190
|
-
const txid = await sendTransaction({
|
|
191
|
-
signedTransaction,
|
|
192
|
-
rpcUrl
|
|
193
|
-
});
|
|
194
|
-
if (!txid) {
|
|
195
|
-
throw new Error('Transaction hash is undefined');
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
txHash: txid,
|
|
199
|
-
signedTx: serializedTransaction
|
|
200
|
-
};
|
|
145
|
+
return signedTransaction;
|
|
201
146
|
} catch (error) {
|
|
202
|
-
this.logger.error('Error in
|
|
147
|
+
this.logger.error('Error in signTransaction:', error);
|
|
203
148
|
if (error instanceof Error) {
|
|
204
149
|
this.logger.error('Error details:', error);
|
|
205
150
|
}
|
|
@@ -289,7 +234,8 @@ class DynamicSvmWalletClient extends browser.DynamicWalletClient {
|
|
|
289
234
|
walletId: newWalletId,
|
|
290
235
|
chainName: this.chainName,
|
|
291
236
|
clientKeyShares,
|
|
292
|
-
thresholdSignatureScheme
|
|
237
|
+
thresholdSignatureScheme,
|
|
238
|
+
clientKeySharesBackupInfo: browser.getClientKeyShareBackupInfo()
|
|
293
239
|
};
|
|
294
240
|
await this.storeEncryptedBackupByWallet({
|
|
295
241
|
accountAddress
|
package/index.esm.js
CHANGED
|
@@ -1,66 +1,25 @@
|
|
|
1
|
-
import { DynamicWalletClient } from '@dynamic-labs-wallet/browser';
|
|
1
|
+
import { DynamicWalletClient, getClientKeyShareBackupInfo } from '@dynamic-labs-wallet/browser';
|
|
2
2
|
import bs58 from 'bs58';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { Transaction, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
4
|
+
import '@dynamic-labs-wallet/core';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const addSignatureToTransaction = ({ transaction, signature })=>{
|
|
7
7
|
try {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
async function createSolanaTransaction({ senderSolanaAddress, amount, to, rpcUrl = 'https://api.devnet.solana.com' }) {
|
|
17
|
-
try {
|
|
18
|
-
const connection = new Connection(rpcUrl != null ? rpcUrl : 'https://api.devnet.solana.com');
|
|
19
|
-
const balance = await getBalance({
|
|
20
|
-
address: senderSolanaAddress,
|
|
21
|
-
rpcUrl
|
|
22
|
-
});
|
|
23
|
-
if (balance < amount * 1e9) {
|
|
24
|
-
throw new Error('Insufficient balance');
|
|
8
|
+
if (transaction instanceof Transaction) {
|
|
9
|
+
transaction.addSignature(transaction.feePayer, Buffer.from(signature));
|
|
10
|
+
} else {
|
|
11
|
+
// For versioned transactions, we should add the signature to the fee payer
|
|
12
|
+
// which is always the first account in the static account keys
|
|
13
|
+
// TODO: see if this works for sponsored transactions
|
|
14
|
+
const feePayer = transaction.message.staticAccountKeys[0];
|
|
15
|
+
transaction.addSignature(feePayer, Buffer.from(signature));
|
|
25
16
|
}
|
|
26
|
-
|
|
27
|
-
const transaction = new Transaction().add(SystemProgram.transfer({
|
|
28
|
-
fromPubkey: fromPubkey,
|
|
29
|
-
toPubkey: new PublicKey(to),
|
|
30
|
-
lamports: amount * 1e9
|
|
31
|
-
}));
|
|
32
|
-
const { blockhash } = await connection.getLatestBlockhash();
|
|
33
|
-
transaction.recentBlockhash = blockhash;
|
|
34
|
-
transaction.feePayer = fromPubkey;
|
|
35
|
-
const serializedTransaction = transaction.serializeMessage();
|
|
36
|
-
return {
|
|
37
|
-
transaction,
|
|
38
|
-
serializedTransaction
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.error('Error in creating transaction:', error);
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function finalizeTransaction({ transaction, signature }) {
|
|
46
|
-
try {
|
|
47
|
-
transaction.addSignature(transaction.feePayer, Buffer.from(signature));
|
|
48
|
-
return new Uint8Array(transaction.serialize());
|
|
17
|
+
return transaction;
|
|
49
18
|
} catch (error) {
|
|
50
19
|
console.error('Error in finalizing transaction:', error);
|
|
51
20
|
throw error;
|
|
52
21
|
}
|
|
53
|
-
}
|
|
54
|
-
async function sendTransaction({ signedTransaction, rpcUrl = 'https://api.devnet.solana.com' }) {
|
|
55
|
-
try {
|
|
56
|
-
const connection = new Connection(rpcUrl != null ? rpcUrl : 'https://api.devnet.solana.com');
|
|
57
|
-
const txid = await connection.sendRawTransaction(Buffer.from(signedTransaction));
|
|
58
|
-
return txid;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.error('Error in sending transaction:', error);
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
22
|
+
};
|
|
64
23
|
|
|
65
24
|
class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
66
25
|
/**
|
|
@@ -91,7 +50,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
91
50
|
walletId: newWalletId,
|
|
92
51
|
chainName: this.chainName,
|
|
93
52
|
clientKeyShares: clientKeyShares,
|
|
94
|
-
thresholdSignatureScheme
|
|
53
|
+
thresholdSignatureScheme,
|
|
54
|
+
clientKeySharesBackupInfo: getClientKeyShareBackupInfo()
|
|
95
55
|
};
|
|
96
56
|
await this.storeEncryptedBackupByWallet({
|
|
97
57
|
accountAddress,
|
|
@@ -156,20 +116,18 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
156
116
|
// console.log('verified', verified);
|
|
157
117
|
// return verified;
|
|
158
118
|
// }
|
|
159
|
-
async signTransaction({ senderAddress,
|
|
119
|
+
async signTransaction({ senderAddress, transaction }) {
|
|
160
120
|
try {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
121
|
+
let messageToSign;
|
|
122
|
+
if (transaction instanceof VersionedTransaction) {
|
|
123
|
+
// For versioned transactions, we need to sign the message directly
|
|
124
|
+
const messageBytes = transaction.message.serialize();
|
|
125
|
+
messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
126
|
+
} else {
|
|
127
|
+
// For legacy transactions, serialize the message
|
|
128
|
+
const messageBytes = transaction.serializeMessage();
|
|
129
|
+
messageToSign = Buffer.from(messageBytes).toString('hex');
|
|
169
130
|
}
|
|
170
|
-
const rawMessageToSign = new Uint8Array(serializedTransaction);
|
|
171
|
-
//convert raw bites to hex to send to server
|
|
172
|
-
const messageToSign = Buffer.from(rawMessageToSign).toString('hex');
|
|
173
131
|
const signatureEd25519 = await this.sign({
|
|
174
132
|
message: messageToSign,
|
|
175
133
|
accountAddress: senderAddress,
|
|
@@ -178,26 +136,13 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
178
136
|
if (!signatureEd25519) {
|
|
179
137
|
throw new Error('Signature is undefined');
|
|
180
138
|
}
|
|
181
|
-
const signedTransaction =
|
|
139
|
+
const signedTransaction = addSignatureToTransaction({
|
|
182
140
|
transaction,
|
|
183
141
|
signature: signatureEd25519
|
|
184
142
|
});
|
|
185
|
-
|
|
186
|
-
throw new Error('Signed transaction is undefined');
|
|
187
|
-
}
|
|
188
|
-
const txid = await sendTransaction({
|
|
189
|
-
signedTransaction,
|
|
190
|
-
rpcUrl
|
|
191
|
-
});
|
|
192
|
-
if (!txid) {
|
|
193
|
-
throw new Error('Transaction hash is undefined');
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
txHash: txid,
|
|
197
|
-
signedTx: serializedTransaction
|
|
198
|
-
};
|
|
143
|
+
return signedTransaction;
|
|
199
144
|
} catch (error) {
|
|
200
|
-
this.logger.error('Error in
|
|
145
|
+
this.logger.error('Error in signTransaction:', error);
|
|
201
146
|
if (error instanceof Error) {
|
|
202
147
|
this.logger.error('Error details:', error);
|
|
203
148
|
}
|
|
@@ -287,7 +232,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
287
232
|
walletId: newWalletId,
|
|
288
233
|
chainName: this.chainName,
|
|
289
234
|
clientKeyShares,
|
|
290
|
-
thresholdSignatureScheme
|
|
235
|
+
thresholdSignatureScheme,
|
|
236
|
+
clientKeySharesBackupInfo: getClientKeyShareBackupInfo()
|
|
291
237
|
};
|
|
292
238
|
await this.storeEncryptedBackupByWallet({
|
|
293
239
|
accountAddress
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
5
|
+
"@dynamic-labs-wallet/browser": "0.0.33",
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.33",
|
|
7
7
|
"@solana/web3.js": "^1.98.0",
|
|
8
8
|
"bs58": "^6.0.0"
|
|
9
9
|
},
|
package/src/svm/svm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientKeyShare, DynamicWalletClient, Ed25519KeygenResult, ThresholdSignatureScheme } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
3
|
export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
3
4
|
readonly chainName = "SOL";
|
|
4
5
|
accountAddress?: string;
|
|
@@ -34,15 +35,10 @@ export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
34
35
|
message: string;
|
|
35
36
|
accountAddress?: string;
|
|
36
37
|
}): Promise<string>;
|
|
37
|
-
signTransaction({ senderAddress,
|
|
38
|
+
signTransaction({ senderAddress, transaction, }: {
|
|
38
39
|
senderAddress: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
rpcUrl: string;
|
|
42
|
-
}): Promise<{
|
|
43
|
-
txHash?: string;
|
|
44
|
-
signedTx: Uint8Array;
|
|
45
|
-
}>;
|
|
40
|
+
transaction: VersionedTransaction | Transaction;
|
|
41
|
+
}): Promise<VersionedTransaction | Transaction>;
|
|
46
42
|
/**
|
|
47
43
|
* Exports the private key for a given account address
|
|
48
44
|
*
|
package/src/svm/svm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../src/svm/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../src/svm/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EAEzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAW,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG7E,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAEZ,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B;IASD;;;;;OAKG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,GACzB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;KACpD,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,CAAC;QACzB,eAAe,EAAE,cAAc,EAAE,CAAC;KACnC,CAAC;IAoDI,oBAAoB,CAAC,YAAY,EAAE,UAAU;;;IAOnD;;;;;OAKG;IACG,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,GACf,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IA0CK,eAAe,CAAC,EACpB,aAAa,EACb,WAAW,GACZ,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,oBAAoB,GAAG,WAAW,CAAC;KACjD,GAAG,OAAO,CAAC,oBAAoB,GAAG,WAAW,CAAC;IAuC/C;;;;;OAKG;IACG,gBAAgB,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE;;;IAYrE;;;;;OAKG;IACG,uBAAuB,CAAC,EAC5B,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,mBAAmB,EAAE,CAAC;QACjC,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;;;IASD;;;;;OAKG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM;IAM5C,0BAA0B,CAAC,UAAU,EAAE,MAAM;IAQ7C,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM;IAI9C;;;;;;;OAOG;IACG,gBAAgB,CAAC,EACrB,UAAU,EACV,SAAS,EACT,wBAAwB,GACzB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,wBAAwB,EAAE,wBAAwB,CAAC;KACpD,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,SAAS,CAAC;QACrC,eAAe,EAAE,cAAc,EAAE,CAAC;KACnC,CAAC;IAmDI,aAAa;CAOpB"}
|
package/src/svm/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transaction } from '@solana/web3.js';
|
|
1
|
+
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
2
|
export declare function getBalance({ address, rpcUrl, }: {
|
|
3
3
|
address: string;
|
|
4
4
|
rpcUrl?: string;
|
|
@@ -12,10 +12,10 @@ export declare function createSolanaTransaction({ senderSolanaAddress, amount, t
|
|
|
12
12
|
transaction: Transaction;
|
|
13
13
|
serializedTransaction: Buffer;
|
|
14
14
|
}>;
|
|
15
|
-
export declare
|
|
16
|
-
transaction: Transaction;
|
|
15
|
+
export declare const addSignatureToTransaction: ({ transaction, signature, }: {
|
|
16
|
+
transaction: Transaction | VersionedTransaction;
|
|
17
17
|
signature: Uint8Array;
|
|
18
|
-
})
|
|
18
|
+
}) => VersionedTransaction | Transaction;
|
|
19
19
|
export declare function sendTransaction({ signedTransaction, rpcUrl, }: {
|
|
20
20
|
signedTransaction: Uint8Array;
|
|
21
21
|
rpcUrl?: string;
|
package/src/svm/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/svm/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,WAAW,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/svm/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,WAAW,EACX,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,wBAAsB,UAAU,CAAC,EAC/B,OAAO,EACP,MAAuB,GACxB,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,mBAWA;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,mBAAmB,EACnB,MAAM,EACN,EAAE,EACF,MAAwC,GACzC,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;;GA+BA;AAED,eAAO,MAAM,yBAAyB,gCAGnC;IACD,WAAW,EAAE,WAAW,GAAG,oBAAoB,CAAC;IAChD,SAAS,EAAE,UAAU,CAAC;CACvB,KAAG,oBAAoB,GAAG,WAmB1B,CAAC;AAEF,wBAAsB,eAAe,CAAC,EACpC,iBAAiB,EACjB,MAAwC,GACzC,EAAE;IACD,iBAAiB,EAAE,UAAU,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,mBAaA"}
|