mirror of
https://github.com/alexgo-io/stacks-transaction-sponsor.git
synced 2026-01-12 06:43:50 +08:00
@@ -1,2 +1,2 @@
|
||||
nodejs 20.12.2
|
||||
yarn 1.22.19
|
||||
pnpm 9.0.4
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
"memoizee": "^0.4.15",
|
||||
"ramda": "^0.29.1",
|
||||
"safe-json-stringify": "^1.2.0",
|
||||
"slonik": "^40.2.5",
|
||||
"slonik": "^41.0.0",
|
||||
"ts-clarity": "^0.0.20",
|
||||
"yargs-parser": "^21.1.1",
|
||||
"zod": "^3.22.4"
|
||||
"zod": "^3.22.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@swc/core": "^1.4.14",
|
||||
"@swc/core": "^1.4.16",
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/memoizee": "^0.4.11",
|
||||
|
||||
4231
pnpm-lock.yaml
generated
Normal file
4231
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import { TransactionVersion } from '@stacks/common';
|
||||
import { hashSha256Sync } from '@stacks/encryption';
|
||||
import { getAddressFromPrivateKey } from '@stacks/transactions';
|
||||
import assert from 'assert';
|
||||
import assert from 'node:assert';
|
||||
import {
|
||||
kSponsorAccountCount,
|
||||
kSponsorAddress,
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
generateWallet,
|
||||
getStxAddress,
|
||||
} from '@stacks/wallet-sdk';
|
||||
import got from 'got-cjs';
|
||||
import { getRequiredEnv, kStacksEndpoint } from '../config';
|
||||
import { stringify } from '../util';
|
||||
|
||||
@@ -51,17 +50,19 @@ async function main() {
|
||||
tx_bytes.byteLength,
|
||||
);
|
||||
|
||||
const rs = await got
|
||||
.post('https://sponsor-tx.alexgo.dev/v1/graphql', {
|
||||
json: {
|
||||
query: `mutation MyMutation {
|
||||
const rs = await fetch('https://sponsor-tx.alexgo.dev/v1/graphql', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
query: `mutation MyMutation {
|
||||
execute(tx: "${tx_buffer.toString('hex')}")
|
||||
}`,
|
||||
variables: null,
|
||||
operationName: 'MyMutation',
|
||||
},
|
||||
})
|
||||
.json();
|
||||
variables: null,
|
||||
operationName: 'MyMutation',
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
}).then(rs => rs.json());
|
||||
console.log(stringify(rs));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import assert from 'assert';
|
||||
import assert from 'node:assert';
|
||||
|
||||
export function getOptionalEnv(envKey: string) {
|
||||
return process.env[envKey];
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
createNumericTypeParser,
|
||||
createPool,
|
||||
createSqlTag,
|
||||
DatabasePool,
|
||||
PrimitiveValueExpression,
|
||||
type DatabasePool,
|
||||
type PrimitiveValueExpression,
|
||||
} from 'slonik';
|
||||
import { fromUint8Array } from 'ts-clarity';
|
||||
import z from 'zod';
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
cvToString,
|
||||
deserializeTransaction,
|
||||
} from '@stacks/transactions';
|
||||
import assert from 'assert';
|
||||
import { RequestHandler } from 'express';
|
||||
import type { RequestHandler } from 'express';
|
||||
import assert from 'node:assert';
|
||||
import { getAccountNonces } from 'ts-clarity';
|
||||
import {
|
||||
kMaxTransactionsPerBlock,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
PayloadType,
|
||||
StacksMessageType,
|
||||
StacksTransaction,
|
||||
addressToString,
|
||||
type StacksTransaction,
|
||||
} from '@stacks/transactions';
|
||||
import { getPgPool, sql } from './db';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TypeParser } from 'slonik';
|
||||
import type { TypeParser } from 'slonik';
|
||||
import { hexToBuffer } from './utils';
|
||||
|
||||
const byteaParser = (value: string) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TypeParser } from 'slonik';
|
||||
import type { TypeParser } from 'slonik';
|
||||
|
||||
const numericParser = (value: string) => {
|
||||
return BigInt(value.replace(/\.[0]*$/, ''));
|
||||
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
estimateTransactionFeeWithFallback,
|
||||
sponsorTransaction,
|
||||
} from '@stacks/transactions';
|
||||
import assert from 'assert';
|
||||
import assert from 'node:assert';
|
||||
import { getAccountNonces } from 'ts-clarity';
|
||||
import { SponsorAccount } from './accounts';
|
||||
import type { SponsorAccount } from './accounts';
|
||||
import {
|
||||
kFeeIncrement,
|
||||
kStacksBroadcastEndpoints,
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
estimateTransactionFeeWithFallback,
|
||||
sponsorTransaction,
|
||||
} from '@stacks/transactions';
|
||||
import assert from 'assert';
|
||||
import assert from 'node:assert';
|
||||
import { getAccountNonces } from 'ts-clarity';
|
||||
import { SponsorAccount } from './accounts';
|
||||
import type { SponsorAccount } from './accounts';
|
||||
import {
|
||||
kBaseFee,
|
||||
kMaxTransactionsPerBlock,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { StacksMainnet, StacksMocknet } from '@stacks/network';
|
||||
import type { StacksMainnet, StacksMocknet } from '@stacks/network';
|
||||
import { getAccountNonces, getTransaction } from 'ts-clarity';
|
||||
import { SponsorAccount } from './accounts';
|
||||
import type { SponsorAccount } from './accounts';
|
||||
import { SponsorRecord, getPgPool, sql } from './db';
|
||||
import { stringify } from './util';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user