Skip to content

Commit fd6e2ce

Browse files
nooxxloicttn
authored andcommitted
fix solana signature
1 parent a45e1de commit fd6e2ce

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

examples/sol.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const apiSecret = fs.readFileSync(__dirname + '/fireblocks_secret.key', 'utf8');
66
const f = async () => {
77
const k = new Kiln({
88
testnet: true,
9-
apiToken: 'kiln_V1JKOW55SkZMOFZvMzBJYmw0aGQ3bkM3UFpIM2IzeXA6Zi0zcUU3SHNIZTB6WDg2dkVUbUpWbmhLRFFyYmljdm1aQzFqOGcwOWFtY3U0Yk9fZHh6SkVweDJRcUxOVERWMA',
9+
apiToken: 'kiln_dTkxUTFRdHBMZm9vNFFycFhDSTZCdlJsbjJZang5VnY6ZjF1SUw4d3R1ZDRxYUdreEwtV2sxcjdmbVFJYlhuMWFGUVduRjBkVFJscFdCaUc5bkV2WmpyTU9xb19pSjlsWg',
1010
integrations: [
1111
{
1212
name: 'vault1',
@@ -19,9 +19,10 @@ const f = async () => {
1919
});
2020

2121
try {
22-
const tx = await k.sol.craftDeactivateStakeTx(
23-
'AhymNaMJBxLCWRgrNb7Er4bUQoGWpYV2EG4qrGwqzemY',
22+
const tx = await k.sol.craftStakeTx(
23+
'771254de-ac5a-4911-afdf-1d5b7e802dc9',
2424
'4icse2mPXNgyxxn11tVM7sTnSqDqwJSEzdnaCQnRzvA9',
25+
0.1
2526
);
2627
const signedTx = await k.sol.sign('vault1', tx);
2728
const hash = await k.sol.broadcast(signedTx);

src/services/sol.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,15 @@ export class SolService extends Service {
368368

369369
let transactionBuffer = transaction.serializeMessage();
370370
const message = transactionBuffer.toString('hex');
371-
const payload = [
372-
{
373-
"content": message,
374-
},
375-
];
371+
const payload = {
372+
rawMessageData: {
373+
messages: [
374+
{
375+
"content": message,
376+
},
377+
]
378+
}
379+
};
376380

377381
const signatures = await this.fbSigner.signWithFB(payload, this.testnet ? 'SOL_TEST' : 'SOL', note);
378382
signatures.signedMessages?.forEach((signedMessage: any) => {

0 commit comments

Comments
 (0)