You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import*assdkfrom'@spare-technologies/spare-typescript-sdk'constPrivateKey='Your ecc private key';constServerPublicKey='Spare ecc public key'constclient=sdk.SpPaymentClient({
appid
})// Configure clientconstclient=newsdk.SpPaymentClient({apiKey: "Your api key",appId: "Your app id",baseUrl: "https://payment.tryspare.com"});// Initialize paymentconstpayment=newsdk.SpDomesticPayment(10,'Payment from Spare sdk');// Sign the paymentconstsignature=sdk.EccSignatureManager.sign(PrivateKey,payment)// Create paymentconstcreatedPayment=awaitclient.CreateDomesticPayment(payment,signature)// To verify signature of the created paymentif(sdk.EccSignatureManager.verify(ServerPublicKey,createdPayment.payment,createdPayment.signature)){// Signature verified}