Allow recipient account address to be off the curve
This commit is contained in:
parent
2b7d120887
commit
8f0a727373
@ -5,6 +5,7 @@ import assert from 'assert';
|
|||||||
|
|
||||||
import { GasPrice } from '@cosmjs/stargate';
|
import { GasPrice } from '@cosmjs/stargate';
|
||||||
import { Connection } from '@solana/web3.js';
|
import { Connection } from '@solana/web3.js';
|
||||||
|
import { DENOM as ALNT_DENOM } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { verifyUnusedSolanaPayment } from '@/utils/solanaVerify';
|
import { verifyUnusedSolanaPayment } from '@/utils/solanaVerify';
|
||||||
import { transferLNTTokens } from '@/services/laconicTransfer';
|
import { transferLNTTokens } from '@/services/laconicTransfer';
|
||||||
@ -153,6 +154,8 @@ export async function POST(request: NextRequest) {
|
|||||||
}, { status: 400 });
|
}, { status: 400 });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
status: 'error',
|
status: 'error',
|
||||||
message: 'Invalid JSON in request body'
|
message: 'Invalid JSON in request body'
|
||||||
@ -266,7 +269,7 @@ export async function POST(request: NextRequest) {
|
|||||||
const deployerLrn = process.env.DEPLOYER_LRN!;
|
const deployerLrn = process.env.DEPLOYER_LRN!;
|
||||||
|
|
||||||
// Create Registry client instance
|
// Create Registry client instance
|
||||||
const gasPrice = GasPrice.fromString(config.fee.gasPrice);
|
const gasPrice = GasPrice.fromString(config.fee.gasPrice + ALNT_DENOM);
|
||||||
console.log('Using manual gas price:', gasPrice);
|
console.log('Using manual gas price:', gasPrice);
|
||||||
|
|
||||||
const registry = getRegistry()
|
const registry = getRegistry()
|
||||||
|
@ -131,7 +131,7 @@ export default function StatusDisplay({
|
|||||||
{lrn && <InfoItem label="Laconic Resource Name (LRN)" value={lrn} />}
|
{lrn && <InfoItem label="Laconic Resource Name (LRN)" value={lrn} />}
|
||||||
{dns && (
|
{dns && (
|
||||||
domainSuffix
|
domainSuffix
|
||||||
? <InfoItem label="Deployment URL (ready in 2-3 minutes)" value={`https://${dns}${domainSuffix}`} />
|
? <InfoItem label="Deployment URL (ready in 2-3 minutes)" value={`https://${dns}.${domainSuffix}`} />
|
||||||
: <InfoItem label="Please set domain suffix" value="" />
|
: <InfoItem label="Please set domain suffix" value="" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,7 +41,7 @@ export const transferLNTTokens = async (): Promise<LaconicTransferResult> => {
|
|||||||
|
|
||||||
// Find the paymentAddress attribute
|
// Find the paymentAddress attribute
|
||||||
const paymentAddress = deployerRecord.attributes.paymentAddress
|
const paymentAddress = deployerRecord.attributes.paymentAddress
|
||||||
const deployerMinPayment = deployerRecord.attributes.minimumPayment
|
const deployerMinPayment = (deployerRecord.attributes.minimumPayment as string).split(ALNT_DENOM)[0]
|
||||||
|
|
||||||
console.log('Found payment address:', paymentAddress);
|
console.log('Found payment address:', paymentAddress);
|
||||||
console.log('Found minimum payment:', deployerMinPayment);
|
console.log('Found minimum payment:', deployerMinPayment);
|
||||||
|
@ -89,7 +89,9 @@ export const verifyUnusedSolanaPayment = async (
|
|||||||
|
|
||||||
const expectedTokenAccount = getAssociatedTokenAddressSync(
|
const expectedTokenAccount = getAssociatedTokenAddressSync(
|
||||||
new PublicKey(process.env.NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS!),
|
new PublicKey(process.env.NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS!),
|
||||||
new PublicKey(process.env.NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS!)
|
new PublicKey(process.env.NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS!),
|
||||||
|
// Allow recipient account address to be off the curve (i.e now having a private key)
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Verify recipient address by checking the transaction instructions
|
// Verify recipient address by checking the transaction instructions
|
||||||
|
Loading…
Reference in New Issue
Block a user