@develit-services/blockchain 0.6.1 → 0.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/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/worker.cjs +92 -1
- package/dist/export/worker.d.cts +6 -4
- package/dist/export/worker.d.mts +6 -4
- package/dist/export/worker.d.ts +6 -4
- package/dist/export/worker.mjs +93 -2
- package/dist/export/wrangler.cjs +0 -4
- package/dist/export/wrangler.d.cts +1 -4
- package/dist/export/wrangler.d.mts +1 -4
- package/dist/export/wrangler.d.ts +1 -4
- package/dist/export/wrangler.mjs +0 -4
- package/dist/shared/blockchain.AQv3PaVU.cjs +35 -0
- package/dist/shared/blockchain.CNVF0KXj.mjs +30 -0
- package/dist/shared/{blockchain.4u7GTzW9.d.cts → blockchain.DQEKAvxx.d.cts} +1 -4
- package/dist/shared/{blockchain.4u7GTzW9.d.mts → blockchain.DQEKAvxx.d.mts} +1 -4
- package/dist/shared/{blockchain.4u7GTzW9.d.ts → blockchain.DQEKAvxx.d.ts} +1 -4
- package/dist/shared/blockchain.DskfTOau.d.cts +38 -0
- package/dist/shared/blockchain.DskfTOau.d.mts +38 -0
- package/dist/shared/blockchain.DskfTOau.d.ts +38 -0
- package/dist/shared/blockchain.f4eN2PFQ.d.cts +97 -0
- package/dist/shared/blockchain.f4eN2PFQ.d.mts +97 -0
- package/dist/shared/blockchain.f4eN2PFQ.d.ts +97 -0
- package/dist/types.cjs +3 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
- package/dist/shared/blockchain.55Jm5hWs.mjs +0 -11
- package/dist/shared/blockchain.BalTLss2.d.cts +0 -12
- package/dist/shared/blockchain.BalTLss2.d.mts +0 -12
- package/dist/shared/blockchain.BalTLss2.d.ts +0 -12
- package/dist/shared/blockchain.ByChhKtd.d.cts +0 -217
- package/dist/shared/blockchain.ByChhKtd.d.mts +0 -217
- package/dist/shared/blockchain.ByChhKtd.d.ts +0 -217
- package/dist/shared/blockchain.D63utaAU.cjs +0 -14
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as address } from '../shared/blockchain.
|
|
1
|
+
export { a as address } from '../shared/blockchain.f4eN2PFQ.cjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as address } from '../shared/blockchain.
|
|
1
|
+
export { a as address } from '../shared/blockchain.f4eN2PFQ.mjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as address } from '../shared/blockchain.
|
|
1
|
+
export { a as address } from '../shared/blockchain.f4eN2PFQ.js';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -3,14 +3,89 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
|
+
const viem = require('viem');
|
|
6
7
|
const database_schema = require('../shared/blockchain.JxC5JMLI.cjs');
|
|
7
8
|
require('drizzle-orm');
|
|
8
|
-
const syncAddress = require('../shared/blockchain.
|
|
9
|
+
const syncAddress = require('../shared/blockchain.AQv3PaVU.cjs');
|
|
9
10
|
const cloudflare_workers = require('cloudflare:workers');
|
|
10
11
|
const d1 = require('drizzle-orm/d1');
|
|
11
12
|
require('drizzle-orm/sqlite-core');
|
|
12
13
|
require('zod');
|
|
13
14
|
|
|
15
|
+
class IBlockchainConnector {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class AlchemyConnector extends IBlockchainConnector {
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super();
|
|
21
|
+
this.connectorKey = "ALCHEMY";
|
|
22
|
+
this.client = null;
|
|
23
|
+
this.rpcUrl = config.rpcUrl;
|
|
24
|
+
}
|
|
25
|
+
createClient() {
|
|
26
|
+
if (!this.client) {
|
|
27
|
+
this.client = viem.createPublicClient({
|
|
28
|
+
transport: viem.http(this.rpcUrl)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return this.client;
|
|
32
|
+
}
|
|
33
|
+
async getTransaction(txHash) {
|
|
34
|
+
const client = this.createClient();
|
|
35
|
+
const [tx, txError] = await backendSdk.useResult(
|
|
36
|
+
client.getTransaction({ hash: txHash })
|
|
37
|
+
);
|
|
38
|
+
if (txError || !tx) {
|
|
39
|
+
throw backendSdk.createInternalError(txError);
|
|
40
|
+
}
|
|
41
|
+
let status = "pending";
|
|
42
|
+
let gasUsed = null;
|
|
43
|
+
let timestamp = null;
|
|
44
|
+
if (tx.blockNumber) {
|
|
45
|
+
const [receipt, receiptError] = await backendSdk.useResult(
|
|
46
|
+
client.getTransactionReceipt({ hash: txHash })
|
|
47
|
+
);
|
|
48
|
+
if (receiptError || !receipt) {
|
|
49
|
+
throw backendSdk.createInternalError(receiptError);
|
|
50
|
+
}
|
|
51
|
+
const [block, blockError] = await backendSdk.useResult(
|
|
52
|
+
client.getBlock({ blockNumber: tx.blockNumber })
|
|
53
|
+
);
|
|
54
|
+
if (blockError || !block) {
|
|
55
|
+
throw backendSdk.createInternalError(blockError);
|
|
56
|
+
}
|
|
57
|
+
status = receipt.status === "success" ? "success" : "reverted";
|
|
58
|
+
gasUsed = receipt.gasUsed.toString();
|
|
59
|
+
timestamp = Number(block.timestamp) * 1e3;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
hash: tx.hash,
|
|
63
|
+
from: tx.from,
|
|
64
|
+
to: tx.to,
|
|
65
|
+
value: tx.value.toString(),
|
|
66
|
+
blockNumber: tx.blockNumber?.toString() ?? null,
|
|
67
|
+
blockHash: tx.blockHash ?? null,
|
|
68
|
+
gasPrice: tx.gasPrice?.toString() ?? null,
|
|
69
|
+
gas: tx.gas.toString(),
|
|
70
|
+
nonce: tx.nonce,
|
|
71
|
+
transactionIndex: tx.transactionIndex,
|
|
72
|
+
status,
|
|
73
|
+
gasUsed,
|
|
74
|
+
timestamp
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async getTransactionReceipt(txHash) {
|
|
78
|
+
const client = this.createClient();
|
|
79
|
+
const [receipt, error] = await backendSdk.useResult(
|
|
80
|
+
client.getTransactionReceipt({ hash: txHash })
|
|
81
|
+
);
|
|
82
|
+
if (error || !receipt) {
|
|
83
|
+
throw backendSdk.createInternalError(error);
|
|
84
|
+
}
|
|
85
|
+
return receipt;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
14
89
|
const tables = database_schema.schema;
|
|
15
90
|
|
|
16
91
|
var __defProp = Object.defineProperty;
|
|
@@ -45,10 +120,26 @@ let BlockchainServiceBase = class extends backendSdk.develitWorker(
|
|
|
45
120
|
}
|
|
46
121
|
);
|
|
47
122
|
}
|
|
123
|
+
async getTransaction(input) {
|
|
124
|
+
return this.handleAction(
|
|
125
|
+
{ data: input, schema: syncAddress.getTransactionInputSchema },
|
|
126
|
+
{ successMessage: "Transaction retrieved successfully." },
|
|
127
|
+
async ({ txHash }) => {
|
|
128
|
+
const rpcUrl = (await this.env.SECRETS_STORE.get({
|
|
129
|
+
secretName: "BLOCKCHAIN_SERVICE_RPC_URL"
|
|
130
|
+
})).data?.secretValue || "";
|
|
131
|
+
const connector = new AlchemyConnector({ rpcUrl });
|
|
132
|
+
return connector.getTransaction(txHash);
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
48
136
|
};
|
|
49
137
|
__decorateClass([
|
|
50
138
|
backendSdk.action("sync-address")
|
|
51
139
|
], BlockchainServiceBase.prototype, "syncAddress", 1);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
backendSdk.action("get-transaction")
|
|
142
|
+
], BlockchainServiceBase.prototype, "getTransaction", 1);
|
|
52
143
|
BlockchainServiceBase = __decorateClass([
|
|
53
144
|
backendSdk.service("blockchain")
|
|
54
145
|
], BlockchainServiceBase);
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
1
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
2
|
-
import { s as schema } from '../shared/blockchain.
|
|
3
|
-
import { S as SyncAddressInput, b as SyncAddressOutput } from '../shared/blockchain.
|
|
4
|
-
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
3
|
+
import { s as schema } from '../shared/blockchain.f4eN2PFQ.cjs';
|
|
4
|
+
import { S as SyncAddressInput, b as SyncAddressOutput, G as GetTransactionInput, a as GetTransactionOutput } from '../shared/blockchain.DskfTOau.cjs';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
|
+
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
7
|
import 'drizzle-orm/sqlite-core';
|
|
7
8
|
import 'zod';
|
|
8
9
|
|
|
9
10
|
declare const tables: typeof schema;
|
|
10
11
|
|
|
11
|
-
declare const BlockchainServiceBase_base: any;
|
|
12
|
+
declare const BlockchainServiceBase_base: (abstract new (ctx: ExecutionContext, env: BlockchainEnv) => WorkerEntrypoint<BlockchainEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
12
13
|
declare class BlockchainServiceBase extends BlockchainServiceBase_base {
|
|
13
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
14
15
|
constructor(ctx: ExecutionContext, env: BlockchainEnv);
|
|
15
16
|
syncAddress(input: SyncAddressInput): Promise<IRPCResponse<SyncAddressOutput>>;
|
|
17
|
+
getTransaction(input: GetTransactionInput): Promise<IRPCResponse<GetTransactionOutput>>;
|
|
16
18
|
}
|
|
17
19
|
declare function defineBlockchainService(): new (ctx: ExecutionContext, env: BlockchainEnv) => BlockchainServiceBase;
|
|
18
20
|
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
1
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
2
|
-
import { s as schema } from '../shared/blockchain.
|
|
3
|
-
import { S as SyncAddressInput, b as SyncAddressOutput } from '../shared/blockchain.
|
|
4
|
-
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
3
|
+
import { s as schema } from '../shared/blockchain.f4eN2PFQ.mjs';
|
|
4
|
+
import { S as SyncAddressInput, b as SyncAddressOutput, G as GetTransactionInput, a as GetTransactionOutput } from '../shared/blockchain.DskfTOau.mjs';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
|
+
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
7
|
import 'drizzle-orm/sqlite-core';
|
|
7
8
|
import 'zod';
|
|
8
9
|
|
|
9
10
|
declare const tables: typeof schema;
|
|
10
11
|
|
|
11
|
-
declare const BlockchainServiceBase_base: any;
|
|
12
|
+
declare const BlockchainServiceBase_base: (abstract new (ctx: ExecutionContext, env: BlockchainEnv) => WorkerEntrypoint<BlockchainEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
12
13
|
declare class BlockchainServiceBase extends BlockchainServiceBase_base {
|
|
13
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
14
15
|
constructor(ctx: ExecutionContext, env: BlockchainEnv);
|
|
15
16
|
syncAddress(input: SyncAddressInput): Promise<IRPCResponse<SyncAddressOutput>>;
|
|
17
|
+
getTransaction(input: GetTransactionInput): Promise<IRPCResponse<GetTransactionOutput>>;
|
|
16
18
|
}
|
|
17
19
|
declare function defineBlockchainService(): new (ctx: ExecutionContext, env: BlockchainEnv) => BlockchainServiceBase;
|
|
18
20
|
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
1
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
2
|
-
import { s as schema } from '../shared/blockchain.
|
|
3
|
-
import { S as SyncAddressInput, b as SyncAddressOutput } from '../shared/blockchain.
|
|
4
|
-
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
3
|
+
import { s as schema } from '../shared/blockchain.f4eN2PFQ.js';
|
|
4
|
+
import { S as SyncAddressInput, b as SyncAddressOutput, G as GetTransactionInput, a as GetTransactionOutput } from '../shared/blockchain.DskfTOau.js';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
|
+
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
7
|
import 'drizzle-orm/sqlite-core';
|
|
7
8
|
import 'zod';
|
|
8
9
|
|
|
9
10
|
declare const tables: typeof schema;
|
|
10
11
|
|
|
11
|
-
declare const BlockchainServiceBase_base: any;
|
|
12
|
+
declare const BlockchainServiceBase_base: (abstract new (ctx: ExecutionContext, env: BlockchainEnv) => WorkerEntrypoint<BlockchainEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
12
13
|
declare class BlockchainServiceBase extends BlockchainServiceBase_base {
|
|
13
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
14
15
|
constructor(ctx: ExecutionContext, env: BlockchainEnv);
|
|
15
16
|
syncAddress(input: SyncAddressInput): Promise<IRPCResponse<SyncAddressOutput>>;
|
|
17
|
+
getTransaction(input: GetTransactionInput): Promise<IRPCResponse<GetTransactionOutput>>;
|
|
16
18
|
}
|
|
17
19
|
declare function defineBlockchainService(): new (ctx: ExecutionContext, env: BlockchainEnv) => BlockchainServiceBase;
|
|
18
20
|
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,12 +1,87 @@
|
|
|
1
|
-
import { develitWorker, action, service } from '@develit-io/backend-sdk';
|
|
1
|
+
import { useResult, createInternalError, develitWorker, action, service } from '@develit-io/backend-sdk';
|
|
2
|
+
import { createPublicClient, http } from 'viem';
|
|
2
3
|
import { s as schema } from '../shared/blockchain.DmhmTTL_.mjs';
|
|
3
4
|
import 'drizzle-orm';
|
|
4
|
-
import { s as syncAddressInputSchema } from '../shared/blockchain.
|
|
5
|
+
import { s as syncAddressInputSchema, g as getTransactionInputSchema } from '../shared/blockchain.CNVF0KXj.mjs';
|
|
5
6
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
7
|
import { drizzle } from 'drizzle-orm/d1';
|
|
7
8
|
import 'drizzle-orm/sqlite-core';
|
|
8
9
|
import 'zod';
|
|
9
10
|
|
|
11
|
+
class IBlockchainConnector {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class AlchemyConnector extends IBlockchainConnector {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super();
|
|
17
|
+
this.connectorKey = "ALCHEMY";
|
|
18
|
+
this.client = null;
|
|
19
|
+
this.rpcUrl = config.rpcUrl;
|
|
20
|
+
}
|
|
21
|
+
createClient() {
|
|
22
|
+
if (!this.client) {
|
|
23
|
+
this.client = createPublicClient({
|
|
24
|
+
transport: http(this.rpcUrl)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return this.client;
|
|
28
|
+
}
|
|
29
|
+
async getTransaction(txHash) {
|
|
30
|
+
const client = this.createClient();
|
|
31
|
+
const [tx, txError] = await useResult(
|
|
32
|
+
client.getTransaction({ hash: txHash })
|
|
33
|
+
);
|
|
34
|
+
if (txError || !tx) {
|
|
35
|
+
throw createInternalError(txError);
|
|
36
|
+
}
|
|
37
|
+
let status = "pending";
|
|
38
|
+
let gasUsed = null;
|
|
39
|
+
let timestamp = null;
|
|
40
|
+
if (tx.blockNumber) {
|
|
41
|
+
const [receipt, receiptError] = await useResult(
|
|
42
|
+
client.getTransactionReceipt({ hash: txHash })
|
|
43
|
+
);
|
|
44
|
+
if (receiptError || !receipt) {
|
|
45
|
+
throw createInternalError(receiptError);
|
|
46
|
+
}
|
|
47
|
+
const [block, blockError] = await useResult(
|
|
48
|
+
client.getBlock({ blockNumber: tx.blockNumber })
|
|
49
|
+
);
|
|
50
|
+
if (blockError || !block) {
|
|
51
|
+
throw createInternalError(blockError);
|
|
52
|
+
}
|
|
53
|
+
status = receipt.status === "success" ? "success" : "reverted";
|
|
54
|
+
gasUsed = receipt.gasUsed.toString();
|
|
55
|
+
timestamp = Number(block.timestamp) * 1e3;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
hash: tx.hash,
|
|
59
|
+
from: tx.from,
|
|
60
|
+
to: tx.to,
|
|
61
|
+
value: tx.value.toString(),
|
|
62
|
+
blockNumber: tx.blockNumber?.toString() ?? null,
|
|
63
|
+
blockHash: tx.blockHash ?? null,
|
|
64
|
+
gasPrice: tx.gasPrice?.toString() ?? null,
|
|
65
|
+
gas: tx.gas.toString(),
|
|
66
|
+
nonce: tx.nonce,
|
|
67
|
+
transactionIndex: tx.transactionIndex,
|
|
68
|
+
status,
|
|
69
|
+
gasUsed,
|
|
70
|
+
timestamp
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async getTransactionReceipt(txHash) {
|
|
74
|
+
const client = this.createClient();
|
|
75
|
+
const [receipt, error] = await useResult(
|
|
76
|
+
client.getTransactionReceipt({ hash: txHash })
|
|
77
|
+
);
|
|
78
|
+
if (error || !receipt) {
|
|
79
|
+
throw createInternalError(error);
|
|
80
|
+
}
|
|
81
|
+
return receipt;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
10
85
|
const tables = schema;
|
|
11
86
|
|
|
12
87
|
var __defProp = Object.defineProperty;
|
|
@@ -41,10 +116,26 @@ let BlockchainServiceBase = class extends develitWorker(
|
|
|
41
116
|
}
|
|
42
117
|
);
|
|
43
118
|
}
|
|
119
|
+
async getTransaction(input) {
|
|
120
|
+
return this.handleAction(
|
|
121
|
+
{ data: input, schema: getTransactionInputSchema },
|
|
122
|
+
{ successMessage: "Transaction retrieved successfully." },
|
|
123
|
+
async ({ txHash }) => {
|
|
124
|
+
const rpcUrl = (await this.env.SECRETS_STORE.get({
|
|
125
|
+
secretName: "BLOCKCHAIN_SERVICE_RPC_URL"
|
|
126
|
+
})).data?.secretValue || "";
|
|
127
|
+
const connector = new AlchemyConnector({ rpcUrl });
|
|
128
|
+
return connector.getTransaction(txHash);
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
44
132
|
};
|
|
45
133
|
__decorateClass([
|
|
46
134
|
action("sync-address")
|
|
47
135
|
], BlockchainServiceBase.prototype, "syncAddress", 1);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
action("get-transaction")
|
|
138
|
+
], BlockchainServiceBase.prototype, "getTransaction", 1);
|
|
48
139
|
BlockchainServiceBase = __decorateClass([
|
|
49
140
|
service("blockchain")
|
|
50
141
|
], BlockchainServiceBase);
|
package/dist/export/wrangler.cjs
CHANGED
|
@@ -9,9 +9,6 @@ function defineBlockchainServiceWrangler(config) {
|
|
|
9
9
|
project,
|
|
10
10
|
name
|
|
11
11
|
}),
|
|
12
|
-
vars: {
|
|
13
|
-
RPC_URL: ""
|
|
14
|
-
},
|
|
15
12
|
services: [
|
|
16
13
|
{
|
|
17
14
|
binding: "SECRETS_STORE",
|
|
@@ -40,7 +37,6 @@ function defineBlockchainServiceWrangler(config) {
|
|
|
40
37
|
)) {
|
|
41
38
|
base.env[envName] = {
|
|
42
39
|
vars: {
|
|
43
|
-
...envCfg.vars,
|
|
44
40
|
ENVIRONMENT: envName
|
|
45
41
|
},
|
|
46
42
|
d1_databases: [
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as BlockchainServiceWranglerConfig } from '../shared/blockchain.DQEKAvxx.cjs';
|
|
2
2
|
|
|
3
3
|
declare function defineBlockchainServiceWrangler(config: BlockchainServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
RPC_URL: string;
|
|
6
|
-
};
|
|
7
4
|
services: {
|
|
8
5
|
binding: string;
|
|
9
6
|
service: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as BlockchainServiceWranglerConfig } from '../shared/blockchain.DQEKAvxx.mjs';
|
|
2
2
|
|
|
3
3
|
declare function defineBlockchainServiceWrangler(config: BlockchainServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
RPC_URL: string;
|
|
6
|
-
};
|
|
7
4
|
services: {
|
|
8
5
|
binding: string;
|
|
9
6
|
service: string;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as BlockchainServiceWranglerConfig } from '../shared/blockchain.DQEKAvxx.js';
|
|
2
2
|
|
|
3
3
|
declare function defineBlockchainServiceWrangler(config: BlockchainServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
RPC_URL: string;
|
|
6
|
-
};
|
|
7
4
|
services: {
|
|
8
5
|
binding: string;
|
|
9
6
|
service: string;
|
package/dist/export/wrangler.mjs
CHANGED
|
@@ -7,9 +7,6 @@ function defineBlockchainServiceWrangler(config) {
|
|
|
7
7
|
project,
|
|
8
8
|
name
|
|
9
9
|
}),
|
|
10
|
-
vars: {
|
|
11
|
-
RPC_URL: ""
|
|
12
|
-
},
|
|
13
10
|
services: [
|
|
14
11
|
{
|
|
15
12
|
binding: "SECRETS_STORE",
|
|
@@ -38,7 +35,6 @@ function defineBlockchainServiceWrangler(config) {
|
|
|
38
35
|
)) {
|
|
39
36
|
base.env[envName] = {
|
|
40
37
|
vars: {
|
|
41
|
-
...envCfg.vars,
|
|
42
38
|
ENVIRONMENT: envName
|
|
43
39
|
},
|
|
44
40
|
d1_databases: [
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const zod = require('zod');
|
|
4
|
+
|
|
5
|
+
const getTransactionInputSchema = zod.z.object({
|
|
6
|
+
txHash: zod.z.string()
|
|
7
|
+
});
|
|
8
|
+
const getTransactionOutputSchema = zod.z.object({
|
|
9
|
+
hash: zod.z.string(),
|
|
10
|
+
from: zod.z.string(),
|
|
11
|
+
to: zod.z.string().nullable(),
|
|
12
|
+
value: zod.z.string(),
|
|
13
|
+
blockNumber: zod.z.string().nullable(),
|
|
14
|
+
blockHash: zod.z.string().nullable(),
|
|
15
|
+
gasPrice: zod.z.string().nullable(),
|
|
16
|
+
gas: zod.z.string(),
|
|
17
|
+
nonce: zod.z.number(),
|
|
18
|
+
transactionIndex: zod.z.number().nullable(),
|
|
19
|
+
status: zod.z.enum(["success", "reverted", "pending"]),
|
|
20
|
+
gasUsed: zod.z.string().nullable(),
|
|
21
|
+
timestamp: zod.z.number().nullable()
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const syncAddressInputSchema = zod.z.object({
|
|
25
|
+
addressId: zod.z.string()
|
|
26
|
+
});
|
|
27
|
+
const syncAddressOutputSchema = zod.z.object({
|
|
28
|
+
// instanceId: z.string(),
|
|
29
|
+
// details: workflowInstanceStatusSchema,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
exports.getTransactionInputSchema = getTransactionInputSchema;
|
|
33
|
+
exports.getTransactionOutputSchema = getTransactionOutputSchema;
|
|
34
|
+
exports.syncAddressInputSchema = syncAddressInputSchema;
|
|
35
|
+
exports.syncAddressOutputSchema = syncAddressOutputSchema;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const getTransactionInputSchema = z.object({
|
|
4
|
+
txHash: z.string()
|
|
5
|
+
});
|
|
6
|
+
const getTransactionOutputSchema = z.object({
|
|
7
|
+
hash: z.string(),
|
|
8
|
+
from: z.string(),
|
|
9
|
+
to: z.string().nullable(),
|
|
10
|
+
value: z.string(),
|
|
11
|
+
blockNumber: z.string().nullable(),
|
|
12
|
+
blockHash: z.string().nullable(),
|
|
13
|
+
gasPrice: z.string().nullable(),
|
|
14
|
+
gas: z.string(),
|
|
15
|
+
nonce: z.number(),
|
|
16
|
+
transactionIndex: z.number().nullable(),
|
|
17
|
+
status: z.enum(["success", "reverted", "pending"]),
|
|
18
|
+
gasUsed: z.string().nullable(),
|
|
19
|
+
timestamp: z.number().nullable()
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const syncAddressInputSchema = z.object({
|
|
23
|
+
addressId: z.string()
|
|
24
|
+
});
|
|
25
|
+
const syncAddressOutputSchema = z.object({
|
|
26
|
+
// instanceId: z.string(),
|
|
27
|
+
// details: workflowInstanceStatusSchema,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { getTransactionOutputSchema as a, syncAddressOutputSchema as b, getTransactionInputSchema as g, syncAddressInputSchema as s };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
interface BlockchainServiceEnvironmentConfig {
|
|
2
|
-
vars: {
|
|
3
|
-
RPC_URL: string;
|
|
4
|
-
};
|
|
5
2
|
d1: {
|
|
6
3
|
id: string;
|
|
7
4
|
};
|
|
@@ -17,4 +14,4 @@ interface BlockchainServiceWranglerConfig {
|
|
|
17
14
|
interface BlockchainServiceEnv extends BlockchainEnv {
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
export type {
|
|
17
|
+
export type { BlockchainServiceEnv as B, BlockchainServiceEnvironmentConfig as a, BlockchainServiceWranglerConfig as b };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
interface BlockchainServiceEnvironmentConfig {
|
|
2
|
-
vars: {
|
|
3
|
-
RPC_URL: string;
|
|
4
|
-
};
|
|
5
2
|
d1: {
|
|
6
3
|
id: string;
|
|
7
4
|
};
|
|
@@ -17,4 +14,4 @@ interface BlockchainServiceWranglerConfig {
|
|
|
17
14
|
interface BlockchainServiceEnv extends BlockchainEnv {
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
export type {
|
|
17
|
+
export type { BlockchainServiceEnv as B, BlockchainServiceEnvironmentConfig as a, BlockchainServiceWranglerConfig as b };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
interface BlockchainServiceEnvironmentConfig {
|
|
2
|
-
vars: {
|
|
3
|
-
RPC_URL: string;
|
|
4
|
-
};
|
|
5
2
|
d1: {
|
|
6
3
|
id: string;
|
|
7
4
|
};
|
|
@@ -17,4 +14,4 @@ interface BlockchainServiceWranglerConfig {
|
|
|
17
14
|
interface BlockchainServiceEnv extends BlockchainEnv {
|
|
18
15
|
}
|
|
19
16
|
|
|
20
|
-
export type {
|
|
17
|
+
export type { BlockchainServiceEnv as B, BlockchainServiceEnvironmentConfig as a, BlockchainServiceWranglerConfig as b };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const getTransactionInputSchema: z.ZodObject<{
|
|
4
|
+
txHash: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const getTransactionOutputSchema: z.ZodObject<{
|
|
7
|
+
hash: z.ZodString;
|
|
8
|
+
from: z.ZodString;
|
|
9
|
+
to: z.ZodNullable<z.ZodString>;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
blockNumber: z.ZodNullable<z.ZodString>;
|
|
12
|
+
blockHash: z.ZodNullable<z.ZodString>;
|
|
13
|
+
gasPrice: z.ZodNullable<z.ZodString>;
|
|
14
|
+
gas: z.ZodString;
|
|
15
|
+
nonce: z.ZodNumber;
|
|
16
|
+
transactionIndex: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
success: "success";
|
|
19
|
+
reverted: "reverted";
|
|
20
|
+
pending: "pending";
|
|
21
|
+
}>;
|
|
22
|
+
gasUsed: z.ZodNullable<z.ZodString>;
|
|
23
|
+
timestamp: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
interface GetTransactionInput extends z.infer<typeof getTransactionInputSchema> {
|
|
26
|
+
}
|
|
27
|
+
type GetTransactionOutput = z.infer<typeof getTransactionOutputSchema>;
|
|
28
|
+
|
|
29
|
+
declare const syncAddressInputSchema: z.ZodObject<{
|
|
30
|
+
addressId: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
declare const syncAddressOutputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
33
|
+
interface SyncAddressInput extends z.infer<typeof syncAddressInputSchema> {
|
|
34
|
+
}
|
|
35
|
+
type SyncAddressOutput = z.infer<typeof syncAddressOutputSchema>;
|
|
36
|
+
|
|
37
|
+
export { getTransactionOutputSchema as c, syncAddressOutputSchema as d, getTransactionInputSchema as g, syncAddressInputSchema as s };
|
|
38
|
+
export type { GetTransactionInput as G, SyncAddressInput as S, GetTransactionOutput as a, SyncAddressOutput as b };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const getTransactionInputSchema: z.ZodObject<{
|
|
4
|
+
txHash: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const getTransactionOutputSchema: z.ZodObject<{
|
|
7
|
+
hash: z.ZodString;
|
|
8
|
+
from: z.ZodString;
|
|
9
|
+
to: z.ZodNullable<z.ZodString>;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
blockNumber: z.ZodNullable<z.ZodString>;
|
|
12
|
+
blockHash: z.ZodNullable<z.ZodString>;
|
|
13
|
+
gasPrice: z.ZodNullable<z.ZodString>;
|
|
14
|
+
gas: z.ZodString;
|
|
15
|
+
nonce: z.ZodNumber;
|
|
16
|
+
transactionIndex: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
success: "success";
|
|
19
|
+
reverted: "reverted";
|
|
20
|
+
pending: "pending";
|
|
21
|
+
}>;
|
|
22
|
+
gasUsed: z.ZodNullable<z.ZodString>;
|
|
23
|
+
timestamp: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
interface GetTransactionInput extends z.infer<typeof getTransactionInputSchema> {
|
|
26
|
+
}
|
|
27
|
+
type GetTransactionOutput = z.infer<typeof getTransactionOutputSchema>;
|
|
28
|
+
|
|
29
|
+
declare const syncAddressInputSchema: z.ZodObject<{
|
|
30
|
+
addressId: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
declare const syncAddressOutputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
33
|
+
interface SyncAddressInput extends z.infer<typeof syncAddressInputSchema> {
|
|
34
|
+
}
|
|
35
|
+
type SyncAddressOutput = z.infer<typeof syncAddressOutputSchema>;
|
|
36
|
+
|
|
37
|
+
export { getTransactionOutputSchema as c, syncAddressOutputSchema as d, getTransactionInputSchema as g, syncAddressInputSchema as s };
|
|
38
|
+
export type { GetTransactionInput as G, SyncAddressInput as S, GetTransactionOutput as a, SyncAddressOutput as b };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const getTransactionInputSchema: z.ZodObject<{
|
|
4
|
+
txHash: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
declare const getTransactionOutputSchema: z.ZodObject<{
|
|
7
|
+
hash: z.ZodString;
|
|
8
|
+
from: z.ZodString;
|
|
9
|
+
to: z.ZodNullable<z.ZodString>;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
blockNumber: z.ZodNullable<z.ZodString>;
|
|
12
|
+
blockHash: z.ZodNullable<z.ZodString>;
|
|
13
|
+
gasPrice: z.ZodNullable<z.ZodString>;
|
|
14
|
+
gas: z.ZodString;
|
|
15
|
+
nonce: z.ZodNumber;
|
|
16
|
+
transactionIndex: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
success: "success";
|
|
19
|
+
reverted: "reverted";
|
|
20
|
+
pending: "pending";
|
|
21
|
+
}>;
|
|
22
|
+
gasUsed: z.ZodNullable<z.ZodString>;
|
|
23
|
+
timestamp: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
interface GetTransactionInput extends z.infer<typeof getTransactionInputSchema> {
|
|
26
|
+
}
|
|
27
|
+
type GetTransactionOutput = z.infer<typeof getTransactionOutputSchema>;
|
|
28
|
+
|
|
29
|
+
declare const syncAddressInputSchema: z.ZodObject<{
|
|
30
|
+
addressId: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
declare const syncAddressOutputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
33
|
+
interface SyncAddressInput extends z.infer<typeof syncAddressInputSchema> {
|
|
34
|
+
}
|
|
35
|
+
type SyncAddressOutput = z.infer<typeof syncAddressOutputSchema>;
|
|
36
|
+
|
|
37
|
+
export { getTransactionOutputSchema as c, syncAddressOutputSchema as d, getTransactionInputSchema as g, syncAddressInputSchema as s };
|
|
38
|
+
export type { GetTransactionInput as G, SyncAddressInput as S, GetTransactionOutput as a, SyncAddressOutput as b };
|