@piprail/sdk 1.0.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/CHANGELOG.md +160 -0
- package/ERRORS.md +182 -0
- package/LICENSE +21 -0
- package/README.md +497 -0
- package/STANDARDS.md +123 -0
- package/dist/chunk-3TQJJ4SQ.js +157 -0
- package/dist/chunk-CQREG5LE.cjs +8 -0
- package/dist/chunk-FURB5RP7.js +8 -0
- package/dist/chunk-WQWNPAYQ.cjs +157 -0
- package/dist/index.cjs +1681 -0
- package/dist/index.d.cts +4578 -0
- package/dist/index.d.ts +4578 -0
- package/dist/index.js +1681 -0
- package/dist/near-4P5XNMMB.cjs +346 -0
- package/dist/near-RVXGF7TW.js +346 -0
- package/dist/solana-7PZG3CDO.js +342 -0
- package/dist/solana-F7H4YDW5.cjs +342 -0
- package/dist/stellar-BPPQTLNI.cjs +389 -0
- package/dist/stellar-PAZ352JL.js +389 -0
- package/dist/sui-6N4ZPAGD.js +304 -0
- package/dist/sui-XV4YYSGV.cjs +304 -0
- package/dist/ton-E5RLUPD2.cjs +366 -0
- package/dist/ton-EFZKQAAK.js +366 -0
- package/dist/tron-243DT6PF.js +372 -0
- package/dist/tron-3UDH7KGF.cjs +372 -0
- package/dist/xrpl-6NRFT5CA.cjs +449 -0
- package/dist/xrpl-7GWXDAVZ.js +449 -0
- package/package.json +143 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkCQREG5LEcjs = require('./chunk-CQREG5LE.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkWQWNPAYQcjs = require('./chunk-WQWNPAYQ.cjs');
|
|
14
|
+
|
|
15
|
+
// src/drivers/stellar/index.ts
|
|
16
|
+
var _stellarsdk = require('@stellar/stellar-sdk');
|
|
17
|
+
|
|
18
|
+
// src/drivers/stellar/chains.ts
|
|
19
|
+
var STELLAR_DECIMALS = 7;
|
|
20
|
+
var XLM_SYMBOL = "XLM";
|
|
21
|
+
var STELLAR_PASSPHRASE = "Public Global Stellar Network ; September 2015";
|
|
22
|
+
var STELLAR_MAINNET = {
|
|
23
|
+
caip2: "stellar:pubnet",
|
|
24
|
+
passphrase: STELLAR_PASSPHRASE,
|
|
25
|
+
defaultRpc: "https://horizon.stellar.org",
|
|
26
|
+
tokens: {
|
|
27
|
+
// Circle USDC — issuer + code verified live on Horizon /assets before shipping.
|
|
28
|
+
// (Mainnet issuer; NOT the testnet GBBD47IF… one.)
|
|
29
|
+
USDC: {
|
|
30
|
+
issuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
|
|
31
|
+
code: "USDC",
|
|
32
|
+
decimals: STELLAR_DECIMALS,
|
|
33
|
+
symbol: "USDC"
|
|
34
|
+
},
|
|
35
|
+
// Circle EURC — issuer + code verified live on Horizon /assets before shipping.
|
|
36
|
+
EURC: {
|
|
37
|
+
issuer: "GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2",
|
|
38
|
+
code: "EURC",
|
|
39
|
+
decimals: STELLAR_DECIMALS,
|
|
40
|
+
symbol: "EURC"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function stellarAssetId(code, issuer) {
|
|
45
|
+
return `${code}:${issuer}`;
|
|
46
|
+
}
|
|
47
|
+
function parseStellarAssetId(asset) {
|
|
48
|
+
if (asset === "native") return null;
|
|
49
|
+
const i = asset.indexOf(":");
|
|
50
|
+
if (i <= 0 || i === asset.length - 1) return null;
|
|
51
|
+
return { code: asset.slice(0, i), issuer: asset.slice(i + 1) };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/drivers/stellar/pay.ts
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
function memoHashForNonce(nonce) {
|
|
64
|
+
return Buffer.from(_stellarsdk.hash.call(void 0, Buffer.from(nonce, "utf8")));
|
|
65
|
+
}
|
|
66
|
+
async function payStellar(params) {
|
|
67
|
+
const { server, keypair, accept } = params;
|
|
68
|
+
try {
|
|
69
|
+
const asset = assetForAccept(accept);
|
|
70
|
+
const source = await server.loadAccount(keypair.publicKey());
|
|
71
|
+
const tx = new (0, _stellarsdk.TransactionBuilder)(source, {
|
|
72
|
+
fee: _stellarsdk.BASE_FEE,
|
|
73
|
+
networkPassphrase: STELLAR_PASSPHRASE
|
|
74
|
+
}).addOperation(
|
|
75
|
+
_stellarsdk.Operation.payment({
|
|
76
|
+
destination: accept.payTo,
|
|
77
|
+
asset,
|
|
78
|
+
amount: accept.extra.amountFormatted
|
|
79
|
+
})
|
|
80
|
+
).addMemo(_stellarsdk.Memo.hash(memoHashForNonce(accept.extra.nonce))).setTimeout(120).build();
|
|
81
|
+
tx.sign(keypair);
|
|
82
|
+
const res = await server.submitTransaction(tx);
|
|
83
|
+
return res.hash;
|
|
84
|
+
} catch (err) {
|
|
85
|
+
throw mapSubmitError(err);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function assetForAccept(accept) {
|
|
89
|
+
if (accept.asset === "native") return _stellarsdk.Asset.native();
|
|
90
|
+
const parts = parseStellarAssetId(accept.asset);
|
|
91
|
+
if (!parts) throw new Error(`Stellar: malformed asset id "${accept.asset}".`);
|
|
92
|
+
return new (0, _stellarsdk.Asset)(parts.code, parts.issuer);
|
|
93
|
+
}
|
|
94
|
+
function mapSubmitError(err) {
|
|
95
|
+
const codes = extractResultCodes(err);
|
|
96
|
+
if (codes.some((c) => /underfunded|insufficient|low_reserve|no_trust/i.test(c))) {
|
|
97
|
+
return new (0, _chunkWQWNPAYQcjs.InsufficientFundsError)(
|
|
98
|
+
"Stellar payment failed: insufficient balance/reserve, or the sender has no trustline for this asset.",
|
|
99
|
+
{ cause: err }
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (isAccountNotFound(err)) {
|
|
103
|
+
return new (0, _chunkWQWNPAYQcjs.InsufficientFundsError)(
|
|
104
|
+
"Stellar source account not found on-chain \u2014 fund it (\u2265 base reserve) before it can pay.",
|
|
105
|
+
{ cause: err }
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
return _nullishCoalesce(_chunkWQWNPAYQcjs.toInsufficientFundsError.call(void 0, err), () => ( err));
|
|
109
|
+
}
|
|
110
|
+
function isAccountNotFound(err) {
|
|
111
|
+
const e = err;
|
|
112
|
+
return _optionalChain([e, 'optionalAccess', _ => _.response, 'optionalAccess', _2 => _2.status]) === 404 || _optionalChain([e, 'optionalAccess', _3 => _3.name]) === "NotFoundError" || /not found|resource missing/i.test(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _4 => _4.message]), () => ( "")));
|
|
113
|
+
}
|
|
114
|
+
function extractResultCodes(err) {
|
|
115
|
+
const extras = _optionalChain([err, 'optionalAccess', _5 => _5.response, 'optionalAccess', _6 => _6.data, 'optionalAccess', _7 => _7.extras, 'optionalAccess', _8 => _8.result_codes]);
|
|
116
|
+
if (!extras) return [];
|
|
117
|
+
return [_nullishCoalesce(extras.transaction, () => ( "")), ..._nullishCoalesce(extras.operations, () => ( []))].filter(Boolean);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/drivers/stellar/verify.ts
|
|
121
|
+
|
|
122
|
+
function memoCandidatesForNonce(nonce) {
|
|
123
|
+
const h = Buffer.from(_stellarsdk.hash.call(void 0, Buffer.from(nonce, "utf8")));
|
|
124
|
+
return [h.toString("base64"), h.toString("hex")];
|
|
125
|
+
}
|
|
126
|
+
async function verifyStellar(params) {
|
|
127
|
+
const { reader, accept } = params;
|
|
128
|
+
const nonce = accept.extra.nonce;
|
|
129
|
+
const required = BigInt(accept.amount);
|
|
130
|
+
const wantMemo = memoCandidatesForNonce(nonce);
|
|
131
|
+
const wantAsset = parseStellarAssetId(accept.asset);
|
|
132
|
+
let txs;
|
|
133
|
+
try {
|
|
134
|
+
txs = await reader.transactionsForAccount(accept.payTo, 50);
|
|
135
|
+
} catch (e2) {
|
|
136
|
+
return rpcFailed(nonce);
|
|
137
|
+
}
|
|
138
|
+
const tx = txs.find(
|
|
139
|
+
(t) => t.memo_type === "hash" && typeof t.memo === "string" && wantMemo.includes(t.memo)
|
|
140
|
+
);
|
|
141
|
+
if (!tx) return notFound(nonce);
|
|
142
|
+
if (!tx.successful) {
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
error: "tx_reverted",
|
|
146
|
+
detail: `Stellar tx ${tx.hash} for nonce ${nonce} failed on-chain.`
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const ageSeconds = Math.floor(Date.now() / 1e3) - Math.floor(Date.parse(tx.created_at) / 1e3);
|
|
150
|
+
if (Number.isFinite(ageSeconds) && ageSeconds > accept.maxTimeoutSeconds) {
|
|
151
|
+
return {
|
|
152
|
+
ok: false,
|
|
153
|
+
error: "payment_expired",
|
|
154
|
+
detail: `Payment is ${ageSeconds}s old; max allowed is ${accept.maxTimeoutSeconds}s.`
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
let payments;
|
|
158
|
+
try {
|
|
159
|
+
payments = await reader.paymentsForTransaction(tx.hash);
|
|
160
|
+
} catch (e3) {
|
|
161
|
+
return rpcFailed(nonce);
|
|
162
|
+
}
|
|
163
|
+
const toUs = payments.filter(
|
|
164
|
+
(p) => p.type === "payment" && p.to === accept.payTo && assetMatches(p, wantAsset)
|
|
165
|
+
);
|
|
166
|
+
if (toUs.length === 0) {
|
|
167
|
+
return {
|
|
168
|
+
ok: false,
|
|
169
|
+
error: "transfer_not_found",
|
|
170
|
+
detail: `Stellar tx ${tx.hash} carries our nonce but has no matching ${wantAsset ? wantAsset.code : "XLM"} payment to ${accept.payTo}.`
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
const paid = toUs.reduce(
|
|
174
|
+
(sum, p) => sum + parseAmount(p.amount, accept.extra.decimals),
|
|
175
|
+
0n
|
|
176
|
+
);
|
|
177
|
+
if (paid < required) {
|
|
178
|
+
return {
|
|
179
|
+
ok: false,
|
|
180
|
+
error: "amount_too_low",
|
|
181
|
+
detail: `Paid ${paid}, required ${required}.`
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
ok: true,
|
|
186
|
+
receipt: {
|
|
187
|
+
scheme: "onchain-proof",
|
|
188
|
+
success: true,
|
|
189
|
+
network: accept.network,
|
|
190
|
+
transaction: tx.hash,
|
|
191
|
+
asset: accept.asset,
|
|
192
|
+
amount: accept.amount,
|
|
193
|
+
payer: toUs[0].from,
|
|
194
|
+
payTo: accept.payTo,
|
|
195
|
+
verifiedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function assetMatches(p, want) {
|
|
200
|
+
if (want === null) return p.asset_type === "native";
|
|
201
|
+
return p.asset_type !== "native" && p.asset_code === want.code && p.asset_issuer === want.issuer;
|
|
202
|
+
}
|
|
203
|
+
function parseAmount(amount, decimals) {
|
|
204
|
+
try {
|
|
205
|
+
return _chunkWQWNPAYQcjs.parseUnits.call(void 0, amount, decimals);
|
|
206
|
+
} catch (e4) {
|
|
207
|
+
return 0n;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function notFound(nonce) {
|
|
211
|
+
return {
|
|
212
|
+
ok: false,
|
|
213
|
+
error: "transfer_not_found",
|
|
214
|
+
detail: `No matching Stellar payment found for nonce ${nonce} (not yet settled, or wrong recipient/amount/asset/memo).`
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function rpcFailed(nonce) {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
error: "tx_not_found",
|
|
221
|
+
detail: `Could not read Horizon for nonce ${nonce} (transient RPC failure) \u2014 retry.`
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/drivers/stellar/wallet.ts
|
|
226
|
+
|
|
227
|
+
function assertStellarWallet(wallet, network) {
|
|
228
|
+
if (typeof wallet !== "object" || wallet === null) {
|
|
229
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
230
|
+
`chain ${network} is Stellar; wallet must be { secret } (S\u2026 seed) or { keypair }.`
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
if ("privateKey" in wallet || "walletClient" in wallet) {
|
|
234
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
235
|
+
`chain ${network} is Stellar; an EVM wallet can't be used \u2014 pass { secret } (S\u2026 seed) or { keypair }.`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
if ("secretKey" in wallet || "signer" in wallet || "mnemonic" in wallet || "keyPair" in wallet) {
|
|
239
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
240
|
+
`chain ${network} is Stellar; that looks like a Solana/TON wallet \u2014 pass { secret } (S\u2026 seed) or { keypair }.`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
if (!("secret" in wallet) && !("keypair" in wallet)) {
|
|
244
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
245
|
+
`chain ${network} is Stellar; wallet must be { secret } (S\u2026 seed) or { keypair }.`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
return wallet;
|
|
249
|
+
}
|
|
250
|
+
function resolveStellarWallet(config) {
|
|
251
|
+
if (config.keypair) return config.keypair;
|
|
252
|
+
if (config.secret) {
|
|
253
|
+
if (!_stellarsdk.StrKey.isValidEd25519SecretSeed(config.secret)) {
|
|
254
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
255
|
+
"Stellar wallet { secret } is not a valid S\u2026 secret seed."
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
return _stellarsdk.Keypair.fromSecret(config.secret);
|
|
259
|
+
}
|
|
260
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)("Stellar wallet needs { secret } (S\u2026 seed) or { keypair }.");
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// src/drivers/stellar/index.ts
|
|
264
|
+
var stellarDriver = {
|
|
265
|
+
family: "stellar",
|
|
266
|
+
resolve(opts) {
|
|
267
|
+
if (opts.chain !== "stellar") return null;
|
|
268
|
+
const rpcUrl = _nullishCoalesce(opts.rpcUrl, () => ( STELLAR_MAINNET.defaultRpc));
|
|
269
|
+
return makeStellarNetwork(STELLAR_MAINNET, rpcUrl);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
function makeStellarNetwork(preset, rpcUrl) {
|
|
273
|
+
const server = new _stellarsdk.Horizon.Server(rpcUrl);
|
|
274
|
+
const network = preset.caip2;
|
|
275
|
+
const reader = {
|
|
276
|
+
async transactionsForAccount(account, limit) {
|
|
277
|
+
const page = await server.transactions().forAccount(account).order("desc").limit(limit).includeFailed(true).call();
|
|
278
|
+
return page.records.map((r) => ({
|
|
279
|
+
hash: r.hash,
|
|
280
|
+
successful: r.successful,
|
|
281
|
+
memo: r.memo,
|
|
282
|
+
memo_type: r.memo_type,
|
|
283
|
+
created_at: r.created_at
|
|
284
|
+
}));
|
|
285
|
+
},
|
|
286
|
+
async paymentsForTransaction(txHash) {
|
|
287
|
+
const page = await server.payments().forTransaction(txHash).limit(100).call();
|
|
288
|
+
return page.records.filter((r) => r.type === "payment").map((r) => ({
|
|
289
|
+
type: r.type,
|
|
290
|
+
from: r.from,
|
|
291
|
+
to: r.to,
|
|
292
|
+
asset_type: r.asset_type,
|
|
293
|
+
asset_code: r.asset_code,
|
|
294
|
+
asset_issuer: r.asset_issuer,
|
|
295
|
+
amount: r.amount
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
return {
|
|
300
|
+
family: "stellar",
|
|
301
|
+
network,
|
|
302
|
+
supports: (n) => n === network,
|
|
303
|
+
resolveToken(token) {
|
|
304
|
+
if (token === "native") {
|
|
305
|
+
return { asset: "native", decimals: STELLAR_DECIMALS, symbol: XLM_SYMBOL };
|
|
306
|
+
}
|
|
307
|
+
if (typeof token === "string") {
|
|
308
|
+
const info = preset.tokens[token.toUpperCase()];
|
|
309
|
+
if (!info) {
|
|
310
|
+
const known = Object.keys(preset.tokens).join(", ") || "(none built in)";
|
|
311
|
+
throw new (0, _chunkWQWNPAYQcjs.UnknownTokenError)(
|
|
312
|
+
`token "${token}" isn't built in for Stellar (known: ${known}). Pass { issuer, code, decimals } for a custom asset, or use 'native'.`
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
asset: stellarAssetId(info.code, info.issuer),
|
|
317
|
+
decimals: info.decimals,
|
|
318
|
+
symbol: info.symbol
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
_chunkWQWNPAYQcjs.rejectForeignToken.call(void 0, token, "stellar", network);
|
|
322
|
+
const t = token;
|
|
323
|
+
if (!t.issuer || !t.code || typeof t.decimals !== "number") {
|
|
324
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
325
|
+
`chain ${network} is Stellar; a custom token must be { issuer, code, decimals }.`
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
asset: stellarAssetId(t.code, t.issuer),
|
|
330
|
+
decimals: t.decimals,
|
|
331
|
+
symbol: _nullishCoalesce(t.symbol, () => ( t.code))
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
describeAsset(asset) {
|
|
335
|
+
if (asset === "native") return { symbol: XLM_SYMBOL, decimals: STELLAR_DECIMALS };
|
|
336
|
+
for (const info of Object.values(preset.tokens)) {
|
|
337
|
+
if (stellarAssetId(info.code, info.issuer) === asset) {
|
|
338
|
+
return { symbol: info.symbol, decimals: info.decimals };
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
},
|
|
343
|
+
assertValidPayTo(payTo) {
|
|
344
|
+
if (payTo.startsWith("0x")) {
|
|
345
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
346
|
+
`chain ${network} is Stellar, but payTo "${payTo}" looks like an EVM address.`
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
if (!_stellarsdk.StrKey.isValidEd25519PublicKey(payTo)) {
|
|
350
|
+
throw new (0, _chunkWQWNPAYQcjs.WrongFamilyError)(
|
|
351
|
+
`chain ${network} is Stellar, but payTo "${payTo}" is not a valid Stellar account (G\u2026).`
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
bindWallet(wallet) {
|
|
356
|
+
return { _native: assertStellarWallet(wallet, network) };
|
|
357
|
+
},
|
|
358
|
+
async send(wallet, accept) {
|
|
359
|
+
const keypair = resolveStellarWallet(wallet._native);
|
|
360
|
+
return payStellar({ server, keypair, accept });
|
|
361
|
+
},
|
|
362
|
+
async confirm(ref) {
|
|
363
|
+
for (let i = 0; i < 10; i += 1) {
|
|
364
|
+
try {
|
|
365
|
+
const tx = await server.transactions().transaction(ref).call();
|
|
366
|
+
return { height: String(_nullishCoalesce(_nullishCoalesce(tx.ledger_attr, () => ( tx.ledger)), () => ( 0))) };
|
|
367
|
+
} catch (e5) {
|
|
368
|
+
await _chunkCQREG5LEcjs.delay.call(void 0, 1500);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
throw new (0, _chunkWQWNPAYQcjs.ConfirmationTimeoutError)(`Stellar tx ${ref} not visible on Horizon in time.`);
|
|
372
|
+
},
|
|
373
|
+
async estimateCost() {
|
|
374
|
+
return _chunkWQWNPAYQcjs.nativeCost.call(void 0, {
|
|
375
|
+
symbol: XLM_SYMBOL,
|
|
376
|
+
decimals: STELLAR_DECIMALS,
|
|
377
|
+
fee: 100n,
|
|
378
|
+
basis: "heuristic",
|
|
379
|
+
detail: "base fee 100 stroops (1 operation)"
|
|
380
|
+
});
|
|
381
|
+
},
|
|
382
|
+
async verify(_ref, accept) {
|
|
383
|
+
return verifyStellar({ reader, accept });
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
exports.stellarDriver = stellarDriver;
|