@chipi-stack/backend 14.6.0 → 14.7.0
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/dist/index.d.mts +47 -2
- package/dist/index.d.ts +47 -2
- package/dist/index.js +67 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -19
- package/dist/index.mjs.map +1 -1
- package/dist/skuPurchases.js +15 -8
- package/dist/skuPurchases.js.map +1 -1
- package/dist/skuPurchases.mjs +15 -8
- package/dist/skuPurchases.mjs.map +1 -1
- package/dist/transactions.js +15 -8
- package/dist/transactions.js.map +1 -1
- package/dist/transactions.mjs +15 -8
- package/dist/transactions.mjs.map +1 -1
- package/dist/wallets.js +41 -15
- package/dist/wallets.js.map +1 -1
- package/dist/wallets.mjs +41 -15
- package/dist/wallets.mjs.map +1 -1
- package/package.json +5 -5
package/dist/skuPurchases.js
CHANGED
|
@@ -246,21 +246,28 @@ async function buildEd25519Envelope(params) {
|
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
248
|
const ed = await import('@noble/ed25519');
|
|
249
|
-
const garaga = await ensureGaragaInit();
|
|
250
249
|
const publicKey = await ed.getPublicKeyAsync(params.privateKey);
|
|
251
250
|
const signedBytes = ed25519SignedBytes(params.messageHash);
|
|
252
251
|
const signature = await ed.signAsync(signedBytes, params.privateKey);
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
bytesToLeBigInt(s),
|
|
258
|
-
bytesToLeBigInt(publicKey),
|
|
252
|
+
return assembleEd25519Envelope({
|
|
253
|
+
R: signature.slice(0, 32),
|
|
254
|
+
s: signature.slice(32, 64),
|
|
255
|
+
publicKey,
|
|
259
256
|
signedBytes,
|
|
257
|
+
ownerIndex
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
async function assembleEd25519Envelope(parts) {
|
|
261
|
+
const garaga = await ensureGaragaInit();
|
|
262
|
+
const payload = garaga.eddsaCalldataBuilder(
|
|
263
|
+
bytesToLeBigInt(parts.R),
|
|
264
|
+
bytesToLeBigInt(parts.s),
|
|
265
|
+
bytesToLeBigInt(parts.publicKey),
|
|
266
|
+
parts.signedBytes,
|
|
260
267
|
false
|
|
261
268
|
);
|
|
262
269
|
return wrapV2Snip12Envelope({
|
|
263
|
-
ownerId: ownerIndex,
|
|
270
|
+
ownerId: parts.ownerIndex,
|
|
264
271
|
kindTag: ED25519_KIND_TAG,
|
|
265
272
|
payload
|
|
266
273
|
});
|