@pushchain/core 2.0.2 → 2.0.5
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/package.json +4 -3
- package/src/lib/constants/abi/erc20.evm.d.ts +36 -0
- package/src/lib/constants/abi/erc20.evm.js +26 -0
- package/src/lib/constants/abi/erc20.evm.js.map +1 -0
- package/src/lib/constants/abi/index.d.ts +3 -0
- package/src/lib/constants/abi/index.js +7 -1
- package/src/lib/constants/abi/index.js.map +1 -1
- package/src/lib/constants/abi/pushsolanagateway.json +1880 -0
- package/src/lib/constants/abi/universalGatewayV0.evm.d.ts +31 -0
- package/src/lib/constants/abi/universalGatewayV0.evm.js +141 -0
- package/src/lib/constants/abi/universalGatewayV0.evm.js.map +1 -0
- package/src/lib/constants/index.d.ts +1 -0
- package/src/lib/constants/index.js.map +1 -1
- package/src/lib/constants/tokens.d.ts +50 -0
- package/src/lib/constants/tokens.js +172 -0
- package/src/lib/constants/tokens.js.map +1 -0
- package/src/lib/generated/uexecutor/v1/query.d.ts +23 -0
- package/src/lib/generated/uexecutor/v1/query.js +79 -0
- package/src/lib/generated/uexecutor/v1/query.js.map +1 -0
- package/src/lib/generated/uexecutor/v1/types.d.ts +91 -0
- package/src/lib/generated/uexecutor/v1/types.js +856 -0
- package/src/lib/generated/uexecutor/v1/types.js.map +1 -0
- package/src/lib/generated/v1/tx.d.ts +4 -4
- package/src/lib/generated/v1/tx.js +1 -1
- package/src/lib/index.d.ts +1 -0
- package/src/lib/index.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.d.ts +19 -0
- package/src/lib/orchestrator/orchestrator.js +796 -7
- package/src/lib/orchestrator/orchestrator.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.types.d.ts +13 -0
- package/src/lib/progress-hook/progress-hook.js +61 -2
- package/src/lib/progress-hook/progress-hook.js.map +1 -1
- package/src/lib/progress-hook/progress-hook.types.d.ts +8 -0
- package/src/lib/progress-hook/progress-hook.types.js +11 -0
- package/src/lib/progress-hook/progress-hook.types.js.map +1 -1
- package/src/lib/push-chain/push-chain.d.ts +17 -0
- package/src/lib/push-chain/push-chain.js +190 -0
- package/src/lib/push-chain/push-chain.js.map +1 -1
- package/src/lib/push-client/push-client.d.ts +5 -0
- package/src/lib/push-client/push-client.js +15 -0
- package/src/lib/push-client/push-client.js.map +1 -1
- package/src/lib/utils.d.ts +98 -2
- package/src/lib/utils.js +264 -8
- package/src/lib/utils.js.map +1 -1
- package/src/lib/vm-client/svm-client.js +83 -4
- package/src/lib/vm-client/svm-client.js.map +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const UNIVERSAL_GATEWAY_V0: ({
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
inputs: never[];
|
|
5
|
+
outputs: {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
internalType: string;
|
|
9
|
+
}[];
|
|
10
|
+
stateMutability: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: string;
|
|
13
|
+
name: string;
|
|
14
|
+
inputs: ({
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
internalType: string;
|
|
18
|
+
components?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
internalType: string;
|
|
23
|
+
components: {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
internalType: string;
|
|
27
|
+
}[];
|
|
28
|
+
})[];
|
|
29
|
+
outputs: never[];
|
|
30
|
+
stateMutability: string;
|
|
31
|
+
})[];
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNIVERSAL_GATEWAY_V0 = void 0;
|
|
4
|
+
exports.UNIVERSAL_GATEWAY_V0 = [
|
|
5
|
+
{
|
|
6
|
+
type: 'function',
|
|
7
|
+
name: 'getMinMaxValueForNative',
|
|
8
|
+
inputs: [],
|
|
9
|
+
outputs: [
|
|
10
|
+
{ name: 'minValue', type: 'uint256', internalType: 'uint256' },
|
|
11
|
+
{ name: 'maxValue', type: 'uint256', internalType: 'uint256' },
|
|
12
|
+
],
|
|
13
|
+
stateMutability: 'view',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'function',
|
|
17
|
+
name: 'addFunds',
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
name: '_transactionHash',
|
|
21
|
+
type: 'bytes32',
|
|
22
|
+
internalType: 'bytes32',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
outputs: [],
|
|
26
|
+
stateMutability: 'payable',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'function',
|
|
30
|
+
name: 'sendFunds',
|
|
31
|
+
inputs: [
|
|
32
|
+
{ name: 'recipient', type: 'address', internalType: 'address' },
|
|
33
|
+
{ name: 'bridgeToken', type: 'address', internalType: 'address' },
|
|
34
|
+
{ name: 'bridgeAmount', type: 'uint256', internalType: 'uint256' },
|
|
35
|
+
{
|
|
36
|
+
name: 'revertCFG',
|
|
37
|
+
type: 'tuple',
|
|
38
|
+
internalType: 'struct RevertSettings',
|
|
39
|
+
components: [
|
|
40
|
+
{ name: 'fundRecipient', type: 'address', internalType: 'address' },
|
|
41
|
+
{ name: 'revertMsg', type: 'bytes', internalType: 'bytes' },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
outputs: [],
|
|
46
|
+
stateMutability: 'payable',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'function',
|
|
50
|
+
name: 'sendTxWithFunds',
|
|
51
|
+
inputs: [
|
|
52
|
+
{ name: 'bridgeToken', type: 'address', internalType: 'address' },
|
|
53
|
+
{ name: 'bridgeAmount', type: 'uint256', internalType: 'uint256' },
|
|
54
|
+
{
|
|
55
|
+
name: 'payload',
|
|
56
|
+
type: 'tuple',
|
|
57
|
+
internalType: 'struct UniversalPayload',
|
|
58
|
+
components: [
|
|
59
|
+
{ name: 'to', type: 'address', internalType: 'address' },
|
|
60
|
+
{ name: 'value', type: 'uint256', internalType: 'uint256' },
|
|
61
|
+
{ name: 'data', type: 'bytes', internalType: 'bytes' },
|
|
62
|
+
{ name: 'gasLimit', type: 'uint256', internalType: 'uint256' },
|
|
63
|
+
{ name: 'maxFeePerGas', type: 'uint256', internalType: 'uint256' },
|
|
64
|
+
{
|
|
65
|
+
name: 'maxPriorityFeePerGas',
|
|
66
|
+
type: 'uint256',
|
|
67
|
+
internalType: 'uint256',
|
|
68
|
+
},
|
|
69
|
+
{ name: 'nonce', type: 'uint256', internalType: 'uint256' },
|
|
70
|
+
{ name: 'deadline', type: 'uint256', internalType: 'uint256' },
|
|
71
|
+
{
|
|
72
|
+
name: 'vType',
|
|
73
|
+
type: 'uint8',
|
|
74
|
+
internalType: 'enum VerificationType',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'revertCFG',
|
|
80
|
+
type: 'tuple',
|
|
81
|
+
internalType: 'struct RevertSettings',
|
|
82
|
+
components: [
|
|
83
|
+
{ name: 'fundRecipient', type: 'address', internalType: 'address' },
|
|
84
|
+
{ name: 'revertMsg', type: 'bytes', internalType: 'bytes' },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{ name: 'signatureData', type: 'bytes', internalType: 'bytes' },
|
|
88
|
+
],
|
|
89
|
+
outputs: [],
|
|
90
|
+
stateMutability: 'payable',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'function',
|
|
94
|
+
name: 'sendTxWithFunds',
|
|
95
|
+
inputs: [
|
|
96
|
+
{ name: 'bridgeToken', type: 'address', internalType: 'address' },
|
|
97
|
+
{ name: 'bridgeAmount', type: 'uint256', internalType: 'uint256' },
|
|
98
|
+
{ name: 'gasToken', type: 'address', internalType: 'address' },
|
|
99
|
+
{ name: 'gasAmount', type: 'uint256', internalType: 'uint256' },
|
|
100
|
+
{ name: 'amountOutMinETH', type: 'uint256', internalType: 'uint256' },
|
|
101
|
+
{ name: 'deadline', type: 'uint256', internalType: 'uint256' },
|
|
102
|
+
{
|
|
103
|
+
name: 'payload',
|
|
104
|
+
type: 'tuple',
|
|
105
|
+
internalType: 'struct UniversalPayload',
|
|
106
|
+
components: [
|
|
107
|
+
{ name: 'to', type: 'address', internalType: 'address' },
|
|
108
|
+
{ name: 'value', type: 'uint256', internalType: 'uint256' },
|
|
109
|
+
{ name: 'data', type: 'bytes', internalType: 'bytes' },
|
|
110
|
+
{ name: 'gasLimit', type: 'uint256', internalType: 'uint256' },
|
|
111
|
+
{ name: 'maxFeePerGas', type: 'uint256', internalType: 'uint256' },
|
|
112
|
+
{
|
|
113
|
+
name: 'maxPriorityFeePerGas',
|
|
114
|
+
type: 'uint256',
|
|
115
|
+
internalType: 'uint256',
|
|
116
|
+
},
|
|
117
|
+
{ name: 'nonce', type: 'uint256', internalType: 'uint256' },
|
|
118
|
+
{ name: 'deadline', type: 'uint256', internalType: 'uint256' },
|
|
119
|
+
{
|
|
120
|
+
name: 'vType',
|
|
121
|
+
type: 'uint8',
|
|
122
|
+
internalType: 'enum VerificationType',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'revertCFG',
|
|
128
|
+
type: 'tuple',
|
|
129
|
+
internalType: 'struct RevertSettings',
|
|
130
|
+
components: [
|
|
131
|
+
{ name: 'fundRecipient', type: 'address', internalType: 'address' },
|
|
132
|
+
{ name: 'revertMsg', type: 'bytes', internalType: 'bytes' },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{ name: 'signatureData', type: 'bytes', internalType: 'bytes' },
|
|
136
|
+
],
|
|
137
|
+
outputs: [],
|
|
138
|
+
stateMutability: 'nonpayable',
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
//# sourceMappingURL=universalGatewayV0.evm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universalGatewayV0.evm.js","sourceRoot":"","sources":["../../../../../../../packages/core/src/lib/constants/abi/universalGatewayV0.evm.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,yBAAyB;QAC/B,MAAM,EAAE,EAAE;QACV,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAC9D,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;SAC/D;QACD,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,kBAAkB;gBACxB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;aACxB;SACF;QACD,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;KAC3B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAC/D,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YACjE,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAClE;gBACE,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,OAAO;gBACb,YAAY,EAAE,uBAAuB;gBACrC,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;oBACnE,EAAE,IAAI,EAAE,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Domain, TypedData } from '../universal/signer/signer.types';
|
|
3
|
+
export type { MoveableToken, PayableToken } from './tokens';
|
|
3
4
|
export declare const CONSTANTS: {
|
|
4
5
|
PUSH_NETWORK: typeof PUSH_NETWORK;
|
|
5
6
|
CHAIN: typeof CHAIN;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/constants/index.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/constants/index.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAIvD,+EAA+E;AAClE,QAAA,SAAS,GAAG;IACvB,YAAY,EAAZ,oBAAY;IACZ,KAAK,EAAL,aAAK;IACL,OAAO,EAAP,eAAO;CACR,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CHAIN } from './enums';
|
|
2
|
+
export interface MoveableToken {
|
|
3
|
+
symbol: string;
|
|
4
|
+
decimals: number;
|
|
5
|
+
address: string;
|
|
6
|
+
mechanism: 'approve' | 'permit2' | 'native';
|
|
7
|
+
}
|
|
8
|
+
export interface PayableToken {
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimals: number;
|
|
11
|
+
address: string;
|
|
12
|
+
mechanism: 'approve' | 'permit2' | 'native';
|
|
13
|
+
}
|
|
14
|
+
export type MoveableTokenMap = Partial<{
|
|
15
|
+
ETH: MoveableToken;
|
|
16
|
+
SOL: MoveableToken;
|
|
17
|
+
USDT: MoveableToken;
|
|
18
|
+
WETH: MoveableToken;
|
|
19
|
+
}>;
|
|
20
|
+
export type PayableTokenMap = Partial<{
|
|
21
|
+
ETH: PayableToken;
|
|
22
|
+
USDT: PayableToken;
|
|
23
|
+
WETH: PayableToken;
|
|
24
|
+
}>;
|
|
25
|
+
export declare class MoveableTokenAccessor {
|
|
26
|
+
private readonly tokens;
|
|
27
|
+
constructor(tokens: Record<string, MoveableToken>);
|
|
28
|
+
private require;
|
|
29
|
+
get ETH(): MoveableToken;
|
|
30
|
+
get SOL(): MoveableToken;
|
|
31
|
+
get USDT(): MoveableToken;
|
|
32
|
+
get WETH(): MoveableToken;
|
|
33
|
+
}
|
|
34
|
+
export declare class PayableTokenAccessor {
|
|
35
|
+
private readonly tokens;
|
|
36
|
+
constructor(tokens: Record<string, PayableToken>);
|
|
37
|
+
private require;
|
|
38
|
+
get ETH(): PayableToken;
|
|
39
|
+
get USDT(): PayableToken;
|
|
40
|
+
get WETH(): PayableToken;
|
|
41
|
+
}
|
|
42
|
+
export interface ConversionQuote {
|
|
43
|
+
amountIn: string;
|
|
44
|
+
amountOut: string;
|
|
45
|
+
rate: number;
|
|
46
|
+
route?: string[];
|
|
47
|
+
timestamp: number;
|
|
48
|
+
}
|
|
49
|
+
export declare const MOVEABLE_TOKENS: Partial<Record<CHAIN, MoveableToken[]>>;
|
|
50
|
+
export declare const PAYABLE_TOKENS: Partial<Record<CHAIN, PayableToken[]>>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PAYABLE_TOKENS = exports.MOVEABLE_TOKENS = exports.PayableTokenAccessor = exports.MoveableTokenAccessor = void 0;
|
|
4
|
+
const enums_1 = require("./enums");
|
|
5
|
+
// Strongly-typed accessors that throw at runtime if a token is unavailable,
|
|
6
|
+
// while providing non-undefined types at compile time.
|
|
7
|
+
class MoveableTokenAccessor {
|
|
8
|
+
constructor(tokens) {
|
|
9
|
+
this.tokens = tokens;
|
|
10
|
+
}
|
|
11
|
+
require(name) {
|
|
12
|
+
const t = this.tokens[name];
|
|
13
|
+
if (!t)
|
|
14
|
+
throw new Error(`${String(name)} token not available on this chain`);
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
get ETH() {
|
|
18
|
+
return this.require('ETH');
|
|
19
|
+
}
|
|
20
|
+
get SOL() {
|
|
21
|
+
return this.require('SOL');
|
|
22
|
+
}
|
|
23
|
+
get USDT() {
|
|
24
|
+
return this.require('USDT');
|
|
25
|
+
}
|
|
26
|
+
get WETH() {
|
|
27
|
+
return this.require('WETH');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.MoveableTokenAccessor = MoveableTokenAccessor;
|
|
31
|
+
class PayableTokenAccessor {
|
|
32
|
+
constructor(tokens) {
|
|
33
|
+
this.tokens = tokens;
|
|
34
|
+
}
|
|
35
|
+
require(name) {
|
|
36
|
+
const t = this.tokens[name];
|
|
37
|
+
if (!t)
|
|
38
|
+
throw new Error(`${String(name)} token not available on this chain`);
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
get ETH() {
|
|
42
|
+
return this.require('ETH');
|
|
43
|
+
}
|
|
44
|
+
get USDT() {
|
|
45
|
+
return this.require('USDT');
|
|
46
|
+
}
|
|
47
|
+
get WETH() {
|
|
48
|
+
return this.require('WETH');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.PayableTokenAccessor = PayableTokenAccessor;
|
|
52
|
+
// Native token sentinel addresses
|
|
53
|
+
const EVM_NATIVE = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';
|
|
54
|
+
// Minimal initial registries. These can be extended safely without breaking the API.
|
|
55
|
+
exports.MOVEABLE_TOKENS = {
|
|
56
|
+
// Ethereum Sepolia (testnet)
|
|
57
|
+
[enums_1.CHAIN.ETHEREUM_SEPOLIA]: [
|
|
58
|
+
{
|
|
59
|
+
symbol: 'ETH',
|
|
60
|
+
decimals: 18,
|
|
61
|
+
address: EVM_NATIVE,
|
|
62
|
+
mechanism: 'native',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
symbol: 'USDT',
|
|
66
|
+
decimals: 6,
|
|
67
|
+
address: '0x7169D38820dfd117C3FA1f22a697dBA58d90BA06',
|
|
68
|
+
mechanism: 'approve',
|
|
69
|
+
},
|
|
70
|
+
// Sepolia WETH9
|
|
71
|
+
{
|
|
72
|
+
symbol: 'WETH',
|
|
73
|
+
decimals: 18,
|
|
74
|
+
address: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
|
|
75
|
+
mechanism: 'approve',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
// Ethereum Mainnet (placeholder addresses for now)
|
|
79
|
+
[enums_1.CHAIN.ETHEREUM_MAINNET]: [
|
|
80
|
+
{
|
|
81
|
+
symbol: 'ETH',
|
|
82
|
+
decimals: 18,
|
|
83
|
+
address: EVM_NATIVE,
|
|
84
|
+
mechanism: 'native',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
symbol: 'USDT',
|
|
88
|
+
decimals: 6,
|
|
89
|
+
address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
|
|
90
|
+
mechanism: 'approve',
|
|
91
|
+
},
|
|
92
|
+
// Mainnet WETH
|
|
93
|
+
{
|
|
94
|
+
symbol: 'WETH',
|
|
95
|
+
decimals: 18,
|
|
96
|
+
address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
97
|
+
mechanism: 'approve',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
// Solana Devnet (decimals are per SPL mint; addresses TBD)
|
|
101
|
+
[enums_1.CHAIN.SOLANA_DEVNET]: [
|
|
102
|
+
// Native SOL (lamports) sentinel: use 'solana-native' string; not used as a Pubkey
|
|
103
|
+
{
|
|
104
|
+
symbol: 'SOL',
|
|
105
|
+
decimals: 9,
|
|
106
|
+
address: 'solana-native',
|
|
107
|
+
mechanism: 'native',
|
|
108
|
+
},
|
|
109
|
+
// Example SPL USDT mint address on Devnet (placeholder or set via config if needed)
|
|
110
|
+
{
|
|
111
|
+
symbol: 'USDT',
|
|
112
|
+
decimals: 6,
|
|
113
|
+
address: 'EiXDnrAg9ea2Q6vEPV7E5TpTU1vh41jcuZqKjU5Dc4ZF',
|
|
114
|
+
mechanism: 'approve',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
exports.PAYABLE_TOKENS = {
|
|
119
|
+
// For now mirror moveable; can extend with additional payable-only tokens (e.g., DAI, PEPE)
|
|
120
|
+
[enums_1.CHAIN.ETHEREUM_SEPOLIA]: [
|
|
121
|
+
{
|
|
122
|
+
symbol: 'ETH',
|
|
123
|
+
decimals: 18,
|
|
124
|
+
address: EVM_NATIVE,
|
|
125
|
+
mechanism: 'native',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
symbol: 'USDT',
|
|
129
|
+
decimals: 6,
|
|
130
|
+
address: '0x7169D38820dfd117C3FA1f22a697dBA58d90BA06',
|
|
131
|
+
mechanism: 'approve',
|
|
132
|
+
},
|
|
133
|
+
// Sepolia WETH9
|
|
134
|
+
{
|
|
135
|
+
symbol: 'WETH',
|
|
136
|
+
decimals: 18,
|
|
137
|
+
address: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
|
|
138
|
+
mechanism: 'approve',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
[enums_1.CHAIN.ETHEREUM_MAINNET]: [
|
|
142
|
+
{
|
|
143
|
+
symbol: 'ETH',
|
|
144
|
+
decimals: 18,
|
|
145
|
+
address: EVM_NATIVE,
|
|
146
|
+
mechanism: 'native',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
symbol: 'USDT',
|
|
150
|
+
decimals: 6,
|
|
151
|
+
address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
|
|
152
|
+
mechanism: 'approve',
|
|
153
|
+
},
|
|
154
|
+
// Mainnet WETH
|
|
155
|
+
{
|
|
156
|
+
symbol: 'WETH',
|
|
157
|
+
decimals: 18,
|
|
158
|
+
address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
159
|
+
mechanism: 'approve',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
[enums_1.CHAIN.SOLANA_DEVNET]: [
|
|
163
|
+
{
|
|
164
|
+
symbol: 'SOL',
|
|
165
|
+
decimals: 9,
|
|
166
|
+
address: 'solana-native',
|
|
167
|
+
mechanism: 'native',
|
|
168
|
+
},
|
|
169
|
+
{ symbol: 'USDT', decimals: 6, address: 'TBD', mechanism: 'approve' },
|
|
170
|
+
],
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/constants/tokens.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAiChC,4EAA4E;AAC5E,uDAAuD;AACvD,MAAa,qBAAqB;IAChC,YAA6B,MAAqC;QAArC,WAAM,GAAN,MAAM,CAA+B;IAAG,CAAC;IAE9D,OAAO,CAAC,IAA4B;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAc,CAAC,CAAC;QACtC,IAAI,CAAC,CAAC;YACJ,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACvE,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AAtBD,sDAsBC;AAED,MAAa,oBAAoB;IAC/B,YAA6B,MAAoC;QAApC,WAAM,GAAN,MAAM,CAA8B;IAAG,CAAC;IAE7D,OAAO,CAAC,IAA2B;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAc,CAAC,C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CAAC,EAAE;QACrB;YACE,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,QAAQ;SACpB;QACD,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE;KACtE;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
+
import type { UniversalTx as UniversalTxMsg } from './types';
|
|
3
|
+
export declare const protobufPackage = "uexecutor.v1";
|
|
4
|
+
export interface QueryGetUniversalTxRequest {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface QueryGetUniversalTxResponse {
|
|
8
|
+
universalTx?: UniversalTxMsg | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare const QueryGetUniversalTxRequest: {
|
|
11
|
+
encode(message: QueryGetUniversalTxRequest, writer?: BinaryWriter): BinaryWriter;
|
|
12
|
+
decode(input: BinaryReader | Uint8Array, length?: number): QueryGetUniversalTxRequest;
|
|
13
|
+
fromPartial(object: {
|
|
14
|
+
id?: string;
|
|
15
|
+
}): QueryGetUniversalTxRequest;
|
|
16
|
+
};
|
|
17
|
+
export declare const QueryGetUniversalTxResponse: {
|
|
18
|
+
encode(message: QueryGetUniversalTxResponse, writer?: BinaryWriter): BinaryWriter;
|
|
19
|
+
decode(input: BinaryReader | Uint8Array, length?: number): QueryGetUniversalTxResponse;
|
|
20
|
+
fromPartial(object: {
|
|
21
|
+
universalTx?: UniversalTxMsg;
|
|
22
|
+
}): QueryGetUniversalTxResponse;
|
|
23
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryGetUniversalTxResponse = exports.QueryGetUniversalTxRequest = exports.protobufPackage = void 0;
|
|
4
|
+
// Minimal generated types for uexecutor.v1 Query service
|
|
5
|
+
// Hand-authored to avoid requiring protoc at build time in this repo
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
exports.protobufPackage = 'uexecutor.v1';
|
|
10
|
+
function createBaseQueryGetUniversalTxRequest() {
|
|
11
|
+
return { id: '' };
|
|
12
|
+
}
|
|
13
|
+
exports.QueryGetUniversalTxRequest = {
|
|
14
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
15
|
+
if (message.id !== '')
|
|
16
|
+
writer.uint32(10).string(message.id);
|
|
17
|
+
return writer;
|
|
18
|
+
},
|
|
19
|
+
decode(input, length) {
|
|
20
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
21
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
22
|
+
const message = createBaseQueryGetUniversalTxRequest();
|
|
23
|
+
while (reader.pos < end) {
|
|
24
|
+
const tag = reader.uint32();
|
|
25
|
+
switch (tag >>> 3) {
|
|
26
|
+
case 1:
|
|
27
|
+
message.id = reader.string();
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
31
|
+
return message;
|
|
32
|
+
}
|
|
33
|
+
reader.skip(tag & 7);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return message;
|
|
38
|
+
},
|
|
39
|
+
fromPartial(object) {
|
|
40
|
+
var _a;
|
|
41
|
+
return { id: (_a = object.id) !== null && _a !== void 0 ? _a : '' };
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
function createBaseQueryGetUniversalTxResponse() {
|
|
45
|
+
return { universalTx: undefined };
|
|
46
|
+
}
|
|
47
|
+
exports.QueryGetUniversalTxResponse = {
|
|
48
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
49
|
+
if (message.universalTx !== undefined) {
|
|
50
|
+
types_1.UniversalTx.encode(message.universalTx, writer.uint32(10).fork()).join();
|
|
51
|
+
}
|
|
52
|
+
return writer;
|
|
53
|
+
},
|
|
54
|
+
decode(input, length) {
|
|
55
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
56
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
57
|
+
const message = createBaseQueryGetUniversalTxResponse();
|
|
58
|
+
while (reader.pos < end) {
|
|
59
|
+
const tag = reader.uint32();
|
|
60
|
+
switch (tag >>> 3) {
|
|
61
|
+
case 1:
|
|
62
|
+
message.universalTx = types_1.UniversalTx.decode(reader, reader.uint32());
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
66
|
+
return message;
|
|
67
|
+
}
|
|
68
|
+
reader.skip(tag & 7);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return message;
|
|
73
|
+
},
|
|
74
|
+
fromPartial(object) {
|
|
75
|
+
var _a;
|
|
76
|
+
return { universalTx: (_a = object.universalTx) !== null && _a !== void 0 ? _a : undefined };
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../../../../../packages/core/src/lib/generated/uexecutor/v1/query.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,qEAAqE;AACrE,oBAAoB;AACpB,kDAAqE;AAErE,mCAA0D;AAE7C,QAAA,eAAe,GAAG,cAAc,CAAC;AAU9C,SAAS,oCAAoC;IAC3C,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACpB,CAAC;AAEY,QAAA,0BAA0B,GAAG;IACxC,MAAM,CACJ,OAAmC,EACnC,SAAuB,IAAI,mBAAY,EAAE;QAEzC,IAAI,OAA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E,WAAW,EAAE,MAAA,MAAM,CAAC,WAAW,mCAAI,SAAS,EAAE,CAAC;IAC1D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "uexecutor.v1";
|
|
3
|
+
export declare enum VerificationType {
|
|
4
|
+
signedVerification = 0,
|
|
5
|
+
universalTxVerification = 1,
|
|
6
|
+
UNRECOGNIZED = -1
|
|
7
|
+
}
|
|
8
|
+
export declare function verificationTypeFromJSON(object: any): VerificationType;
|
|
9
|
+
export declare function verificationTypeToJSON(object: VerificationType): string;
|
|
10
|
+
export declare enum UniversalTxStatus {
|
|
11
|
+
UNIVERSAL_TX_STATUS_UNSPECIFIED = 0,
|
|
12
|
+
INBOUND_SUCCESS = 1,
|
|
13
|
+
PENDING_INBOUND_EXECUTION = 2,
|
|
14
|
+
PC_EXECUTED_SUCCESS = 3,
|
|
15
|
+
PC_EXECUTED_FAILED = 4,
|
|
16
|
+
PC_PENDING_REVERT = 5,
|
|
17
|
+
OUTBOUND_PENDING = 6,
|
|
18
|
+
OUTBOUND_SUCCESS = 7,
|
|
19
|
+
OUTBOUND_FAILED = 8,
|
|
20
|
+
CANCELED = 9,
|
|
21
|
+
UNRECOGNIZED = -1
|
|
22
|
+
}
|
|
23
|
+
export declare function universalTxStatusFromJSON(object: any): UniversalTxStatus;
|
|
24
|
+
export declare function universalTxStatusToJSON(object: UniversalTxStatus): string;
|
|
25
|
+
export interface UniversalPayload {
|
|
26
|
+
to: string;
|
|
27
|
+
value: string;
|
|
28
|
+
data: string;
|
|
29
|
+
gasLimit: string;
|
|
30
|
+
maxFeePerGas: string;
|
|
31
|
+
maxPriorityFeePerGas: string;
|
|
32
|
+
nonce: string;
|
|
33
|
+
deadline: string;
|
|
34
|
+
vType: VerificationType;
|
|
35
|
+
}
|
|
36
|
+
export interface Inbound {
|
|
37
|
+
sourceChain: string;
|
|
38
|
+
txHash: string;
|
|
39
|
+
sender: string;
|
|
40
|
+
recipient: string;
|
|
41
|
+
amount: string;
|
|
42
|
+
assetAddr: string;
|
|
43
|
+
txType: number;
|
|
44
|
+
universalPayload?: UniversalPayload | undefined;
|
|
45
|
+
verificationData: string;
|
|
46
|
+
}
|
|
47
|
+
export interface PCTx {
|
|
48
|
+
txHash: string;
|
|
49
|
+
sender: string;
|
|
50
|
+
gasUsed: number;
|
|
51
|
+
blockHeight: number;
|
|
52
|
+
status: string;
|
|
53
|
+
errorMsg: string;
|
|
54
|
+
}
|
|
55
|
+
export interface OutboundTx {
|
|
56
|
+
destinationChain: string;
|
|
57
|
+
txHash: string;
|
|
58
|
+
recipient: string;
|
|
59
|
+
amount: string;
|
|
60
|
+
assetAddr: string;
|
|
61
|
+
}
|
|
62
|
+
export interface UniversalTx {
|
|
63
|
+
inboundTx?: Inbound | undefined;
|
|
64
|
+
pcTx: PCTx[];
|
|
65
|
+
outboundTx?: OutboundTx | undefined;
|
|
66
|
+
universalStatus: UniversalTxStatus;
|
|
67
|
+
}
|
|
68
|
+
export declare const UniversalPayload: MessageFns<UniversalPayload>;
|
|
69
|
+
export declare const Inbound: MessageFns<Inbound>;
|
|
70
|
+
export declare const PCTx: MessageFns<PCTx>;
|
|
71
|
+
export declare const OutboundTx: MessageFns<OutboundTx>;
|
|
72
|
+
export declare const UniversalTx: MessageFns<UniversalTx>;
|
|
73
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
74
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
75
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
76
|
+
} : Partial<T>;
|
|
77
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
78
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
79
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
80
|
+
} & {
|
|
81
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
82
|
+
};
|
|
83
|
+
export interface MessageFns<T> {
|
|
84
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
85
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
86
|
+
fromJSON(object: any): T;
|
|
87
|
+
toJSON(message: T): unknown;
|
|
88
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
89
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
90
|
+
}
|
|
91
|
+
export {};
|