@n1xyz/nord-ts 0.0.1
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/.eslintignore +1 -0
- package/.eslintrc.js +20 -0
- package/.prettierignore +1 -0
- package/README.md +110 -0
- package/dist/abis/ERC20_ABI.d.ts +39 -0
- package/dist/abis/ERC20_ABI.js +313 -0
- package/dist/abis/NORD_GETTERS_FACET_ABI.d.ts +34 -0
- package/dist/abis/NORD_GETTERS_FACET_ABI.js +195 -0
- package/dist/abis/NORD_RAMP_FACET_ABI.d.ts +35 -0
- package/dist/abis/NORD_RAMP_FACET_ABI.js +144 -0
- package/dist/abis/index.d.ts +3 -0
- package/dist/abis/index.js +9 -0
- package/dist/const.d.ts +11 -0
- package/dist/const.js +34 -0
- package/dist/gen/common.d.ts +63 -0
- package/dist/gen/common.js +205 -0
- package/dist/gen/nord.d.ts +705 -0
- package/dist/gen/nord.js +4784 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +21 -0
- package/dist/nord/Nord.d.ts +76 -0
- package/dist/nord/Nord.js +376 -0
- package/dist/nord/NordImpl.d.ts +7 -0
- package/dist/nord/NordImpl.js +6 -0
- package/dist/nord/NordUser.d.ts +77 -0
- package/dist/nord/NordUser.js +249 -0
- package/dist/nord/actions.d.ts +101 -0
- package/dist/nord/actions.js +254 -0
- package/dist/nord/index.d.ts +2 -0
- package/dist/nord/index.js +9 -0
- package/dist/types.d.ts +343 -0
- package/dist/types.js +92 -0
- package/dist/utils.d.ts +114 -0
- package/dist/utils.js +257 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +92 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1415 -0
- package/docs/classes/Nord.html +44 -0
- package/docs/classes/NordUser.html +35 -0
- package/docs/classes/Subscriber.html +6 -0
- package/docs/enums/FillMode.html +5 -0
- package/docs/enums/KeyType.html +4 -0
- package/docs/enums/PeakTpsPeriodUnit.html +15 -0
- package/docs/enums/Side.html +3 -0
- package/docs/functions/assert.html +1 -0
- package/docs/functions/bigIntToProtoU128.html +4 -0
- package/docs/functions/checkPubKeyLength.html +1 -0
- package/docs/functions/checkedFetch.html +6 -0
- package/docs/functions/createWebSocketSubscription.html +12 -0
- package/docs/functions/decodeLengthDelimited.html +10 -0
- package/docs/functions/encodeLengthDelimited.html +6 -0
- package/docs/functions/fillModeToProtoFillMode.html +5 -0
- package/docs/functions/findMarket.html +1 -0
- package/docs/functions/findToken.html +1 -0
- package/docs/functions/makeWalletSignFn.html +6 -0
- package/docs/functions/optExpect.html +5 -0
- package/docs/functions/optMap.html +5 -0
- package/docs/functions/optUnwrap.html +2 -0
- package/docs/functions/panic.html +1 -0
- package/docs/functions/signAction.html +6 -0
- package/docs/functions/toScaledU128.html +8 -0
- package/docs/functions/toScaledU64.html +8 -0
- package/docs/index.html +21 -0
- package/docs/interfaces/Account.html +8 -0
- package/docs/interfaces/ActionInfo.html +8 -0
- package/docs/interfaces/ActionQuery.html +4 -0
- package/docs/interfaces/ActionResponse.html +8 -0
- package/docs/interfaces/ActionsExtendedInfo.html +10 -0
- package/docs/interfaces/ActionsQuery.html +5 -0
- package/docs/interfaces/ActionsResponse.html +6 -0
- package/docs/interfaces/AggregateMetrics.html +12 -0
- package/docs/interfaces/BlockQuery.html +6 -0
- package/docs/interfaces/BlockResponse.html +6 -0
- package/docs/interfaces/BlockSummary.html +8 -0
- package/docs/interfaces/BlockSummaryResponse.html +6 -0
- package/docs/interfaces/DeltaEvent.html +6 -0
- package/docs/interfaces/ERC20TokenInfo.html +5 -0
- package/docs/interfaces/Info.html +3 -0
- package/docs/interfaces/Market.html +6 -0
- package/docs/interfaces/MarketStats.html +7 -0
- package/docs/interfaces/MarketsStatsResponse.html +2 -0
- package/docs/interfaces/NordConfig.html +5 -0
- package/docs/interfaces/Order.html +6 -0
- package/docs/interfaces/OrderInfo.html +6 -0
- package/docs/interfaces/OrderbookOrder.html +6 -0
- package/docs/interfaces/OrderbookResponse.html +10 -0
- package/docs/interfaces/PerpMarketStats.html +5 -0
- package/docs/interfaces/RollmanActionExtendedInfo.html +4 -0
- package/docs/interfaces/RollmanActionInfo.html +4 -0
- package/docs/interfaces/RollmanActionResponse.html +4 -0
- package/docs/interfaces/RollmanActionsResponse.html +2 -0
- package/docs/interfaces/RollmanBlockResponse.html +3 -0
- package/docs/interfaces/SubscriberConfig.html +3 -0
- package/docs/interfaces/Token.html +5 -0
- package/docs/interfaces/Trade.html +5 -0
- package/docs/interfaces/TradeInfo.html +20 -0
- package/docs/interfaces/Trades.html +5 -0
- package/docs/interfaces/TradesQueryParams.html +10 -0
- package/docs/interfaces/TradesResponse.html +12 -0
- package/docs/modules.html +77 -0
- package/docs/types/BigIntValue.html +2 -0
- package/docs/variables/DEBUG_KEYS.html +1 -0
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -0
- package/docs/variables/DEV_CONTRACT_ADDRESS.html +1 -0
- package/docs/variables/DEV_TOKEN_INFOS.html +1 -0
- package/docs/variables/DEV_URL.html +1 -0
- package/docs/variables/ERC20_ABI.html +1 -0
- package/docs/variables/EVM_DEV_URL.html +1 -0
- package/docs/variables/FAUCET_PRIVATE_ADDRESS.html +1 -0
- package/docs/variables/MAX_BUFFER_LEN.html +1 -0
- package/docs/variables/NORD_GETTERS_FACET_ABI.html +1 -0
- package/docs/variables/NORD_RAMP_FACET_ABI.html +1 -0
- package/docs/variables/SESSION_TTL.html +1 -0
- package/docs/variables/WEBSERVER_DEV_URL.html +1 -0
- package/docs/variables/ZERO_DECIMAL.html +1 -0
- package/jest.config.ts +9 -0
- package/nodemon.json +4 -0
- package/package.json +61 -0
- package/protoc-generate.sh +23 -0
- package/src/abis/ERC20_ABI.ts +310 -0
- package/src/abis/NORD_GETTERS_FACET_ABI.ts +192 -0
- package/src/abis/NORD_RAMP_FACET_ABI.ts +141 -0
- package/src/abis/index.ts +3 -0
- package/src/const.ts +39 -0
- package/src/gen/common.ts +280 -0
- package/src/gen/nord.ts +5666 -0
- package/src/index.ts +5 -0
- package/src/nord/Nord.ts +504 -0
- package/src/nord/NordImpl.ts +8 -0
- package/src/nord/NordUser.ts +469 -0
- package/src/nord/actions.ts +484 -0
- package/src/nord/index.ts +2 -0
- package/src/types.ts +393 -0
- package/src/utils.ts +300 -0
- package/tests/utils.spec.ts +154 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NORD_GETTERS_FACET_ABI = void 0;
|
|
4
|
+
exports.NORD_GETTERS_FACET_ABI = [
|
|
5
|
+
{
|
|
6
|
+
type: "function",
|
|
7
|
+
name: "getActionId",
|
|
8
|
+
inputs: [],
|
|
9
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
10
|
+
stateMutability: "view",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: "function",
|
|
14
|
+
name: "getActionNonce",
|
|
15
|
+
inputs: [],
|
|
16
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
17
|
+
stateMutability: "view",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: "function",
|
|
21
|
+
name: "getAssetInfo",
|
|
22
|
+
inputs: [{ name: "assetId", type: "uint256", internalType: "uint256" }],
|
|
23
|
+
outputs: [
|
|
24
|
+
{ name: "addr", type: "address", internalType: "address" },
|
|
25
|
+
{
|
|
26
|
+
name: "decimals",
|
|
27
|
+
type: "uint8",
|
|
28
|
+
internalType: "uint8",
|
|
29
|
+
},
|
|
30
|
+
{ name: "added", type: "bool", internalType: "bool" },
|
|
31
|
+
],
|
|
32
|
+
stateMutability: "view",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "function",
|
|
36
|
+
name: "getBlockId",
|
|
37
|
+
inputs: [],
|
|
38
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
39
|
+
stateMutability: "view",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "function",
|
|
43
|
+
name: "getCurrentStateHash",
|
|
44
|
+
inputs: [],
|
|
45
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
46
|
+
stateMutability: "view",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "function",
|
|
50
|
+
name: "getDAFactRegistry",
|
|
51
|
+
inputs: [],
|
|
52
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
53
|
+
stateMutability: "view",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "function",
|
|
57
|
+
name: "getFraudProofParticipant",
|
|
58
|
+
inputs: [{ name: "index", type: "uint256", internalType: "uint256" }],
|
|
59
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
60
|
+
stateMutability: "view",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "function",
|
|
64
|
+
name: "getFraudProofParticipantCount",
|
|
65
|
+
inputs: [],
|
|
66
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
67
|
+
stateMutability: "view",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "function",
|
|
71
|
+
name: "getFraudProofParticipants",
|
|
72
|
+
inputs: [],
|
|
73
|
+
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
|
|
74
|
+
stateMutability: "view",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "function",
|
|
78
|
+
name: "getLastFinalizedStateUpdateInfo",
|
|
79
|
+
inputs: [],
|
|
80
|
+
outputs: [
|
|
81
|
+
{ name: "blockId", type: "uint64", internalType: "uint64" },
|
|
82
|
+
{
|
|
83
|
+
name: "actionId",
|
|
84
|
+
type: "uint64",
|
|
85
|
+
internalType: "uint64",
|
|
86
|
+
},
|
|
87
|
+
{ name: "currentStateHash", type: "uint256", internalType: "uint256" },
|
|
88
|
+
],
|
|
89
|
+
stateMutability: "view",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: "function",
|
|
93
|
+
name: "getNextProposedBlockId",
|
|
94
|
+
inputs: [],
|
|
95
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
96
|
+
stateMutability: "view",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "function",
|
|
100
|
+
name: "getOperator",
|
|
101
|
+
inputs: [{ name: "index", type: "uint256", internalType: "uint256" }],
|
|
102
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
103
|
+
stateMutability: "view",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "function",
|
|
107
|
+
name: "getOperatorCount",
|
|
108
|
+
inputs: [],
|
|
109
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
110
|
+
stateMutability: "view",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "function",
|
|
114
|
+
name: "getOperators",
|
|
115
|
+
inputs: [],
|
|
116
|
+
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
|
|
117
|
+
stateMutability: "view",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "function",
|
|
121
|
+
name: "getPendingDeposit",
|
|
122
|
+
inputs: [
|
|
123
|
+
{ name: "owner", type: "bytes", internalType: "bytes" },
|
|
124
|
+
{
|
|
125
|
+
name: "assetId",
|
|
126
|
+
type: "uint256",
|
|
127
|
+
internalType: "uint256",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
131
|
+
stateMutability: "view",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "function",
|
|
135
|
+
name: "getPendingFacts",
|
|
136
|
+
inputs: [{ name: "blockId", type: "uint256", internalType: "uint256" }],
|
|
137
|
+
outputs: [
|
|
138
|
+
{
|
|
139
|
+
name: "",
|
|
140
|
+
type: "tuple",
|
|
141
|
+
internalType: "struct Types.StateUpdateFacts",
|
|
142
|
+
components: [
|
|
143
|
+
{
|
|
144
|
+
name: "prevStateHash",
|
|
145
|
+
type: "uint256",
|
|
146
|
+
internalType: "uint256",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "pendingStateHash",
|
|
150
|
+
type: "uint256",
|
|
151
|
+
internalType: "uint256",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "daFact",
|
|
155
|
+
type: "uint256",
|
|
156
|
+
internalType: "uint256",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "onchainUpdatesHash",
|
|
160
|
+
type: "uint256",
|
|
161
|
+
internalType: "uint256",
|
|
162
|
+
},
|
|
163
|
+
{ name: "startingActionId", type: "uint64", internalType: "uint64" },
|
|
164
|
+
{
|
|
165
|
+
name: "endingActionId",
|
|
166
|
+
type: "uint64",
|
|
167
|
+
internalType: "uint64",
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
stateMutability: "view",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: "function",
|
|
176
|
+
name: "getPendingWithdrawal",
|
|
177
|
+
inputs: [
|
|
178
|
+
{ name: "owner", type: "address", internalType: "address" },
|
|
179
|
+
{
|
|
180
|
+
name: "assetId",
|
|
181
|
+
type: "uint256",
|
|
182
|
+
internalType: "uint256",
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
186
|
+
stateMutability: "view",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: "function",
|
|
190
|
+
name: "getStateFactRegistry",
|
|
191
|
+
inputs: [],
|
|
192
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
193
|
+
stateMutability: "view",
|
|
194
|
+
},
|
|
195
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const NORD_RAMP_FACET_ABI: ({
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
inputs: {
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
internalType: string;
|
|
8
|
+
}[];
|
|
9
|
+
outputs: never[];
|
|
10
|
+
stateMutability: string;
|
|
11
|
+
anonymous?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
type: string;
|
|
14
|
+
name: string;
|
|
15
|
+
inputs: {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
indexed: boolean;
|
|
19
|
+
internalType: string;
|
|
20
|
+
}[];
|
|
21
|
+
anonymous: boolean;
|
|
22
|
+
outputs?: undefined;
|
|
23
|
+
stateMutability?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
type: string;
|
|
26
|
+
name: string;
|
|
27
|
+
inputs: {
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
internalType: string;
|
|
31
|
+
}[];
|
|
32
|
+
outputs?: undefined;
|
|
33
|
+
stateMutability?: undefined;
|
|
34
|
+
anonymous?: undefined;
|
|
35
|
+
})[];
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NORD_RAMP_FACET_ABI = void 0;
|
|
4
|
+
exports.NORD_RAMP_FACET_ABI = [
|
|
5
|
+
{
|
|
6
|
+
type: "function",
|
|
7
|
+
name: "depositUnchecked",
|
|
8
|
+
inputs: [
|
|
9
|
+
{ name: "recipient", type: "bytes", internalType: "bytes" },
|
|
10
|
+
{
|
|
11
|
+
name: "assetId",
|
|
12
|
+
type: "uint256",
|
|
13
|
+
internalType: "uint256",
|
|
14
|
+
},
|
|
15
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
16
|
+
],
|
|
17
|
+
outputs: [],
|
|
18
|
+
stateMutability: "payable",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: "function",
|
|
22
|
+
name: "withdraw",
|
|
23
|
+
inputs: [
|
|
24
|
+
{ name: "receiver", type: "address", internalType: "address" },
|
|
25
|
+
{
|
|
26
|
+
name: "assetId",
|
|
27
|
+
type: "uint256",
|
|
28
|
+
internalType: "uint256",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
outputs: [],
|
|
32
|
+
stateMutability: "nonpayable",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "event",
|
|
36
|
+
name: "RampDeposit",
|
|
37
|
+
inputs: [
|
|
38
|
+
{
|
|
39
|
+
name: "caller",
|
|
40
|
+
type: "address",
|
|
41
|
+
indexed: true,
|
|
42
|
+
internalType: "address",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "receiverPublicKey",
|
|
46
|
+
type: "bytes",
|
|
47
|
+
indexed: false,
|
|
48
|
+
internalType: "bytes",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "assetId",
|
|
52
|
+
type: "uint256",
|
|
53
|
+
indexed: true,
|
|
54
|
+
internalType: "uint256",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "quantizedAmount",
|
|
58
|
+
type: "uint256",
|
|
59
|
+
indexed: false,
|
|
60
|
+
internalType: "uint256",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "actionNonce",
|
|
64
|
+
type: "uint256",
|
|
65
|
+
indexed: false,
|
|
66
|
+
internalType: "uint256",
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
anonymous: false,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "event",
|
|
73
|
+
name: "RampWithdrawal",
|
|
74
|
+
inputs: [
|
|
75
|
+
{ name: "user", type: "address", indexed: true, internalType: "address" },
|
|
76
|
+
{
|
|
77
|
+
name: "assetId",
|
|
78
|
+
type: "uint256",
|
|
79
|
+
indexed: true,
|
|
80
|
+
internalType: "uint256",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "quantizedAmount",
|
|
84
|
+
type: "uint256",
|
|
85
|
+
indexed: false,
|
|
86
|
+
internalType: "uint256",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
anonymous: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: "error",
|
|
93
|
+
name: "AddressEmptyCode",
|
|
94
|
+
inputs: [{ name: "target", type: "address", internalType: "address" }],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: "error",
|
|
98
|
+
name: "AddressInsufficientBalance",
|
|
99
|
+
inputs: [{ name: "account", type: "address", internalType: "address" }],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "error",
|
|
103
|
+
name: "AssetNotAdded",
|
|
104
|
+
inputs: [{ name: "assetId", type: "uint256", internalType: "uint256" }],
|
|
105
|
+
},
|
|
106
|
+
{ type: "error", name: "FailedInnerCall", inputs: [] },
|
|
107
|
+
{
|
|
108
|
+
type: "error",
|
|
109
|
+
name: "IncorrectAmountTransferred",
|
|
110
|
+
inputs: [{ name: "amount", type: "uint256", internalType: "uint256" }],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "error",
|
|
114
|
+
name: "InvalidAmount",
|
|
115
|
+
inputs: [
|
|
116
|
+
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
117
|
+
{
|
|
118
|
+
name: "quantum",
|
|
119
|
+
type: "uint256",
|
|
120
|
+
internalType: "uint256",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: "error",
|
|
126
|
+
name: "InvalidPublicKeyLength",
|
|
127
|
+
inputs: [{ name: "publicKey", type: "bytes", internalType: "bytes" }],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: "error",
|
|
131
|
+
name: "InvalidRecipient",
|
|
132
|
+
inputs: [{ name: "recipient", type: "address", internalType: "address" }],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "error",
|
|
136
|
+
name: "QuantizedAmountTooLarge",
|
|
137
|
+
inputs: [{ name: "amount", type: "uint256", internalType: "uint256" }],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: "error",
|
|
141
|
+
name: "SafeERC20FailedOperation",
|
|
142
|
+
inputs: [{ name: "token", type: "address", internalType: "address" }],
|
|
143
|
+
},
|
|
144
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NORD_GETTERS_FACET_ABI = exports.NORD_RAMP_FACET_ABI = exports.ERC20_ABI = void 0;
|
|
4
|
+
var ERC20_ABI_1 = require("./ERC20_ABI");
|
|
5
|
+
Object.defineProperty(exports, "ERC20_ABI", { enumerable: true, get: function () { return ERC20_ABI_1.ERC20_ABI; } });
|
|
6
|
+
var NORD_RAMP_FACET_ABI_1 = require("./NORD_RAMP_FACET_ABI");
|
|
7
|
+
Object.defineProperty(exports, "NORD_RAMP_FACET_ABI", { enumerable: true, get: function () { return NORD_RAMP_FACET_ABI_1.NORD_RAMP_FACET_ABI; } });
|
|
8
|
+
var NORD_GETTERS_FACET_ABI_1 = require("./NORD_GETTERS_FACET_ABI");
|
|
9
|
+
Object.defineProperty(exports, "NORD_GETTERS_FACET_ABI", { enumerable: true, get: function () { return NORD_GETTERS_FACET_ABI_1.NORD_GETTERS_FACET_ABI; } });
|
package/dist/const.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ERC20TokenInfo } from "./types";
|
|
2
|
+
export declare const DEBUG_KEYS: string[];
|
|
3
|
+
export declare const DEV_URL = "http://localhost";
|
|
4
|
+
export declare const EVM_DEV_URL: string;
|
|
5
|
+
export declare const WEBSERVER_DEV_URL: string;
|
|
6
|
+
export declare const DEV_CONTRACT_ADDRESS = "0x8a791620dd6260079bf849dc5567adc3f2fdc318";
|
|
7
|
+
export declare const DEV_TOKEN_INFOS: ERC20TokenInfo[];
|
|
8
|
+
export declare const FAUCET_PRIVATE_ADDRESS = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
|
|
9
|
+
export declare const DEFAULT_FUNDING_AMOUNTS: {
|
|
10
|
+
[key: string]: [string, number];
|
|
11
|
+
};
|
package/dist/const.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_FUNDING_AMOUNTS = exports.FAUCET_PRIVATE_ADDRESS = exports.DEV_TOKEN_INFOS = exports.DEV_CONTRACT_ADDRESS = exports.WEBSERVER_DEV_URL = exports.EVM_DEV_URL = exports.DEV_URL = exports.DEBUG_KEYS = void 0;
|
|
4
|
+
const EVM_PORT = "8545";
|
|
5
|
+
const WEBSERVER_PORT = "80";
|
|
6
|
+
exports.DEBUG_KEYS = [
|
|
7
|
+
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
|
|
8
|
+
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
|
|
9
|
+
"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a",
|
|
10
|
+
"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6",
|
|
11
|
+
"0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a",
|
|
12
|
+
"0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba",
|
|
13
|
+
"0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e",
|
|
14
|
+
"0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356",
|
|
15
|
+
"0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97",
|
|
16
|
+
"0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6",
|
|
17
|
+
];
|
|
18
|
+
exports.DEV_URL = "http://localhost";
|
|
19
|
+
exports.EVM_DEV_URL = exports.DEV_URL + ":" + EVM_PORT;
|
|
20
|
+
exports.WEBSERVER_DEV_URL = exports.DEV_URL + ":" + WEBSERVER_PORT;
|
|
21
|
+
exports.DEV_CONTRACT_ADDRESS = "0x8a791620dd6260079bf849dc5567adc3f2fdc318";
|
|
22
|
+
exports.DEV_TOKEN_INFOS = [
|
|
23
|
+
{
|
|
24
|
+
address: "0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae",
|
|
25
|
+
precision: 6,
|
|
26
|
+
tokenId: 0,
|
|
27
|
+
name: "usdc",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
exports.FAUCET_PRIVATE_ADDRESS = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
|
|
31
|
+
exports.DEFAULT_FUNDING_AMOUNTS = {
|
|
32
|
+
ETH: ["0.2", 0],
|
|
33
|
+
"0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae": ["10000", 6],
|
|
34
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "common";
|
|
3
|
+
export interface Message {
|
|
4
|
+
kind?: {
|
|
5
|
+
$case: "transfer";
|
|
6
|
+
value: Message_Transfer;
|
|
7
|
+
} | undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Message sent by user to app to move funds out of app, `withdraw`.
|
|
11
|
+
* Receiver side considers it `route` or `deposit`.
|
|
12
|
+
*/
|
|
13
|
+
export interface Message_Transfer {
|
|
14
|
+
/** Token id as registered on L1 chain settlement */
|
|
15
|
+
tokenId: number;
|
|
16
|
+
/**
|
|
17
|
+
* User public key from L1 which he used for deposits
|
|
18
|
+
* This address will be used to deposit onto L1 or L2 target,
|
|
19
|
+
* Target is "here", as soon as ther are no `channel_id`s remaining.
|
|
20
|
+
*/
|
|
21
|
+
userPubkey: Uint8Array;
|
|
22
|
+
amount: bigint;
|
|
23
|
+
/**
|
|
24
|
+
* Numeric identifiers of channels to traverse.
|
|
25
|
+
*
|
|
26
|
+
* Message removed first channel_id in list,
|
|
27
|
+
* and sent remaining message to "removed" channel.
|
|
28
|
+
*
|
|
29
|
+
* If received by app via channel and no channels defined,
|
|
30
|
+
* deposit target this app ("here").
|
|
31
|
+
*
|
|
32
|
+
* If it is direct user input and no channels defined, default route is used: q
|
|
33
|
+
* to Gate on Nord, to L1 on Gate, and to Gate on L1.
|
|
34
|
+
*/
|
|
35
|
+
channelId: number[];
|
|
36
|
+
}
|
|
37
|
+
export declare const Message: MessageFns<Message>;
|
|
38
|
+
export declare const Message_Transfer: MessageFns<Message_Transfer>;
|
|
39
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
40
|
+
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 {
|
|
41
|
+
$case: string;
|
|
42
|
+
value: unknown;
|
|
43
|
+
} ? {
|
|
44
|
+
$case: T["$case"];
|
|
45
|
+
value?: DeepPartial<T["value"]>;
|
|
46
|
+
} : T extends {} ? {
|
|
47
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
48
|
+
} : Partial<T>;
|
|
49
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
50
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
51
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
52
|
+
} & {
|
|
53
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
54
|
+
};
|
|
55
|
+
export interface MessageFns<T> {
|
|
56
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
57
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
58
|
+
fromJSON(object: any): T;
|
|
59
|
+
toJSON(message: T): unknown;
|
|
60
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
61
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
62
|
+
}
|
|
63
|
+
export {};
|