diff --git a/packages/account/dist/index.js b/packages/account/dist/index.js index 57309eb97..4c7f248e5 100644 --- a/packages/account/dist/index.js +++ b/packages/account/dist/index.js @@ -1180,8 +1180,13 @@ Array.prototype.submit = async function(feePayer) { const errorMess = obj.error.message; throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); } else if (obj.canSubmit) { + console.log("# canSubmit", obj); await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); } else { + console.log("# transfer transaction start: ", obj); return await obj.submit(feePayer); } i++; @@ -1401,4 +1406,4 @@ var Account = { 0 && (module.exports = { Account }); -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvY29uc3RhbnRzLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvcmVzdWx0LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvc2hhcmVkLnRzIiwgIi4uLy4uL25vZGUvc3JjL2luZGV4LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29sbGVjdGlvbi50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NyZWF0b3JzLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvcm95YWx0eS50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NvbXByZXNzZWQtbmZ0LW1ldGFkYXRhLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvbWVtby50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL21pbnQudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb2xsZWN0aW9uLWRldGFpbHMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy91c2VzLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvdG9rZW4tbWV0YWRhdGEudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9yZWd1bGFyLW5mdC1tZ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JbmZyYSA9IChcbiAgICAgIGlucHV0OiBPcHRpb248SW5wdXRDcmVhdG9yc1tdPiB8IHVuZGVmaW5lZCxcbiAgICApOiBPcHRpb248SW50ZXJuYWxDcmVhdG9yc1tdPiA9PiB7XG4gICAgICBpZiAoIWlucHV0KSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGlucHV0Lm1hcCgoZGF0YSkgPT4ge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZHJlc3M6IGRhdGEuYWRkcmVzcy50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIHNoYXJlOiBkYXRhLnNoYXJlLFxuICAgICAgICAgIHZlcmlmaWVkOiBmYWxzZSxcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBleHBvcnQgY29uc3QgaW50b0NvbXByZXNzZWROZnRJbmZyYSA9IChcbiAgICAgIGlucHV0OiBPcHRpb248SW5wdXRDcmVhdG9yc1tdPiB8IHVuZGVmaW5lZCxcbiAgICApOiBJbnRlcm5hbENyZWF0b3JzW10gPT4ge1xuICAgICAgaWYgKCFpbnB1dCkge1xuICAgICAgICByZXR1cm4gW107XG4gICAgICB9XG4gICAgICByZXR1cm4gaW5wdXQhLm1hcCgoZGF0YSkgPT4ge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZHJlc3M6IGRhdGEuYWRkcmVzcy50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIHNoYXJlOiBkYXRhLnNoYXJlLFxuICAgICAgICAgIHZlcmlmaWVkOiBmYWxzZSxcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBleHBvcnQgY29uc3QgaW50b1VzZXIgPSAoXG4gICAgICBvdXRwdXQ6IE9wdGlvbjxJbnRlcm5hbENyZWF0b3JzW10+LFxuICAgICk6IENyZWF0b3JzW10gfCB1bmRlZmluZWQgPT4ge1xuICAgICAgaWYgKCFvdXRwdXQ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kZWZpbmVkLFxuICAgICAgY2FsbGJhY2tGdW5jOiAoXG4gICAgICAgIGZpbGVQYXRoOiBGaWxlVHlwZSxcbiAgICAgICAgc3RvcmFnZVR5cGU6IFN0b3JhZ2VUeXBlLFxuICAgICAgICBmZWVQYXllcj86IFNlY3JldCxcbiAgICAgICkgPT4gUHJvbWlzZTxSZXN1bHQ8c3RyaW5nLCBFcnJvcj4+LFxuICAgICAgc3RvcmFnZVR5cGU6IFN0b3JhZ2VUeXBlLFxuICAgICAgZmVlUGF5ZXI/OiBTZWNyZXQsXG4gICAgKTogUHJvbWlzZTxQcm9wZXJ0aWVzPiA9PiB7XG4gICAgICBpZiAoIWlucHV0IHx8ICFpbnB1dC5maWxlcykge1xuICAgICAgICByZXR1cm4ge307XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGZpbGVzID0gYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgIGlucHV0LmZpbGVzLm1hcChhc3luYyAoZmlsZSkgPT4ge1xuICAgICAgICAgIGlmICghZmlsZS5maWxlUGF0aCkge1xuICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCBjYWxsYmFja0Z1bmMoZmlsZS5maWxlUGF0aCwgc3RvcmFnZVR5cGUsIGZlZVBheWVyKTtcbiAgICAgICAgICBpZiAocmVzLmlzRXJyKSB7XG4gICAgICAgICAgICB0aHJvdyBFcnJvcihyZXMuZXJyb3IubWVzc2FnZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBvdmVyd3JpdGVPYmplY3QoZmlsZSwgW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBleGlzdHNLZXk6ICdmaWxlUGF0aCcsXG4gICAgICAgICAgICAgIHdpbGw6IHsga2V5OiAndXJpJywgdmFsdWU6IHJlcy52YWx1ZSB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICBdKTtcbiAgICAgICAgfSksXG4gICAg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FrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlcyAmJiByZXMuaXNFcnIpIHtcbiAgICAgICAgICByZXN1bHRzLnB1c2goLi4ucmVzLmVycm9yLmRldGFpbHMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgY29uc3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AgKiBAcmV0dXJucyBQcm9taXNlPHN0cmluZz5cbiAgICAgKi9cbiAgICBleHBvcnQgY29uc3QgcmV0cnlHZXRPckNyZWF0ZSA9IGFzeW5jIChcbiAgICAgIG1pbnQ6IFB1YmtleSxcbiAgICAgIG93bmVyOiBQdWJrZXksXG4gICAgICBmZWVQYXllcjogU2VjcmV0LFxuICAgICk6IFByb21pc2U8c3RyaW5nPiA9PiB7XG4gICAgICBsZXQgY291bnRlciA9IDE7XG4gICAgICB3aGlsZSAoY291bnRlciA8IFJFVFJZX09WRVJfTElNSVQpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICBjb25zdCBpbnN0ID0gYXdhaXQgZ2V0KG1pbnQsIG93bmVyLCBmZWVQYXllciwgdHJ1ZSk7XG5cbiAgICAgICAgICBpZiAoaW5zdCAmJiB0eXBlb2YgaW5zdCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGluc3QpO1xuICAgICAgICAgICAgcmV0dXJuIGluc3Q7XG4gICAgICAgICAgfSBlbHNlIGlmIChpbnN0IGluc3RhbmNlb2YgVHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgIChhd2FpdCBpbnN0LnN1Ym1pdCgpKS5tYXAoXG4gICAgICAgICAgICAgIGFzeW5jIChvaykgPT4ge1xuICAgICAgICAgICAgICAgIGF3YWl0IE5vZGUuY29uZmlybWVkU2lnKG9rKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5zdC5kYXRhIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIGRlYnVnTG9nKCcjIEVycm9yIHN1Ym1pdCByZXRyeUdldE9yQ3JlYXRlOiAnLCBlcnIpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAg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1bmRlZmluZWQ7XG4gICAgfT4gPT4ge1xuICAgICAgY29uc3QgYXNzb2NpYXRlZFRva2VuQWNjb3VudCA9IGdldEFzc29jaWF0ZWRUb2tlbkFkZHJlc3NTeW5jKFxuICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgIGFsbG93T3duZXJPZmZDdXJ2ZSxcbiAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgKTtcblxuICAgICAgZGVidWdMb2coJyMgYXNzb2NpYXRlZFRva2VuQWNjb3VudDogJywgYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgLy8gRG9udCB1c2UgUmVzdWx0XG4gICAgICAgIGF3YWl0IGdldEFjY291bnQoXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKS5jb21taXRtZW50LFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdDogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgfSBjYXRjaCAoZXJyb3I6IHVua25vd24pIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkFjY291bnROb3RGb3VuZEVycm9yKSAmJlxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkludmFsaWRBY2NvdW50T3duZXJFcnJvcilcbiAgICAgICAg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sICJDb252ZXJ0ZXIiLCAiQ29sbGVjdGlvbkRldGFpbHMiLCAiQ29udmVydGVyIiwgIlVzZXMiLCAiQ29udmVydGVyIiwgIlRva2VuTWV0YWRhdGEiLCAiQ29udmVydGVyIiwgIlJlZ3VsYXJOZnRNZXRhZGF0YSIsICJDb252ZXJ0ZXIiLCAiUHJvcGVydGllcyIsICJDb252ZXJ0ZXIiLCAiVHJhbnNmZXJDaGVja2VkIiwgIkNvbnZlcnRlciIsICJUcmFuc2ZlciIsICJDb252ZXJ0ZXIiLCAiVmFsaWRhdG9yIiwgIk1lc3NhZ2UiLCAiQ29udmVydGVyIiwgImltcG9ydF93ZWIzIiwgImJzIiwgImltcG9ydF93ZWIzIiwgIlR4IiwgImltcG9ydF93ZWIzIiwgIlR4IiwgImltcG9ydF93ZWIzIiwgImltcG9ydF93ZWIzIiwgImltcG9ydF93ZWIzIiwgImltcG9ydF9iczU4IiwgIkFjY291bnQiLCAiS2V5cGFpciIsICJicyIsICJPcmlnaW5hbCIsICJBY2NvdW50IiwgIkFzc29jaWF0ZWQiLCAiaW1wb3J0X3dlYjMiLCAiQWNjb3VudCIsICJQZGEiLCAiQk4iLCAiQWNjb3VudCJdCn0K \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvY29uc3RhbnRzLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvcmVzdWx0LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvc2hhcmVkLnRzIiwgIi4uLy4uL25vZGUvc3JjL2luZGV4LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29sbGVjdGlvbi50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NyZWF0b3JzLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvcm95YWx0eS50cyIsICIuLi8uLi9jb252ZXJ0Z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GluIG1ldGFkYXRhICYmIG1ldGFkYXRhLmltYWdlKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzSW1hZ2VVcmwobWV0YWRhdGEuaW1hZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAncm95YWx0eSc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzUm95YWx0eShtZXRhZGF0YS5yb3lhbHR5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaW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AgICAgbGV0IGNvdW50ZXIgPSAxO1xuICAgICAgd2hpbGUgKGNvdW50ZXIgPCBSRVRSWV9PVkVSX0xJTUlUKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgaW5zdCA9IGF3YWl0IGdldChtaW50LCBvd25lciwgZmVlUGF5ZXIsIHRydWUpO1xuXG4gICAgICAgICAgaWYgKGluc3QgJiYgdHlwZW9mIGluc3QgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBkZWJ1Z0xvZygnIyBhc3NvY2lhdGVkVG9rZW5BY2NvdW50OiAnLCBpbnN0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnN0O1xuICAgICAgICAgIH0gZWxzZSBpZiAoaW5zdCBpbnN0YW5jZW9mIFRyYW5zYWN0aW9uKSB7XG4gICAgICAgICAgICAoYXdhaXQgaW5zdC5zdWJtaXQoKSkubWFwKFxuICAgICAgICAgICAgICBhc3luYyAob2spID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBOb2RlLmNvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiBhY2NvdW50OiBgLCBlKTtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyBtaW50OiAke21pbnR9LCBvd25lcjogJHtvd25lcn0sIGZlZVBheWVyOiAke2Zl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G4gICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICk7XG5cbiAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSk7XG5cbiAgICAgIHRyeSB7XG4gICAgICAgIC8vIERvbnQgdXNlIFJlc3VsdFxuICAgICAgICBhd2FpdCBnZXRBY2NvdW50KFxuICAgICAgICAgIE5vZGUuZ2V0Q29ubmVjdGlvbigpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCkuY29tbWl0bWVudCxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYXllciA/IG93bmVyIDogZmVlUGF5ZXI7XG5cbiAgICAgICAgY29uc3QgaW5zdCA9IGNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjd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F0YSIsICJDb252ZXJ0ZXIiLCAiUmVndWxhck5mdE1ldGFkYXRhIiwgIkNvbnZlcnRlciIsICJQcm9wZXJ0aWVzIiwgIkNvbnZlcnRlciIsICJUcmFuc2ZlckNoZWNrZWQiLCAiQ29udmVydGVyIiwgIlRyYW5zZmVyIiwgIkNvbnZlcnRlciIsICJWYWxpZGF0b3IiLCAiTWVzc2FnZSIsICJDb252ZXJ0ZXIiLCAiaW1wb3J0X3dlYjMiLCAiYnMiLCAiaW1wb3J0X3dlYjMiLCAiVHgiLCAiaW1wb3J0X3dlYjMiLCAiVHgiLCAiaW1wb3J0X3dlYjMiLCAiaW1wb3J0X3dlYjMiLCAiaW1wb3J0X3dlYjMiLCAiaW1wb3J0X2JzNTgiLCAiQWNjb3VudCIsICJLZXlwYWlyIiwgImJzIiwgIk9yaWdpbmFsIiwgIkFjY291bnQiLCAiQXNzb2NpYXRlZCIsICJpbXBvcnRfd2ViMyIsICJBY2NvdW50IiwgIlBkYSIsICJCTiIsICJBY2NvdW50Il0KfQo= \ No newline at end of file diff --git a/packages/account/dist/index.mjs b/packages/account/dist/index.mjs index 56b349283..e3aab7e2f 100644 --- a/packages/account/dist/index.mjs +++ b/packages/account/dist/index.mjs @@ -1158,8 +1158,13 @@ Array.prototype.submit = async function(feePayer) { const errorMess = obj.error.message; throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); } else if (obj.canSubmit) { + console.log("# canSubmit", obj); await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); } else { + console.log("# transfer transaction start: ", obj); return await obj.submit(feePayer); } i++; @@ -1386,4 +1391,4 @@ var Account = { export { Account }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc2hhcmVkL3NyYy9jb25zdGFudHMudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9yZXN1bHQudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9zaG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ICAgIHRocm93IEVycm9yKENvbnN0YW50cy5XYXJubmluZ01lc3NhZ2UuREFTX0FQSV9VUkwpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHVybHMgPSBDb25zdGFudHMuQnVuZGxyVXJsLnByZC5zcGxpdCgnLCcpO1xuICAgICAgICBjb25zdCBpbmRleCA9IERhdGUubm93KCkgJSB1cmxzLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHVybHNbaW5kZXhdO1xuICAgICAgZGVmYXVsdDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkRhc0FwaVVybC5kZXYuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbiAgZXhwb3J0IGNvbnN0IHN3aXRjaE5mdFN0b3JhZ2UgPSAoZW52OiBzdHJpbmcpOiBzdHJpbmcgPT4ge1xuICAgIHN3aXRjaCAoZW52KSB7XG4gICAgICBjYXNlIENvbnN0YW50cy5DbHVzdGVyLnByZDpcbiAgICAgICAgaWYgKCFuZnRTdG9yYWdlQXBpS2V5KSB7XG4gICAgICAgICAgdGhyb3cgRXJyb3IoV2Fybm5pbmdNZXNzYWdlLk5GVF9TVE9SQUdFX0FQSV9LRVkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZnRTdG9yYWdlQXBpS2V5O1xuICAgICAgZGVmYXVsdDoge1xuICAgICAgICByZXR1cm4gQ29uc3RhbnRzLk5mdHN0b3JhZ2VBcGlLZXkuZGV2O1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3QgV1JBUFBFRF9UT0tFTl9QUk9HUkFNX0lEID0gbmV3IFB1YmxpY0tleShcbiAgICAnU28xMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMicsXG4gICk7XG4gI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9IGlzSW1hZ2VVcmwobWV0YWRhdGEuaW1hZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAncm95YWx0eSc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzUm95YWx0eShtZXRhZGF0YS5yb3lhbHR5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZ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cbiAgICAgICAgICAgICAgICByZXR1cm4gaW5zdC5kYXRhIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIGRlYnVnTG9nKCcjIEVycm9yIHN1Ym1pdCByZXRyeUdldE9yQ3JlYXRlOiAnLCBlcnIpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgZGVidWdMb2coYCMgcmV0cnk6ICR7Y291bnRlcn0gY3JlYXRlIHRva2VuIGFjY291bnQ6IGAsIGUpO1xuICAgICAgICAgIGRlYnVnTG9nKGAjIG1pbnQ6ICR7bWludH0sIG93bmVyOiAke293bmVyfSwgZmVlUGF5ZXI6ICR7ZmVlUGF5ZXJ9YCk7XG4gICAgICAgIH1cbiAgICAgICAgYXdhaXQgc2xlZXAoUkVUUllfU0xFRVBfVElNRSk7XG4gICAgICAgIGNvdW50ZXIrKztcbiAgICAgIH1cbiAgICAgIHRocm93IEVycm9yKGByZXRyeSBhY3Rpb24gaXMgb3ZlciBsaW1pdCAke1JFVFJZX09WRVJfTElNSVR9YCk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFtNYWluIGxvZ2ljXUdldCBBc3NvY2lhdGVkIHRva2VuIEFjY291bnQuXG4gICAgICogaWYgbm90IGNyZWF0ZWQsIGNyZWF0ZSBuZXcgdG9rZW4gYWNjb3VpbnRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBtaW50XG4gICAgICogQHBhcmFtIHtQdWJrZXl9IG93bmVyXG4gICAgICogQHBhcmFtIHtQdWJrZXl9IGZlZVBheWVyXG4gICAgICogQHJldHVybnMgUHJvbWlzZTxzdHJpbmc+XG4gICAgICovXG4gICAgZXhwb3J0IGNvbnN0IG1ha2VPckNyZWF0ZUluc3RydWN0aW9uID0gYXN5bmMgKFxuICAgICAgbWludDogUHVia2V5LFxuICAgICAgb3duZXI6IFB1YmtleSxcbiAgICAgIGZlZVBheWVyPzogUHVia2V5LFxuICAgICAgYWxsb3dPd25lck9mZkN1cnZlID0gZmFsc2UsXG4gICAgKTogUHJvbWlzZTx7XG4gICAgICB0b2tlbkFjY291bnQ6IHN0cmluZztcbiAgICAgIGluc3Q6IFRyYW5zYWN0aW9uSW5zdHJ1Y3Rpb24gfCB1bmRlZmluZWQ7XG4gICAgfT4gPT4ge1xuICAgICAgY29uc3QgYXNzb2NpYXRlZFRva2VuQWNjb3VudCA9IGdldEFzc29jaWF0ZWRUb2tlbkFkZHJlc3NTeW5jKFxuICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgIGFsbG93T3duZXJPZmZDdXJ2ZSxcbiAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgKTtcblxuICAgICAgZGVidWdMb2coJyMgYXNzb2NpYXRlZFRva2VuQWNjb3VudDogJywgYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgLy8gRG9udCB1c2UgUmVzdWx0XG4gICAgICAgIGF3YWl0IGdldEFjY291bnQoXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKS5jb21taXRtZW50LFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdDogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgfSBjYXRjaCAoZXJyb3I6IHVua25vd24pIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkFjY291bnROb3RGb3VuZEVycm9yKSAmJlxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkludmFsaWRBY2NvdW50T3duZXJFcnJvcilcbiAgICAgICAgKSB7XG4gICAgICAgICAgdGhyb3cgRXJyb3IoJ1VuZXhwZWN0ZWQgZXJyb3InKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHBheWVyID0gIWZlZVBheWVyID8gb3duZXIgOiBmZWVQYXllcjtcblxuICAgICAgICBjb25zdCBpbnN0ID0gY3JlYXRlQXNzb2NpYXRlZFRva2VuQWNjb3VudEluc3RydWN0aW9uKFxuICAgICAgICAgIHBheWVyLnRvUHVibGljS2V5KCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgKTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3QsXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfTtcbiAgfVxufVxuIiwgImltcG9ydCB7IEtleXBhaXIgYXMgT3JpZ2luYWwsIFB1YmxpY0tleSB9IGZyb20gJ0Bzb2xhbmEvd2ViMy5qcyc7XG5pbXBvcnQgeyBQdWJrZXksIFNlY3JldCB9IGZyb20gJ34vdHlwZXMvYWNjb3VudCc7XG5p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HJhbnNmZXIiLCAiQ29udmVydGVyIiwgIlZhbGlkYXRvciIsICJNZXNzYWdlIiwgIkNvbnZlcnRlciIsICJQdWJsaWNLZXkiLCAiUHVibGljS2V5IiwgInNlbmRBbmRDb25maXJtVHJhbnNhY3Rpb24iLCAiVHgiLCAiVHgiLCAic2VuZEFuZENvbmZpcm1UcmFuc2FjdGlvbiIsICJzZW5kQW5kQ29uZmlybVRyYW5zYWN0aW9uIiwgIlR4IiwgIlR4IiwgIlB1YmxpY0tleSIsICJicyIsICJBY2NvdW50IiwgIktleXBhaXIiLCAiQWNjb3VudCIsICJBc3NvY2lhdGVkIiwgIlB1YmxpY0tleSIsICJBY2NvdW50IiwgIlBkYSIsICJBY2NvdW50Il0KfQo= \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc2hhcmVkL3NyYy9jb25zdGFudHMudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9yZXN1bHQudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9zaGFyZWQudHMiLCAiLi4vLi4vbm9kZS9zcmMvaW5kZXgudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb2xsZWN0aW9uLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY3JlYXRvcnMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9yb3lhbHR5LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29tcHJlc3NlZC1uZnQtbWV0YWRhdGEudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9tZW1vLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvbWludC50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NvbGxlY3Rpb24tZGV0YWlscy50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL3VzZXMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy90b2tlbi1tZXRhZGF0YS50cyIsICI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cpOiBzdHJpbmcgPT4ge1xuICAgIHN3aXRjaCAoZW52KSB7XG4gICAgICBjYXNlIENvbnN0YW50cy5DbHVzdGVyLnByZDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkJ1bmRsclVybC5wcmQuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgcmV0dXJuIENvbnN0YW50cy5CdW5kbHJVcmwuZGV2O1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3Qgc3dpdGNoRGFzQXBpID0gKGVudjogc3RyaW5nKTogc3RyaW5nID0+IHtcbiAgICBzd2l0Y2ggKGVudikge1xuICAgICAgY2FzZSBDb25zdGFudHMuQ2x1c3Rlci5wcmQ6XG4gICAgICAgIGlmIChkYXNBcGlVcmwubGVuZ3RoIDwgMSkge1xuICAgICAgICAgIHRocm93IEVycm9yKENvbnN0YW50cy5XYXJubmluZ01lc3NhZ2UuREFTX0FQSV9VUkwpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHVybHMgPSBDb25zdGFudHMuQnVuZGxyVXJsLnByZC5zcGxpdCgnLCcpO1xuICAgICAgICBjb25zdCBpbmRleCA9IERhdGUubm93KCkgJSB1cmxzLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHVybHNbaW5kZXhdO1xuICAgICAgZGVmYXVsdDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkRhc0FwaVVybC5kZXYuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbiAgZXhwb3J0I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WxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlcyAmJiByZXMuaXNFcnIpIHtcbiAgICAgICAgICByZXN1bHRzLnB1c2goLi4ucmVzLmVycm9yLmRldGFpbHMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgY29uc3QgbWVzc2FnZSA9XG4gICAgICAgICAgJ0NhdWdodCBpbiB0aGUgdmFsaWRhdGlvbiBlcnJvcnMuIHNlZSBpbmZvcm1hdGlvbiBlLmc6IGVycjxWYWxpZGF0b3JFcnJvcj4uZGV0YWlscyc7XG4gICAgICAgIHRocm93IG5ldyBWYWxpZGF0b3JFcnJvcihtZXNzYWdlLCByZXN1bHRzKTtcbiAgICAgIH1cbiAg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bmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiBhY2NvdW50OiBgLCBlKTtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyBtaW50OiAke21pbnR9LCBvd25lcjogJHtvd25lcn0sIGZlZVBheWVyOiAke2ZlZVBheWVyfWApO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKFJFVFJZX1NMRUVQX1RJTUUpO1xuICAgICAgICBjb3VudGVyKys7XG4gICAgICB9XG4gICAgICB0aHJvdyBFcnJvcihgcmV0cnkgYWN0aW9uIGlzIG92ZXIgbGltaXQgJHtSRVRSWV9PVkVSX0xJTUlUfWApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBbTWFpbiBsb2dpY11HZXQgQXNzb2NpYXRlZCB0b2tlbiBBY2NvdW50LlxuICAgICAqIGlmIG5vdCBjcmVhdGVkLCBjcmVhdGUgbmV3IHRva2VuIGFjY291aW50XG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1B1YmtleX0gbWludFxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBvd25lclxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBmZWVQYXllclxuICAgICAqIEByZXR1cm5zIFByb21pc2U8c3RyaW5nPlxuICAgICAqL1xuICAgIGV4cG9ydCBjb25zdCBt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QWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYXllciA/IG93bmVyIDogZmVlUGF5ZXI7XG5cbiAgICAgICAgY29uc3QgaW5zdCA9IGNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjdGlvbihcbiAgICAgICAgICBwYXllci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgICBBU1NPQ0lBVEVEX1RPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0LFxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH1cbn1cbiIsICJpbXBvcnQgeyBLZXlwYWlyIGFzIE9yaWdpbmFsLCBQdWJsaWNLZXkgfSBmcm9tICdAc29sYW5hL3dlYjMuanMnO1xuaW1wb3J0IHsgUHVia2V5LCBTZW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ZXIiLCAiUHJvcGVydGllcyIsICJDb252ZXJ0ZXIiLCAiVHJhbnNmZXJDaGVja2VkIiwgIkNvbnZlcnRlciIsICJUcmFuc2ZlciIsICJDb252ZXJ0ZXIiLCAiVmFsaWRhdG9yIiwgIk1lc3NhZ2UiLCAiQ29udmVydGVyIiwgIlB1YmxpY0tleSIsICJQdWJsaWNLZXkiLCAic2VuZEFuZENvbmZpcm1UcmFuc2FjdGlvbiIsICJUeCIsICJUeCIsICJzZW5kQW5kQ29uZmlybVRyYW5zYWN0aW9uIiwgInNlbmRBbmRDb25maXJtVHJhbnNhY3Rpb24iLCAiVHgiLCAiVHgiLCAiUHVibGljS2V5IiwgImJzIiwgIkFjY291bnQiLCAiS2V5cGFpciIsICJBY2NvdW50IiwgIkFzc29jaWF0ZWQiLCAiUHVibGljS2V5IiwgIkFjY291bnQiLCAiUGRhIiwgIkFjY291bnQiXQp9Cg== \ No newline at end of file diff --git a/packages/account/src/associated.ts b/packages/account/src/associated.ts index dd765ef7e..ea2bae1ff 100644 --- a/packages/account/src/associated.ts +++ b/packages/account/src/associated.ts @@ -1,7 +1,7 @@ import { TransactionInstruction } from '@solana/web3.js'; import { debugLog, sleep } from '~/shared'; import { Node } from '~/node'; -import { Transaction } from '~/transaction'; +import { StructTransaction, TransactionBuilder } from '~/transaction-builder'; import { Pubkey, Secret } from '~/types/account'; import { @@ -36,7 +36,7 @@ export namespace Account { owner: Pubkey, feePayer: Secret, allowOwnerOffCurve = false, - ): Promise => { + ): Promise => { const res = await makeOrCreateInstruction( mint, owner, @@ -48,7 +48,7 @@ export namespace Account { return res.tokenAccount; } - return new Transaction( + return new TransactionBuilder.Common( [res.inst], [], feePayer.toKeypair(), @@ -77,13 +77,13 @@ export namespace Account { if (inst && typeof inst === 'string') { debugLog('# associatedTokenAccount: ', inst); return inst; - } else if (inst instanceof Transaction) { + } else if (inst instanceof TransactionBuilder.Common) { (await inst.submit()).map( - async (ok) => { + async (ok: string) => { await Node.confirmedSig(ok); return inst.data as string; }, - (err) => { + (err: Error) => { debugLog('# Error submit retryGetOrCreate: ', err); throw err; }, diff --git a/packages/suite-spl-token/dist/index.d.mts b/packages/suite-spl-token/dist/index.d.mts index 140d67baf..a326f2c43 100644 --- a/packages/suite-spl-token/dist/index.d.mts +++ b/packages/suite-spl-token/dist/index.d.mts @@ -861,7 +861,19 @@ declare class Transaction { submit: () => Promise>; } -declare class MintTransaction { +interface StructPartialSignTransaction { + hexInstruction: string; + submit: (feePayer: Secret) => Promise>; +} +interface StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + submit: () => Promise>; +} + +declare class MintTransaction implements StructTransaction { instructions: TransactionInstruction[]; signers: Keypair[]; feePayer?: Keypair; @@ -870,7 +882,7 @@ declare class MintTransaction { submit: () => Promise>; } -declare class PartialSignTransaction { +declare class PartialSignTransaction implements StructPartialSignTransaction { hexInstruction: string; data?: Pubkey; canSubmit?: boolean; diff --git a/packages/suite-spl-token/dist/index.d.ts b/packages/suite-spl-token/dist/index.d.ts index 140d67baf..a326f2c43 100644 --- a/packages/suite-spl-token/dist/index.d.ts +++ b/packages/suite-spl-token/dist/index.d.ts @@ -861,7 +861,19 @@ declare class Transaction { submit: () => Promise>; } -declare class MintTransaction { +interface StructPartialSignTransaction { + hexInstruction: string; + submit: (feePayer: Secret) => Promise>; +} +interface StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + submit: () => Promise>; +} + +declare class MintTransaction implements StructTransaction { instructions: TransactionInstruction[]; signers: Keypair[]; feePayer?: Keypair; @@ -870,7 +882,7 @@ declare class MintTransaction { submit: () => Promise>; } -declare class PartialSignTransaction { +declare class PartialSignTransaction implements StructPartialSignTransaction { hexInstruction: string; data?: Pubkey; canSubmit?: boolean; diff --git a/packages/suite-spl-token/dist/index.js b/packages/suite-spl-token/dist/index.js index f3ec25531..7fd0996ec 100644 --- a/packages/suite-spl-token/dist/index.js +++ b/packages/suite-spl-token/dist/index.js @@ -607,8 +607,13 @@ Array.prototype.submit = async function(feePayer) { const errorMess = obj.error.message; throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); } else if (obj.canSubmit) { + console.log("# canSubmit", obj); await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); } else { + console.log("# transfer transaction start: ", obj); return await obj.submit(feePayer); } i++; @@ -2258,4 +2263,4 @@ var SplToken10 = { Validator, ValidatorError }); -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9hZGQudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9jb25zdGFudHMudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9yZXN1bHQudHMiLCAiLi4vLi4vc2hhcmVkL3NyYy9zaGFyZWQudHMiLCAiLi4vLi4vbm9kZS9zcmMvaW5kZXgudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL2JhdGNoLnRzIiwgIi4uLy4uL3RyYW5zYWN0aW9uL3NyYy9kZWZpbmUudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL2RlZmF1bHQudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL21pbnQudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL3BhcnRpYWwtc2lnbi50cyIsICIuLi8uLi9nbG9iYWwvc3JjL2luZGV4LnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL2Fzc29jaWF0ZWQudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMva2V5cGFpci50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9wZGEudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvaW5kZXgudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb2xsZWN0aW9uLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY3JlYXRvcnMudHMi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HtcbiAgICAgICAgICAgIChhd2FpdCBpbnN0LnN1Ym1pdCgpKS5tYXAoXG4gICAgICAgICAgICAgIGFzeW5jIChvaykgPT4ge1xuICAgICAgICAgICAgICAgIGF3YWl0IE5vZGUuY29uZmlybWVkU2lnKG9rKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5zdC5kYXRhIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIGRlYnVnTG9nKCcjIEVycm9yIHN1Ym1pdCByZXRyeUdldE9yQ3JlYXRlOiAnLCBlcnIpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgZGVidWdMb2coYCMgcmV0cnk6ICR7Y291bnRlcn0gY3JlYXRlIHRva2VuIGFjY291bnQ6IGAsIGUpO1xuICAgICAgICAgIGRlYnVnTG9nKGAjIG1pbnQ6ICR7bWludH0sIG93bmVyOiAke293bmVyfSwgZmVlUGF5ZXI6ICR7ZmVlUGF5ZXJ9YCk7XG4gICAgICAgIH1cbiAgICAgICAgYXdhaXQgc2xlZXAoUkVUUllfU0xFRVBfVElNRSk7XG4gICAgICAgIGNvdW50ZXIrKztcbiAgICAgIH1cbiAgICAgIHRocm93IEVycm9yKGByZXRyeSBhY3Rpb24gaXMgb3ZlciBsaW1pdCAke1JFVFJZX09WRVJfTElNSVR9YCk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFtNYWluIGxvZ2ljXUdldCBBc3NvY2lhdGVkIHRva2VuIEFjY291bnQuXG4gICAgICogaWYgbm90IGNyZWF0ZWQsIGNyZWF0ZSBuZXcgdG9rZW4gYWNjb3VpbnRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBtaW50XG4gICAgICogQHBhcmFtIHtQdWJrZXl9IG93bmVyXG4gICAgICogQHBhcmFtIHtQdWJrZXl9IGZlZVBheWVyXG4gICAgICogQHJldHVybnMgUHJvbWlzZTxzdHJpbmc+XG4gICAgICovXG4gICAgZXhwb3J0IGNvbnN0IG1ha2VPckNyZWF0ZUluc3RydWN0aW9uID0gYXN5bmMgKFxuICAgICAgbWludDogUHVia2V5LFxuICAgICAgb3duZXI6IFB1YmtleSxcbiAgICAgIGZlZVBheWVyPzogUHVia2V5LFxuICAgICAgYWxsb3dPd25lck9mZkN1cnZlID0gZmFsc2UsXG4gICAgKTogUHJvbWlzZTx7XG4gICAgICB0b2tlbkFjY291bnQ6IHN0cmluZztcbiAgICAgIGluc3Q6IFRyYW5zYWN0aW9uSW5zdHJ1Y3Rpb24gfCB1bmRlZmluZWQ7XG4gICAgfT4gPT4ge1xuICAgICAgY29uc3QgYXNzb2NpYXRlZFRva2VuQWNjb3VudCA9IGdldEFzc29jaWF0ZWRUb2tlbkFkZHJlc3NTeW5jKFxuICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgIGFsbG93T3duZXJPZmZDdXJ2ZSxcbiAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgKTtcblxuICAgICAgZGVidWdMb2coJyMgYXNzb2NpYXRlZFRva2VuQWNjb3VudDogJywgYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgLy8gRG9udCB1c2UgUmVzdWx0XG4gICAgICAgIGF3YWl0IGdldEFjY291bnQoXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKS5jb21taXRtZW50LFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdDogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgfSBjYXRjaCAoZXJyb3I6IHVua25vd24pIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkFjY291bnROb3RGb3VuZEVycm9yKSAmJlxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkludmFsaWRBY2NvdW50T3duZXJFcnJvcilcbiAgICAgICAgKSB7XG4gICAgICAgICAgdGhyb3cgRXJyb3IoJ1VuZXhwZWN0ZWQgZXJyb3InKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHBheWVyID0gIWZlZVBheWVyID8gb3duZXIgOiBmZWVQYXllcjtcblxuICAgICAgICBjb25zdCBpbnN0ID0gY3JlYXRlQXNzb2NpYXRlZFRva2VuQWNjb3VudEluc3RydWN0aW9uKFxuICAgICAgICAgIHBheWVyLnRvUHVibGljS2V5KCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgKTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3QsXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfTtcbiAgfVxufVxuIiwgImltcG9ydCB7I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JzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNSb3lhbHR5KG1ldGFkYXRhLnJveWFsdHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSAmJiBtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cykge1xuICAgICAgICAgICAgICByZXMgPSBpc1NlbGxlckZlZUJhc2lzUG9pbnRzKG1ldGFkYXRhLnNlbGxlcl9mZWVfYmFzaXNfcG9pbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlckZlZUJhc2lzUG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJGZWVCYXNpc1BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICduYW1lJzpcbiAgICAgICAgICAgIGlmIChtZXRhZGF0YS5uYW1lKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzTmFtZShtZXRhZGF0YS5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3N5bWJvbCc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEuc3ltYm9sKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU3ltYm9sKG1ldGFkYXRhLnN5bWJvbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzICYmIH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aW5nO1xuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgbWV0YWRhdGEgPSBhd2FpdCBNZXRhZGF0YS5mcm9tQWNjb3VudEFkZHJlc3MoXG4gICAgICAgICAgICBjb25uZWN0aW9uLFxuICAgICAgICAgICAgQWNjb3VudC5QZGEuZ2V0TWV0YWRhdGEobWludCksXG4gICAgICAgICAgKTtcbiAgICAgICAgICBkZWJ1Z0xvZygnIyBmaW5kQnlPd25lciBtZXRhZGF0YTogJywgbWV0YWRhdGEpO1xuICAgICAgICAgIC8vIHRva2VuU3RhbmRhcmQ6IDAoTkZUKSBvciAyIChTUEwtVE9LRU4pXG4gICAgICAgICAgaWYgKG1ldGFkYXRhLnRva2VuU3RhbmRhcmQgIT09IHRva2VuU3RhbmRhcmQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmZXRjaChtZXRhZGF0YS5kYXRhLnVyaSlcbiAgICAgICAgICAgIC50aGVuKChyZXNwb25zZSkgPT4ge1xuICAgICAgICAgICAgICByZXNwb25zZVxuICAgICAgICAgICAgICAgIC5qc29uKClcbiAgICAgICAgICAgICAgICAudGhlbigoanNvbjogT2ZmY2hhaW4pID0+IHtcbiAgICAgICAgICAgICAgICAgIGRhdGEucHVzaChcbiAgICAgICAgICAgICAgICAgICAgY29udmVydGVyPFQ+KHRva2VuU3RhbmRhcmQsIG1ldGFkYXRhLCBqc29uLCB0b2tlbkFtb3VudCksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0Lm9rKGRhdGEpKTsgLy8gbmVlZCB0aGlzIGNhbGwgP1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNhdGNoKChlKSA9PiB7XG4gICAgICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQuZXJyKGUpKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5maW5hbGx5KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGRlc2NBbGdvID0gc29ydEJ5VWluaXhUaW1lc3RhbXA8VD4oU29ydERpcmVjdGlvbi5EZXNjKTtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGFzY0FsZ28gPSBzb3J0QnlVaW5peFRpbWVzdGFtcDxUPihTb3J0RGlyZWN0aW9uLkFzYyk7XG4gICAgICAgICAgICAgICAgICBpZiAoc29ydGFibGUgPT09IFNvcnREaXJlY3Rpb24uRGVzYykge1xuICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5zb3J0KGRlc2NBbGdvKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc29ydGFibGUgPT09IFNvcnREaXJlY3Rpb24uQXNjKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEgPSBkYXRhLnNvcnQoYXNjQWxnbyk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQub2soZGF0YSkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4ge1xuICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQuZXJyKGUpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBFcnJvciAmJiBVTkFCTEVfRVJST1JfUkVHRVgudGVzdChlLm1lc3NhZ2UpKSB7XG4gICAgICAgICAgICBkZWJ1Z0xvZygnIyBza2lwIGVycm9yIGZvciBvbGQgU1BMLVRPS0VOOiAnLCBtaW50KTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIGlmIChlIGluc3RhbmNlb2YgRXJyb3IpIHtcbi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iAgICAgICAgbGFzdFZhbGlkQmxvY2tIZWlnaHQ6IGJsb2NraGFzaE9iai5sYXN0VmFsaWRCbG9ja0hlaWdodCxcbiAgICAgICAgYmxvY2toYXNoOiBibG9ja2hhc2hPYmouYmxvY2toYXNoLFxuICAgICAgICBmZWVQYXllcjogZmVlUGF5ZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgIH0pO1xuXG4gICAgICAvLyByZXR1cm4gYXNzb2NpYXRlZCB0b2tlbiBhY2NvdW50XG4gICAgICBpZiAoIWRlc3RUb2tlbi5pbnN0KSB7XG4gICAgICAgIGluc3QyID0gY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgc291cmNlVG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGRlc3RUb2tlbi50b2tlbkFjY291bnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIENhbGN1bGF0b3IuY2FsY3VsYXRlQW1vdW50KGFtb3VudCwgbWludERlY2ltYWwpLFxuICAgICAgICAgIG1pbnREZWNpbWFsLFxuICAgICAgICAgIGtleXBhaXJzLFxuICAgICAgICApO1xuICAgICAgICB0eC5hZGQoaW5zdDIpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gcmV0dXJuIGluc3RydWN0aW9uIGFuZCB1bmRlY2lkZWQgYXNzb2NpYXRlZCB0b2tlbiBhY2NvdW50XG4gICAgICAgIGluc3QyID0gY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgc291cmNlVG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGRlc3RUb2tlbi50b2tlbkFjY291bnQudG9QdWJsaWN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UFtb3VudCh0b3RhbEFtb3VudCwgbWludERlY2ltYWwpLFxuICAgICAgICBtaW50RGVjaW1hbCxcbiAgICAgICksXG4gICAgKTtcblxuICAgIGluc3RydWN0aW9ucy5wdXNoKFxuICAgICAgY3JlYXRlQ3JlYXRlTWV0YWRhdGFBY2NvdW50VjNJbnN0cnVjdGlvbihcbiAgICAgICAge1xuICAgICAgICAgIG1ldGFkYXRhOiBtZXRhZGF0YVBkYSxcbiAgICAgICAgICBtaW50LFxuICAgICAgICAgIG1pbnRBdXRob3JpdHk6IG93bmVyLFxuICAgICAgICAgIHBheWVyOiBmZWVQYXllcixcbiAgICAgICAgICB1cGRhdGVBdXRob3JpdHk6IG93bmVyLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgY3JlYXRlTWV0YWRhdGFBY2NvdW50QXJnc1YzOiB7XG4gICAgICAgICAgICBkYXRhOiB0b2tlbk1ldGFkYXRhLFxuICAgICAgICAgICAgaXNNdXRhYmxlLFxuICAgICAgICAgICAgY29sbGVjdGlvbkRldGFpbHM6IG51bGwsXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICksXG4gICAgKTtcbiAgICByZXR1cm4gaW5zdHJ1Y3Rpb25zO1xuICB9O1xuXG4gIC8qKlxuICAgKiBTUEwtVE9LRU4gbWludFxuICAgKlxuICAgKiBAcGFyYW0ge1B1YmtleX0gb3duZXIgICAgICAgLy8gdG9rZW4gb3duZXJcbiAgICogQHBhcmFtIHtTZWNyZXR9IHNpZ25lciAgICAgIC8vIHRva2VuIG93bmVyIFNlY3JldFxuICAgKiBAcGFyYW0ge251bWJlcn0gdG90YWxBbW91bnQgLy8gdG90YWwgbnVtYmVyXG4gICAqIEBwYXJhbSB7bnVtYmVyfSBtaW50RGVjaW1hbCAvLyB0b2tlbiBkZWNpbWFsXG4gICAqIEBwYXJhbSB7SW5wdXRUb2tlbk1ldGFkYXRhfSBpbnB1dCAgICAgICAvLyB0b2tlbiBtZXRhZGF0YV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1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRocm93IEVycm9yKGBNdXN0IHNldCBmaWxlUGF0aCcgb3IgJ3VyaSdgKTtcbiAgICAgIH1cblxuICAgICAgY29uc3QgaXNNdXRhYmxlID0gdHJ1ZTtcblxuICAgICAgY29uc3QgZGF0YXYyID0gQ29udmVydGVyLlRva2VuTWV0YWRhdGEuaW50b0luZnJhKFxuICAgICAgICBpbnB1dCxcbiAgICAgICAgdXJpLFxuICAgICAgICBzZWxsZXJGZWVCYXNpc1BvaW50cyxcbiAgICAgICk7XG5cbiAgICAgIGRlYnVnTG9nKCcjIGRhdGF2MjogJywgZGF0YXYyKTtcbiAgICAgIGRlYnVnTG9nKCcjIHVwbG9hZCBjb250ZW50IHVybDogJywgdXJpKTtcblxuICAgICAgY29uc3QgbWludCA9IEFjY291bnQuS2V5cGFpci5jcmVhdGUoKTtcbiAgICAgIGNvbnN0IGluc3RzID0gYXdhaXQgY3JlYXRlTWludChcbiAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICB0b3RhbEFtb3VudCxcbiAgICAgICAgbWludERlY2ltYWwsXG4gICAgICAgIGRhdGF2MixcbiAgICAgICAgcGF5ZXIudG9LZXlwYWlyKCkucHVibGljS2V5LFxuICAgICAgICBpc011dGFibGUsXG4gICAgICApO1xuXG4gICAgICAvLyBmcmVlemVBdXRob3JpdHlcbiAgICAgIGlmIChmcmVlemVBdXRob3JpdHkpIHtcbiAgICAgICAgaW5zdHMucHVzaChcbiAgICAgICAgICBjcmVhdGVGcmVlemVBdXRob3JpdHkoXG4gICAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICAgZnJlZXplQXV0aG9yaXR5LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgKSxcbiAgICAgICAgKTtcbiAgICAgIH1cblxuICAgIC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NvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiBhY2NvdW50OiBgLCBlKTtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyBtaW50OiAke21pbnR9LCBvd25lcjogJHtvd25lcn0sIGZlZVBheWVyOiAke2ZlZVBheWVyfWApO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKFJFVFJZX1NMRUVQX1RJTUUpO1xuICAgICAgICBjb3VudGVyKys7XG4gICAgICB9XG4gICAgICB0aHJvdyBFcnJvcihgcmV0cnkgYWN0aW9uIGlzIG92ZXIgbGltaXQgJHtSRVRSWV9PVkVSX0xJTUlUfWApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBbTWFpbiBsb2dpY11HZXQgQXNzb2NpYXRlZCB0b2tlbiBBY2NvdW50LlxuICAgICAqIGlmIG5vdCBjcmVhdGVkLCBjcmVhdGUgbmV3IHRva2VuIGFjY291aW50XG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1B1YmtleX0gbWludFxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBvd25lclxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBmZWVQYXllclxuICAgICAqIEByZXR1cm5zIFByb21pc2U8c3RyaW5nPlxuICAgICAqL1xuICAgIGV4cG9ydCBjb25zdC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VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYXllciA/IG93bmVyIDogZmVlUGF5ZXI7XG5cbiAgICAgICAgY29uc3QgaW5zdCA9IGNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjdGlvbihcbiAgICAgICAgICBwYXllci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgICBBU1NPQ0lBVEVEX1RPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0LFxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH1cbn1cbiIsICJpbXBvcnQgeyBLZXlwYWlyIGFzIE9yaWdpbmFsLCBQdWJsaWNLZXkgfSBmcm9tICdAc29sYW5hL3dlYjMuanMnO1xuaW1wb3J0IHsgUHVia2V5LCBT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YWx0eShtZXRhZGF0YS5yb3lhbHR5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlcyAmJiByZXMuaXNFcnIpIHtcbiAgICAgICAgICByZXN1bHRzLnB1c2goLi4ucmVzLmVycm9yLmRldGFpbHMpO1xuICAgICAgICB9XG4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U8dm9pZD4gPT4ge1xuICAgIHRyeSB7XG4gICAgICBsZXQgZGF0YTogVFtdID0gW107XG4gICAgICBjb25zdCBjb25uZWN0aW9uID0gTm9kZS5nZXRDb25uZWN0aW9uKCk7XG4gICAgICBjb25zdCBpbmZvID0gYXdhaXQgY29ubmVjdGlvbi5nZXRQYXJzZWRUb2tlbkFjY291bnRzQnlPd25lcihcbiAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAge1xuICAgICAgICAgIHByb2dyYW1JZDogVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgfSxcbiAgICAgICk7XG5cbiAgICAgIGluZm8udmFsdWUubGVuZ3RoID09PSAwICYmIGNhbGxiYWNrKFJlc3VsdC5vayhbXSkpO1xuXG4gICAgICBmb3IgYXdhaXQgKGNvbnN0IGQgb2YgaW5mby52YWx1ZSkge1xuICAgICAgICBpZiAoaXNIb2xkZXIgJiYgZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8udG9rZW5BbW91bnQudWlBbW91bnQgPCAxKSB7XG4gICAgICAgICAgZGVidWdMb2coXG4gICAgICAgICAgICAnIyBmaW5kQnlPd25lciBubyBob2xkIG1ldGFkYXRhOiAnLFxuICAgICAgICAgICAgZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8sXG4gICAgICAgICAgKTtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtaW50ID0gZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8ubWludCBhcyBQdWJrZXk7XG4gICAgICAgIGNvbnN0IHRva2VuQW1vdW50ID0gZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8udG9rZW5BbW91bnRcbiAgICAgICAgICAuYW1vdW50IGFzIHN0cmluZztcblxuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IG1ldGFkYXRhID0gYXdhaXQgTWV0YWRhdGEuZnJvbUFjY291bnRBZGRyZXNzKFxuICAgICAgICAgICAgY29ubmVjdGlvbixcbiAgICAgICAgICAgIEFjY291bnQuUGRhLmdldE1ldGFkYXRhKG1pbnQpLFxuICAgICAgICAgICk7XG4gICAgICAgICAgZGVidWdMb2coJyMgZmluZEJ5T3duZXIgbWV0YWRhdGE6ICcsIG1ldGFkYXRhKTtcbiAgICAgICAgICAvLyB0b2tlblN0YW5kYXJkOiAwKE5GVCkgb3IgMiAoU1BMLVRPS0VOKVxuICAgICAgICAgIGlmIChtZXRhZGF0YS50b2tlblN0YW5kYXJkICE9PSB0b2tlblN0YW5kYXJkKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmV0Y2gobWV0YWRhdGEuZGF0YS51cmkpXG4gICAgICAgICAgICAudGhlbigocmVzcG9uc2UpID0+IHtcbiAgICAgICAgICAgICAgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICAuanNvbigpXG4gICAgICAgICAgICAgICAgLnRoZW4oKGpzb246IE9mZmNoYWluKSA9PiB7XG4gICAgICAgICAgICAgICAgICBkYXRhLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIGNvbnZlcnRlcjxUPih0b2tlblN0YW5kYXJkLCBtZXRhZGF0YSwganNvbiwgdG9rZW5BbW91bnQpLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKFJlc3VsdC5vayhkYXRhKSk7IC8vIG5lZWQgdGhpcyBjYWxsID9cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0LmVycihlKSk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuZmluYWxseSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBkZXNjQWxnbyA9IHNvcnRCeVVpbml4VGltZXN0YW1wPFQ+KFNvcnREaXJlY3Rpb24uRGVzYyk7XG4gICAgICAgICAgICAgICAgICBjb25zdCBhc2NBbGdvID0gc29ydEJ5VWluaXhUaW1lc3RhbXA8VD4oU29ydERpcmVjdGlvbi5Bc2MpO1xuICAgICAgICAgICAgICAgICAgaWYgKHNvcnRhYmxlID09PSBTb3J0RGlyZWN0aW9uLkRlc2MpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGRhdGEuc29ydChkZXNjQWxnbyk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNvcnRhYmxlID09PSBTb3J0RGlyZWN0aW9uLkFzYykge1xuICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5zb3J0KGFzY0FsZ28pO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0Lm9rKGRhdGEpKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2F0Y2goKGUpID0+IHtcbiAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0LmVycihlKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgRXJyb3IgJiYgVU5BQkxFX0VSUk9SX1JFR0VYLnRlc3QoZS5tZXNzYWdlKSkge1xuICAgICAgICAgICAgZGVidWdMb2coJyMgc2tpcCBlcnJvciBmb3Igb2xkIFNQTC1UT0tFTjogJywgbWludCk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBpZiAoZSBpbnN0YW5jZW9mIEVycm9yKSB7XG4gICAgICAgIGNhbGxiYWNrKFJlc3VsdC5lcnIoZSkpO1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3QgZ2VuZXJpY0ZpbmRCeU1pbnQgPSBhc3luYyA8X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9IFtdO1xuXG4gICAgaW5zdHJ1Y3Rpb25zLnB1c2goXG4gICAgICBTeXN0ZW1Qcm9ncmFtLmNyZWF0ZUFjY291bnQoe1xuICAgICAgICBmcm9tUHVia2V5OiBmZWVQYXllcixcbiAgICAgICAgbmV3QWNjb3VudFB1YmtleTogbWludCxcbiAgICAgICAgc3BhY2U6IE1JTlRfU0laRSxcbiAgICAgICAgbGFtcG9ydHM6IGxhbXBvcnRzLFxuICAgICAgICBwcm9ncmFtSWQ6IFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICB9KSxcbiAgICApO1xuXG4gICAgaW5zdHJ1Y3Rpb25zLnB1c2goXG4gICAgICBjcmVhdGVJbml0aWFsaXplTWludEluc3RydWN0aW9uKFxuICAgICAgICBtaW50LFxuICAgICAgICBtaW50RGVjaW1hbCxcbiAgICAgICAgb3duZXIsXG4gICAgICAgIG93bmVyLFxuICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgKSxcbiAgICApO1xuXG4gICAgaW5zdHJ1Y3Rpb25zLnB1c2goXG4gICAgICBjcmVhdGVBc3NvY2lhdGVkVG9rZW5BY2NvdW50SW5zdHJ1Y3Rpb24oXG4gICAgICAgIGZlZVBheWVyLFxuICAgICAgICB0b2tlbkFzc29jaWF0ZWQsXG4gICAgICAgIG93bmVyLFxuICAgICAgICBtaW50LFxuICAgICAgKSxcbiAgICApO1xuXG4gICAgaW5zdHJ1Y3Rpb25zLnB1c2goXG4gICAgICBjcmVhdGVNaW50VG9DaGVja2VkSW5zdHJ1Y3Rpb24oXG4gICAgICAgIG1pbnQsXG4gICAgICAgIHRva2VuQXNzb2NpYXRlZCxcbiAgICAgICAgb3duZXIsXG4gICAgICAgIENhbGN1bGF0ZS5jYWxjdWxhdGVBbW91bnQodG90YWxBbW91bnQsIG1pbnREZWNpbWFsKSxcbiAgICAgICAgbWludERlY2ltYWwsXG4gICAgICApLFxuICAgICk7XG5cbiAgICBpbnN0cnVjdGlvbnMucHVzaChcbiA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biAgICAgIGNvbnN0IGlzTXV0YWJsZSA9IHRydWU7XG5cbiAgICAgIGNvbnN0IGRhdGF2MiA9IENvbnZlcnRlci5Ub2tlbk1ldGFkYXRhLmludG9JbmZyYShcbiAgICAgICAgaW5wdXQsXG4gICAgICAgIHVyaSxcbiAgICAgICAgc2VsbGVyRmVlQmFzaXNQb2ludHMsXG4gICAgICApO1xuXG4gICAgICBkZWJ1Z0xvZygnIyBkYXRhdjI6ICcsIGRhdGF2Mik7XG4gICAgICBkZWJ1Z0xvZygnIyB1cGxvYWQgY29udGVudCB1cmw6ICcsIHVyaSk7XG5cbiAgICAgIGNvbnN0IG1pbnQgPSBBY2NvdW50LktleXBhaXIuY3JlYXRlKCk7XG4gICAgICBjb25zdCBpbnN0cyA9IGF3YWl0IGNyZWF0ZU1pbnQoXG4gICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgdG90YWxBbW91bnQsXG4gICAgICAgIG1pbnREZWNpbWFsLFxuICAgICAgICBkYXRhdjIsXG4gICAgICAgIHBheWVyLnRvS2V5cGFpcigpLnB1YmxpY0tleSxcbiAgICAgICAgaXNNdXRhYmxlLFxuICAgICAgKTtcblxuICAgICAgLy8gZnJlZXplQXV0aG9yaXR5XG4gICAgICBpZiAoZnJlZXplQXV0aG9yaXR5KSB7XG4gICAgICAgIGluc3RzLnB1c2goXG4gICAgICAgICAgY3JlYXRlRnJlZXplQXV0aG9yaXR5KFxuICAgICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICAgIGZyZWV6ZUF1dGhvcml0eS50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICksXG4gICAgICAgICk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBuZXcgTWludFRyYW5zYWN0aW9uKFxuICAgICAgICBpbnN0cyxcbiAgICAgICAgW3Np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QiLCAiQ29udmVydGVyIiwgIlRyYW5zZmVyIiwgIkNvbnZlcnRlciIsICJWYWxpZGF0b3IiLCAiTWVzc2FnZSIsICJDb252ZXJ0ZXIiLCAiRmlsdGVyVHlwZSIsICJNb2R1bGVOYW1lIiwgIlNwbFRva2VuIiwgIlNwbFRva2VuIiwgImltcG9ydF9zcGxfdG9rZW4iLCAiU3BsVG9rZW4iLCAiaW1wb3J0X21wbF90b2tlbl9tZXRhZGF0YSIsICJpbXBvcnRfc3BsX3Rva2VuIiwgIlNwbFRva2VuIiwgIkNvbnZlcnRlciIsICJmZXRjaCIsICJpbXBvcnRfc3BsX3Rva2VuIiwgIlNwbFRva2VuIiwgImltcG9ydF9zcGxfdG9rZW4iLCAiaW1wb3J0X3dlYjMiLCAiU3BsVG9rZW4iLCAiaW1wb3J0X3dlYjMiLCAiaW1wb3J0X3NwbF90b2tlbiIsICJpbXBvcnRfbXBsX3Rva2VuX21ldGFkYXRhIiwgIlByb3ZlbmFuY2VMYXllciIsICJ1cGxvYWRGaWxlIiwgIklyeXMiLCAiQXJ3ZWF2ZSIsICJOZnRTdG9yYWdlIiwgIlN0b3JhZ2UiLCAiU3BsVG9rZW4iLCAibWludCIsICJDb252ZXJ0ZXIiLCAiaW1wb3J0X3NwbF90b2tlbiIsICJTcGxUb2tlbiIsICJpbXBvcnRfc3BsX3Rva2VuIiwgIlNwbFRva2VuIiwgIlNwbFRva2VuIl0KfQo= \ No newline at end of file diff --git a/packages/suite-spl-token/dist/index.mjs b/packages/suite-spl-token/dist/index.mjs index b64c95b90..5060e0c21 100644 --- a/packages/suite-spl-token/dist/index.mjs +++ b/packages/suite-spl-token/dist/index.mjs @@ -575,8 +575,13 @@ Array.prototype.submit = async function(feePayer) { const errorMess = obj.error.message; throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); } else if (obj.canSubmit) { + console.log("# canSubmit", obj); await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); } else { + console.log("# transfer transaction start: ", obj); return await obj.submit(feePayer); } i++; @@ -2262,4 +2267,4 @@ export { Validator, ValidatorError }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2FkZC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL2NvbnN0YW50cy50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3Jlc3VsdC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3NoYXJlZC50cyIsICIuLi8uLi9ub2RlL3NyYy9pbmRleC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvYmF0Y2gudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL2RlZmluZS50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvZGVmYXVsdC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvbWludC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvcGFydGlhbC1zaWduLnRzIiwgIi4uLy4uL2dsb2JhbC9zcmMvaW5kZXgudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvYXNzb2NpYXRlZC50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9rZXlwYWlyLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL3BkYS50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9pbmRleC50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NvbGxlY3Rpb24udHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jcmVhdG9ycy50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL3JveWFsdHkudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb21wcmVzc2VkLW5mdC1tZXRhZGF0YS50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL21lbW8udHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9taW50LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29sbGVjdGlvbi1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gICAgICAgfSBlbHNlIGlmIChpbnN0IGluc3RhbmNlb2YgVHJhbnNhY3Rpb24pIHtcbiAgICAgICAgICAgIChhd2FpdCBpbnN0LnN1Ym1pdCgpKS5tYXAoXG4gICAgICAgICAgICAgIGFzeW5jIChvaykgPT4ge1xuICAgICAgICAgICAgICAgIGF3YWl0IE5vZGUuY29uZmlybWVkU2lnKG9rKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5zdC5kYXRhIGFzIHN0cmluZztcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIGRlYnVnTG9nKCcjIEVycm9yIHN1Ym1pdCByZXRyeUdldE9yQ3JlYXRlOiAnLCBlcnIpO1xuICAgICAgICAgICAgICAgIHRocm93IGVycjtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgZGVidWdMb2coYCMgcmV0cnk6ICR7Y291bnRlcn0gY3JlYXRlIHRva2VuIGFjY291bnQ6IGAsIGUpO1xuICAgICAgICAgIGRlYnVnTG9nKGAjIG1pbnQ6ICR7bWludH0sIG93bmVyOiAke293bmVyfSwgZmVlUGF5ZXI6ICR7ZmVlUGF5ZXJ9YCk7XG4gICAgICAgIH1cbiAgICAgICAgYXdhaXQgc2xlZXAoUkVUUllfU0xFRVBfVElNRSk7XG4gICAgICAgIGNvdW50ZXIrKztcbiAgICAgIH1cbiAgICAgIHRocm93IEVycm9yKGByZXRyeSBhY3Rpb24gaXMgb3ZlciBsaW1pdCAke1JFVFJZX09WRVJfTElNSVR9YCk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFtNYWluIGxvZ2ljXUdldCBBc3NvY2lhdGVkIHRva2VuIEFjY291bnQuXG4gICAgICogaWYgbm90IGNyZWF0ZWQsIGNyZWF0ZSBuZXcgdG9rZW4gYWNjb3VpbnRcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBtaW50XG4gICAgICogQHBhcmFtIHtQdWJrZXl9IG93bmVyXG4gICAgICogQHBhcmFtIHtQdWJrZXl9IGZlZVBheWVyXG4gICAgICogQHJldHVybnMgUHJvbWlzZTxzdHJpbmc+XG4gICAgICovXG4gICAgZXhwb3J0IGNvbnN0IG1ha2VPckNyZWF0ZUluc3RydWN0aW9uID0gYXN5bmMgKFxuICAgICAgbWludDogUHVia2V5LFxuICAgICAgb3duZXI6IFB1YmtleSxcbiAgICAgIGZlZVBheWVyPzogUHVia2V5LFxuICAgICAgYWxsb3dPd25lck9mZkN1cnZlID0gZmFsc2UsXG4gICAgKTogUHJvbWlzZTx7XG4gICAgICB0b2tlbkFjY291bnQ6IHN0cmluZztcbiAgICAgIGluc3Q6IFRyYW5zYWN0aW9uSW5zdHJ1Y3Rpb24gfCB1bmRlZmluZWQ7XG4gICAgfT4gPT4ge1xuICAgICAgY29uc3QgYXNzb2NpYXRlZFRva2VuQWNjb3VudCA9IGdldEFzc29jaWF0ZWRUb2tlbkFkZHJlc3NTeW5jKFxuICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgIGFsbG93T3duZXJPZmZDdXJ2ZSxcbiAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgKTtcblxuICAgICAgZGVidWdMb2coJyMgYXNzb2NpYXRlZFRva2VuQWNjb3VudDogJywgYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgLy8gRG9udCB1c2UgUmVzdWx0XG4gICAgICAgIGF3YWl0IGdldEFjY291bnQoXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKS5jb21taXRtZW50LFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdDogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgfSBjYXRjaCAoZXJyb3I6IHVua25vd24pIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkFjY291bnROb3RGb3VuZEVycm9yKSAmJlxuICAgICAgICAgICEoZXJyb3IgaW5zdGFuY2VvZiBUb2tlbkludmFsaWRBY2NvdW50T3duZXJFcnJvcilcbiAgICAgICAgKSB7XG4gICAgICAgICAgdGhyb3cgRXJyb3IoJ1VuZXhwZWN0ZWQgZXJyb3InKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHBheWVyID0gIWZlZVBheWVyID8gb3duZXIgOiBmZWVQYXllcjtcblxuICAgICAgICBjb25zdCBpbnN0ID0gY3JlYXRlQXNzb2NpYXRlZFRva2VuQWNjb3VudEluc3RydWN0aW9uKFxuICAgICAgICAgIHBheWVyLnRvUHVibGljS2V5KCksXG4gICAgICAgICAgYXNzb2NpYXRlZFRva2VuQWNjb3VudCxcbiAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgKTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3QsXG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AgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdyb3lhbHR5JzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNSb3lhbHR5KG1ldGFkYXRhLnJveWFsdHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSAmJiBtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cykge1xuICAgICAgICAgICAgICByZXMgPSBpc1NlbGxlckZlZUJhc2lzUG9pbnRzKG1ldGFkYXRhLnNlbGxlcl9mZWVfYmFzaXNfcG9pbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlckZlZUJhc2lzUG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJGZWVCYXNpc1BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICduYW1lJzpcbiAgICAgICAgICAgIGlmIChtZXRhZGF0YS5uYW1lKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzTmFtZShtZXRhZGF0YS5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3N5bWJvbCc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEuc3ltYm9sKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU3ltYm9sKG1ldGFkYXRhLnN5bWJvbCk7XG4gICAgICAgICAgICB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wYXJzZWQuaW5mby50b2tlbkFtb3VudFxuICAgICAgICAgIC5hbW91bnQgYXMgc3RyaW5nO1xuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgbWV0YWRhdGEgPSBhd2FpdCBNZXRhZGF0YS5mcm9tQWNjb3VudEFkZHJlc3MoXG4gICAgICAgICAgICBjb25uZWN0aW9uLFxuICAgICAgICAgICAgQWNjb3VudC5QZGEuZ2V0TWV0YWRhdGEobWludCksXG4gICAgICAgICAgKTtcbiAgICAgICAgICBkZWJ1Z0xvZygnIyBmaW5kQnlPd25lciBtZXRhZGF0YTogJywgbWV0YWRhdGEpO1xuICAgICAgICAgIC8vIHRva2VuU3RhbmRhcmQ6IDAoTkZUKSBvciAyIChTUEwtVE9LRU4pXG4gICAgICAgICAgaWYgKG1ldGFkYXRhLnRva2VuU3RhbmRhcmQgIT09IHRva2VuU3RhbmRhcmQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBmZXRjaChtZXRhZGF0YS5kYXRhLnVyaSlcbiAgICAgICAgICAgIC50aGVuKChyZXNwb25zZSkgPT4ge1xuICAgICAgICAgICAgICByZXNwb25zZVxuICAgICAgICAgICAgICAgIC5qc29uKClcbiAgICAgICAgICAgICAgICAudGhlbigoanNvbjogT2ZmY2hhaW4pID0+IHtcbiAgICAgICAgICAgICAgICAgIGRhdGEucHVzaChcbiAgICAgICAgICAgICAgICAgICAgY29udmVydGVyPFQ+KHRva2VuU3RhbmRhcmQsIG1ldGFkYXRhLCBqc29uLCB0b2tlbkFtb3VudCksXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0Lm9rKGRhdGEpKTsgLy8gbmVlZCB0aGlzIGNhbGwgP1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNhdGNoKChlKSA9PiB7XG4gICAgICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQuZXJyKGUpKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5maW5hbGx5KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGRlc2NBbGdvID0gc29ydEJ5VWluaXhUaW1lc3RhbXA8VD4oU29ydERpcmVjdGlvbi5EZXNjKTtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGFzY0FsZ28gPSBzb3J0QnlVaW5peFRpbWVzdGFtcDxUPihTb3J0RGlyZWN0aW9uLkFzYyk7XG4gICAgICAgICAgICAgICAgICBpZiAoc29ydGFibGUgPT09IFNvcnREaXJlY3Rpb24uRGVzYykge1xuICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5zb3J0KGRlc2NBbGdvKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc29ydGFibGUgPT09IFNvcnREaXJlY3Rpb24uQXNjKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGEgPSBkYXRhLnNvcnQoYXNjQWxnbyk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQub2soZGF0YSkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4ge1xuICAgICAgICAgICAgICBjYWxsYmFjayhSZXN1bHQuZXJyKGUpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBFcnJvciAmJiBVTkFCTEVfRVJST1JfUkVHRVgudGVzdChlLm1lc3NhZ2UpKSB7XG4gICAgICAgICAgICBkZWJ1Z0xvZygnIyBza2lwIGVycm9yIGZvciBvbGQgU1BMLVRPS0VOOiAnLCBtaW50KTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gY2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NoKCk7XG5cbiAgICAgIGNvbnN0IHR4ID0gbmV3IFRyYW5zYWN0aW9uKHtcbiAgICAgICAgbGFzdFZhbGlkQmxvY2tIZWlnaHQ6IGJsb2NraGFzaE9iai5sYXN0VmFsaWRCbG9ja0hlaWdodCxcbiAgICAgICAgYmxvY2toYXNoOiBibG9ja2hhc2hPYmouYmxvY2toYXNoLFxuICAgICAgICBmZWVQYXllcjogZmVlUGF5ZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgIH0pO1xuXG4gICAgICAvLyByZXR1cm4gYXNzb2NpYXRlZCB0b2tlbiBhY2NvdW50XG4gICAgICBpZiAoIWRlc3RUb2tlbi5pbnN0KSB7XG4gICAgICAgIGluc3QyID0gY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgc291cmNlVG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGRlc3RUb2tlbi50b2tlbkFjY291bnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIENhbGN1bGF0b3IuY2FsY3VsYXRlQW1vdW50KGFtb3VudCwgbWludERlY2ltYWwpLFxuICAgICAgICAgIG1pbnREZWNpbWFsLFxuICAgICAgICAgIGtleXBhaXJzLFxuICAgICAgICApO1xuICAgICAgICB0eC5hZGQoaW5zdDIpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gcmV0dXJuIGluc3RydWN0aW9uIGFuZCB1bmRlY2lkZWQgYXNzb2NpYXRlZCB0b2tlbiBhY2NvdW50XG4gICAgICAgIGluc3QyID0gY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgc291cmNlVG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY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VkLFxuICAgICAgICBvd25lcixcbiAgICAgICAgQ2FsY3VsYXRlLmNhbGN1bGF0ZUFtb3VudCh0b3RhbEFtb3VudCwgbWludERlY2ltYWwpLFxuICAgICAgICBtaW50RGVjaW1hbCxcbiAgICAgICksXG4gICAgKTtcblxuICAgIGluc3RydWN0aW9ucy5wdXNoKFxuICAgICAgY3JlYXRlQ3JlYXRlTWV0YWRhdGFBY2NvdW50VjNJbnN0cnVjdGlvbihcbiAgICAgICAge1xuICAgICAgICAgIG1ldGFkYXRhOiBtZXRhZGF0YVBkYSxcbiAgICAgICAgICBtaW50LFxuICAgICAgICAgIG1pbnRBdXRob3JpdHk6IG93bmVyLFxuICAgICAgICAgIHBheWVyOiBmZWVQYXllcixcbiAgICAgICAgICB1cGRhdGVBdXRob3JpdHk6IG93bmVyLFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgY3JlYXRlTWV0YWRhdGFBY2NvdW50QXJnc1YzOiB7XG4gICAgICAgICAgICBkYXRhOiB0b2tlbk1ldGFkYXRhLFxuICAgICAgICAgICAgaXNNdXRhYmxlLFxuICAgICAgICAgICAgY29sbGVjdGlvbkRldGFpbHM6IG51bGwsXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICksXG4gICAgKTtcbiAgICByZXR1cm4gaW5zdHJ1Y3Rpb25zO1xuICB9O1xuXG4gIC8qKlxuICAgKiBTUEwtVE9LRU4gbWludFxuICAgKlxuICAgKiBAcGFyYW0ge1B1YmtleX0gb3duZXIgICAgICAgLy8gdG9rZW4gb3duZXJcbiAgICogQHBhcmFtIHtTZWNyZXR9IHNpZ25lciAgICAgIC8vIHRva2VuIG93bmVyIFNlY3JldFxuICAgKiBAcGFyYW0ge251bWJlcn0gdG90YWxBbW91bnQgLy8gdG90YWwgbnVtYmVyXG4gICAqIEBwYXJhbSB7bnVtYmVyfSBtaW50RGVjaW1hbCAvLyB0b2tlbiBkZWNpbWFsXG4gICAqIEBwYXJhbSB7SW5wdX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1cGxvYWRlZDtcbiAgICAgICAgfVxuICAgICAgICB1cmkgPSB1cGxvYWRlZC52YWx1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRocm93IEVycm9yKGBNdXN0IHNldCBmaWxlUGF0aCcgb3IgJ3VyaSdgKTtcbiAgICAgIH1cblxuICAgICAgY29uc3QgaXNNdXRhYmxlID0gdHJ1ZTtcblxuICAgICAgY29uc3QgZGF0YXYyID0gQ29udmVydGVyLlRva2VuTWV0YWRhdGEuaW50b0luZnJhKFxuICAgICAgICBpbnB1dCxcbiAgICAgICAgdXJpLFxuICAgICAgICBzZWxsZXJGZWVCYXNpc1BvaW50cyxcbiAgICAgICk7XG5cbiAgICAgIGRlYnVnTG9nKCcjIGRhdGF2MjogJywgZGF0YXYyKTtcbiAgICAgIGRlYnVnTG9nKCcjIHVwbG9hZCBjb250ZW50IHVybDogJywgdXJpKTtcblxuICAgICAgY29uc3QgbWludCA9IEFjY291bnQuS2V5cGFpci5jcmVhdGUoKTtcbiAgICAgIGNvbnN0IGluc3RzID0gYXdhaXQgY3JlYXRlTWludChcbiAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICB0b3RhbEFtb3VudCxcbiAgICAgICAgbWludERlY2ltYWwsXG4gICAgICAgIGRhdGF2MixcbiAgICAgICAgcGF5ZXIudG9LZXlwYWlyKCkucHVibGljS2V5LFxuICAgICAgICBpc011dGFibGUsXG4gICAgICApO1xuXG4gICAgICAvLyBmcmVlemVBdXRob3JpdHlcbiAgICAgIGlmIChmcmVlemVBdXRob3JpdHkpIHtcbiAgICAgICAgaW5zdHMucHVzaChcbiAgICAgICAgICBjcmVhdGVGcmVlemVBdXRob3JpdHkoXG4gICAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICAgZnJlZXplQXV0aG9yaXR5LnRvUHVib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0lEIiwgImNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjdGlvbiIsICJjcmVhdGVNaW50VG9DaGVja2VkSW5zdHJ1Y3Rpb24iLCAiQ29udmVydGVyIiwgImdldEFzc29jaWF0ZWRUb2tlbkFkZHJlc3NTeW5jIiwgIlNwbFRva2VuIiwgImNyZWF0ZVRyYW5zZmVyQ2hlY2tlZEluc3RydWN0aW9uIiwgIlNwbFRva2VuIiwgImNyZWF0ZVRyYW5zZmVyQ2hlY2tlZEluc3RydWN0aW9uIiwgIlNwbFRva2VuIl0KfQo= \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2FkZC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL2NvbnN0YW50cy50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3Jlc3VsdC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3NoYXJlZC50cyIsICIuLi8uLi9ub2RlL3NyYy9pbmRleC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvYmF0Y2gudHMiLCAiLi4vLi4vdHJhbnNhY3Rpb24vc3JjL2RlZmluZS50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvZGVmYXVsdC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvbWludC50cyIsICIuLi8uLi90cmFuc2FjdGlvbi9zcmMvcGFydGlhbC1zaWduLnRzIiwgIi4uLy4uL2dsb2JhbC9zcmMvaW5kZXgudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvYXNzb2NpYXRlZC50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9rZXlwYWlyLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL3BkYS50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9pbmRleC50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NvbGxlY3Rpb24udHMiLCAiLi4vLi4vY29udm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d2l0Y2hCdW5kbHIgPSAoZW52OiBzdHJpbmcpOiBzdHJpbmcgPT4ge1xuICAgIHN3aXRjaCAoZW52KSB7XG4gICAgICBjYXNlIENvbnN0YW50cy5DbHVzdGVyLnByZDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkJ1bmRsclVybC5wcmQuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgcmV0dXJuIENvbnN0YW50cy5CdW5kbHJVcmwuZGV2O1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3Qgc3dpdGNoRGFzQXBpID0gKGVudjogc3RyaW5nKTogc3RyaW5nID0+IHtcbiAgICBzd2l0Y2ggKGVudikge1xuICAgICAgY2FzZSBDb25zdGFudHMuQ2x1c3Rlci5wcmQ6XG4gICAgICAgIGlmIChkYXNBcGlVcmwubGVuZ3RoIDwgMSkge1xuICAgICAgICAgIHRocm93IEVycm9yKENvbnN0YW50cy5XYXJubmluZ01lc3NhZ2UuREFTX0FQSV9VUkwpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHVybHMgPSBDb25zdGFudHMuQnVuZGxyVXJsLnByZC5zcGxpdCgnLCcpO1xuICAgICAgICBjb25zdCBpbmRleCA9IERhdGUubm93KCkgJSB1cmxzLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHVybHNbaW5kZXhdO1xuICAgICAgZGVmYXVsdDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkRhc0FwaVVybC5kZXYuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgI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dHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiBhY2NvdW50OiBgLCBlKTtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyBtaW50OiAke21pbnR9LCBvd25lcjogJHtvd25lcn0sIGZlZVBheWVyOiAke2ZlZVBheWVyfWApO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKFJFVFJZX1NMRUVQX1RJTUUpO1xuICAgICAgICBjb3VudGVyKys7XG4gICAgICB9XG4gICAgICB0aHJvdyBFcnJvcihgcmV0cnkgYWN0aW9uIGlzIG92ZXIgbGltaXQgJHtSRVRSWV9PVkVSX0xJTUlUfWApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBbTWFpbiBsb2dpY11HZXQgQXNzb2NpYXRlZCB0b2tlbiBBY2NvdW50LlxuICAgICAqIGlmIG5vdCBjcmVhdGVkLCBjcmVhdGUgbmV3IHRva2VuIGFjY291aW50XG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1B1YmtleX0gbWludFxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBvd25lclxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBmZWVQYXllclxuICAgICAqIEByZXR1cm5zIFByb21pc2U8c3RyaW5nPlxuICAgICAqL1xuICAgIGV4cG9ydCBjb25zdCBtYWtlT3JDcmVhdGVJbnN0cnVjdGlvbiA9IGFzeW5jIChcbiAgICAgIG1pbnQ6IFB1YmtleSxcbiAgICAgIG93bmVyOiBQdWJrZXksXG4gICAgICBmZWVQYXllcj86IFB1YmtleSxcbiAgICAgIGFsbG93T3duZXJPZmZDdXJ2ZSA9IGZhbHNlLFxuICAgICk6IFByb21pc2U8e1xuICAgICAgdG9rZW5BY2NvdW50OiBzdHJpbmc7XG4gICAgICBpbnN0OiBUcmFuc2FjdGlvbkluc3RydWN0aW9uIHwgdW5kZWZpbmVkO1xuICAgIH0+ID0+IHtcbiAgICAgIGNvbnN0IGFzc29jaWF0ZWRUb2tlbkFjY291bnQgPSBnZXRBc3NvY2lhdGVkVG9rZW5BZGRyZXNzU3luYyhcbiAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICBhbGxvd093bmVyT2ZmQ3VydmUsXG4gICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICk7XG5cbiAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSk7XG5cbiAgICAgIHRyeSB7XG4gICAgICAgIC8vIERvbnQgdXNlIFJlc3VsdFxuICAgICAgICBhd2FpdCBnZXRBY2NvdW50KFxuICAgICAgICAgIE5vZGUuZ2V0Q29ubmVjdGlvbigpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCkuY29tbWl0bWVudCxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYXllciA/IG93bmVyIDogZmVlUGF5ZXI7XG5cbiAgICAgICAgY29uc3QgaW5zdCA9IGNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjdGlvbihcbiAgICAgICAgICBwYXllci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgICBBU1NPQ0lBVEVEX1RPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0LFxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH1cbn1cbiIsICJpbXBvcnQgeyBLZXlwYWlyIGFzIE9yaWdpbmFsLCBQdWJsaWNLZXkgfSBmcm9tICdAc29sYW5hL3dlYjMuanMnO1xuaW1wb3J0IHsgUHVia2V5LCBTZWNyZXQgfSBmcm9tICd+L3R5cGVzL2FjY291bnQnO1xuaW1wb3J0IGJzIGZyb20gJ2JzNT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JbmZyYSA9IChcbiAgICAgIGlucHV0OiBPcHRpb248SW5wdXRDcmVhdG9yc1tdPiB8IHVuZGVmaW5lZCxcbiAgICApOiBPcHRpb248SW50ZXJuYWxDcmVhdG9yc1tdPiA9PiB7XG4gICAgICBpZiAoIWlucHV0KSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGlucHV0Lm1hcCgoZGF0YSkgPT4ge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZHJlc3M6IGRhdGEuYWRkcmVzcy50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIHNoYXJlOiBkYXRhLnNoYXJlLFxuICAgICAgICAgIHZlcmlmaWVkOiBmYWxzZSxcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBleHBvcnQgY29uc3QgaW50b0NvbXByZXNzZWROZnRJbmZyYSA9IChcbiAgICAgIGlucHV0OiBPcHRpb248SW5wdXRDcmVhdG9yc1tdPiB8IHVuZGVmaW5lZCxcbiAgICApOiBJbnRlcm5hbENyZWF0b3JzW10gPT4ge1xuICAgICAgaWYgKCFpbnB1dCkge1xuICAgICAgICByZXR1cm4gW107XG4gICAgICB9XG4gICAgICByZXR1cm4gaW5wdXQhLm1hcCgoZGF0YSkgPT4ge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZHJlc3M6IGRhdGEuYWRkcmVzcy50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIHNoYXJlOiBkYXRhLnNoYXJlLFxuICAgICAgICAgIHZlcmlmaWVkOiBmYWxzZSxcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBleHBvcnQgY29uc3QgaW50b1VzZXIgPSAoXG4gICAgICBvdXRwdXQ6IE9wdGlvbjxJbnRlcm5hbENyZWF0b3JzW10+LFxuICAgICk6IENyZWF0b3JzW10gfCB1bmRlZmluZWQgPT4ge1xuICAgICAgaWYgKCFvdXRwdXQ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kZWZpbmVkLFxuICAgICAgY2FsbGJhY2tGdW5jOiAoXG4gICAgICAgIGZpbGVQYXRoOiBGaWxlVHlwZSxcbiAgICAgICAgc3RvcmFnZVR5cGU6IFN0b3JhZ2VUeXBlLFxuICAgICAgICBmZWVQYXllcj86IFNlY3JldCxcbiAgICAgICkgPT4gUHJvbWlzZTxSZXN1bHQ8c3RyaW5nLCBFcnJvcj4+LFxuICAgICAgc3RvcmFnZVR5cGU6IFN0b3JhZ2VUeXBlLFxuICAgICAgZmVlUGF5ZXI/OiBTZWNyZXQsXG4gICAgKTogUHJvbWlzZTxQcm9wZXJ0aWVzPiA9PiB7XG4gICAgICBpZiAoIWlucHV0IHx8ICFpbnB1dC5maWxlcykge1xuICAgICAgICByZXR1cm4ge307XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGZpbGVzID0gYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgIGlucHV0LmZpbGVzLm1hcChhc3luYyAoZmlsZSkgPT4ge1xuICAgICAgICAgIGlmICghZmlsZS5maWxlUGF0aCkge1xuICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCBjYWxsYmFja0Z1bmMoZmlsZS5maWxlUGF0aCwgc3RvcmFnZVR5cGUsIGZlZVBheWVyKTtcbiAgICAgICAgICBpZiAocmVzLmlzRXJyKSB7XG4gICAgICAgICAgICB0aHJvdyBFcnJvcihyZXMuZXJyb3IubWVzc2FnZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBvdmVyd3JpdGVPYmplY3QoZmlsZSwgW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBleGlzdHNLZXk6ICdmaWxlUGF0aCcsXG4gICAgICAgICAgICAgIHdpbGw6IHsga2V5OiAndXJpJywgdmFsdWU6IHJlcy52YWx1ZSB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICBdKTtcbiAgICAgICAgfSksXG4gICAg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FrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlcyAmJiByZXMuaXNFcnIpIHtcbiAgICAgICAgICByZXN1bHRzLnB1c2goLi4ucmVzLmVycm9yLmRldGFpbHMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgY29uc3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Bjb25zdCBjb25uZWN0aW9uID0gTm9kZS5nZXRDb25uZWN0aW9uKCk7XG4gICAgICBjb25zdCBpbmZvID0gYXdhaXQgY29ubmVjdGlvbi5nZXRQYXJzZWRUb2tlbkFjY291bnRzQnlPd25lcihcbiAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAge1xuICAgICAgICAgIHByb2dyYW1JZDogVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgfSxcbiAgICAgICk7XG5cbiAgICAgIGluZm8udmFsdWUubGVuZ3RoID09PSAwICYmIGNhbGxiYWNrKFJlc3VsdC5vayhbXSkpO1xuXG4gICAgICBmb3IgYXdhaXQgKGNvbnN0IGQgb2YgaW5mby52YWx1ZSkge1xuICAgICAgICBpZiAoaXNIb2xkZXIgJiYgZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8udG9rZW5BbW91bnQudWlBbW91bnQgPCAxKSB7XG4gICAgICAgICAgZGVidWdMb2coXG4gICAgICAgICAgICAnIyBmaW5kQnlPd25lciBubyBob2xkIG1ldGFkYXRhOiAnLFxuICAgICAgICAgICAgZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8sXG4gICAgICAgICAgKTtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtaW50ID0gZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8ubWludCBhcyBQdWJrZXk7XG4gICAgICAgIGNvbnN0IHRva2VuQW1vdW50ID0gZC5hY2NvdW50LmRhdGEucGFyc2VkLmluZm8udG9rZW5BbW91bnRcbiAgICAgICAgICAuYW1vdW50IGFzIHN0cmluZztcblxuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IG1ldGFkYXRhID0gYXdhaXQgTWV0YWRhdGEuZnJvbUFjY291bnRBZGRyZXNzKFxuICAgICAgICAgICAgY29ubmVjdGlvbixcbiAgICAgICAgICAgIEFjY291bnQuUGRhLmdldE1ldGFkYXRhKG1pbnQpLFxuICAgICAgICAgICk7XG4gICAgICAgICAgZGVidWdMb2coJyMgZmluZEJ5T3duZXIgbWV0YWRhdGE6ICcsIG1ldGFkYXRhKTtcbiAgICAgICAgICAvLyB0b2tlblN0YW5kYXJkOiAwKE5GVCkgb3IgMiAoU1BMLVRPS0VOKVxuICAgICAgICAgIGlmIChtZXRhZGF0YS50b2tlblN0YW5kYXJkICE9PSB0b2tlblN0YW5kYXJkKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgZmV0Y2gobWV0YWRhdGEuZGF0YS51cmkpXG4gICAgICAgICAgICAudGhlbigocmVzcG9uc2UpID0+IHtcbiAgICAgICAgICAgICAgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICAuanNvbigpXG4gICAgICAgICAgICAgICAgLnRoZW4oKGpzb246IE9mZmNoYWluKSA9PiB7XG4gICAgICAgICAgICAgICAgICBkYXRhLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIGNvbnZlcnRlcjxUPih0b2tlblN0YW5kYXJkLCBtZXRhZGF0YSwganNvbiwgdG9rZW5BbW91bnQpLFxuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKFJlc3VsdC5vayhkYXRhKSk7IC8vIG5lZWQgdGhpcyBjYWxsID9cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5jYXRjaCgoZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0LmVycihlKSk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuZmluYWxseSgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBkZXNjQWxnbyA9IHNvcnRCeVVpbml4VGltZXN0YW1wPFQ+KFNvcnREaXJlY3Rpb24uRGVzYyk7XG4gICAgICAgICAgICAgICAgICBjb25zdCBhc2NBbGdvID0gc29ydEJ5VWluaXhUaW1lc3RhbXA8VD4oU29ydERpcmVjdGlvbi5Bc2MpO1xuICAgICAgICAgICAgICAgICAgaWYgKHNvcnRhYmxlID09PSBTb3J0RGlyZWN0aW9uLkRlc2MpIHtcbiAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGRhdGEuc29ydChkZXNjQWxnbyk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNvcnRhYmxlID09PSBTb3J0RGlyZWN0aW9uLkFzYykge1xuICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS5zb3J0KGFzY0FsZ28pO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0Lm9rKGRhdGEpKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2F0Y2goKGUpID0+IHtcbiAgICAgICAgICAgICAgY2FsbGJhY2soUmVzdWx0LmVycihlKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgRXJyb3IgJiYgVU5BQkxFX0VSUk9SX1JFR0VYLnRlc3QoZS5tZXNzYWdlKSkge1xuICAgICAgICAgICAgZGVidWdMb2coJyMgc2tpcCBlcnJvciBmb3Igb2xkIFNQTC1UT0tFTjogJywgbWludCk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBpZiAoZSBpbnN0YW5jZW9mIEVycm9yKSB7XG4gICAgICAgIGNhbGxiYWNrKFJlc3VsdC5lcnIoZSkpO1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3QgZ2VuZXJpY0ZpbmRCeU1pbnQgPSBhc3luYyA8XG4gICAgVCBleHRlbmRzIFJlZ3VsYXJOZnRNZXRhZGF0YSB8IFRva2VuTWV0YWRhdGEsXG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xuICAgICAgLy8gcmV0dXJuIGFzc29jaWF0ZWQgdG9rZW4gYWNjb3VudFxuICAgICAgaWYgKCFkZXN0VG9rZW4uaW5zdCkge1xuICAgICAgICBpbnN0MiA9IGNyZWF0ZVRyYW5zZmVyQ2hlY2tlZEluc3RydWN0aW9uKFxuICAgICAgICAgIHNvdXJjZVRva2VuLnRva2VuQWNjb3VudC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBkZXN0VG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBDYWxjdWxhdG9yLmNhbGN1bGF0ZUFtb3VudChhbW91bnQsIG1pbnREZWNpbWFsKSxcbiAgICAgICAgICBtaW50RGVjaW1hbCxcbiAgICAgICAgICBrZXlwYWlycyxcbiAgICAgICAgKTtcbiAgICAgICAgdHguYWRkKGluc3QyKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIHJldHVybiBpbnN0cnVjdGlvbiBhbmQgdW5kZWNpZGVkIGFzc29jaWF0ZWQgdG9rZW4gYWNjb3VudFxuICAgICAgICBpbnN0MiA9IGNyZWF0ZVRyYW5zZmVyQ2hlY2tlZEluc3RydWN0aW9uKFxuICAgICAgICAgIHNvdXJjZVRva2VuLnRva2VuQWNjb3VudC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBkZXN0VG9rZW4udG9rZW5BY2NvdW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBDYWxjdWxhdG9yLmNhbGN1bGF0ZUFtb3VudChhbW91bnQsIG1pbnREZWNpbWFsKSxcbiAgICAgICAgICBtaW50RGVjaW1hbCxcbiAgICAgICAgICBrZXlwYWlycyxcbiAgICAgICAgKTtcbi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ICAgICAgIHtcbiAgICAgICAgICBtZXRhZGF0YTogbWV0YWRhdGFQZGEsXG4gICAgICAgICAgbWludCxcbiAgICAgICAgICBtaW50QXV0aG9yaXR5OiBvd25lcixcbiAgICAgICAgICBwYXllcjogZmVlUGF5ZXIsXG4gICAgICAgICAgdXBkYXRlQXV0aG9yaXR5OiBvd25lcixcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIGNyZWF0ZU1ldGFkYXRhQWNjb3VudEFyZ3NWMzoge1xuICAgICAgICAgICAgZGF0YTogdG9rZW5NZXRhZGF0YSxcbiAgICAgICAgICAgIGlzTXV0YWJsZSxcbiAgICAgICAgICAgIGNvbGxlY3Rpb25EZXRhaWxzOiBudWxsLFxuICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICApLFxuICAgICk7XG4gICAgcmV0dXJuIGluc3RydWN0aW9ucztcbiAgfTtcblxuICAvKipcbiAgICogU1BMLVRPS0VOIG1pbnRcbiAgICpcbiAgICogQHBhcmFtIHtQdWJrZXl9IG93bmVyICAgICAgIC8vIHRva2VuIG93bmVyXG4gICAqIEBwYXJhbSB7U2VjcmV0fSBzaWduZXIgICAgICAvLyB0b2tlbiBvd25lciBTZWNyZXRcbiAgICogQHBhcmFtIHtudW1iZXJ9IHRvdGFsQW1vdW50IC8vIHRvdGFsIG51bWJlclxuICAgKiBAcGFyYW0ge251bWJlcn0gbWludERlY2ltYWwgLy8gdG9rZW4gZGVjaW1hbFxuICAgKiBAcGFyYW0ge0lucHV0VG9rZW5NZXRhZGF0YX0gaW5wdXQgICAgICAgLy8gdG9rZW4gbWV0YWRhdGFcbiAgICogQHBhcmFtIHtQYXJ0aWFsPE1pbnRPcHRpb25zPn0gb3B0aW9ucyAgIC8vIG9wdGlvbnNcbiAgICogQHJldHVybiBQcm9taXNlPFJlc3VsdDxNaW50SW5zdHJ1Y3Rpb24sIEVycm9yPj5cbiAgICovXG4gIGV4cG9ydCBjb25zdCBtaW50ID0gYXN5bmMgK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A9IENvbnZlcnRlci5Ub2tlbk1ldGFkYXRhLmludG9JbmZyYShcbiAgICAgICAgaW5wdXQsXG4gICAgICAgIHVyaSxcbiAgICAgICAgc2VsbGVyRmVlQmFzaXNQb2ludHMsXG4gICAgICApO1xuXG4gICAgICBkZWJ1Z0xvZygnIyBkYXRhdjI6ICcsIGRhdGF2Mik7XG4gICAgICBkZWJ1Z0xvZygnIyB1cGxvYWQgY29udGVudCB1cmw6ICcsIHVyaSk7XG5cbiAgICAgIGNvbnN0IG1pbnQgPSBBY2NvdW50LktleXBhaXIuY3JlYXRlKCk7XG4gICAgICBjb25zdCBpbnN0cyA9IGF3YWl0IGNyZWF0ZU1pbnQoXG4gICAgICAgIG1pbnQudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgdG90YWxBbW91bnQsXG4gICAgICAgIG1pbnREZWNpbWFsLFxuICAgICAgICBkYXRhdjIsXG4gICAgICAgIHBheWVyLnRvS2V5cGFpcigpLnB1YmxpY0tleSxcbiAgICAgICAgaXNNdXRhYmxlLFxuICAgICAgKTtcblxuICAgICAgLy8gZnJlZXplQXV0aG9yaXR5XG4gICAgICBpZiAoZnJlZXplQXV0aG9yaXR5KSB7XG4gICAgICAgIGluc3RzLnB1c2goXG4gICAgICAgICAgY3JlYXRlRnJlZXplQXV0aG9yaXR5KFxuICAgICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICAgIGZyZWV6ZUF1dGhvcml0eS50b1B1YmxpY0tleSgpLFxuICAgICAgICAgICksXG4gICAgICAgICk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBuZXcgTWludFRyYW5zYWN0aW9uKFxuICAgICAgICBpbnN0cyxcbiAgICAgICAgW3NpZ25lci50b0tleXBhaXIoKSwgbWludC50b0tleXBhaXIoKV0sXG4gICAgICAgIHBheWVyLnRvS2V5c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jb3VudEluc3RydWN0aW9uIiwgImNyZWF0ZU1pbnRUb0NoZWNrZWRJbnN0cnVjdGlvbiIsICJDb252ZXJ0ZXIiLCAiZ2V0QXNzb2NpYXRlZFRva2VuQWRkcmVzc1N5bmMiLCAiU3BsVG9rZW4iLCAiY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24iLCAiU3BsVG9rZW4iLCAiY3JlYXRlVHJhbnNmZXJDaGVja2VkSW5zdHJ1Y3Rpb24iLCAiU3BsVG9rZW4iXQp9Cg== \ No newline at end of file diff --git a/packages/transaction/dist/index.d.mts b/packages/transaction-builder/dist/index.d.mts similarity index 81% rename from packages/transaction/dist/index.d.mts rename to packages/transaction-builder/dist/index.d.mts index d0f42518d..08a2aaeba 100644 --- a/packages/transaction/dist/index.d.mts +++ b/packages/transaction-builder/dist/index.d.mts @@ -1,4 +1,5 @@ -import { TransactionSignature, PublicKey, Keypair, TransactionInstruction } from '@solana/web3.js'; +import * as _solana_web3_js from '@solana/web3.js'; +import { TransactionSignature, PublicKey, Keypair, TransactionInstruction, Transaction } from '@solana/web3.js'; declare abstract class AbstractResult { protected abstract _chain(ok: (value: T) => Result, err: (error: E) => Result): Result; @@ -241,34 +242,68 @@ type ExplorerOptions = { replacePath: string; }; -declare class Transaction { +interface StructPartialSignTransaction { + hexInstruction: string; + submit: (feePayer: Secret) => Promise>; +} +interface StructTransaction { instructions: TransactionInstruction[]; signers: Keypair[]; feePayer?: Keypair; data?: unknown; - constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: unknown); submit: () => Promise>; } +declare namespace TransactionBuilder$4 { + class Common implements StructTransaction { + static MAX_TRANSACTION_SIZE: number; + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: unknown); + submit: () => Promise>; + } + /** + * @param tx a solana transaction + * @param feePayer the publicKey of the signer + * @returns size in bytes of the transaction + */ + const getTxSize: (tx: Transaction, feePayer: PublicKey) => number; +} -declare class BatchTransaction { - submit: (arr: Transaction[]) => Promise; +declare namespace TransactionBuilder$3 { + class BatchTransaction { + submit: (arr: TransactionBuilder$4.Common[]) => Promise; + } } -declare class MintTransaction { - instructions: TransactionInstruction[]; - signers: Keypair[]; - feePayer?: Keypair; - data?: T; - constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: T); - submit: () => Promise>; +declare namespace TransactionBuilder$2 { + class Mint implements StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: T; + constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: T); + submit: () => Promise>; + } } -declare class PartialSignTransaction { - hexInstruction: string; - data?: Pubkey; - canSubmit?: boolean; - constructor(instructions: string, mint?: Pubkey, canSubmit?: boolean); - submit: (feePayer: Secret) => Promise>; +declare namespace TransactionBuilder$1 { + class PartialSignTransaction implements StructPartialSignTransaction { + hexInstruction: string; + data?: Pubkey; + canSubmit?: boolean; + constructor(instructions: string, mint?: Pubkey, canSubmit?: boolean); + submit: (feePayer: Secret) => Promise>; + } } -export { BatchTransaction, MintTransaction, PartialSignTransaction, Transaction }; +declare const TransactionBuilder: { + PartialSignTransaction: typeof TransactionBuilder$1.PartialSignTransaction; + Common: typeof TransactionBuilder$4.Common; + getTxSize: (tx: _solana_web3_js.Transaction, feePayer: _solana_web3_js.PublicKey) => number; + Mint: typeof TransactionBuilder$2.Mint; + BatchTransaction: typeof TransactionBuilder$3.BatchTransaction; +}; + +export { StructTransaction, TransactionBuilder }; diff --git a/packages/transaction/dist/index.d.ts b/packages/transaction-builder/dist/index.d.ts similarity index 81% rename from packages/transaction/dist/index.d.ts rename to packages/transaction-builder/dist/index.d.ts index d0f42518d..08a2aaeba 100644 --- a/packages/transaction/dist/index.d.ts +++ b/packages/transaction-builder/dist/index.d.ts @@ -1,4 +1,5 @@ -import { TransactionSignature, PublicKey, Keypair, TransactionInstruction } from '@solana/web3.js'; +import * as _solana_web3_js from '@solana/web3.js'; +import { TransactionSignature, PublicKey, Keypair, TransactionInstruction, Transaction } from '@solana/web3.js'; declare abstract class AbstractResult { protected abstract _chain(ok: (value: T) => Result, err: (error: E) => Result): Result; @@ -241,34 +242,68 @@ type ExplorerOptions = { replacePath: string; }; -declare class Transaction { +interface StructPartialSignTransaction { + hexInstruction: string; + submit: (feePayer: Secret) => Promise>; +} +interface StructTransaction { instructions: TransactionInstruction[]; signers: Keypair[]; feePayer?: Keypair; data?: unknown; - constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: unknown); submit: () => Promise>; } +declare namespace TransactionBuilder$4 { + class Common implements StructTransaction { + static MAX_TRANSACTION_SIZE: number; + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: unknown); + submit: () => Promise>; + } + /** + * @param tx a solana transaction + * @param feePayer the publicKey of the signer + * @returns size in bytes of the transaction + */ + const getTxSize: (tx: Transaction, feePayer: PublicKey) => number; +} -declare class BatchTransaction { - submit: (arr: Transaction[]) => Promise; +declare namespace TransactionBuilder$3 { + class BatchTransaction { + submit: (arr: TransactionBuilder$4.Common[]) => Promise; + } } -declare class MintTransaction { - instructions: TransactionInstruction[]; - signers: Keypair[]; - feePayer?: Keypair; - data?: T; - constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: T); - submit: () => Promise>; +declare namespace TransactionBuilder$2 { + class Mint implements StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: T; + constructor(instructions: TransactionInstruction[], signers: Keypair[], feePayer?: Keypair, data?: T); + submit: () => Promise>; + } } -declare class PartialSignTransaction { - hexInstruction: string; - data?: Pubkey; - canSubmit?: boolean; - constructor(instructions: string, mint?: Pubkey, canSubmit?: boolean); - submit: (feePayer: Secret) => Promise>; +declare namespace TransactionBuilder$1 { + class PartialSignTransaction implements StructPartialSignTransaction { + hexInstruction: string; + data?: Pubkey; + canSubmit?: boolean; + constructor(instructions: string, mint?: Pubkey, canSubmit?: boolean); + submit: (feePayer: Secret) => Promise>; + } } -export { BatchTransaction, MintTransaction, PartialSignTransaction, Transaction }; +declare const TransactionBuilder: { + PartialSignTransaction: typeof TransactionBuilder$1.PartialSignTransaction; + Common: typeof TransactionBuilder$4.Common; + getTxSize: (tx: _solana_web3_js.Transaction, feePayer: _solana_web3_js.PublicKey) => number; + Mint: typeof TransactionBuilder$2.Mint; + BatchTransaction: typeof TransactionBuilder$3.BatchTransaction; +}; + +export { StructTransaction, TransactionBuilder }; diff --git a/packages/transaction-builder/dist/index.js b/packages/transaction-builder/dist/index.js new file mode 100644 index 000000000..212c84d93 --- /dev/null +++ b/packages/transaction-builder/dist/index.js @@ -0,0 +1,1530 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + TransactionBuilder: () => TransactionBuilder +}); +module.exports = __toCommonJS(src_exports); + +// src/batch.ts +var import_web37 = require("@solana/web3.js"); + +// ../shared/src/constants.ts +var import_web3 = require("@solana/web3.js"); +var import_load = __toESM(require("@solana-suite/config/load")); +var Config = import_load.default; +var Constants; +((Constants2) => { + let WarnningMessage; + ((WarnningMessage2) => { + const THRESHHOLD = 5; + let isDisplay = false; + WarnningMessage2.NFT_STORAGE_API_KEY = ` + [Warning] + -------------------------------------- + You need to update nftStorageApiKey define parameter in solana-suite.json. + Can get api key from https://nft.storage/ + -------------------------------------- + `; + WarnningMessage2.DAS_API_URL = ` + [Warning] + -------------------------------------- + You need to update dasApiUrl define parameter in solana-suite.json. + can get api url from https://www.helius.dev/ + -------------------------------------- + `; + WarnningMessage2.calculateProbability = () => { + const randomValue = Math.random(); + const probability = 1 / THRESHHOLD; + if (!isDisplay && randomValue < probability) { + isDisplay = true; + return true; + } + return false; + }; + })(WarnningMessage = Constants2.WarnningMessage || (Constants2.WarnningMessage = {})); +})(Constants || (Constants = {})); +((Constants2) => { + Constants2.currentCluster = Config.cluster.type; + Constants2.customClusterUrl = Config.cluster.customClusterUrl; + Constants2.isDebugging = Config.debugging; + Constants2.nftStorageApiKey = Config.nftStorageApiKey; + Constants2.dasApiUrl = Config.dasApiUrl; + let Cluster; + ((Cluster2) => { + Cluster2["prd"] = "mainnet-beta"; + Cluster2["prdMetaplex"] = "mainnet-beta-metaplex"; + Cluster2["dev"] = "devnet"; + Cluster2["test"] = "testnet"; + Cluster2["localhost"] = "localhost-devnet"; + })(Cluster = Constants2.Cluster || (Constants2.Cluster = {})); + let EndPointUrl; + ((EndPointUrl2) => { + EndPointUrl2["prd"] = "https://api.mainnet-beta.solana.com"; + EndPointUrl2["prdMetaplex"] = "https://api.metaplex.solana.com"; + EndPointUrl2["dev"] = "https://api.devnet.solana.com"; + EndPointUrl2["test"] = "https://api.testnet.solana.com"; + EndPointUrl2["localhost"] = "http://api.devnet.solana.com"; + })(EndPointUrl = Constants2.EndPointUrl || (Constants2.EndPointUrl = {})); + let BundlrUrl; + ((BundlrUrl2) => { + BundlrUrl2["prd"] = "https://node1.irys.xyz,https://node2.irys.xyz"; + BundlrUrl2["dev"] = "https://devnet.irys.xyz"; + })(BundlrUrl = Constants2.BundlrUrl || (Constants2.BundlrUrl = {})); + let DasApiUrl; + ((DasApiUrl2) => { + DasApiUrl2["dev"] = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639"; + })(DasApiUrl = Constants2.DasApiUrl || (Constants2.DasApiUrl = {})); + let NftstorageApiKey; + ((NftstorageApiKey2) => { + NftstorageApiKey2["dev"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE"; + })(NftstorageApiKey = Constants2.NftstorageApiKey || (Constants2.NftstorageApiKey = {})); + Constants2.loadConfig = async () => { + Config = await import("@solana-suite/config/load"); + }; + Constants2.switchCluster = (param) => { + const { cluster: env, customClusterUrl: customClusterUrl2 } = param; + if (customClusterUrl2 && customClusterUrl2.length > 0) { + const index = Date.now() % customClusterUrl2.length; + return customClusterUrl2[index]; + } + switch (env) { + case "mainnet-beta" /* prd */: + return "https://api.mainnet-beta.solana.com" /* prd */; + case "mainnet-beta-metaplex" /* prdMetaplex */: + return "https://api.metaplex.solana.com" /* prdMetaplex */; + case "testnet" /* test */: + return "https://api.testnet.solana.com" /* test */; + case "devnet" /* dev */: + return "https://api.devnet.solana.com" /* dev */; + default: + return "http://api.devnet.solana.com" /* localhost */; + } + }; + Constants2.switchBundlr = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: { + const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); + const index = Date.now() % urls.length; + return urls[index]; + } + default: { + return "https://devnet.irys.xyz" /* dev */; + } + } + }; + Constants2.switchDasApi = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: + if (Constants2.dasApiUrl.length < 1) { + throw Error(Constants2.WarnningMessage.DAS_API_URL); + } + const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); + const index = Date.now() % urls.length; + return urls[index]; + default: { + const urls2 = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639" /* dev */.split(","); + const index2 = Date.now() % urls2.length; + return urls2[index2]; + } + } + }; + Constants2.switchNftStorage = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: + if (!Constants2.nftStorageApiKey) { + throw Error(Constants2.WarnningMessage.NFT_STORAGE_API_KEY); + } + return Constants2.nftStorageApiKey; + default: { + return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE" /* dev */; + } + } + }; + Constants2.WRAPPED_TOKEN_PROGRAM_ID = new import_web3.PublicKey( + "So11111111111111111111111111111111111111112" + ); + Constants2.MEMO_PROGRAM_ID = new import_web3.PublicKey( + "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo" + ); + Constants2.METAPLEX_PROGRAM_ID = new import_web3.PublicKey( + "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + ); + Constants2.COMMITMENT = "confirmed"; + Constants2.NFT_STORAGE_GATEWAY_URL = "https://ipfs.io/ipfs"; + Constants2.IRYS_GATEWAY_URL = "https://gateway.irys.xyz"; + Constants2.BUNDLR_NETWORK_URL = (0, Constants2.switchBundlr)(Config.cluster.type); + Constants2.DAS_API_URL = (0, Constants2.switchDasApi)(Config.cluster.type); + Constants2.NFT_STORAGE_API_KEY = (0, Constants2.switchNftStorage)(Config.cluster.type); + Constants2.EXPLORER_SOLSCAN_URL = "https://solscan.io"; + Constants2.EXPLORER_SOLANAFM_URL = "https://solana.fm"; + Constants2.EXPLORER_XRAY_URL = "https://xray.helius.xyz"; +})(Constants || (Constants = {})); + +// ../shared/src/result.ts +var AbstractResult = class { + // unified-signatures. into line 10 + // unwrap(ok: (value: T) => U, err: (error: E) => U): U; + unwrap(ok, err) { + const r = this._chain( + (value) => Result.ok(ok ? ok(value) : value), + (error) => err ? Result.ok(err(error)) : Result.err(error) + ); + if (r.isErr) { + throw r.error; + } + return r.value; + } + map(ok, err) { + return this._chain( + (value) => Result.ok(ok(value)), + (error) => Result.err(err ? err(error) : error) + ); + } + chain(ok, err) { + return this._chain(ok, err || ((error) => Result.err(error))); + } + match(ok, err) { + this._chain( + (value) => Result.ok(ok(value)), + (error) => Result.err(err(error)) + ); + } + /// submit (alias Instruction.submit) //// + async submit() { + try { + const instruction = this.unwrap(); + if (instruction.instructions && instruction.signers) { + return await instruction.submit(); + } + return Result.err(Error("Only Instruction object")); + } catch (err) { + return Result.err(err); + } + } +}; +var InternalOk = class extends AbstractResult { + constructor(value) { + super(); + this.value = value; + } + isOk = true; + isErr = false; + /* eslint-disable @typescript-eslint/no-unused-vars */ + _chain(ok, _err) { + return ok(this.value); + } +}; +var InternalErr = class extends AbstractResult { + constructor(error) { + super(); + this.error = error; + } + isOk = false; + isErr = true; + _chain(_ok, err) { + return err(this.error); + } +}; +var Result; +((Result7) => { + function ok(value) { + return new InternalOk(value); + } + Result7.ok = ok; + function err(error) { + return new InternalErr(error || Error()); + } + Result7.err = err; + function all(obj) { + if (Array.isArray(obj)) { + const resArr = []; + for (const item of obj) { + if (item.isErr) { + return item; + } + resArr.push(item.value); + } + return Result7.ok(resArr); + } + const res = {}; + const keys = Object.keys(obj); + for (const key of keys) { + const item = obj[key]; + if (item.isErr) { + return item; + } + res[key] = item.value; + } + return Result7.ok(res); + } + Result7.all = all; +})(Result || (Result = {})); + +// ../shared/src/shared.ts +var overwriteObject = (object, targets) => { + const that = object; + targets.forEach((target) => { + delete that[target.existsKey]; + that[target.will.key] = target.will.value; + }); + return that; +}; +var debugLog = (data1, data2 = "", data3 = "", data4 = "") => { + if (Constants.isDebugging === "true" || process.env.DEBUG === "true") { + console.log("[DEBUG]", data1, data2, data3, data4); + } +}; +var sleep = async (sec) => { + return new Promise((r) => setTimeout(r, sec * 1e3)); +}; +var isPromise = (obj) => { + return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; +}; +function Try(input, finallyInput) { + try { + const v = input(); + if (isPromise(v)) { + return v.then( + (x) => Result.ok(x), + (err) => Result.err(err) + ); + } else { + return Result.ok(v); + } + } catch (e) { + if (e instanceof Error) { + return Result.err(e); + } + return Result.err(Error(e)); + } finally { + if (finallyInput) { + debugLog("# finally input:", finallyInput); + finallyInput(); + } + } +} +var convertTimestampToDateTime = (created_at) => { + if (created_at) { + return new Date(created_at * 1e3); + } + return; +}; + +// ../account/src/associated.ts +var import_spl_token = require("@solana/spl-token"); + +// ../account/src/keypair.ts +var import_web32 = require("@solana/web3.js"); +var import_bs58 = __toESM(require("bs58")); +var Account; +((Account5) => { + class Keypair4 { + secret; + pubkey; + constructor(params) { + if (!params.pubkey) { + const keypair = params.secret.toKeypair(); + this.pubkey = keypair.publicKey.toString(); + } else { + this.pubkey = params.pubkey; + } + this.secret = params.secret; + } + toPublicKey() { + return new import_web32.PublicKey(this.pubkey); + } + toKeypair() { + const decoded = import_bs58.default.decode(this.secret); + return import_web32.Keypair.fromSecretKey(decoded); + } + static isPubkey = (value) => /^[0-9a-zA-Z]{32,44}$/.test(value); + static isSecret = (value) => /^[0-9a-zA-Z]{87,88}$/.test(value); + static create = () => { + const keypair = import_web32.Keypair.generate(); + return new Keypair4({ + pubkey: keypair.publicKey.toString(), + secret: import_bs58.default.encode(keypair.secretKey) + }); + }; + static toKeyPair = (keypair) => { + return new Keypair4({ + pubkey: keypair.publicKey.toString(), + secret: import_bs58.default.encode(keypair.secretKey) + }); + }; + } + Account5.Keypair = Keypair4; +})(Account || (Account = {})); + +// ../account/src/associated.ts +var Account2; +((Account5) => { + let Associated; + ((Associated2) => { + const RETRY_OVER_LIMIT = 10; + const RETRY_SLEEP_TIME = 3; + const get = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { + const res = await (0, Associated2.makeOrCreateInstruction)( + mint, + owner, + new Account.Keypair({ secret: feePayer }).pubkey, + allowOwnerOffCurve + ); + if (!res.inst) { + return res.tokenAccount; + } + return new TransactionBuilder.Common( + [res.inst], + [], + feePayer.toKeypair(), + res.tokenAccount + ); + }; + Associated2.retryGetOrCreate = async (mint, owner, feePayer) => { + let counter = 1; + while (counter < RETRY_OVER_LIMIT) { + try { + const inst = await get(mint, owner, feePayer, true); + if (inst && typeof inst === "string") { + debugLog("# associatedTokenAccount: ", inst); + return inst; + } else if (inst instanceof TransactionBuilder.Common) { + (await inst.submit()).map( + async (ok) => { + await Node.confirmedSig(ok); + return inst.data; + }, + (err) => { + debugLog("# Error submit retryGetOrCreate: ", err); + throw err; + } + ); + } + } catch (e) { + debugLog(`# retry: ${counter} create token account: `, e); + debugLog(`# mint: ${mint}, owner: ${owner}, feePayer: ${feePayer}`); + } + await sleep(RETRY_SLEEP_TIME); + counter++; + } + throw Error(`retry action is over limit ${RETRY_OVER_LIMIT}`); + }; + Associated2.makeOrCreateInstruction = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { + const associatedTokenAccount = (0, import_spl_token.getAssociatedTokenAddressSync)( + mint.toPublicKey(), + owner.toPublicKey(), + allowOwnerOffCurve, + import_spl_token.TOKEN_PROGRAM_ID, + import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID + ); + debugLog("# associatedTokenAccount: ", associatedTokenAccount.toString()); + try { + await (0, import_spl_token.getAccount)( + Node.getConnection(), + associatedTokenAccount, + Node.getConnection().commitment, + import_spl_token.TOKEN_PROGRAM_ID + ); + return { + tokenAccount: associatedTokenAccount.toString(), + inst: void 0 + }; + } catch (error) { + if (!(error instanceof import_spl_token.TokenAccountNotFoundError) && !(error instanceof import_spl_token.TokenInvalidAccountOwnerError)) { + throw Error("Unexpected error"); + } + const payer = !feePayer ? owner : feePayer; + const inst = (0, import_spl_token.createAssociatedTokenAccountInstruction)( + payer.toPublicKey(), + associatedTokenAccount, + owner.toPublicKey(), + mint.toPublicKey(), + import_spl_token.TOKEN_PROGRAM_ID, + import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID + ); + return { + tokenAccount: associatedTokenAccount.toString(), + inst + }; + } + }; + })(Associated = Account5.Associated || (Account5.Associated = {})); +})(Account2 || (Account2 = {})); + +// ../account/src/pda.ts +var import_web33 = require("@solana/web3.js"); +var import_mpl_token_metadata = require("@metaplex-foundation/mpl-token-metadata"); +var import_mpl_bubblegum = require("@metaplex-foundation/mpl-bubblegum"); +var import_bn = __toESM(require("bn.js")); +var Account3; +((Account5) => { + let Pda; + ((Pda2) => { + Pda2.getMetadata = (address) => { + const [publicKey] = import_web33.PublicKey.findProgramAddressSync( + [ + Buffer.from("metadata"), + import_mpl_token_metadata.PROGRAM_ID.toBuffer(), + address.toPublicKey().toBuffer() + ], + import_mpl_token_metadata.PROGRAM_ID + ); + return publicKey; + }; + Pda2.getMasterEdition = (address) => { + const [publicKey] = import_web33.PublicKey.findProgramAddressSync( + [ + Buffer.from("metadata"), + import_mpl_token_metadata.PROGRAM_ID.toBuffer(), + address.toPublicKey().toBuffer(), + Buffer.from("edition") + ], + import_mpl_token_metadata.PROGRAM_ID + ); + return publicKey; + }; + Pda2.getTreeAuthority = (address) => { + const [publicKey] = import_web33.PublicKey.findProgramAddressSync( + [address.toPublicKey().toBuffer()], + import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return publicKey; + }; + Pda2.getBgumSigner = () => { + const [publicKey] = import_web33.PublicKey.findProgramAddressSync( + [Buffer.from("collection_cpi", "utf8")], + import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return publicKey; + }; + Pda2.getAssetId = (address, leafIndex) => { + const node = new import_bn.default.BN(leafIndex); + const [assetId] = import_web33.PublicKey.findProgramAddressSync( + [ + Buffer.from("asset", "utf8"), + address.toPublicKey().toBuffer(), + Uint8Array.from(node.toArray("le", 8)) + ], + import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return assetId.toString(); + }; + })(Pda = Account5.Pda || (Account5.Pda = {})); +})(Account3 || (Account3 = {})); + +// ../account/src/index.ts +var Account4 = { + ...Account2, + ...Account, + ...Account3 +}; + +// ../converter/src/collection.ts +var Converter; +((Converter15) => { + let Collection; + ((Collection2) => { + Collection2.intoInfra = (input) => { + if (!input) { + return null; + } + return { + key: input.toPublicKey(), + verified: false + }; + }; + Collection2.intoUser = (output) => { + if (!output) { + return void 0; + } + return { + address: output.key.toString(), + verified: output.verified + }; + }; + })(Collection = Converter15.Collection || (Converter15.Collection = {})); + let CollectionMint; + ((CollectionMint2) => { + CollectionMint2.intoUser = (output) => { + const res = output.find((value) => { + if (value.group_key === "collection") { + return value.group_value; + } + }); + return res ? res.group_value : ""; + }; + })(CollectionMint = Converter15.CollectionMint || (Converter15.CollectionMint = {})); +})(Converter || (Converter = {})); + +// ../converter/src/creators.ts +var Converter2; +((Converter15) => { + let Creators; + ((Creators2) => { + Creators2.intoInfra = (input) => { + if (!input) { + return null; + } + return input.map((data) => { + return { + address: data.address.toPublicKey(), + share: data.share, + verified: false + }; + }); + }; + Creators2.intoCompressedNftInfra = (input) => { + if (!input) { + return []; + } + return input.map((data) => { + return { + address: data.address.toPublicKey(), + share: data.share, + verified: false + }; + }); + }; + Creators2.intoUser = (output) => { + if (!output) { + return void 0; + } + return output.map((data) => { + return { + address: data.address.toString(), + share: data.share, + verified: data.verified + }; + }); + }; + })(Creators = Converter15.Creators || (Converter15.Creators = {})); +})(Converter2 || (Converter2 = {})); + +// ../converter/src/royalty.ts +var Converter3; +((Converter15) => { + let Royalty; + ((Royalty2) => { + Royalty2.THRESHOLD = 100; + Royalty2.intoInfra = (percentage) => { + return percentage * Royalty2.THRESHOLD; + }; + Royalty2.intoUser = (percentage) => { + return percentage * Royalty2.THRESHOLD; + }; + })(Royalty = Converter15.Royalty || (Converter15.Royalty = {})); +})(Converter3 || (Converter3 = {})); + +// ../converter/src/compressed-nft-metadata.ts +var import_mpl_bubblegum_instruction = require("mpl-bubblegum-instruction"); +var Converter4; +((Converter15) => { + let CompressedNftMetadata; + ((CompressedNftMetadata2) => { + CompressedNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoCompressedNftInfra(input.creators), + collection: Converter.Collection.intoInfra(input.collection), + uses: input.uses || null, + primarySaleHappened: false, + isMutable: input.isMutable ?? false, + editionNonce: 0, + tokenStandard: import_mpl_bubblegum_instruction.TokenStandard.NonFungible, + tokenProgramVersion: import_mpl_bubblegum_instruction.TokenProgramVersion.Original + }; + }; + CompressedNftMetadata2.intoUser = (output) => { + return { + mint: output.onchain.id.toString(), + collectionMint: Converter.CollectionMint.intoUser( + output.onchain.grouping + ), + authorities: output.onchain.authorities, + royalty: Converter3.Royalty.intoUser(output.onchain.royalty.percent), + name: output.onchain.content.metadata.name, + symbol: output.onchain.content.metadata.symbol, + uri: output.onchain.content.json_uri, + creators: Converter2.Creators.intoUser(output.onchain.creators), + treeAddress: output.onchain.compression.tree, + isCompressed: output.onchain.compression.compressed, + isMutable: output.onchain.mutable, + isBurn: output.onchain.burnt, + editionNonce: output.onchain.supply.edition_nonce, + primarySaleHappened: output.onchain.royalty.primary_sale_happened, + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + })(CompressedNftMetadata = Converter15.CompressedNftMetadata || (Converter15.CompressedNftMetadata = {})); +})(Converter4 || (Converter4 = {})); + +// ../converter/src/memo.ts +var Converter5; +((Converter15) => { + let Memo; + ((Memo2) => { + Memo2.intoUserSide = (output, meta, outputTransfer, mappingTokenAccount) => { + const history = {}; + if (outputTransfer && outputTransfer.program !== "") { + if (mappingTokenAccount && outputTransfer.program === "spl-token") { + const foundSource = mappingTokenAccount.find( + (m) => m.account === outputTransfer.parsed.info.source + ); + const foundDest = mappingTokenAccount.find( + (m) => m.account === outputTransfer.parsed.info.destination + ); + history.mint = outputTransfer.parsed.info.mint; + foundSource && (history.source = foundSource.owner); + foundDest && (history.destination = foundDest.owner); + } else { + history.source = outputTransfer.parsed.info.source; + history.destination = outputTransfer.parsed.info.destination; + } + } + history.memo = output.parsed; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Memo = Converter15.Memo || (Converter15.Memo = {})); +})(Converter5 || (Converter5 = {})); + +// ../converter/src/mint.ts +var Converter6; +((Converter15) => { + let Mint; + ((Mint2) => { + Mint2.intoUserSide = (output, meta) => { + const history = {}; + history.mint = output.parsed.info.mint; + history.mintAuthority = output.parsed.info.mintAuthority; + history.tokenAmount = output.parsed.info.tokenAmount; + history.account = output.parsed.info.account; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Mint = Converter15.Mint || (Converter15.Mint = {})); +})(Converter6 || (Converter6 = {})); + +// ../converter/src/collection-details.ts +var Converter7; +((Converter15) => { + let CollectionDetails; + ((CollectionDetails2) => { + CollectionDetails2.intoUser = (output) => { + if (!output) { + return void 0; + } + return { + __kind: output.__kind, + size: parseInt(output.size.toString(10)) + }; + }; + })(CollectionDetails = Converter15.CollectionDetails || (Converter15.CollectionDetails = {})); +})(Converter7 || (Converter7 = {})); + +// ../converter/src/uses.ts +var Converter8; +((Converter15) => { + let Uses; + ((Uses2) => { + Uses2.intoUserSide = (output) => { + if (!output) { + return void 0; + } + return output; + }; + })(Uses = Converter15.Uses || (Converter15.Uses = {})); +})(Converter8 || (Converter8 = {})); + +// ../converter/src/token-metadata.ts +var Converter9; +((Converter15) => { + let TokenMetadata; + ((TokenMetadata2) => { + TokenMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoInfra(input.creators), + collection: null, + uses: input.uses || null + }; + }; + TokenMetadata2.intoUser = (output, tokenAmount) => { + return { + mint: output.onchain.mint.toString(), + royalty: output.onchain.data.sellerFeeBasisPoints, + name: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.name), + symbol: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.symbol), + tokenAmount, + uri: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.uri), + creators: Converter2.Creators.intoUser(output.onchain.data.creators), + uses: Converter8.Uses.intoUserSide(output.onchain.uses), + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + TokenMetadata2.deleteNullStrings = (str) => { + return str.replace(/\0/g, ""); + }; + })(TokenMetadata = Converter15.TokenMetadata || (Converter15.TokenMetadata = {})); +})(Converter9 || (Converter9 = {})); + +// ../converter/src/regular-nft-metadata.ts +var Converter10; +((Converter15) => { + let RegularNftMetadata; + ((RegularNftMetadata2) => { + RegularNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoInfra(input.creators), + collection: Converter.Collection.intoInfra(input.collection), + uses: input.uses || null + }; + }; + RegularNftMetadata2.intoUser = (output) => { + return { + mint: output.onchain.mint.toString(), + updateAuthority: output.onchain.updateAuthority.toString(), + royalty: output.onchain.data.sellerFeeBasisPoints, + name: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.name), + symbol: Converter9.TokenMetadata.deleteNullStrings( + output.onchain.data.symbol + ), + uri: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.uri), + isMutable: output.onchain.isMutable, + primarySaleHappened: output.onchain.primarySaleHappened, + creators: Converter2.Creators.intoUser(output.onchain.data.creators), + editionNonce: output.onchain.editionNonce, + collection: Converter.Collection.intoUser(output.onchain.collection), + collectionDetails: Converter7.CollectionDetails.intoUser( + output.onchain.collectionDetails + ), + uses: Converter8.Uses.intoUserSide(output.onchain.uses), + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + })(RegularNftMetadata = Converter15.RegularNftMetadata || (Converter15.RegularNftMetadata = {})); +})(Converter10 || (Converter10 = {})); + +// ../converter/src/properties.ts +var Converter11; +((Converter15) => { + let Properties; + ((Properties2) => { + Properties2.intoInfra = async (input, callbackFunc, storageType, feePayer) => { + if (!input || !input.files) { + return {}; + } + const files = await Promise.all( + input.files.map(async (file) => { + if (!file.filePath) { + return {}; + } + const res = await callbackFunc(file.filePath, storageType, feePayer); + if (res.isErr) { + throw Error(res.error.message); + } + return overwriteObject(file, [ + { + existsKey: "filePath", + will: { key: "uri", value: res.value } + } + ]); + }) + ); + return { ...input, files }; + }; + })(Properties = Converter15.Properties || (Converter15.Properties = {})); +})(Converter11 || (Converter11 = {})); + +// ../converter/src/transfer-checked.ts +var Converter12; +((Converter15) => { + let TransferChecked; + ((TransferChecked2) => { + TransferChecked2.intoUserSide = (output, meta, mappingTokenAccount) => { + const history = {}; + if (mappingTokenAccount) { + const foundSource = mappingTokenAccount.find( + (m) => m.account === output.parsed.info.source + ); + const foundDest = mappingTokenAccount.find( + (m) => m.account === output.parsed.info.destination + ); + foundSource && (history.source = foundSource.owner); + foundDest && (history.destination = foundDest.owner); + } + history.tokenAmount = output.parsed.info.tokenAmount; + history.mint = output.parsed.info.mint; + history.multisigAuthority = output.parsed.info.multisigAuthority; + history.signers = output.parsed.info.signers; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(TransferChecked = Converter15.TransferChecked || (Converter15.TransferChecked = {})); +})(Converter12 || (Converter12 = {})); + +// ../converter/src/transfer.ts +var Converter13; +((Converter15) => { + let Transfer; + ((Transfer2) => { + Transfer2.intoUserSide = (output, meta) => { + const history = {}; + if (!output.parsed.info.destination || !output.parsed.info.lamports) { + return; + } + history.source = output.parsed.info.source; + history.destination = output.parsed.info.destination; + history.sol = output.parsed.info.lamports?.toSol().toString(); + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Transfer = Converter15.Transfer || (Converter15.Transfer = {})); +})(Converter13 || (Converter13 = {})); + +// ../converter/src/index.ts +var Converter14 = { + ...Converter4, + ...Converter, + ...Converter2, + ...Converter5, + ...Converter6, + ...Converter10, + ...Converter11, + ...Converter3, + ...Converter9, + ...Converter12, + ...Converter13, + ...Converter8 +}; + +// ../validator/src/index.ts +var Validator; +((Validator2) => { + let Message; + ((Message2) => { + Message2.SUCCESS = "success"; + Message2.SMALL_NUMBER = "too small"; + Message2.BIG_NUMBER = "too big"; + Message2.LONG_LENGTH = "too long"; + Message2.EMPTY = "invalid empty value"; + Message2.INVALID_URL = "invalid url"; + Message2.ONLY_NODE_JS = "`string` type is only Node.js"; + })(Message = Validator2.Message || (Validator2.Message = {})); + Validator2.NAME_LENGTH = 32; + Validator2.SYMBOL_LENGTH = 10; + Validator2.URL_LENGTH = 200; + Validator2.ROYALTY_MAX = 100; + Validator2.SELLER_FEE_BASIS_POINTS_MAX = 1e4; + Validator2.ROYALTY_MIN = 0; + Validator2.isRoyalty = (royalty) => { + return Try(() => { + const key = "royalty"; + if (royalty !== 0 && !royalty) { + throw createError(key, Message.EMPTY, royalty); + } + if (royalty < Validator2.ROYALTY_MIN) { + throw createError(key, Message.SMALL_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MIN, + condition: "underMin" + }); + } else if (royalty > Validator2.ROYALTY_MAX) { + throw createError(key, Message.BIG_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MAX, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isSellerFeeBasisPoints = (royalty) => { + return Try(() => { + const key = "sellerFeeBasisPoints/seller_fee_basis_points"; + if (royalty !== 0 && !royalty) { + throw createError(key, Message.EMPTY, royalty); + } + if (royalty < Validator2.ROYALTY_MIN) { + throw createError(key, Message.SMALL_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MIN, + condition: "underMin" + }); + } else if (royalty > Validator2.ROYALTY_MAX * Converter14.Royalty.THRESHOLD) { + throw createError(key, Message.BIG_NUMBER, royalty, { + threshold: Validator2.SELLER_FEE_BASIS_POINTS_MAX, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isName = (name) => { + return Try(() => { + const key = "name"; + if (!name) { + throw createError(key, Message.EMPTY, name); + } + if (byteLength(name) > Validator2.NAME_LENGTH) { + throw createError(key, Message.LONG_LENGTH, name, { + threshold: Validator2.NAME_LENGTH, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isSymbol = (symbol) => { + return Try(() => { + const key = "symbol"; + if (!symbol) { + throw createError(key, Message.EMPTY, symbol); + } + if (byteLength(symbol) > Validator2.SYMBOL_LENGTH) { + throw createError(key, Message.LONG_LENGTH, symbol, { + threshold: Validator2.SYMBOL_LENGTH, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isImageUrl = (image) => isUriOrImage(image, "image"); + Validator2.checkAll = (metadata) => { + return Try(() => { + const keys = Object.keys(metadata); + const results = []; + keys.map((key) => { + let res; + switch (key) { + case "image": + if (key in metadata && metadata.image) { + res = (0, Validator2.isImageUrl)(metadata.image); + } + break; + case "royalty": + if (key in metadata) { + res = (0, Validator2.isRoyalty)(metadata.royalty); + } + break; + case "seller_fee_basis_points": + if (key in metadata && metadata.seller_fee_basis_points) { + res = (0, Validator2.isSellerFeeBasisPoints)(metadata.seller_fee_basis_points); + } + break; + case "sellerFeeBasisPoints": + if (key in metadata) { + res = (0, Validator2.isSellerFeeBasisPoints)(metadata.sellerFeeBasisPoints); + } + break; + case "name": + if (metadata.name) { + res = (0, Validator2.isName)(metadata.name); + } + break; + case "symbol": + if (metadata.symbol) { + res = (0, Validator2.isSymbol)(metadata.symbol); + } + break; + } + if (res && res.isErr) { + results.push(...res.error.details); + } + }); + if (results.length > 0) { + const message = "Caught in the validation errors. see information e.g: err.details"; + throw new ValidatorError(message, results); + } + return Message.SUCCESS; + }); + }; + const byteLength = (value) => { + const text = new TextEncoder(); + return text.encode(value).length; + }; + const createError = (key, message, actual, limit) => { + let error; + if (limit) { + error = new ValidatorError(message, [{ key, message, actual, limit }]); + } else { + error = new ValidatorError(message, [{ key, message, actual }]); + } + return error; + }; + const isUriOrImage = (imageOrUri, key) => { + return Try(() => { + if (!imageOrUri) { + throw createError(key, Message.EMPTY, imageOrUri); + } + if (byteLength(imageOrUri) > Validator2.URL_LENGTH) { + throw createError(key, Message.LONG_LENGTH, imageOrUri, { + threshold: Validator2.URL_LENGTH, + condition: "overMax" + }); + } + if (!/https?:\/\/[-_.!~*\\()a-zA-Z0-9;?:&=+,%#]+/g.test(imageOrUri)) { + throw createError(key, Message.INVALID_URL, imageOrUri); + } + return Message.SUCCESS; + }); + }; +})(Validator || (Validator = {})); +var ValidatorError = class extends Error { + details; + constructor(message, details) { + super(message); + this.details = details; + } +}; + +// ../global/src/index.ts +var import_web34 = require("@solana/web3.js"); +var import_bignumber = require("bignumber.js"); +var import_bs582 = __toESM(require("bs58")); +String.prototype.toExplorerUrl = function(explorer = "solscan" /* Solscan */, options = {}) { + const endPointUrl = Node.getConnection().rpcEndpoint; + debugLog("# toExplorerUrl rpcEndpoint:", endPointUrl); + let cluster = ""; + if (endPointUrl === Constants.EndPointUrl.prd) { + cluster = Constants.Cluster.prd; + } else if (endPointUrl === Constants.EndPointUrl.test) { + cluster = Constants.Cluster.test; + } else if (endPointUrl === Constants.EndPointUrl.dev) { + cluster = Constants.Cluster.dev; + } else { + cluster = Constants.Cluster.dev; + } + const addressOrSignature = this.toString(); + let url = ""; + if (options.replacePath) { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/${options.replacePath}/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; + } + return url; + } + if (Account4.Keypair.isPubkey(addressOrSignature)) { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/address/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/account/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/account/${addressOrSignature}?cluster=${cluster}`; + } + } else { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/tx/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/tx/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/tx/${addressOrSignature}?cluster=${cluster}`; + } + } + return url; +}; +String.prototype.toPublicKey = function() { + if (!Account4.Keypair.isPubkey(this.toString())) { + throw Error(`No match KeyPair.PubKey: ${this.toString()}`); + } + return new import_web34.PublicKey(this.toString()); +}; +String.prototype.toKeypair = function() { + if (!Account4.Keypair.isSecret(this.toString())) { + throw Error(`No match KeyPair.Secret: ${this.toString()}`); + } + const decoded = import_bs582.default.decode(this.toString()); + return import_web34.Keypair.fromSecretKey(decoded); +}; +Number.prototype.toSol = function() { + return (0, import_bignumber.BigNumber)(this).div(import_web34.LAMPORTS_PER_SOL).toNumber(); +}; +Number.prototype.toLamports = function() { + return (0, import_bignumber.BigNumber)(this).times(import_web34.LAMPORTS_PER_SOL).toNumber(); +}; + +// ../node/src/index.ts +var import_web35 = require("@solana/web3.js"); +var Node; +((Node2) => { + const setted = { + clusterUrl: "", + commitment: Constants.COMMITMENT, + customClusterUrl: [] + }; + Node2.getConnection = () => { + if (setted.customClusterUrl.length > 0) { + setted.clusterUrl = Constants.switchCluster({ + customClusterUrl: setted.customClusterUrl + }); + } else if (Constants.customClusterUrl.length > 0) { + setted.clusterUrl = Constants.switchCluster({ + customClusterUrl: Constants.customClusterUrl + }); + } else if (!setted.clusterUrl) { + setted.clusterUrl = Constants.switchCluster({ + cluster: Constants.currentCluster + }); + } + if (!setted.commitment) { + setted.commitment = Constants.COMMITMENT; + } + return new import_web35.Connection(setted.clusterUrl, setted.commitment); + }; + Node2.changeConnection = (param) => { + setted.clusterUrl = ""; + setted.customClusterUrl = []; + setted.commitment = Constants.COMMITMENT; + const { cluster, commitment, customClusterUrl } = param; + if (commitment) { + setted.commitment = commitment; + debugLog("# Node change commitment: ", setted.commitment); + } + if (cluster) { + setted.clusterUrl = Constants.switchCluster({ cluster }); + debugLog("# Node change clusterUrl: ", setted.clusterUrl); + } + if (customClusterUrl) { + debugLog("# customClusterUrl: ", customClusterUrl); + setted.clusterUrl = Constants.switchCluster({ customClusterUrl }); + setted.customClusterUrl = customClusterUrl; + debugLog( + "# Node change cluster, custom cluster url: ", + setted.clusterUrl + ); + } + }; + Node2.confirmedSig = async (signature, commitment = Constants.COMMITMENT) => { + const connection = Node2.getConnection(); + const latestBlockhash = await connection.getLatestBlockhash(); + return await connection.confirmTransaction( + { + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, + signature + }, + commitment + ).then(Result.ok).catch(Result.err); + }; +})(Node || (Node = {})); + +// src/common.ts +var import_web36 = require("@solana/web3.js"); +var MAX_RETRIES = 3; +var TransactionBuilder2; +((TransactionBuilder6) => { + class Common2 { + static MAX_TRANSACTION_SIZE = 1232; + instructions; + signers; + feePayer; + data; + constructor(instructions, signers, feePayer, data) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + submit = async () => { + return Try(async () => { + if (!(this instanceof Common2)) { + throw Error("only Instruction object that can use this"); + } + const transaction = new import_web36.Transaction(); + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + this.instructions.forEach((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + return await (0, import_web36.sendAndConfirmTransaction)( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }); + }; + } + TransactionBuilder6.Common = Common2; + TransactionBuilder6.getTxSize = (tx, feePayer) => { + const feePayerPk = [feePayer.toBase58()]; + const signers = new Set(feePayerPk); + const accounts = new Set(feePayerPk); + const ixsSize = tx.instructions.reduce((acc, ix) => { + ix.keys.forEach(({ pubkey, isSigner }) => { + const pk = pubkey.toBase58(); + if (isSigner) + signers.add(pk); + accounts.add(pk); + }); + accounts.add(ix.programId.toBase58()); + const nIndexes = ix.keys.length; + const opaqueData = ix.data.length; + return acc + 1 + // PID index + compactArraySize(nIndexes, 1) + compactArraySize(opaqueData, 1); + }, 0); + return compactArraySize(signers.size, 64) + // signatures + 3 + // header + compactArraySize(accounts.size, 32) + // accounts + 32 + // blockhash + compactHeader(tx.instructions.length) + // instructions + ixsSize; + }; + const LOW_VALUE = 127; + const HIGH_VALUE = 16383; + const compactHeader = (n) => n <= LOW_VALUE ? 1 : n <= HIGH_VALUE ? 2 : 3; + const compactArraySize = (n, size) => compactHeader(n) + n * size; +})(TransactionBuilder2 || (TransactionBuilder2 = {})); + +// src/batch.ts +var TransactionBuilder3; +((TransactionBuilder6) => { + class BatchTransaction { + submit = async (arr) => { + let i = 0; + for (const a of arr) { + if (!a.instructions && !a.signers) { + throw Error( + `only Instruction object that can use batchSubmit(). + Index: ${i}, Set value: ${JSON.stringify(a)}` + ); + } + i++; + } + const instructions = arr.flatMap((a) => a.instructions); + const signers = arr.flatMap((a) => a.signers); + const feePayers = arr.filter((a) => a.feePayer !== void 0); + let feePayer = signers[0]; + if (feePayers.length > 0 && feePayers[0].feePayer) { + feePayer = feePayers[0].feePayer; + } + const transaction = new import_web37.Transaction(); + let finalSigners = signers; + if (feePayer) { + transaction.feePayer = feePayer.publicKey; + finalSigners = [feePayer, ...signers]; + } + instructions.map((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + return await (0, import_web37.sendAndConfirmTransaction)( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }; + } + TransactionBuilder6.BatchTransaction = BatchTransaction; + Array.prototype.submit = async function() { + const instructions = []; + return Try(async () => { + let i = 0; + for (const obj of this) { + if (obj.isErr) { + const errorMess = obj.error.message; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.isOk) { + instructions.push(obj.value); + } else { + instructions.push(obj); + } + i++; + } + return new BatchTransaction().submit(instructions); + }); + }; +})(TransactionBuilder3 || (TransactionBuilder3 = {})); + +// src/mint.ts +var import_web38 = require("@solana/web3.js"); +var TransactionBuilder4; +((TransactionBuilder6) => { + class Mint { + instructions; + signers; + feePayer; + data; + constructor(instructions, signers, feePayer, data) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + submit = async () => { + return Try(async () => { + if (!(this instanceof Mint)) { + throw Error("only MintInstruction object that can use this"); + } + const transaction = new import_web38.Transaction(); + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + this.instructions.forEach((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { + debugLog("# Change metaplex cluster on mainnet-beta"); + Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); + } + return await (0, import_web38.sendAndConfirmTransaction)( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }); + }; + } + TransactionBuilder6.Mint = Mint; +})(TransactionBuilder4 || (TransactionBuilder4 = {})); + +// src/partial-sign.ts +var import_web39 = require("@solana/web3.js"); +var TransactionBuilder5; +((TransactionBuilder6) => { + class PartialSignTransaction { + hexInstruction; + data; + canSubmit; + constructor(instructions, mint, canSubmit = false) { + this.hexInstruction = instructions; + this.data = mint; + this.canSubmit = canSubmit; + } + submit = async (feePayer) => { + return Try(async () => { + if (!(this instanceof PartialSignTransaction)) { + throw Error("only PartialSignInstruction object that can use this"); + } + const decode = Buffer.from(this.hexInstruction, "hex"); + const transactionFromJson = import_web39.Transaction.from(decode); + transactionFromJson.partialSign(feePayer.toKeypair()); + const options = { + maxRetries: MAX_RETRIES + }; + const wireTransaction = transactionFromJson.serialize(); + return await Node.getConnection().sendRawTransaction( + wireTransaction, + options + ); + }); + }; + } + TransactionBuilder6.PartialSignTransaction = PartialSignTransaction; + Array.prototype.submit = async function(feePayer) { + return Try(async () => { + let i = 0; + for await (const obj of this) { + if (obj.isErr) { + const errorMess = obj.error.message; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.canSubmit) { + console.log("# canSubmit", obj); + await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); + } else { + console.log("# transfer transaction start: ", obj); + return await obj.submit(feePayer); + } + i++; + } + }); + }; +})(TransactionBuilder5 || (TransactionBuilder5 = {})); + +// src/index.ts +var TransactionBuilder = { + ...TransactionBuilder3, + ...TransactionBuilder4, + ...TransactionBuilder2, + ...TransactionBuilder5 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + TransactionBuilder +}); +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9iYXRjaC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL2NvbnN0YW50cy50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3Jlc3VsdC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3NoYXJlZC50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9hc3NvY2lhdGVkLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL2tleXBhaXIudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvcGRhLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL2luZGV4LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29sbGVjdGlvbi50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NyZWF0b3JzLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvcm95YWx0eS50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL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0KG1pbnQsIG93bmVyLCBmZWVQYXllciwgdHJ1ZSk7XG5cbiAgICAgICAgICBpZiAoaW5zdCAmJiB0eXBlb2YgaW5zdCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGluc3QpO1xuICAgICAgICAgICAgcmV0dXJuIGluc3Q7XG4gICAgICAgICAgfSBlbHNlIGlmIChpbnN0IGluc3RhbmNlb2YgVHJhbnNhY3Rpb25CdWlsZGVyLkNvbW1vbikge1xuICAgICAgICAgICAgKGF3YWl0IGluc3Quc3VibWl0KCkpLm1hcChcbiAgICAgICAgICAgICAgYXN5bmMgKG9rOiBzdHJpbmcpID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBOb2RlLmNvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnI6IEVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgZGVidWdMb2coJyMgRXJyb3Igc3VibWl0IHJldHJ5R2V0T3JDcmVhdGU6ICcsIGVycik7XG4gICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyByZXRyeTogJHtjb3VudGVyfSBjcmVhdGUgdG9rZW4gYWNjb3VudDogYCwgZSk7XG4gICAgICAgICAgZGVidWdMb2coYCMgbWludDogJHttaW50fSwgb3duZXI6ICR7b3duZXJ9LCBmZWVQYXllcjogJHtmZWVQYXllcn1gKTtcbiAgICAgICAgfVxuICAgICAgICBhd2FpdCBzbGVlcChSRVRSWV9TTEVFUF9USU1FKTtcbiAgICAgICAgY291bnRlcisrO1xuICAgICAgfVxu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XG4gICAgICBkZWJ1Z0xvZygnIyBhc3NvY2lhdGVkVG9rZW5BY2NvdW50OiAnLCBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCkpO1xuXG4gICAgICB0cnkge1xuICAgICAgICAvLyBEb250IHVzZSBSZXN1bHRcbiAgICAgICAgYXdhaXQgZ2V0QWNjb3VudChcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKSxcbiAgICAgICAgICBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LFxuICAgICAgICAgIE5vZGUuZ2V0Q29ubmVjdGlvbigpLmNvbW1pdG1lbnQsXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0OiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICB9IGNhdGNoIChlcnJvcjogdW5rbm93bikge1xuICAgICAgICBpZiAoXG4gICAgICAgICAgIShlcnJvciBpbnN0YW5jZW9mIFRva2VuQWNjb3VudE5vdEZvdW5kRXJyb3IpICYmXG4gICAgICAgICAgIShlcnJvciBpbnN0YW5jZW9mIFRva2VuSW52YWxpZEFjY291bnRPd25lckVycm9yKVxuICAgICAgICApIHtcbiAgICAgICAgICB0aHJvdyBFcnJvcignVW5leHBlY3RlZCBlcnJvcicpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgcGF5ZXIgPSAhZmVlUGF5ZXIgPyBvd25lciA6IGZlZVBheWVyO1xuXG4gICAgICAgIGNvbnN0IGluc3QgPSBjcmVhdGVBc3NvY2lhdGVkVG9rZW5BY2NvdW50SW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgcGF5ZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LFxuICAgICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdCxcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9O1xuICB9XG59XG4iLCAiaW1wb3J0IHsgS2V5cGFpciBhcyBPcmlnaW5hbCwgUHVibGljS2V5IH0gZnJvbSAnQHNvbGFuYS93ZWIzLmpzJztcbmltcG9ydCB7IFB1YmtleSwgU2VjcmV0IH0gZnJvbSAnfi90eXBlcy9hY2NvdW50JztcbmltcG9ydCBicyBmcm9tICdiczU4JztcblxuZXhwb3J0IG5hbWVzcGFjZSBBY2NvdW50IHtcbiAgZXhwb3J0IGNsYXNzIEtleXBhaXIge1xuICAgIHNlY3JldDogU2VjcmV0O1xuICAgIHB1YmtleTogUHVia2V5O1xuXG4gICAgY29uc3RydWN0b3IocGFyYW1zOiB7IHB1YmtleT86IFB1YmtleTsgc2VjcmV0OiBTZWNyZXQgfSkge1xuICAgICAgaWYgKCFwYXJhbXMucHVia2V5KSB7XG4gICAgICAgIGNvbnN0IGtleXBhaXIgPSBwYXJhbXMuc2VjcmV0LnRvS2V5cGFpcigpO1xuICAgICAgICB0aGlzLnB1YmtleSA9IGtleXBhaXIucHVibGljS2V5LnRvU3RyaW5nKCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLnB1YmtleSA9IHBhcmFtcy5wdWJrZXk7XG4gICAgICB9XG4gICAgICB0aGlzLnNlY3JldCA9IHBhcmFtcy5zZWNyZXQ7XG4gICAgfVxuXG4gICAgdG9QdWJsaWNLZX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TogSW50ZXJuYWxDcmVhdG9yc1tdID0+IHtcbiAgICAgIGlmICghaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGlucHV0IS5tYXAoKGRhdGEpID0+IHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBhZGRyZXNzOiBkYXRhLmFkZHJlc3MudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBzaGFyZTogZGF0YS5zaGFyZSxcbiAgICAgICAgICB2ZXJpZmllZDogZmFsc2UsXG4gICAgICAgIH07XG4gICAgICB9KTtcbiAgICB9O1xuXG4gICAgZXhwb3J0IGNvbnN0IGludG9Vc2VyID0gKFxuICAgICAgb3V0cHV0OiBPcHRpb248SW50ZXJuYWxDcmVhdG9yc1tdPixcbiAgICApOiBDcmVhdG9yc1tdIHwgdW5kZWZpbmVkID0+IHtcbiAgICAgIGlmICghb3V0cHV0KSB7XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBvdXRwdXQubWFwKChkYXRhKSA9PiB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgYWRkcmVzczogZGF0YS5hZGRyZXNzLnRvU3RyaW5nKCksXG4gICAgICAgICAgc2hhcmU6IGRhdGEuc2hhcmUsXG4gICAgICAgICAgdmVyaWZpZWQ6IGRhdGEudmVyaWZpZWQsXG4gICAgICAgIH07XG4gICAgICB9KTtcbiAgICB9O1xuICB9XG59XG4iLCAiZXhwb3J0IG5hbWVzcGFjZSBDb252ZXJ0ZXIge1xuICBleHBvcnQgbmFtZXNwYWNlIFJveWFsdHkge1xuICAgIGV4cG9ydCBjb25zdCBUSFJFU0hPTEQgPSAxMDA7XG4gICAgZXhwb3J0IGNvbnN0IGludG9JbmZyYSA9IChwZXJjZW50YWdlOiBudW1iZXIpID0+IHtcbiAgICAgIHJldHVybiBwZXJjZW50YWdlICogVEhSRVNIT0xEO1xuICAgIH07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c3RyaW5nLCBWYWxpZGF0b3JFcnJvcj47XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgY2FzZSAnaW1hZ2UnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSAmJiBtZXRhZGF0YS5pbWFnZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc0ltYWdlVXJsKG1ldGFkYXRhLmltYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3JveWFsdHknOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSkge1xuICAgICAgICAgICAgICByZXMgPSBpc1JveWFsdHkobWV0YWRhdGEucm95YWx0eSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhICYmIG1ldGFkYXRhLnNlbGxlcl9mZWVfYmFzaXNfcG9pbnRzKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnc2VsbGVyRmVlQmFzaXNQb2ludHMnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSkge1xuICAgICAgICAgICAgICByZXMgPSBpc1NlbGxlckZlZUJhc2lzUG9pbnRzKG1ldGFkYXRhLnNlbGxlckZlZUJhc2lzUG9pbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ25hbWUnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLm5hbWUpIHtcbiAgICAgICAgICAgICAgcmVzID0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MucmVkdWNlKChhY2MsIGl4KSA9PiB7XG4gICAgICBpeC5rZXlzLmZvckVhY2goKHsgcHVia2V5LCBpc1NpZ25lciB9KSA9PiB7XG4gICAgICAgIGNvbnN0IHBrID0gcHVia2V5LnRvQmFzZTU4KCk7XG4gICAgICAgIGlmIChpc1NpZ25lcikgc2lnbmVycy5hZGQocGspO1xuICAgICAgICBhY2NvdW50cy5hZGQocGspO1xuICAgICAgfSk7XG5cbiAgICAgIGFjY291bnRzLmFkZChpeC5wcm9ncmFtSWQudG9CYXNlNTgoKSk7XG5cbiAgICAgIGNvbnN0IG5JbmRleGVzID0gaXgua2V5cy5sZW5ndGg7XG4gICAgICBjb25zdCBvcGFxdWVEYXRhID0gaXguZGF0YS5sZW5ndGg7XG5cbiAgICAgIHJldHVybiAoXG4gICAgICAgIGFjYyArXG4gICAgICAgIDEgKyAvLyBQSUQgaW5kZXhcbiAgICAgICAgY29tcGFjdEFycmF5U2l6ZShuSW5kZXhlcywgMSkgK1xuICAgICAgICBjb21wYWN0QXJyYXlTaXplKG9wYXF1ZURhdGEsIDEpXG4gICAgICApO1xuICAgIH0sIDApO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIGNvbXBhY3RBcnJheVNpemUoc2lnbmVycy5zaXplLCA2NCkgKyAvLyBzaWduYXR1cmVzXG4gICAgICAzICsgLy8gaGVhZGVyXG4gICAgICBjb21wYWN0QXJyYXlTaXplKGFjY291bnRzLnNpemUsIDMyKSArIC8vIGFjY291bnRzXG4gICAgICAzMiArIC8vIGJsb2NraGFzaFxuICAgICAgY29tcGFjdEhlYWRlcih0eC5pbnN0cnVjdGlvbnMubGVuZ3RoKSArIC8vIGluc3RydWN0aW9uc1xuICAgICAgaXhzU2l6ZVxuICAgICk7XG4gIH07XG5cbiAgLy8gQ09NUEFDVCBBUlJBWVxuXG4gIGNvbnN0IExPV19WQUxVRSA9IDEyNzsgLy8gMHg3ZlxuICBjb25zdCBISUdIX1ZBTFVFID0gMTYzODM7IC8vIDB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gIk1lbW8iLCAiQ29udmVydGVyIiwgIk1pbnQiLCAiQ29udmVydGVyIiwgIkNvbGxlY3Rpb25EZXRhaWxzIiwgIkNvbnZlcnRlciIsICJVc2VzIiwgIkNvbnZlcnRlciIsICJUb2tlbk1ldGFkYXRhIiwgIkNvbnZlcnRlciIsICJSZWd1bGFyTmZ0TWV0YWRhdGEiLCAiQ29udmVydGVyIiwgIlByb3BlcnRpZXMiLCAiQ29udmVydGVyIiwgIlRyYW5zZmVyQ2hlY2tlZCIsICJDb252ZXJ0ZXIiLCAiVHJhbnNmZXIiLCAiQ29udmVydGVyIiwgIlZhbGlkYXRvciIsICJNZXNzYWdlIiwgIkNvbnZlcnRlciIsICJpbXBvcnRfd2ViMyIsICJpbXBvcnRfYnM1OCIsICJBY2NvdW50IiwgImJzIiwgImltcG9ydF93ZWIzIiwgIk5vZGUiLCAiaW1wb3J0X3dlYjMiLCAiVHJhbnNhY3Rpb25CdWlsZGVyIiwgIkNvbW1vbiIsICJUeCIsICJUcmFuc2FjdGlvbkJ1aWxkZXIiLCAiVHgiLCAiaW1wb3J0X3dlYjMiLCAiVHJhbnNhY3Rpb25CdWlsZGVyIiwgIlR4IiwgImltcG9ydF93ZWIzIiwgIlRyYW5zYWN0aW9uQnVpbGRlciIsICJUeCIsICJUcmFuc2FjdGlvbkJ1aWxkZXIiXQp9Cg== \ No newline at end of file diff --git a/packages/transaction-builder/dist/index.mjs b/packages/transaction-builder/dist/index.mjs new file mode 100644 index 000000000..dfb0cbf66 --- /dev/null +++ b/packages/transaction-builder/dist/index.mjs @@ -0,0 +1,1515 @@ +// src/batch.ts +import { + sendAndConfirmTransaction as sendAndConfirmTransaction2, + Transaction as Tx2 +} from "@solana/web3.js"; + +// ../shared/src/constants.ts +import { PublicKey } from "@solana/web3.js"; +import SolanaJsonConfig from "@solana-suite/config/load"; +var Config = SolanaJsonConfig; +var Constants; +((Constants2) => { + let WarnningMessage; + ((WarnningMessage2) => { + const THRESHHOLD = 5; + let isDisplay = false; + WarnningMessage2.NFT_STORAGE_API_KEY = ` + [Warning] + -------------------------------------- + You need to update nftStorageApiKey define parameter in solana-suite.json. + Can get api key from https://nft.storage/ + -------------------------------------- + `; + WarnningMessage2.DAS_API_URL = ` + [Warning] + -------------------------------------- + You need to update dasApiUrl define parameter in solana-suite.json. + can get api url from https://www.helius.dev/ + -------------------------------------- + `; + WarnningMessage2.calculateProbability = () => { + const randomValue = Math.random(); + const probability = 1 / THRESHHOLD; + if (!isDisplay && randomValue < probability) { + isDisplay = true; + return true; + } + return false; + }; + })(WarnningMessage = Constants2.WarnningMessage || (Constants2.WarnningMessage = {})); +})(Constants || (Constants = {})); +((Constants2) => { + Constants2.currentCluster = Config.cluster.type; + Constants2.customClusterUrl = Config.cluster.customClusterUrl; + Constants2.isDebugging = Config.debugging; + Constants2.nftStorageApiKey = Config.nftStorageApiKey; + Constants2.dasApiUrl = Config.dasApiUrl; + let Cluster; + ((Cluster2) => { + Cluster2["prd"] = "mainnet-beta"; + Cluster2["prdMetaplex"] = "mainnet-beta-metaplex"; + Cluster2["dev"] = "devnet"; + Cluster2["test"] = "testnet"; + Cluster2["localhost"] = "localhost-devnet"; + })(Cluster = Constants2.Cluster || (Constants2.Cluster = {})); + let EndPointUrl; + ((EndPointUrl2) => { + EndPointUrl2["prd"] = "https://api.mainnet-beta.solana.com"; + EndPointUrl2["prdMetaplex"] = "https://api.metaplex.solana.com"; + EndPointUrl2["dev"] = "https://api.devnet.solana.com"; + EndPointUrl2["test"] = "https://api.testnet.solana.com"; + EndPointUrl2["localhost"] = "http://api.devnet.solana.com"; + })(EndPointUrl = Constants2.EndPointUrl || (Constants2.EndPointUrl = {})); + let BundlrUrl; + ((BundlrUrl2) => { + BundlrUrl2["prd"] = "https://node1.irys.xyz,https://node2.irys.xyz"; + BundlrUrl2["dev"] = "https://devnet.irys.xyz"; + })(BundlrUrl = Constants2.BundlrUrl || (Constants2.BundlrUrl = {})); + let DasApiUrl; + ((DasApiUrl2) => { + DasApiUrl2["dev"] = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639"; + })(DasApiUrl = Constants2.DasApiUrl || (Constants2.DasApiUrl = {})); + let NftstorageApiKey; + ((NftstorageApiKey2) => { + NftstorageApiKey2["dev"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE"; + })(NftstorageApiKey = Constants2.NftstorageApiKey || (Constants2.NftstorageApiKey = {})); + Constants2.loadConfig = async () => { + Config = await import("@solana-suite/config/load"); + }; + Constants2.switchCluster = (param) => { + const { cluster: env, customClusterUrl: customClusterUrl2 } = param; + if (customClusterUrl2 && customClusterUrl2.length > 0) { + const index = Date.now() % customClusterUrl2.length; + return customClusterUrl2[index]; + } + switch (env) { + case "mainnet-beta" /* prd */: + return "https://api.mainnet-beta.solana.com" /* prd */; + case "mainnet-beta-metaplex" /* prdMetaplex */: + return "https://api.metaplex.solana.com" /* prdMetaplex */; + case "testnet" /* test */: + return "https://api.testnet.solana.com" /* test */; + case "devnet" /* dev */: + return "https://api.devnet.solana.com" /* dev */; + default: + return "http://api.devnet.solana.com" /* localhost */; + } + }; + Constants2.switchBundlr = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: { + const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); + const index = Date.now() % urls.length; + return urls[index]; + } + default: { + return "https://devnet.irys.xyz" /* dev */; + } + } + }; + Constants2.switchDasApi = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: + if (Constants2.dasApiUrl.length < 1) { + throw Error(Constants2.WarnningMessage.DAS_API_URL); + } + const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); + const index = Date.now() % urls.length; + return urls[index]; + default: { + const urls2 = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639" /* dev */.split(","); + const index2 = Date.now() % urls2.length; + return urls2[index2]; + } + } + }; + Constants2.switchNftStorage = (env) => { + switch (env) { + case "mainnet-beta" /* prd */: + if (!Constants2.nftStorageApiKey) { + throw Error(Constants2.WarnningMessage.NFT_STORAGE_API_KEY); + } + return Constants2.nftStorageApiKey; + default: { + return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE" /* dev */; + } + } + }; + Constants2.WRAPPED_TOKEN_PROGRAM_ID = new PublicKey( + "So11111111111111111111111111111111111111112" + ); + Constants2.MEMO_PROGRAM_ID = new PublicKey( + "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo" + ); + Constants2.METAPLEX_PROGRAM_ID = new PublicKey( + "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" + ); + Constants2.COMMITMENT = "confirmed"; + Constants2.NFT_STORAGE_GATEWAY_URL = "https://ipfs.io/ipfs"; + Constants2.IRYS_GATEWAY_URL = "https://gateway.irys.xyz"; + Constants2.BUNDLR_NETWORK_URL = (0, Constants2.switchBundlr)(Config.cluster.type); + Constants2.DAS_API_URL = (0, Constants2.switchDasApi)(Config.cluster.type); + Constants2.NFT_STORAGE_API_KEY = (0, Constants2.switchNftStorage)(Config.cluster.type); + Constants2.EXPLORER_SOLSCAN_URL = "https://solscan.io"; + Constants2.EXPLORER_SOLANAFM_URL = "https://solana.fm"; + Constants2.EXPLORER_XRAY_URL = "https://xray.helius.xyz"; +})(Constants || (Constants = {})); + +// ../shared/src/result.ts +var AbstractResult = class { + // unified-signatures. into line 10 + // unwrap(ok: (value: T) => U, err: (error: E) => U): U; + unwrap(ok, err) { + const r = this._chain( + (value) => Result.ok(ok ? ok(value) : value), + (error) => err ? Result.ok(err(error)) : Result.err(error) + ); + if (r.isErr) { + throw r.error; + } + return r.value; + } + map(ok, err) { + return this._chain( + (value) => Result.ok(ok(value)), + (error) => Result.err(err ? err(error) : error) + ); + } + chain(ok, err) { + return this._chain(ok, err || ((error) => Result.err(error))); + } + match(ok, err) { + this._chain( + (value) => Result.ok(ok(value)), + (error) => Result.err(err(error)) + ); + } + /// submit (alias Instruction.submit) //// + async submit() { + try { + const instruction = this.unwrap(); + if (instruction.instructions && instruction.signers) { + return await instruction.submit(); + } + return Result.err(Error("Only Instruction object")); + } catch (err) { + return Result.err(err); + } + } +}; +var InternalOk = class extends AbstractResult { + constructor(value) { + super(); + this.value = value; + } + isOk = true; + isErr = false; + /* eslint-disable @typescript-eslint/no-unused-vars */ + _chain(ok, _err) { + return ok(this.value); + } +}; +var InternalErr = class extends AbstractResult { + constructor(error) { + super(); + this.error = error; + } + isOk = false; + isErr = true; + _chain(_ok, err) { + return err(this.error); + } +}; +var Result; +((Result7) => { + function ok(value) { + return new InternalOk(value); + } + Result7.ok = ok; + function err(error) { + return new InternalErr(error || Error()); + } + Result7.err = err; + function all(obj) { + if (Array.isArray(obj)) { + const resArr = []; + for (const item of obj) { + if (item.isErr) { + return item; + } + resArr.push(item.value); + } + return Result7.ok(resArr); + } + const res = {}; + const keys = Object.keys(obj); + for (const key of keys) { + const item = obj[key]; + if (item.isErr) { + return item; + } + res[key] = item.value; + } + return Result7.ok(res); + } + Result7.all = all; +})(Result || (Result = {})); + +// ../shared/src/shared.ts +var overwriteObject = (object, targets) => { + const that = object; + targets.forEach((target) => { + delete that[target.existsKey]; + that[target.will.key] = target.will.value; + }); + return that; +}; +var debugLog = (data1, data2 = "", data3 = "", data4 = "") => { + if (Constants.isDebugging === "true" || process.env.DEBUG === "true") { + console.log("[DEBUG]", data1, data2, data3, data4); + } +}; +var sleep = async (sec) => { + return new Promise((r) => setTimeout(r, sec * 1e3)); +}; +var isPromise = (obj) => { + return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; +}; +function Try(input, finallyInput) { + try { + const v = input(); + if (isPromise(v)) { + return v.then( + (x) => Result.ok(x), + (err) => Result.err(err) + ); + } else { + return Result.ok(v); + } + } catch (e) { + if (e instanceof Error) { + return Result.err(e); + } + return Result.err(Error(e)); + } finally { + if (finallyInput) { + debugLog("# finally input:", finallyInput); + finallyInput(); + } + } +} +var convertTimestampToDateTime = (created_at) => { + if (created_at) { + return new Date(created_at * 1e3); + } + return; +}; + +// ../account/src/associated.ts +import { + ASSOCIATED_TOKEN_PROGRAM_ID, + createAssociatedTokenAccountInstruction, + getAccount, + getAssociatedTokenAddressSync, + TOKEN_PROGRAM_ID, + TokenAccountNotFoundError, + TokenInvalidAccountOwnerError +} from "@solana/spl-token"; + +// ../account/src/keypair.ts +import { Keypair as Original, PublicKey as PublicKey2 } from "@solana/web3.js"; +import bs from "bs58"; +var Account; +((Account5) => { + class Keypair4 { + secret; + pubkey; + constructor(params) { + if (!params.pubkey) { + const keypair = params.secret.toKeypair(); + this.pubkey = keypair.publicKey.toString(); + } else { + this.pubkey = params.pubkey; + } + this.secret = params.secret; + } + toPublicKey() { + return new PublicKey2(this.pubkey); + } + toKeypair() { + const decoded = bs.decode(this.secret); + return Original.fromSecretKey(decoded); + } + static isPubkey = (value) => /^[0-9a-zA-Z]{32,44}$/.test(value); + static isSecret = (value) => /^[0-9a-zA-Z]{87,88}$/.test(value); + static create = () => { + const keypair = Original.generate(); + return new Keypair4({ + pubkey: keypair.publicKey.toString(), + secret: bs.encode(keypair.secretKey) + }); + }; + static toKeyPair = (keypair) => { + return new Keypair4({ + pubkey: keypair.publicKey.toString(), + secret: bs.encode(keypair.secretKey) + }); + }; + } + Account5.Keypair = Keypair4; +})(Account || (Account = {})); + +// ../account/src/associated.ts +var Account2; +((Account5) => { + let Associated; + ((Associated2) => { + const RETRY_OVER_LIMIT = 10; + const RETRY_SLEEP_TIME = 3; + const get = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { + const res = await (0, Associated2.makeOrCreateInstruction)( + mint, + owner, + new Account.Keypair({ secret: feePayer }).pubkey, + allowOwnerOffCurve + ); + if (!res.inst) { + return res.tokenAccount; + } + return new TransactionBuilder.Common( + [res.inst], + [], + feePayer.toKeypair(), + res.tokenAccount + ); + }; + Associated2.retryGetOrCreate = async (mint, owner, feePayer) => { + let counter = 1; + while (counter < RETRY_OVER_LIMIT) { + try { + const inst = await get(mint, owner, feePayer, true); + if (inst && typeof inst === "string") { + debugLog("# associatedTokenAccount: ", inst); + return inst; + } else if (inst instanceof TransactionBuilder.Common) { + (await inst.submit()).map( + async (ok) => { + await Node.confirmedSig(ok); + return inst.data; + }, + (err) => { + debugLog("# Error submit retryGetOrCreate: ", err); + throw err; + } + ); + } + } catch (e) { + debugLog(`# retry: ${counter} create token account: `, e); + debugLog(`# mint: ${mint}, owner: ${owner}, feePayer: ${feePayer}`); + } + await sleep(RETRY_SLEEP_TIME); + counter++; + } + throw Error(`retry action is over limit ${RETRY_OVER_LIMIT}`); + }; + Associated2.makeOrCreateInstruction = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { + const associatedTokenAccount = getAssociatedTokenAddressSync( + mint.toPublicKey(), + owner.toPublicKey(), + allowOwnerOffCurve, + TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID + ); + debugLog("# associatedTokenAccount: ", associatedTokenAccount.toString()); + try { + await getAccount( + Node.getConnection(), + associatedTokenAccount, + Node.getConnection().commitment, + TOKEN_PROGRAM_ID + ); + return { + tokenAccount: associatedTokenAccount.toString(), + inst: void 0 + }; + } catch (error) { + if (!(error instanceof TokenAccountNotFoundError) && !(error instanceof TokenInvalidAccountOwnerError)) { + throw Error("Unexpected error"); + } + const payer = !feePayer ? owner : feePayer; + const inst = createAssociatedTokenAccountInstruction( + payer.toPublicKey(), + associatedTokenAccount, + owner.toPublicKey(), + mint.toPublicKey(), + TOKEN_PROGRAM_ID, + ASSOCIATED_TOKEN_PROGRAM_ID + ); + return { + tokenAccount: associatedTokenAccount.toString(), + inst + }; + } + }; + })(Associated = Account5.Associated || (Account5.Associated = {})); +})(Account2 || (Account2 = {})); + +// ../account/src/pda.ts +import { PublicKey as PublicKey3 } from "@solana/web3.js"; +import { PROGRAM_ID } from "@metaplex-foundation/mpl-token-metadata"; +import { MPL_BUBBLEGUM_PROGRAM_ID } from "@metaplex-foundation/mpl-bubblegum"; +import BN from "bn.js"; +var Account3; +((Account5) => { + let Pda; + ((Pda2) => { + Pda2.getMetadata = (address) => { + const [publicKey] = PublicKey3.findProgramAddressSync( + [ + Buffer.from("metadata"), + PROGRAM_ID.toBuffer(), + address.toPublicKey().toBuffer() + ], + PROGRAM_ID + ); + return publicKey; + }; + Pda2.getMasterEdition = (address) => { + const [publicKey] = PublicKey3.findProgramAddressSync( + [ + Buffer.from("metadata"), + PROGRAM_ID.toBuffer(), + address.toPublicKey().toBuffer(), + Buffer.from("edition") + ], + PROGRAM_ID + ); + return publicKey; + }; + Pda2.getTreeAuthority = (address) => { + const [publicKey] = PublicKey3.findProgramAddressSync( + [address.toPublicKey().toBuffer()], + MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return publicKey; + }; + Pda2.getBgumSigner = () => { + const [publicKey] = PublicKey3.findProgramAddressSync( + [Buffer.from("collection_cpi", "utf8")], + MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return publicKey; + }; + Pda2.getAssetId = (address, leafIndex) => { + const node = new BN.BN(leafIndex); + const [assetId] = PublicKey3.findProgramAddressSync( + [ + Buffer.from("asset", "utf8"), + address.toPublicKey().toBuffer(), + Uint8Array.from(node.toArray("le", 8)) + ], + MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() + ); + return assetId.toString(); + }; + })(Pda = Account5.Pda || (Account5.Pda = {})); +})(Account3 || (Account3 = {})); + +// ../account/src/index.ts +var Account4 = { + ...Account2, + ...Account, + ...Account3 +}; + +// ../converter/src/collection.ts +var Converter; +((Converter15) => { + let Collection; + ((Collection2) => { + Collection2.intoInfra = (input) => { + if (!input) { + return null; + } + return { + key: input.toPublicKey(), + verified: false + }; + }; + Collection2.intoUser = (output) => { + if (!output) { + return void 0; + } + return { + address: output.key.toString(), + verified: output.verified + }; + }; + })(Collection = Converter15.Collection || (Converter15.Collection = {})); + let CollectionMint; + ((CollectionMint2) => { + CollectionMint2.intoUser = (output) => { + const res = output.find((value) => { + if (value.group_key === "collection") { + return value.group_value; + } + }); + return res ? res.group_value : ""; + }; + })(CollectionMint = Converter15.CollectionMint || (Converter15.CollectionMint = {})); +})(Converter || (Converter = {})); + +// ../converter/src/creators.ts +var Converter2; +((Converter15) => { + let Creators; + ((Creators2) => { + Creators2.intoInfra = (input) => { + if (!input) { + return null; + } + return input.map((data) => { + return { + address: data.address.toPublicKey(), + share: data.share, + verified: false + }; + }); + }; + Creators2.intoCompressedNftInfra = (input) => { + if (!input) { + return []; + } + return input.map((data) => { + return { + address: data.address.toPublicKey(), + share: data.share, + verified: false + }; + }); + }; + Creators2.intoUser = (output) => { + if (!output) { + return void 0; + } + return output.map((data) => { + return { + address: data.address.toString(), + share: data.share, + verified: data.verified + }; + }); + }; + })(Creators = Converter15.Creators || (Converter15.Creators = {})); +})(Converter2 || (Converter2 = {})); + +// ../converter/src/royalty.ts +var Converter3; +((Converter15) => { + let Royalty; + ((Royalty2) => { + Royalty2.THRESHOLD = 100; + Royalty2.intoInfra = (percentage) => { + return percentage * Royalty2.THRESHOLD; + }; + Royalty2.intoUser = (percentage) => { + return percentage * Royalty2.THRESHOLD; + }; + })(Royalty = Converter15.Royalty || (Converter15.Royalty = {})); +})(Converter3 || (Converter3 = {})); + +// ../converter/src/compressed-nft-metadata.ts +import { + TokenProgramVersion, + TokenStandard +} from "mpl-bubblegum-instruction"; +var Converter4; +((Converter15) => { + let CompressedNftMetadata; + ((CompressedNftMetadata2) => { + CompressedNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoCompressedNftInfra(input.creators), + collection: Converter.Collection.intoInfra(input.collection), + uses: input.uses || null, + primarySaleHappened: false, + isMutable: input.isMutable ?? false, + editionNonce: 0, + tokenStandard: TokenStandard.NonFungible, + tokenProgramVersion: TokenProgramVersion.Original + }; + }; + CompressedNftMetadata2.intoUser = (output) => { + return { + mint: output.onchain.id.toString(), + collectionMint: Converter.CollectionMint.intoUser( + output.onchain.grouping + ), + authorities: output.onchain.authorities, + royalty: Converter3.Royalty.intoUser(output.onchain.royalty.percent), + name: output.onchain.content.metadata.name, + symbol: output.onchain.content.metadata.symbol, + uri: output.onchain.content.json_uri, + creators: Converter2.Creators.intoUser(output.onchain.creators), + treeAddress: output.onchain.compression.tree, + isCompressed: output.onchain.compression.compressed, + isMutable: output.onchain.mutable, + isBurn: output.onchain.burnt, + editionNonce: output.onchain.supply.edition_nonce, + primarySaleHappened: output.onchain.royalty.primary_sale_happened, + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + })(CompressedNftMetadata = Converter15.CompressedNftMetadata || (Converter15.CompressedNftMetadata = {})); +})(Converter4 || (Converter4 = {})); + +// ../converter/src/memo.ts +var Converter5; +((Converter15) => { + let Memo; + ((Memo2) => { + Memo2.intoUserSide = (output, meta, outputTransfer, mappingTokenAccount) => { + const history = {}; + if (outputTransfer && outputTransfer.program !== "") { + if (mappingTokenAccount && outputTransfer.program === "spl-token") { + const foundSource = mappingTokenAccount.find( + (m) => m.account === outputTransfer.parsed.info.source + ); + const foundDest = mappingTokenAccount.find( + (m) => m.account === outputTransfer.parsed.info.destination + ); + history.mint = outputTransfer.parsed.info.mint; + foundSource && (history.source = foundSource.owner); + foundDest && (history.destination = foundDest.owner); + } else { + history.source = outputTransfer.parsed.info.source; + history.destination = outputTransfer.parsed.info.destination; + } + } + history.memo = output.parsed; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Memo = Converter15.Memo || (Converter15.Memo = {})); +})(Converter5 || (Converter5 = {})); + +// ../converter/src/mint.ts +var Converter6; +((Converter15) => { + let Mint; + ((Mint2) => { + Mint2.intoUserSide = (output, meta) => { + const history = {}; + history.mint = output.parsed.info.mint; + history.mintAuthority = output.parsed.info.mintAuthority; + history.tokenAmount = output.parsed.info.tokenAmount; + history.account = output.parsed.info.account; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Mint = Converter15.Mint || (Converter15.Mint = {})); +})(Converter6 || (Converter6 = {})); + +// ../converter/src/collection-details.ts +var Converter7; +((Converter15) => { + let CollectionDetails; + ((CollectionDetails2) => { + CollectionDetails2.intoUser = (output) => { + if (!output) { + return void 0; + } + return { + __kind: output.__kind, + size: parseInt(output.size.toString(10)) + }; + }; + })(CollectionDetails = Converter15.CollectionDetails || (Converter15.CollectionDetails = {})); +})(Converter7 || (Converter7 = {})); + +// ../converter/src/uses.ts +var Converter8; +((Converter15) => { + let Uses; + ((Uses2) => { + Uses2.intoUserSide = (output) => { + if (!output) { + return void 0; + } + return output; + }; + })(Uses = Converter15.Uses || (Converter15.Uses = {})); +})(Converter8 || (Converter8 = {})); + +// ../converter/src/token-metadata.ts +var Converter9; +((Converter15) => { + let TokenMetadata; + ((TokenMetadata2) => { + TokenMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoInfra(input.creators), + collection: null, + uses: input.uses || null + }; + }; + TokenMetadata2.intoUser = (output, tokenAmount) => { + return { + mint: output.onchain.mint.toString(), + royalty: output.onchain.data.sellerFeeBasisPoints, + name: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.name), + symbol: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.symbol), + tokenAmount, + uri: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.uri), + creators: Converter2.Creators.intoUser(output.onchain.data.creators), + uses: Converter8.Uses.intoUserSide(output.onchain.uses), + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + TokenMetadata2.deleteNullStrings = (str) => { + return str.replace(/\0/g, ""); + }; + })(TokenMetadata = Converter15.TokenMetadata || (Converter15.TokenMetadata = {})); +})(Converter9 || (Converter9 = {})); + +// ../converter/src/regular-nft-metadata.ts +var Converter10; +((Converter15) => { + let RegularNftMetadata; + ((RegularNftMetadata2) => { + RegularNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { + return { + name: input.name, + symbol: input.symbol, + uri, + sellerFeeBasisPoints, + creators: Converter2.Creators.intoInfra(input.creators), + collection: Converter.Collection.intoInfra(input.collection), + uses: input.uses || null + }; + }; + RegularNftMetadata2.intoUser = (output) => { + return { + mint: output.onchain.mint.toString(), + updateAuthority: output.onchain.updateAuthority.toString(), + royalty: output.onchain.data.sellerFeeBasisPoints, + name: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.name), + symbol: Converter9.TokenMetadata.deleteNullStrings( + output.onchain.data.symbol + ), + uri: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.uri), + isMutable: output.onchain.isMutable, + primarySaleHappened: output.onchain.primarySaleHappened, + creators: Converter2.Creators.intoUser(output.onchain.data.creators), + editionNonce: output.onchain.editionNonce, + collection: Converter.Collection.intoUser(output.onchain.collection), + collectionDetails: Converter7.CollectionDetails.intoUser( + output.onchain.collectionDetails + ), + uses: Converter8.Uses.intoUserSide(output.onchain.uses), + dateTime: convertTimestampToDateTime(output.offchain.created_at), + offchain: output.offchain + }; + }; + })(RegularNftMetadata = Converter15.RegularNftMetadata || (Converter15.RegularNftMetadata = {})); +})(Converter10 || (Converter10 = {})); + +// ../converter/src/properties.ts +var Converter11; +((Converter15) => { + let Properties; + ((Properties2) => { + Properties2.intoInfra = async (input, callbackFunc, storageType, feePayer) => { + if (!input || !input.files) { + return {}; + } + const files = await Promise.all( + input.files.map(async (file) => { + if (!file.filePath) { + return {}; + } + const res = await callbackFunc(file.filePath, storageType, feePayer); + if (res.isErr) { + throw Error(res.error.message); + } + return overwriteObject(file, [ + { + existsKey: "filePath", + will: { key: "uri", value: res.value } + } + ]); + }) + ); + return { ...input, files }; + }; + })(Properties = Converter15.Properties || (Converter15.Properties = {})); +})(Converter11 || (Converter11 = {})); + +// ../converter/src/transfer-checked.ts +var Converter12; +((Converter15) => { + let TransferChecked; + ((TransferChecked2) => { + TransferChecked2.intoUserSide = (output, meta, mappingTokenAccount) => { + const history = {}; + if (mappingTokenAccount) { + const foundSource = mappingTokenAccount.find( + (m) => m.account === output.parsed.info.source + ); + const foundDest = mappingTokenAccount.find( + (m) => m.account === output.parsed.info.destination + ); + foundSource && (history.source = foundSource.owner); + foundDest && (history.destination = foundDest.owner); + } + history.tokenAmount = output.parsed.info.tokenAmount; + history.mint = output.parsed.info.mint; + history.multisigAuthority = output.parsed.info.multisigAuthority; + history.signers = output.parsed.info.signers; + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(TransferChecked = Converter15.TransferChecked || (Converter15.TransferChecked = {})); +})(Converter12 || (Converter12 = {})); + +// ../converter/src/transfer.ts +var Converter13; +((Converter15) => { + let Transfer; + ((Transfer2) => { + Transfer2.intoUserSide = (output, meta) => { + const history = {}; + if (!output.parsed.info.destination || !output.parsed.info.lamports) { + return; + } + history.source = output.parsed.info.source; + history.destination = output.parsed.info.destination; + history.sol = output.parsed.info.lamports?.toSol().toString(); + history.type = output.program; + history.dateTime = convertTimestampToDateTime(meta.blockTime); + history.sig = meta.transaction.signatures[0]; + history.innerInstruction = false; + if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { + history.innerInstruction = true; + } + return history; + }; + })(Transfer = Converter15.Transfer || (Converter15.Transfer = {})); +})(Converter13 || (Converter13 = {})); + +// ../converter/src/index.ts +var Converter14 = { + ...Converter4, + ...Converter, + ...Converter2, + ...Converter5, + ...Converter6, + ...Converter10, + ...Converter11, + ...Converter3, + ...Converter9, + ...Converter12, + ...Converter13, + ...Converter8 +}; + +// ../validator/src/index.ts +var Validator; +((Validator2) => { + let Message; + ((Message2) => { + Message2.SUCCESS = "success"; + Message2.SMALL_NUMBER = "too small"; + Message2.BIG_NUMBER = "too big"; + Message2.LONG_LENGTH = "too long"; + Message2.EMPTY = "invalid empty value"; + Message2.INVALID_URL = "invalid url"; + Message2.ONLY_NODE_JS = "`string` type is only Node.js"; + })(Message = Validator2.Message || (Validator2.Message = {})); + Validator2.NAME_LENGTH = 32; + Validator2.SYMBOL_LENGTH = 10; + Validator2.URL_LENGTH = 200; + Validator2.ROYALTY_MAX = 100; + Validator2.SELLER_FEE_BASIS_POINTS_MAX = 1e4; + Validator2.ROYALTY_MIN = 0; + Validator2.isRoyalty = (royalty) => { + return Try(() => { + const key = "royalty"; + if (royalty !== 0 && !royalty) { + throw createError(key, Message.EMPTY, royalty); + } + if (royalty < Validator2.ROYALTY_MIN) { + throw createError(key, Message.SMALL_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MIN, + condition: "underMin" + }); + } else if (royalty > Validator2.ROYALTY_MAX) { + throw createError(key, Message.BIG_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MAX, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isSellerFeeBasisPoints = (royalty) => { + return Try(() => { + const key = "sellerFeeBasisPoints/seller_fee_basis_points"; + if (royalty !== 0 && !royalty) { + throw createError(key, Message.EMPTY, royalty); + } + if (royalty < Validator2.ROYALTY_MIN) { + throw createError(key, Message.SMALL_NUMBER, royalty, { + threshold: Validator2.ROYALTY_MIN, + condition: "underMin" + }); + } else if (royalty > Validator2.ROYALTY_MAX * Converter14.Royalty.THRESHOLD) { + throw createError(key, Message.BIG_NUMBER, royalty, { + threshold: Validator2.SELLER_FEE_BASIS_POINTS_MAX, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isName = (name) => { + return Try(() => { + const key = "name"; + if (!name) { + throw createError(key, Message.EMPTY, name); + } + if (byteLength(name) > Validator2.NAME_LENGTH) { + throw createError(key, Message.LONG_LENGTH, name, { + threshold: Validator2.NAME_LENGTH, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isSymbol = (symbol) => { + return Try(() => { + const key = "symbol"; + if (!symbol) { + throw createError(key, Message.EMPTY, symbol); + } + if (byteLength(symbol) > Validator2.SYMBOL_LENGTH) { + throw createError(key, Message.LONG_LENGTH, symbol, { + threshold: Validator2.SYMBOL_LENGTH, + condition: "overMax" + }); + } + return Message.SUCCESS; + }); + }; + Validator2.isImageUrl = (image) => isUriOrImage(image, "image"); + Validator2.checkAll = (metadata) => { + return Try(() => { + const keys = Object.keys(metadata); + const results = []; + keys.map((key) => { + let res; + switch (key) { + case "image": + if (key in metadata && metadata.image) { + res = (0, Validator2.isImageUrl)(metadata.image); + } + break; + case "royalty": + if (key in metadata) { + res = (0, Validator2.isRoyalty)(metadata.royalty); + } + break; + case "seller_fee_basis_points": + if (key in metadata && metadata.seller_fee_basis_points) { + res = (0, Validator2.isSellerFeeBasisPoints)(metadata.seller_fee_basis_points); + } + break; + case "sellerFeeBasisPoints": + if (key in metadata) { + res = (0, Validator2.isSellerFeeBasisPoints)(metadata.sellerFeeBasisPoints); + } + break; + case "name": + if (metadata.name) { + res = (0, Validator2.isName)(metadata.name); + } + break; + case "symbol": + if (metadata.symbol) { + res = (0, Validator2.isSymbol)(metadata.symbol); + } + break; + } + if (res && res.isErr) { + results.push(...res.error.details); + } + }); + if (results.length > 0) { + const message = "Caught in the validation errors. see information e.g: err.details"; + throw new ValidatorError(message, results); + } + return Message.SUCCESS; + }); + }; + const byteLength = (value) => { + const text = new TextEncoder(); + return text.encode(value).length; + }; + const createError = (key, message, actual, limit) => { + let error; + if (limit) { + error = new ValidatorError(message, [{ key, message, actual, limit }]); + } else { + error = new ValidatorError(message, [{ key, message, actual }]); + } + return error; + }; + const isUriOrImage = (imageOrUri, key) => { + return Try(() => { + if (!imageOrUri) { + throw createError(key, Message.EMPTY, imageOrUri); + } + if (byteLength(imageOrUri) > Validator2.URL_LENGTH) { + throw createError(key, Message.LONG_LENGTH, imageOrUri, { + threshold: Validator2.URL_LENGTH, + condition: "overMax" + }); + } + if (!/https?:\/\/[-_.!~*\\()a-zA-Z0-9;?:&=+,%#]+/g.test(imageOrUri)) { + throw createError(key, Message.INVALID_URL, imageOrUri); + } + return Message.SUCCESS; + }); + }; +})(Validator || (Validator = {})); +var ValidatorError = class extends Error { + details; + constructor(message, details) { + super(message); + this.details = details; + } +}; + +// ../global/src/index.ts +import { Keypair, LAMPORTS_PER_SOL, PublicKey as PublicKey4 } from "@solana/web3.js"; +import { BigNumber } from "bignumber.js"; +import bs2 from "bs58"; +String.prototype.toExplorerUrl = function(explorer = "solscan" /* Solscan */, options = {}) { + const endPointUrl = Node.getConnection().rpcEndpoint; + debugLog("# toExplorerUrl rpcEndpoint:", endPointUrl); + let cluster = ""; + if (endPointUrl === Constants.EndPointUrl.prd) { + cluster = Constants.Cluster.prd; + } else if (endPointUrl === Constants.EndPointUrl.test) { + cluster = Constants.Cluster.test; + } else if (endPointUrl === Constants.EndPointUrl.dev) { + cluster = Constants.Cluster.dev; + } else { + cluster = Constants.Cluster.dev; + } + const addressOrSignature = this.toString(); + let url = ""; + if (options.replacePath) { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/${options.replacePath}/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; + } + return url; + } + if (Account4.Keypair.isPubkey(addressOrSignature)) { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/address/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/account/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/account/${addressOrSignature}?cluster=${cluster}`; + } + } else { + if (explorer === "solanafm" /* SolanaFM */) { + url = `${Constants.EXPLORER_SOLANAFM_URL}/tx/${addressOrSignature}?cluster=${cluster}`; + } else if (explorer === "xray" /* Xray */) { + url = `${Constants.EXPLORER_XRAY_URL}/tx/${addressOrSignature}?network=${cluster}`; + } else { + url = `${Constants.EXPLORER_SOLSCAN_URL}/tx/${addressOrSignature}?cluster=${cluster}`; + } + } + return url; +}; +String.prototype.toPublicKey = function() { + if (!Account4.Keypair.isPubkey(this.toString())) { + throw Error(`No match KeyPair.PubKey: ${this.toString()}`); + } + return new PublicKey4(this.toString()); +}; +String.prototype.toKeypair = function() { + if (!Account4.Keypair.isSecret(this.toString())) { + throw Error(`No match KeyPair.Secret: ${this.toString()}`); + } + const decoded = bs2.decode(this.toString()); + return Keypair.fromSecretKey(decoded); +}; +Number.prototype.toSol = function() { + return BigNumber(this).div(LAMPORTS_PER_SOL).toNumber(); +}; +Number.prototype.toLamports = function() { + return BigNumber(this).times(LAMPORTS_PER_SOL).toNumber(); +}; + +// ../node/src/index.ts +import { Connection } from "@solana/web3.js"; +var Node; +((Node2) => { + const setted = { + clusterUrl: "", + commitment: Constants.COMMITMENT, + customClusterUrl: [] + }; + Node2.getConnection = () => { + if (setted.customClusterUrl.length > 0) { + setted.clusterUrl = Constants.switchCluster({ + customClusterUrl: setted.customClusterUrl + }); + } else if (Constants.customClusterUrl.length > 0) { + setted.clusterUrl = Constants.switchCluster({ + customClusterUrl: Constants.customClusterUrl + }); + } else if (!setted.clusterUrl) { + setted.clusterUrl = Constants.switchCluster({ + cluster: Constants.currentCluster + }); + } + if (!setted.commitment) { + setted.commitment = Constants.COMMITMENT; + } + return new Connection(setted.clusterUrl, setted.commitment); + }; + Node2.changeConnection = (param) => { + setted.clusterUrl = ""; + setted.customClusterUrl = []; + setted.commitment = Constants.COMMITMENT; + const { cluster, commitment, customClusterUrl } = param; + if (commitment) { + setted.commitment = commitment; + debugLog("# Node change commitment: ", setted.commitment); + } + if (cluster) { + setted.clusterUrl = Constants.switchCluster({ cluster }); + debugLog("# Node change clusterUrl: ", setted.clusterUrl); + } + if (customClusterUrl) { + debugLog("# customClusterUrl: ", customClusterUrl); + setted.clusterUrl = Constants.switchCluster({ customClusterUrl }); + setted.customClusterUrl = customClusterUrl; + debugLog( + "# Node change cluster, custom cluster url: ", + setted.clusterUrl + ); + } + }; + Node2.confirmedSig = async (signature, commitment = Constants.COMMITMENT) => { + const connection = Node2.getConnection(); + const latestBlockhash = await connection.getLatestBlockhash(); + return await connection.confirmTransaction( + { + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, + signature + }, + commitment + ).then(Result.ok).catch(Result.err); + }; +})(Node || (Node = {})); + +// src/common.ts +import { + sendAndConfirmTransaction, + Transaction as Tx +} from "@solana/web3.js"; +var MAX_RETRIES = 3; +var TransactionBuilder2; +((TransactionBuilder6) => { + class Common2 { + static MAX_TRANSACTION_SIZE = 1232; + instructions; + signers; + feePayer; + data; + constructor(instructions, signers, feePayer, data) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + submit = async () => { + return Try(async () => { + if (!(this instanceof Common2)) { + throw Error("only Instruction object that can use this"); + } + const transaction = new Tx(); + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + this.instructions.forEach((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + return await sendAndConfirmTransaction( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }); + }; + } + TransactionBuilder6.Common = Common2; + TransactionBuilder6.getTxSize = (tx, feePayer) => { + const feePayerPk = [feePayer.toBase58()]; + const signers = new Set(feePayerPk); + const accounts = new Set(feePayerPk); + const ixsSize = tx.instructions.reduce((acc, ix) => { + ix.keys.forEach(({ pubkey, isSigner }) => { + const pk = pubkey.toBase58(); + if (isSigner) + signers.add(pk); + accounts.add(pk); + }); + accounts.add(ix.programId.toBase58()); + const nIndexes = ix.keys.length; + const opaqueData = ix.data.length; + return acc + 1 + // PID index + compactArraySize(nIndexes, 1) + compactArraySize(opaqueData, 1); + }, 0); + return compactArraySize(signers.size, 64) + // signatures + 3 + // header + compactArraySize(accounts.size, 32) + // accounts + 32 + // blockhash + compactHeader(tx.instructions.length) + // instructions + ixsSize; + }; + const LOW_VALUE = 127; + const HIGH_VALUE = 16383; + const compactHeader = (n) => n <= LOW_VALUE ? 1 : n <= HIGH_VALUE ? 2 : 3; + const compactArraySize = (n, size) => compactHeader(n) + n * size; +})(TransactionBuilder2 || (TransactionBuilder2 = {})); + +// src/batch.ts +var TransactionBuilder3; +((TransactionBuilder6) => { + class BatchTransaction { + submit = async (arr) => { + let i = 0; + for (const a of arr) { + if (!a.instructions && !a.signers) { + throw Error( + `only Instruction object that can use batchSubmit(). + Index: ${i}, Set value: ${JSON.stringify(a)}` + ); + } + i++; + } + const instructions = arr.flatMap((a) => a.instructions); + const signers = arr.flatMap((a) => a.signers); + const feePayers = arr.filter((a) => a.feePayer !== void 0); + let feePayer = signers[0]; + if (feePayers.length > 0 && feePayers[0].feePayer) { + feePayer = feePayers[0].feePayer; + } + const transaction = new Tx2(); + let finalSigners = signers; + if (feePayer) { + transaction.feePayer = feePayer.publicKey; + finalSigners = [feePayer, ...signers]; + } + instructions.map((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + return await sendAndConfirmTransaction2( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }; + } + TransactionBuilder6.BatchTransaction = BatchTransaction; + Array.prototype.submit = async function() { + const instructions = []; + return Try(async () => { + let i = 0; + for (const obj of this) { + if (obj.isErr) { + const errorMess = obj.error.message; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.isOk) { + instructions.push(obj.value); + } else { + instructions.push(obj); + } + i++; + } + return new BatchTransaction().submit(instructions); + }); + }; +})(TransactionBuilder3 || (TransactionBuilder3 = {})); + +// src/mint.ts +import { + sendAndConfirmTransaction as sendAndConfirmTransaction3, + Transaction as Tx3 +} from "@solana/web3.js"; +var TransactionBuilder4; +((TransactionBuilder6) => { + class Mint { + instructions; + signers; + feePayer; + data; + constructor(instructions, signers, feePayer, data) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + submit = async () => { + return Try(async () => { + if (!(this instanceof Mint)) { + throw Error("only MintInstruction object that can use this"); + } + const transaction = new Tx3(); + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + this.instructions.forEach((inst) => transaction.add(inst)); + const options = { + maxRetries: MAX_RETRIES + }; + if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { + debugLog("# Change metaplex cluster on mainnet-beta"); + Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); + } + return await sendAndConfirmTransaction3( + Node.getConnection(), + transaction, + finalSigners, + options + ); + }); + }; + } + TransactionBuilder6.Mint = Mint; +})(TransactionBuilder4 || (TransactionBuilder4 = {})); + +// src/partial-sign.ts +import { + Transaction as Tx4 +} from "@solana/web3.js"; +var TransactionBuilder5; +((TransactionBuilder6) => { + class PartialSignTransaction { + hexInstruction; + data; + canSubmit; + constructor(instructions, mint, canSubmit = false) { + this.hexInstruction = instructions; + this.data = mint; + this.canSubmit = canSubmit; + } + submit = async (feePayer) => { + return Try(async () => { + if (!(this instanceof PartialSignTransaction)) { + throw Error("only PartialSignInstruction object that can use this"); + } + const decode = Buffer.from(this.hexInstruction, "hex"); + const transactionFromJson = Tx4.from(decode); + transactionFromJson.partialSign(feePayer.toKeypair()); + const options = { + maxRetries: MAX_RETRIES + }; + const wireTransaction = transactionFromJson.serialize(); + return await Node.getConnection().sendRawTransaction( + wireTransaction, + options + ); + }); + }; + } + TransactionBuilder6.PartialSignTransaction = PartialSignTransaction; + Array.prototype.submit = async function(feePayer) { + return Try(async () => { + let i = 0; + for await (const obj of this) { + if (obj.isErr) { + const errorMess = obj.error.message; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.canSubmit) { + console.log("# canSubmit", obj); + await obj.submit(feePayer); + console.log("# canSubmit finish"); + await sleep(30); + console.log("# sleep finish"); + } else { + console.log("# transfer transaction start: ", obj); + return await obj.submit(feePayer); + } + i++; + } + }); + }; +})(TransactionBuilder5 || (TransactionBuilder5 = {})); + +// src/index.ts +var TransactionBuilder = { + ...TransactionBuilder3, + ...TransactionBuilder4, + ...TransactionBuilder2, + ...TransactionBuilder5 +}; +export { + TransactionBuilder +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2JhdGNoLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvY29uc3RhbnRzLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvcmVzdWx0LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvc2hhcmVkLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL2Fzc29jaWF0ZWQudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMva2V5cGFpci50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9wZGEudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvaW5kZXgudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb2xsZWN0aW9uLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY3JlYXRvcnMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9yb3lhbHR5LnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY29tcHJlc3NlZC1uZnQtbWV0YWRhdGEudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9tZW1vLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvbWludC50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL2NvbGxlY3Rpb24tZGV0YWlscy50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL3VzZXMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy90b2tlbi1tZXRhZGF0YS50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL3JlZ3VsYXItbmZ0LW1ldGFkYXRhLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvcHJvcGVydGllcy50cyIsICIuLi8uLi9jb252ZXJ0ZXIvc3JjL3RyYW5zZmVyLWNoZWNrZWQudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy90cmFuc2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HtcbiAgICAgICAgICBjb25zdCBpbnN0ID0gYXdhaXQgZ2V0KG1pbnQsIG93bmVyLCBmZWVQYXllciwgdHJ1ZSk7XG5cbiAgICAgICAgICBpZiAoaW5zdCAmJiB0eXBlb2YgaW5zdCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGluc3QpO1xuICAgICAgICAgICAgcmV0dXJuIGluc3Q7XG4gICAgICAgICAgfSBlbHNlIGlmIChpbnN0IGluc3RhbmNlb2YgVHJhbnNhY3Rpb25CdWlsZGVyLkNvbW1vbikge1xuICAgICAgICAgICAgKGF3YWl0IGluc3Quc3VibWl0KCkpLm1hcChcbiAgICAgICAgICAgICAgYXN5bmMgKG9rOiBzdHJpbmcpID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBOb2RlLmNvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnI6IEVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgZGVidWdMb2coJyMgRXJyb3Igc3VibWl0IHJldHJ5R2V0T3JDcmVhdGU6ICcsIGVycik7XG4gICAgICAgICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyByZXRyeTogJHtjb3VudGVyfSBjcmVhdGUgdG9rZW4gYWNjb3VudDogYCwgZSk7XG4gICAgICAgICAgZGVidWdMb2coYCMgbWludDogJHttaW50fSwgb3duZXI6ICR7b3duZXJ9LCBmZWVQYXllcjogJHtmZWVQYXllcn1gKTtcbiAgICAgICAgfVxuICAgICAgICBhd2FpdCBzbGVlcChSRVRSWV9TTEVFU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0lBVEVEX1RPS0VOX1BST0dSQU1fSUQsXG4gICAgICApO1xuXG4gICAgICBkZWJ1Z0xvZygnIyBhc3NvY2lhdGVkVG9rZW5BY2NvdW50OiAnLCBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCkpO1xuXG4gICAgICB0cnkge1xuICAgICAgICAvLyBEb250IHVzZSBSZXN1bHRcbiAgICAgICAgYXdhaXQgZ2V0QWNjb3VudChcbiAgICAgICAgICBOb2RlLmdldENvbm5lY3Rpb24oKSxcbiAgICAgICAgICBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LFxuICAgICAgICAgIE5vZGUuZ2V0Q29ubmVjdGlvbigpLmNvbW1pdG1lbnQsXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0OiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICB9IGNhdGNoIChlcnJvcjogdW5rbm93bikge1xuICAgICAgICBpZiAoXG4gICAgICAgICAgIShlcnJvciBpbnN0YW5jZW9mIFRva2VuQWNjb3VudE5vdEZvdW5kRXJyb3IpICYmXG4gICAgICAgICAgIShlcnJvciBpbnN0YW5jZW9mIFRva2VuSW52YWxpZEFjY291bnRPd25lckVycm9yKVxuICAgICAgICApIHtcbiAgICAgICAgICB0aHJvdyBFcnJvcignVW5leHBlY3RlZCBlcnJvcicpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgcGF5ZXIgPSAhZmVlUGF5ZXIgPyBvd25lciA6IGZlZVBheWVyO1xuXG4gICAgICAgIGNvbnN0IGluc3QgPSBjcmVhdGVBc3NvY2lhdGVkVG9rZW5BY2NvdW50SW5zdHJ1Y3Rpb24oXG4gICAgICAgICAgcGF5ZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LFxuICAgICAgICAgIG93bmVyLnRvUHVibGljS2V5KCksXG4gICAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICAgQVNTT0NJQVRFRF9UT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgdG9rZW5BY2NvdW50OiBhc3NvY2lhdGVkVG9rZW5BY2NvdW50LnRvU3RyaW5nKCksXG4gICAgICAgICAgaW5zdCxcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9O1xuICB9XG59XG4iLCAiaW1wb3J0IHsgS2V5cGFpciBhcyBPcmlnaW5hbCwgUHVibGljS2V5IH0gZnJvbSAnQHNvbGFuYS93ZWIzLmpzJztcbmltcG9ydCB7IFB1YmtleSwgU2VjcmV0IH0gZnJvbSAnfi90eXBlcy9hY2NvdW50JztcbmltcG9ydCBicyBmcm9tICdiczU4JztcblxuZXhwb3J0IG5hbWVzcGFjZSBBY2NvdW50IHtcbiAgZXhwb3J0IGNsYXNzIEtleXBhaXIge1xuICAgIHNlY3JldDogU2VjcmV0O1xuICAgIHB1YmtleTogUHVia2V5O1xuXG4gICAgY29uc3RydWN0b3IocGFyYW1zOiB7IHB1YmtleT86IFB1YmtleTsgc2VjcmV0OiBTZWNyZXQgfSkge1xuICAgICAgaWYgKCFwYXJhbXMucHVia2V5KSB7XG4gICAgICAgIGNvbnN0IGtleXBhaXIgPSBwYXJhbXMuc2VjcmV0LnRvS2V5cGFpcigpO1xuICAgICAgICB0aGlzLnB1YmtleSA9IGtleXBhaXIucHVibGljS2V5LnRvU3RyaW5nKCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLnB1YmtleSA9IHBhcmFtcy5wdWJrZXk7XG4gICAgICB9XG4gICAgICB0aGlzLnNlY3JldCA9IHBhcmFtcy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V5KSA9PiB7XG4gICAgICAgIGxldCByZXMhOiBSZXN1bHQ8c3RyaW5nLCBWYWxpZGF0b3JFcnJvcj47XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgY2FzZSAnaW1hZ2UnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSAmJiBtZXRhZGF0YS5pbWFnZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc0ltYWdlVXJsKG1ldGFkYXRhLmltYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3JveWFsdHknOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSkge1xuICAgICAgICAgICAgICByZXMgPSBpc1JveWFsdHkobWV0YWRhdGEucm95YWx0eSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhICYmIG1ldGFkYXRhLnNlbGxlcl9mZWVfYmFzaXNfcG9pbnRzKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnc2VsbGVyRmVlQmFzaXNQb2ludHMnOlxuICAgICAgICAgICAgaWYgKGtleSBpbiBtZXRhZGF0YSkge1xuICAgICAgICAgICAgICByZXMgPSBpc1NlbGxlckZlZUJhc2lzUG9pbnRzKG1ldGFkYXRhLnNlbGxlckZlZUJhc2lzUG9pbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ25hbWUnOlxuICAgICAgICAgICAgaWYgKG1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bnZlcnRlciIsICJQdWJsaWNLZXkiLCAiYnMiLCAiQWNjb3VudCIsICJQdWJsaWNLZXkiLCAiTm9kZSIsICJUcmFuc2FjdGlvbkJ1aWxkZXIiLCAiQ29tbW9uIiwgIlRyYW5zYWN0aW9uQnVpbGRlciIsICJUeCIsICJzZW5kQW5kQ29uZmlybVRyYW5zYWN0aW9uIiwgInNlbmRBbmRDb25maXJtVHJhbnNhY3Rpb24iLCAiVHgiLCAiVHJhbnNhY3Rpb25CdWlsZGVyIiwgIlR4IiwgInNlbmRBbmRDb25maXJtVHJhbnNhY3Rpb24iLCAiVHgiLCAiVHJhbnNhY3Rpb25CdWlsZGVyIiwgIlR4IiwgIlRyYW5zYWN0aW9uQnVpbGRlciJdCn0K \ No newline at end of file diff --git a/packages/transaction/package.json b/packages/transaction-builder/package.json similarity index 96% rename from packages/transaction/package.json rename to packages/transaction-builder/package.json index 5d5404d88..8b6907a51 100644 --- a/packages/transaction/package.json +++ b/packages/transaction-builder/package.json @@ -1,5 +1,5 @@ { - "name": "transaction", + "name": "transaction-builder", "version": "0.7.0", "private": true, "main": "dist/index.js", diff --git a/packages/transaction-builder/src/batch.ts b/packages/transaction-builder/src/batch.ts new file mode 100644 index 000000000..538d175b5 --- /dev/null +++ b/packages/transaction-builder/src/batch.ts @@ -0,0 +1,86 @@ +import { + ConfirmOptions, + sendAndConfirmTransaction, + Transaction as Tx, + TransactionSignature, +} from '@solana/web3.js'; + +import { Node } from '~/node'; +import { Try } from '~/shared'; +import { MAX_RETRIES, TransactionBuilder as Common } from './common'; + +export namespace TransactionBuilder { + export class BatchTransaction { + submit = async ( + arr: Common.Common[], + ): Promise => { + let i = 0; + for (const a of arr) { + if (!a.instructions && !a.signers) { + throw Error( + `only Instruction object that can use batchSubmit(). + Index: ${i}, Set value: ${JSON.stringify(a)}`, + ); + } + i++; + } + + const instructions = arr.flatMap((a) => a.instructions); + const signers = arr.flatMap((a) => a.signers); + const feePayers = arr.filter((a) => a.feePayer !== undefined); + let feePayer = signers[0]; + if (feePayers.length > 0 && feePayers[0].feePayer) { + feePayer = feePayers[0].feePayer; + } + + const transaction = new Tx(); + let finalSigners = signers; + if (feePayer) { + transaction.feePayer = feePayer.publicKey; + finalSigners = [feePayer, ...signers]; + } + instructions.map((inst) => transaction.add(inst)); + + const options: ConfirmOptions = { + maxRetries: MAX_RETRIES, + }; + + return await sendAndConfirmTransaction( + Node.getConnection(), + transaction, + finalSigners, + options, + ); + }; + } + + /** + * senTransaction() TransactionInstruction + * + * @see {@link types/global.ts} + * @returns Promise> + */ + + /* eslint-disable @typescript-eslint/ban-ts-comment */ + /* @ts-ignore */ + Array.prototype.submit = async function () { + const instructions: Common.Common[] = []; + // dont use forEach + // It is not possible to stop the process by RETURN in the middle of the process. + return Try(async () => { + let i = 0; + for (const obj of this) { + if (obj.isErr) { + const errorMess: string = obj.error.message as string; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.isOk) { + instructions.push(obj.value as Common.Common); + } else { + instructions.push(obj as Common.Common); + } + i++; + } + return new BatchTransaction().submit(instructions); + }); + }; +} diff --git a/packages/transaction-builder/src/common.ts b/packages/transaction-builder/src/common.ts new file mode 100644 index 000000000..0087a09a7 --- /dev/null +++ b/packages/transaction-builder/src/common.ts @@ -0,0 +1,145 @@ +import { + ConfirmOptions, + Keypair, + PublicKey, + sendAndConfirmTransaction, + Transaction as Tx, + TransactionInstruction, + TransactionSignature, +} from '@solana/web3.js'; + +import { Node } from '~/node'; +import { Result, Try } from '~/shared'; +import { Secret } from '~/types/account'; + +export const MAX_RETRIES = 3; + +export interface StructPartialSignTransaction { + hexInstruction: string; + submit: (feePayer: Secret) => Promise>; +} +export interface StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + submit: () => Promise>; +} + +export namespace TransactionBuilder { + export class Common implements StructTransaction { + static MAX_TRANSACTION_SIZE = 1232; + + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: unknown; + + constructor( + instructions: TransactionInstruction[], + signers: Keypair[], + feePayer?: Keypair, + data?: unknown, + ) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + + submit = async (): Promise> => { + return Try(async () => { + if (!(this instanceof Common)) { + throw Error('only Instruction object that can use this'); + } + const transaction = new Tx(); + + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + + this.instructions.forEach((inst) => transaction.add(inst)); + + const options: ConfirmOptions = { + maxRetries: MAX_RETRIES, + }; + + return await sendAndConfirmTransaction( + Node.getConnection(), + transaction, + finalSigners, + options, + ); + }); + }; + } + + /** + * @param tx a solana transaction + * @param feePayer the publicKey of the signer + * @returns size in bytes of the transaction + */ + export const getTxSize = (tx: Tx, feePayer: PublicKey): number => { + const feePayerPk = [feePayer.toBase58()]; + + const signers = new Set(feePayerPk); + const accounts = new Set(feePayerPk); + + const ixsSize = tx.instructions.reduce((acc, ix) => { + ix.keys.forEach(({ pubkey, isSigner }) => { + const pk = pubkey.toBase58(); + if (isSigner) signers.add(pk); + accounts.add(pk); + }); + + accounts.add(ix.programId.toBase58()); + + const nIndexes = ix.keys.length; + const opaqueData = ix.data.length; + + return ( + acc + + 1 + // PID index + compactArraySize(nIndexes, 1) + + compactArraySize(opaqueData, 1) + ); + }, 0); + + return ( + compactArraySize(signers.size, 64) + // signatures + 3 + // header + compactArraySize(accounts.size, 32) + // accounts + 32 + // blockhash + compactHeader(tx.instructions.length) + // instructions + ixsSize + ); + }; + + // COMPACT ARRAY + + const LOW_VALUE = 127; // 0x7f + const HIGH_VALUE = 16383; // 0x3fff + + /** + * Compact u16 array header size + * @param n elements in the compact array + * @returns size in bytes of array header + */ + const compactHeader = (n: number) => + n <= LOW_VALUE ? 1 : n <= HIGH_VALUE ? 2 : 3; + + /** + * Compact u16 array size + * @param n elements in the compact array + * @param size bytes per each element + * @returns size in bytes of array + */ + const compactArraySize = (n: number, size: number) => + compactHeader(n) + n * size; +} diff --git a/packages/transaction-builder/src/index.ts b/packages/transaction-builder/src/index.ts new file mode 100644 index 000000000..bc5b74a71 --- /dev/null +++ b/packages/transaction-builder/src/index.ts @@ -0,0 +1,14 @@ +import { TransactionBuilder as Batch } from './batch'; +import { TransactionBuilder as Common } from './common'; +import { TransactionBuilder as Mint } from './mint'; +import { TransactionBuilder as PartialSign } from './partial-sign'; +import '~/types/global'; +import '~/global'; +export { StructTransaction } from './common'; + +export const TransactionBuilder = { + ...Batch, + ...Mint, + ...Common, + ...PartialSign, +}; diff --git a/packages/transaction-builder/src/mint.ts b/packages/transaction-builder/src/mint.ts new file mode 100644 index 000000000..f50dd8b15 --- /dev/null +++ b/packages/transaction-builder/src/mint.ts @@ -0,0 +1,69 @@ +import { + ConfirmOptions, + Keypair, + sendAndConfirmTransaction, + Transaction as Tx, + TransactionInstruction, + TransactionSignature, +} from '@solana/web3.js'; + +import { Constants, debugLog, Result, Try } from '~/shared'; +import { Node } from '~/node'; +import { MAX_RETRIES, StructTransaction } from './common'; + +export namespace TransactionBuilder { + export class Mint implements StructTransaction { + instructions: TransactionInstruction[]; + signers: Keypair[]; + feePayer?: Keypair; + data?: T; + + constructor( + instructions: TransactionInstruction[], + signers: Keypair[], + feePayer?: Keypair, + data?: T, + ) { + this.instructions = instructions; + this.signers = signers; + this.feePayer = feePayer; + this.data = data; + } + + submit = async (): Promise> => { + return Try(async () => { + if (!(this instanceof Mint)) { + throw Error('only MintInstruction object that can use this'); + } + const transaction = new Tx(); + const blockhashObj = await Node.getConnection().getLatestBlockhash(); + transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; + transaction.recentBlockhash = blockhashObj.blockhash; + let finalSigners = this.signers; + + if (this.feePayer) { + transaction.feePayer = this.feePayer.publicKey; + finalSigners = [this.feePayer, ...this.signers]; + } + + this.instructions.forEach((inst) => transaction.add(inst)); + + const options: ConfirmOptions = { + maxRetries: MAX_RETRIES, + }; + + if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { + debugLog('# Change metaplex cluster on mainnet-beta'); + Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); + } + + return await sendAndConfirmTransaction( + Node.getConnection(), + transaction, + finalSigners, + options, + ); + }); + }; + } +} diff --git a/packages/transaction-builder/src/partial-sign.ts b/packages/transaction-builder/src/partial-sign.ts new file mode 100644 index 000000000..99ce5f515 --- /dev/null +++ b/packages/transaction-builder/src/partial-sign.ts @@ -0,0 +1,78 @@ +import { + ConfirmOptions, + Transaction as Tx, + TransactionSignature, +} from '@solana/web3.js'; + +import { Result, sleep, Try } from '~/shared'; +import { Node } from '~/node'; +import { Pubkey, Secret } from '~/types/account'; +import { MAX_RETRIES, StructPartialSignTransaction } from './common'; + +export namespace TransactionBuilder { + export class PartialSignTransaction implements StructPartialSignTransaction { + hexInstruction: string; + data?: Pubkey; + canSubmit?: boolean; + + constructor(instructions: string, mint?: Pubkey, canSubmit = false) { + this.hexInstruction = instructions; + this.data = mint; + this.canSubmit = canSubmit; + } + + submit = async ( + feePayer: Secret, + ): Promise> => { + return Try(async () => { + if (!(this instanceof PartialSignTransaction)) { + throw Error('only PartialSignInstruction object that can use this'); + } + + const decode = Buffer.from(this.hexInstruction, 'hex'); + const transactionFromJson = Tx.from(decode); + transactionFromJson.partialSign(feePayer.toKeypair()); + + const options: ConfirmOptions = { + maxRetries: MAX_RETRIES, + }; + const wireTransaction = transactionFromJson.serialize(); + return await Node.getConnection().sendRawTransaction( + wireTransaction, + options, + ); + }); + }; + } + + /** + * senTransaction() TransactionInstruction + * + * @see {@link types/global.ts} + * @returns Promise> + */ + + /* eslint-disable @typescript-eslint/ban-ts-comment */ + /* @ts-ignore */ + Array.prototype.submit = async function (feePayer: Secret) { + return Try(async () => { + let i = 0; + for await (const obj of this) { + if (obj.isErr) { + const errorMess: string = obj.error.message as string; + throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); + } else if (obj.canSubmit) { + console.log('# canSubmit', obj); + await obj.submit(feePayer); + console.log('# canSubmit finish'); + await sleep(30); + console.log('# sleep finish'); + } else { + console.log('# transfer transaction start: ', obj); + return await obj.submit(feePayer); + } + i++; + } + }); + }; +} diff --git a/packages/transaction/test/index.test.ts b/packages/transaction-builder/test/index.test.ts similarity index 100% rename from packages/transaction/test/index.test.ts rename to packages/transaction-builder/test/index.test.ts diff --git a/packages/transaction/tsconfig.json b/packages/transaction-builder/tsconfig.json similarity index 90% rename from packages/transaction/tsconfig.json rename to packages/transaction-builder/tsconfig.json index 8b4094213..d48d8ba98 100644 --- a/packages/transaction/tsconfig.json +++ b/packages/transaction-builder/tsconfig.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "build-configs/tsconfig/base.json", - "display": "transaction", + "display": "transaction-builder", "compilerOptions": { "paths": { "~/types/*": [ diff --git a/packages/transaction/dist/index.js b/packages/transaction/dist/index.js deleted file mode 100644 index 3db87e9fb..000000000 --- a/packages/transaction/dist/index.js +++ /dev/null @@ -1,1480 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/index.ts -var src_exports = {}; -__export(src_exports, { - BatchTransaction: () => BatchTransaction, - MintTransaction: () => MintTransaction, - PartialSignTransaction: () => PartialSignTransaction, - Transaction: () => Transaction -}); -module.exports = __toCommonJS(src_exports); - -// src/batch.ts -var import_web36 = require("@solana/web3.js"); - -// ../shared/src/constants.ts -var import_web3 = require("@solana/web3.js"); -var import_load = __toESM(require("@solana-suite/config/load")); -var Config = import_load.default; -var Constants; -((Constants2) => { - let WarnningMessage; - ((WarnningMessage2) => { - const THRESHHOLD = 5; - let isDisplay = false; - WarnningMessage2.NFT_STORAGE_API_KEY = ` - [Warning] - -------------------------------------- - You need to update nftStorageApiKey define parameter in solana-suite.json. - Can get api key from https://nft.storage/ - -------------------------------------- - `; - WarnningMessage2.DAS_API_URL = ` - [Warning] - -------------------------------------- - You need to update dasApiUrl define parameter in solana-suite.json. - can get api url from https://www.helius.dev/ - -------------------------------------- - `; - WarnningMessage2.calculateProbability = () => { - const randomValue = Math.random(); - const probability = 1 / THRESHHOLD; - if (!isDisplay && randomValue < probability) { - isDisplay = true; - return true; - } - return false; - }; - })(WarnningMessage = Constants2.WarnningMessage || (Constants2.WarnningMessage = {})); -})(Constants || (Constants = {})); -((Constants2) => { - Constants2.currentCluster = Config.cluster.type; - Constants2.customClusterUrl = Config.cluster.customClusterUrl; - Constants2.isDebugging = Config.debugging; - Constants2.nftStorageApiKey = Config.nftStorageApiKey; - Constants2.dasApiUrl = Config.dasApiUrl; - let Cluster; - ((Cluster2) => { - Cluster2["prd"] = "mainnet-beta"; - Cluster2["prdMetaplex"] = "mainnet-beta-metaplex"; - Cluster2["dev"] = "devnet"; - Cluster2["test"] = "testnet"; - Cluster2["localhost"] = "localhost-devnet"; - })(Cluster = Constants2.Cluster || (Constants2.Cluster = {})); - let EndPointUrl; - ((EndPointUrl2) => { - EndPointUrl2["prd"] = "https://api.mainnet-beta.solana.com"; - EndPointUrl2["prdMetaplex"] = "https://api.metaplex.solana.com"; - EndPointUrl2["dev"] = "https://api.devnet.solana.com"; - EndPointUrl2["test"] = "https://api.testnet.solana.com"; - EndPointUrl2["localhost"] = "http://api.devnet.solana.com"; - })(EndPointUrl = Constants2.EndPointUrl || (Constants2.EndPointUrl = {})); - let BundlrUrl; - ((BundlrUrl2) => { - BundlrUrl2["prd"] = "https://node1.irys.xyz,https://node2.irys.xyz"; - BundlrUrl2["dev"] = "https://devnet.irys.xyz"; - })(BundlrUrl = Constants2.BundlrUrl || (Constants2.BundlrUrl = {})); - let DasApiUrl; - ((DasApiUrl2) => { - DasApiUrl2["dev"] = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639"; - })(DasApiUrl = Constants2.DasApiUrl || (Constants2.DasApiUrl = {})); - let NftstorageApiKey; - ((NftstorageApiKey2) => { - NftstorageApiKey2["dev"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE"; - })(NftstorageApiKey = Constants2.NftstorageApiKey || (Constants2.NftstorageApiKey = {})); - Constants2.loadConfig = async () => { - Config = await import("@solana-suite/config/load"); - }; - Constants2.switchCluster = (param) => { - const { cluster: env, customClusterUrl: customClusterUrl2 } = param; - if (customClusterUrl2 && customClusterUrl2.length > 0) { - const index = Date.now() % customClusterUrl2.length; - return customClusterUrl2[index]; - } - switch (env) { - case "mainnet-beta" /* prd */: - return "https://api.mainnet-beta.solana.com" /* prd */; - case "mainnet-beta-metaplex" /* prdMetaplex */: - return "https://api.metaplex.solana.com" /* prdMetaplex */; - case "testnet" /* test */: - return "https://api.testnet.solana.com" /* test */; - case "devnet" /* dev */: - return "https://api.devnet.solana.com" /* dev */; - default: - return "http://api.devnet.solana.com" /* localhost */; - } - }; - Constants2.switchBundlr = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: { - const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); - const index = Date.now() % urls.length; - return urls[index]; - } - default: { - return "https://devnet.irys.xyz" /* dev */; - } - } - }; - Constants2.switchDasApi = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: - if (Constants2.dasApiUrl.length < 1) { - throw Error(Constants2.WarnningMessage.DAS_API_URL); - } - const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); - const index = Date.now() % urls.length; - return urls[index]; - default: { - const urls2 = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639" /* dev */.split(","); - const index2 = Date.now() % urls2.length; - return urls2[index2]; - } - } - }; - Constants2.switchNftStorage = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: - if (!Constants2.nftStorageApiKey) { - throw Error(Constants2.WarnningMessage.NFT_STORAGE_API_KEY); - } - return Constants2.nftStorageApiKey; - default: { - return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE" /* dev */; - } - } - }; - Constants2.WRAPPED_TOKEN_PROGRAM_ID = new import_web3.PublicKey( - "So11111111111111111111111111111111111111112" - ); - Constants2.MEMO_PROGRAM_ID = new import_web3.PublicKey( - "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo" - ); - Constants2.METAPLEX_PROGRAM_ID = new import_web3.PublicKey( - "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" - ); - Constants2.COMMITMENT = "confirmed"; - Constants2.NFT_STORAGE_GATEWAY_URL = "https://ipfs.io/ipfs"; - Constants2.IRYS_GATEWAY_URL = "https://gateway.irys.xyz"; - Constants2.BUNDLR_NETWORK_URL = (0, Constants2.switchBundlr)(Config.cluster.type); - Constants2.DAS_API_URL = (0, Constants2.switchDasApi)(Config.cluster.type); - Constants2.NFT_STORAGE_API_KEY = (0, Constants2.switchNftStorage)(Config.cluster.type); - Constants2.EXPLORER_SOLSCAN_URL = "https://solscan.io"; - Constants2.EXPLORER_SOLANAFM_URL = "https://solana.fm"; - Constants2.EXPLORER_XRAY_URL = "https://xray.helius.xyz"; -})(Constants || (Constants = {})); - -// ../shared/src/result.ts -var AbstractResult = class { - // unified-signatures. into line 10 - // unwrap(ok: (value: T) => U, err: (error: E) => U): U; - unwrap(ok, err) { - const r = this._chain( - (value) => Result.ok(ok ? ok(value) : value), - (error) => err ? Result.ok(err(error)) : Result.err(error) - ); - if (r.isErr) { - throw r.error; - } - return r.value; - } - map(ok, err) { - return this._chain( - (value) => Result.ok(ok(value)), - (error) => Result.err(err ? err(error) : error) - ); - } - chain(ok, err) { - return this._chain(ok, err || ((error) => Result.err(error))); - } - match(ok, err) { - this._chain( - (value) => Result.ok(ok(value)), - (error) => Result.err(err(error)) - ); - } - /// submit (alias Instruction.submit) //// - async submit() { - try { - const instruction = this.unwrap(); - if (instruction.instructions && instruction.signers) { - return await instruction.submit(); - } - return Result.err(Error("Only Instruction object")); - } catch (err) { - return Result.err(err); - } - } -}; -var InternalOk = class extends AbstractResult { - constructor(value) { - super(); - this.value = value; - } - isOk = true; - isErr = false; - /* eslint-disable @typescript-eslint/no-unused-vars */ - _chain(ok, _err) { - return ok(this.value); - } -}; -var InternalErr = class extends AbstractResult { - constructor(error) { - super(); - this.error = error; - } - isOk = false; - isErr = true; - _chain(_ok, err) { - return err(this.error); - } -}; -var Result; -((Result7) => { - function ok(value) { - return new InternalOk(value); - } - Result7.ok = ok; - function err(error) { - return new InternalErr(error || Error()); - } - Result7.err = err; - function all(obj) { - if (Array.isArray(obj)) { - const resArr = []; - for (const item of obj) { - if (item.isErr) { - return item; - } - resArr.push(item.value); - } - return Result7.ok(resArr); - } - const res = {}; - const keys = Object.keys(obj); - for (const key of keys) { - const item = obj[key]; - if (item.isErr) { - return item; - } - res[key] = item.value; - } - return Result7.ok(res); - } - Result7.all = all; -})(Result || (Result = {})); - -// ../shared/src/shared.ts -var overwriteObject = (object, targets) => { - const that = object; - targets.forEach((target) => { - delete that[target.existsKey]; - that[target.will.key] = target.will.value; - }); - return that; -}; -var debugLog = (data1, data2 = "", data3 = "", data4 = "") => { - if (Constants.isDebugging === "true" || process.env.DEBUG === "true") { - console.log("[DEBUG]", data1, data2, data3, data4); - } -}; -var sleep = async (sec) => { - return new Promise((r) => setTimeout(r, sec * 1e3)); -}; -var isPromise = (obj) => { - return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; -}; -function Try(input, finallyInput) { - try { - const v = input(); - if (isPromise(v)) { - return v.then( - (x) => Result.ok(x), - (err) => Result.err(err) - ); - } else { - return Result.ok(v); - } - } catch (e) { - if (e instanceof Error) { - return Result.err(e); - } - return Result.err(Error(e)); - } finally { - if (finallyInput) { - debugLog("# finally input:", finallyInput); - finallyInput(); - } - } -} -var convertTimestampToDateTime = (created_at) => { - if (created_at) { - return new Date(created_at * 1e3); - } - return; -}; - -// ../account/src/associated.ts -var import_spl_token = require("@solana/spl-token"); - -// ../account/src/keypair.ts -var import_web32 = require("@solana/web3.js"); -var import_bs58 = __toESM(require("bs58")); -var Account; -((Account5) => { - class Keypair4 { - secret; - pubkey; - constructor(params) { - if (!params.pubkey) { - const keypair = params.secret.toKeypair(); - this.pubkey = keypair.publicKey.toString(); - } else { - this.pubkey = params.pubkey; - } - this.secret = params.secret; - } - toPublicKey() { - return new import_web32.PublicKey(this.pubkey); - } - toKeypair() { - const decoded = import_bs58.default.decode(this.secret); - return import_web32.Keypair.fromSecretKey(decoded); - } - static isPubkey = (value) => /^[0-9a-zA-Z]{32,44}$/.test(value); - static isSecret = (value) => /^[0-9a-zA-Z]{87,88}$/.test(value); - static create = () => { - const keypair = import_web32.Keypair.generate(); - return new Keypair4({ - pubkey: keypair.publicKey.toString(), - secret: import_bs58.default.encode(keypair.secretKey) - }); - }; - static toKeyPair = (keypair) => { - return new Keypair4({ - pubkey: keypair.publicKey.toString(), - secret: import_bs58.default.encode(keypair.secretKey) - }); - }; - } - Account5.Keypair = Keypair4; -})(Account || (Account = {})); - -// ../account/src/associated.ts -var Account2; -((Account5) => { - let Associated; - ((Associated2) => { - const RETRY_OVER_LIMIT = 10; - const RETRY_SLEEP_TIME = 3; - const get = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { - const res = await (0, Associated2.makeOrCreateInstruction)( - mint, - owner, - new Account.Keypair({ secret: feePayer }).pubkey, - allowOwnerOffCurve - ); - if (!res.inst) { - return res.tokenAccount; - } - return new Transaction( - [res.inst], - [], - feePayer.toKeypair(), - res.tokenAccount - ); - }; - Associated2.retryGetOrCreate = async (mint, owner, feePayer) => { - let counter = 1; - while (counter < RETRY_OVER_LIMIT) { - try { - const inst = await get(mint, owner, feePayer, true); - if (inst && typeof inst === "string") { - debugLog("# associatedTokenAccount: ", inst); - return inst; - } else if (inst instanceof Transaction) { - (await inst.submit()).map( - async (ok) => { - await Node.confirmedSig(ok); - return inst.data; - }, - (err) => { - debugLog("# Error submit retryGetOrCreate: ", err); - throw err; - } - ); - } - } catch (e) { - debugLog(`# retry: ${counter} create token account: `, e); - debugLog(`# mint: ${mint}, owner: ${owner}, feePayer: ${feePayer}`); - } - await sleep(RETRY_SLEEP_TIME); - counter++; - } - throw Error(`retry action is over limit ${RETRY_OVER_LIMIT}`); - }; - Associated2.makeOrCreateInstruction = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { - const associatedTokenAccount = (0, import_spl_token.getAssociatedTokenAddressSync)( - mint.toPublicKey(), - owner.toPublicKey(), - allowOwnerOffCurve, - import_spl_token.TOKEN_PROGRAM_ID, - import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID - ); - debugLog("# associatedTokenAccount: ", associatedTokenAccount.toString()); - try { - await (0, import_spl_token.getAccount)( - Node.getConnection(), - associatedTokenAccount, - Node.getConnection().commitment, - import_spl_token.TOKEN_PROGRAM_ID - ); - return { - tokenAccount: associatedTokenAccount.toString(), - inst: void 0 - }; - } catch (error) { - if (!(error instanceof import_spl_token.TokenAccountNotFoundError) && !(error instanceof import_spl_token.TokenInvalidAccountOwnerError)) { - throw Error("Unexpected error"); - } - const payer = !feePayer ? owner : feePayer; - const inst = (0, import_spl_token.createAssociatedTokenAccountInstruction)( - payer.toPublicKey(), - associatedTokenAccount, - owner.toPublicKey(), - mint.toPublicKey(), - import_spl_token.TOKEN_PROGRAM_ID, - import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID - ); - return { - tokenAccount: associatedTokenAccount.toString(), - inst - }; - } - }; - })(Associated = Account5.Associated || (Account5.Associated = {})); -})(Account2 || (Account2 = {})); - -// ../account/src/pda.ts -var import_web33 = require("@solana/web3.js"); -var import_mpl_token_metadata = require("@metaplex-foundation/mpl-token-metadata"); -var import_mpl_bubblegum = require("@metaplex-foundation/mpl-bubblegum"); -var import_bn = __toESM(require("bn.js")); -var Account3; -((Account5) => { - let Pda; - ((Pda2) => { - Pda2.getMetadata = (address) => { - const [publicKey] = import_web33.PublicKey.findProgramAddressSync( - [ - Buffer.from("metadata"), - import_mpl_token_metadata.PROGRAM_ID.toBuffer(), - address.toPublicKey().toBuffer() - ], - import_mpl_token_metadata.PROGRAM_ID - ); - return publicKey; - }; - Pda2.getMasterEdition = (address) => { - const [publicKey] = import_web33.PublicKey.findProgramAddressSync( - [ - Buffer.from("metadata"), - import_mpl_token_metadata.PROGRAM_ID.toBuffer(), - address.toPublicKey().toBuffer(), - Buffer.from("edition") - ], - import_mpl_token_metadata.PROGRAM_ID - ); - return publicKey; - }; - Pda2.getTreeAuthority = (address) => { - const [publicKey] = import_web33.PublicKey.findProgramAddressSync( - [address.toPublicKey().toBuffer()], - import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return publicKey; - }; - Pda2.getBgumSigner = () => { - const [publicKey] = import_web33.PublicKey.findProgramAddressSync( - [Buffer.from("collection_cpi", "utf8")], - import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return publicKey; - }; - Pda2.getAssetId = (address, leafIndex) => { - const node = new import_bn.default.BN(leafIndex); - const [assetId] = import_web33.PublicKey.findProgramAddressSync( - [ - Buffer.from("asset", "utf8"), - address.toPublicKey().toBuffer(), - Uint8Array.from(node.toArray("le", 8)) - ], - import_mpl_bubblegum.MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return assetId.toString(); - }; - })(Pda = Account5.Pda || (Account5.Pda = {})); -})(Account3 || (Account3 = {})); - -// ../account/src/index.ts -var Account4 = { - ...Account2, - ...Account, - ...Account3 -}; - -// ../converter/src/collection.ts -var Converter; -((Converter15) => { - let Collection; - ((Collection2) => { - Collection2.intoInfra = (input) => { - if (!input) { - return null; - } - return { - key: input.toPublicKey(), - verified: false - }; - }; - Collection2.intoUser = (output) => { - if (!output) { - return void 0; - } - return { - address: output.key.toString(), - verified: output.verified - }; - }; - })(Collection = Converter15.Collection || (Converter15.Collection = {})); - let CollectionMint; - ((CollectionMint2) => { - CollectionMint2.intoUser = (output) => { - const res = output.find((value) => { - if (value.group_key === "collection") { - return value.group_value; - } - }); - return res ? res.group_value : ""; - }; - })(CollectionMint = Converter15.CollectionMint || (Converter15.CollectionMint = {})); -})(Converter || (Converter = {})); - -// ../converter/src/creators.ts -var Converter2; -((Converter15) => { - let Creators; - ((Creators2) => { - Creators2.intoInfra = (input) => { - if (!input) { - return null; - } - return input.map((data) => { - return { - address: data.address.toPublicKey(), - share: data.share, - verified: false - }; - }); - }; - Creators2.intoCompressedNftInfra = (input) => { - if (!input) { - return []; - } - return input.map((data) => { - return { - address: data.address.toPublicKey(), - share: data.share, - verified: false - }; - }); - }; - Creators2.intoUser = (output) => { - if (!output) { - return void 0; - } - return output.map((data) => { - return { - address: data.address.toString(), - share: data.share, - verified: data.verified - }; - }); - }; - })(Creators = Converter15.Creators || (Converter15.Creators = {})); -})(Converter2 || (Converter2 = {})); - -// ../converter/src/royalty.ts -var Converter3; -((Converter15) => { - let Royalty; - ((Royalty2) => { - Royalty2.THRESHOLD = 100; - Royalty2.intoInfra = (percentage) => { - return percentage * Royalty2.THRESHOLD; - }; - Royalty2.intoUser = (percentage) => { - return percentage * Royalty2.THRESHOLD; - }; - })(Royalty = Converter15.Royalty || (Converter15.Royalty = {})); -})(Converter3 || (Converter3 = {})); - -// ../converter/src/compressed-nft-metadata.ts -var import_mpl_bubblegum_instruction = require("mpl-bubblegum-instruction"); -var Converter4; -((Converter15) => { - let CompressedNftMetadata; - ((CompressedNftMetadata2) => { - CompressedNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoCompressedNftInfra(input.creators), - collection: Converter.Collection.intoInfra(input.collection), - uses: input.uses || null, - primarySaleHappened: false, - isMutable: input.isMutable ?? false, - editionNonce: 0, - tokenStandard: import_mpl_bubblegum_instruction.TokenStandard.NonFungible, - tokenProgramVersion: import_mpl_bubblegum_instruction.TokenProgramVersion.Original - }; - }; - CompressedNftMetadata2.intoUser = (output) => { - return { - mint: output.onchain.id.toString(), - collectionMint: Converter.CollectionMint.intoUser( - output.onchain.grouping - ), - authorities: output.onchain.authorities, - royalty: Converter3.Royalty.intoUser(output.onchain.royalty.percent), - name: output.onchain.content.metadata.name, - symbol: output.onchain.content.metadata.symbol, - uri: output.onchain.content.json_uri, - creators: Converter2.Creators.intoUser(output.onchain.creators), - treeAddress: output.onchain.compression.tree, - isCompressed: output.onchain.compression.compressed, - isMutable: output.onchain.mutable, - isBurn: output.onchain.burnt, - editionNonce: output.onchain.supply.edition_nonce, - primarySaleHappened: output.onchain.royalty.primary_sale_happened, - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - })(CompressedNftMetadata = Converter15.CompressedNftMetadata || (Converter15.CompressedNftMetadata = {})); -})(Converter4 || (Converter4 = {})); - -// ../converter/src/memo.ts -var Converter5; -((Converter15) => { - let Memo; - ((Memo2) => { - Memo2.intoUserSide = (output, meta, outputTransfer, mappingTokenAccount) => { - const history = {}; - if (outputTransfer && outputTransfer.program !== "") { - if (mappingTokenAccount && outputTransfer.program === "spl-token") { - const foundSource = mappingTokenAccount.find( - (m) => m.account === outputTransfer.parsed.info.source - ); - const foundDest = mappingTokenAccount.find( - (m) => m.account === outputTransfer.parsed.info.destination - ); - history.mint = outputTransfer.parsed.info.mint; - foundSource && (history.source = foundSource.owner); - foundDest && (history.destination = foundDest.owner); - } else { - history.source = outputTransfer.parsed.info.source; - history.destination = outputTransfer.parsed.info.destination; - } - } - history.memo = output.parsed; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Memo = Converter15.Memo || (Converter15.Memo = {})); -})(Converter5 || (Converter5 = {})); - -// ../converter/src/mint.ts -var Converter6; -((Converter15) => { - let Mint; - ((Mint2) => { - Mint2.intoUserSide = (output, meta) => { - const history = {}; - history.mint = output.parsed.info.mint; - history.mintAuthority = output.parsed.info.mintAuthority; - history.tokenAmount = output.parsed.info.tokenAmount; - history.account = output.parsed.info.account; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Mint = Converter15.Mint || (Converter15.Mint = {})); -})(Converter6 || (Converter6 = {})); - -// ../converter/src/collection-details.ts -var Converter7; -((Converter15) => { - let CollectionDetails; - ((CollectionDetails2) => { - CollectionDetails2.intoUser = (output) => { - if (!output) { - return void 0; - } - return { - __kind: output.__kind, - size: parseInt(output.size.toString(10)) - }; - }; - })(CollectionDetails = Converter15.CollectionDetails || (Converter15.CollectionDetails = {})); -})(Converter7 || (Converter7 = {})); - -// ../converter/src/uses.ts -var Converter8; -((Converter15) => { - let Uses; - ((Uses2) => { - Uses2.intoUserSide = (output) => { - if (!output) { - return void 0; - } - return output; - }; - })(Uses = Converter15.Uses || (Converter15.Uses = {})); -})(Converter8 || (Converter8 = {})); - -// ../converter/src/token-metadata.ts -var Converter9; -((Converter15) => { - let TokenMetadata; - ((TokenMetadata2) => { - TokenMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoInfra(input.creators), - collection: null, - uses: input.uses || null - }; - }; - TokenMetadata2.intoUser = (output, tokenAmount) => { - return { - mint: output.onchain.mint.toString(), - royalty: output.onchain.data.sellerFeeBasisPoints, - name: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.name), - symbol: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.symbol), - tokenAmount, - uri: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.uri), - creators: Converter2.Creators.intoUser(output.onchain.data.creators), - uses: Converter8.Uses.intoUserSide(output.onchain.uses), - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - TokenMetadata2.deleteNullStrings = (str) => { - return str.replace(/\0/g, ""); - }; - })(TokenMetadata = Converter15.TokenMetadata || (Converter15.TokenMetadata = {})); -})(Converter9 || (Converter9 = {})); - -// ../converter/src/regular-nft-metadata.ts -var Converter10; -((Converter15) => { - let RegularNftMetadata; - ((RegularNftMetadata2) => { - RegularNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoInfra(input.creators), - collection: Converter.Collection.intoInfra(input.collection), - uses: input.uses || null - }; - }; - RegularNftMetadata2.intoUser = (output) => { - return { - mint: output.onchain.mint.toString(), - updateAuthority: output.onchain.updateAuthority.toString(), - royalty: output.onchain.data.sellerFeeBasisPoints, - name: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.name), - symbol: Converter9.TokenMetadata.deleteNullStrings( - output.onchain.data.symbol - ), - uri: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.uri), - isMutable: output.onchain.isMutable, - primarySaleHappened: output.onchain.primarySaleHappened, - creators: Converter2.Creators.intoUser(output.onchain.data.creators), - editionNonce: output.onchain.editionNonce, - collection: Converter.Collection.intoUser(output.onchain.collection), - collectionDetails: Converter7.CollectionDetails.intoUser( - output.onchain.collectionDetails - ), - uses: Converter8.Uses.intoUserSide(output.onchain.uses), - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - })(RegularNftMetadata = Converter15.RegularNftMetadata || (Converter15.RegularNftMetadata = {})); -})(Converter10 || (Converter10 = {})); - -// ../converter/src/properties.ts -var Converter11; -((Converter15) => { - let Properties; - ((Properties2) => { - Properties2.intoInfra = async (input, callbackFunc, storageType, feePayer) => { - if (!input || !input.files) { - return {}; - } - const files = await Promise.all( - input.files.map(async (file) => { - if (!file.filePath) { - return {}; - } - const res = await callbackFunc(file.filePath, storageType, feePayer); - if (res.isErr) { - throw Error(res.error.message); - } - return overwriteObject(file, [ - { - existsKey: "filePath", - will: { key: "uri", value: res.value } - } - ]); - }) - ); - return { ...input, files }; - }; - })(Properties = Converter15.Properties || (Converter15.Properties = {})); -})(Converter11 || (Converter11 = {})); - -// ../converter/src/transfer-checked.ts -var Converter12; -((Converter15) => { - let TransferChecked; - ((TransferChecked2) => { - TransferChecked2.intoUserSide = (output, meta, mappingTokenAccount) => { - const history = {}; - if (mappingTokenAccount) { - const foundSource = mappingTokenAccount.find( - (m) => m.account === output.parsed.info.source - ); - const foundDest = mappingTokenAccount.find( - (m) => m.account === output.parsed.info.destination - ); - foundSource && (history.source = foundSource.owner); - foundDest && (history.destination = foundDest.owner); - } - history.tokenAmount = output.parsed.info.tokenAmount; - history.mint = output.parsed.info.mint; - history.multisigAuthority = output.parsed.info.multisigAuthority; - history.signers = output.parsed.info.signers; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(TransferChecked = Converter15.TransferChecked || (Converter15.TransferChecked = {})); -})(Converter12 || (Converter12 = {})); - -// ../converter/src/transfer.ts -var Converter13; -((Converter15) => { - let Transfer; - ((Transfer2) => { - Transfer2.intoUserSide = (output, meta) => { - const history = {}; - if (!output.parsed.info.destination || !output.parsed.info.lamports) { - return; - } - history.source = output.parsed.info.source; - history.destination = output.parsed.info.destination; - history.sol = output.parsed.info.lamports?.toSol().toString(); - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Transfer = Converter15.Transfer || (Converter15.Transfer = {})); -})(Converter13 || (Converter13 = {})); - -// ../converter/src/index.ts -var Converter14 = { - ...Converter4, - ...Converter, - ...Converter2, - ...Converter5, - ...Converter6, - ...Converter10, - ...Converter11, - ...Converter3, - ...Converter9, - ...Converter12, - ...Converter13, - ...Converter8 -}; - -// ../validator/src/index.ts -var Validator; -((Validator2) => { - let Message; - ((Message2) => { - Message2.SUCCESS = "success"; - Message2.SMALL_NUMBER = "too small"; - Message2.BIG_NUMBER = "too big"; - Message2.LONG_LENGTH = "too long"; - Message2.EMPTY = "invalid empty value"; - Message2.INVALID_URL = "invalid url"; - Message2.ONLY_NODE_JS = "`string` type is only Node.js"; - })(Message = Validator2.Message || (Validator2.Message = {})); - Validator2.NAME_LENGTH = 32; - Validator2.SYMBOL_LENGTH = 10; - Validator2.URL_LENGTH = 200; - Validator2.ROYALTY_MAX = 100; - Validator2.SELLER_FEE_BASIS_POINTS_MAX = 1e4; - Validator2.ROYALTY_MIN = 0; - Validator2.isRoyalty = (royalty) => { - return Try(() => { - const key = "royalty"; - if (royalty !== 0 && !royalty) { - throw createError(key, Message.EMPTY, royalty); - } - if (royalty < Validator2.ROYALTY_MIN) { - throw createError(key, Message.SMALL_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MIN, - condition: "underMin" - }); - } else if (royalty > Validator2.ROYALTY_MAX) { - throw createError(key, Message.BIG_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MAX, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isSellerFeeBasisPoints = (royalty) => { - return Try(() => { - const key = "sellerFeeBasisPoints/seller_fee_basis_points"; - if (royalty !== 0 && !royalty) { - throw createError(key, Message.EMPTY, royalty); - } - if (royalty < Validator2.ROYALTY_MIN) { - throw createError(key, Message.SMALL_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MIN, - condition: "underMin" - }); - } else if (royalty > Validator2.ROYALTY_MAX * Converter14.Royalty.THRESHOLD) { - throw createError(key, Message.BIG_NUMBER, royalty, { - threshold: Validator2.SELLER_FEE_BASIS_POINTS_MAX, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isName = (name) => { - return Try(() => { - const key = "name"; - if (!name) { - throw createError(key, Message.EMPTY, name); - } - if (byteLength(name) > Validator2.NAME_LENGTH) { - throw createError(key, Message.LONG_LENGTH, name, { - threshold: Validator2.NAME_LENGTH, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isSymbol = (symbol) => { - return Try(() => { - const key = "symbol"; - if (!symbol) { - throw createError(key, Message.EMPTY, symbol); - } - if (byteLength(symbol) > Validator2.SYMBOL_LENGTH) { - throw createError(key, Message.LONG_LENGTH, symbol, { - threshold: Validator2.SYMBOL_LENGTH, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isImageUrl = (image) => isUriOrImage(image, "image"); - Validator2.checkAll = (metadata) => { - return Try(() => { - const keys = Object.keys(metadata); - const results = []; - keys.map((key) => { - let res; - switch (key) { - case "image": - if (key in metadata && metadata.image) { - res = (0, Validator2.isImageUrl)(metadata.image); - } - break; - case "royalty": - if (key in metadata) { - res = (0, Validator2.isRoyalty)(metadata.royalty); - } - break; - case "seller_fee_basis_points": - if (key in metadata && metadata.seller_fee_basis_points) { - res = (0, Validator2.isSellerFeeBasisPoints)(metadata.seller_fee_basis_points); - } - break; - case "sellerFeeBasisPoints": - if (key in metadata) { - res = (0, Validator2.isSellerFeeBasisPoints)(metadata.sellerFeeBasisPoints); - } - break; - case "name": - if (metadata.name) { - res = (0, Validator2.isName)(metadata.name); - } - break; - case "symbol": - if (metadata.symbol) { - res = (0, Validator2.isSymbol)(metadata.symbol); - } - break; - } - if (res && res.isErr) { - results.push(...res.error.details); - } - }); - if (results.length > 0) { - const message = "Caught in the validation errors. see information e.g: err.details"; - throw new ValidatorError(message, results); - } - return Message.SUCCESS; - }); - }; - const byteLength = (value) => { - const text = new TextEncoder(); - return text.encode(value).length; - }; - const createError = (key, message, actual, limit) => { - let error; - if (limit) { - error = new ValidatorError(message, [{ key, message, actual, limit }]); - } else { - error = new ValidatorError(message, [{ key, message, actual }]); - } - return error; - }; - const isUriOrImage = (imageOrUri, key) => { - return Try(() => { - if (!imageOrUri) { - throw createError(key, Message.EMPTY, imageOrUri); - } - if (byteLength(imageOrUri) > Validator2.URL_LENGTH) { - throw createError(key, Message.LONG_LENGTH, imageOrUri, { - threshold: Validator2.URL_LENGTH, - condition: "overMax" - }); - } - if (!/https?:\/\/[-_.!~*\\()a-zA-Z0-9;?:&=+,%#]+/g.test(imageOrUri)) { - throw createError(key, Message.INVALID_URL, imageOrUri); - } - return Message.SUCCESS; - }); - }; -})(Validator || (Validator = {})); -var ValidatorError = class extends Error { - details; - constructor(message, details) { - super(message); - this.details = details; - } -}; - -// ../global/src/index.ts -var import_web34 = require("@solana/web3.js"); -var import_bignumber = require("bignumber.js"); -var import_bs582 = __toESM(require("bs58")); -String.prototype.toExplorerUrl = function(explorer = "solscan" /* Solscan */, options = {}) { - const endPointUrl = Node.getConnection().rpcEndpoint; - debugLog("# toExplorerUrl rpcEndpoint:", endPointUrl); - let cluster = ""; - if (endPointUrl === Constants.EndPointUrl.prd) { - cluster = Constants.Cluster.prd; - } else if (endPointUrl === Constants.EndPointUrl.test) { - cluster = Constants.Cluster.test; - } else if (endPointUrl === Constants.EndPointUrl.dev) { - cluster = Constants.Cluster.dev; - } else { - cluster = Constants.Cluster.dev; - } - const addressOrSignature = this.toString(); - let url = ""; - if (options.replacePath) { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/${options.replacePath}/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; - } - return url; - } - if (Account4.Keypair.isPubkey(addressOrSignature)) { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/address/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/account/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/account/${addressOrSignature}?cluster=${cluster}`; - } - } else { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/tx/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/tx/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/tx/${addressOrSignature}?cluster=${cluster}`; - } - } - return url; -}; -String.prototype.toPublicKey = function() { - if (!Account4.Keypair.isPubkey(this.toString())) { - throw Error(`No match KeyPair.PubKey: ${this.toString()}`); - } - return new import_web34.PublicKey(this.toString()); -}; -String.prototype.toKeypair = function() { - if (!Account4.Keypair.isSecret(this.toString())) { - throw Error(`No match KeyPair.Secret: ${this.toString()}`); - } - const decoded = import_bs582.default.decode(this.toString()); - return import_web34.Keypair.fromSecretKey(decoded); -}; -Number.prototype.toSol = function() { - return (0, import_bignumber.BigNumber)(this).div(import_web34.LAMPORTS_PER_SOL).toNumber(); -}; -Number.prototype.toLamports = function() { - return (0, import_bignumber.BigNumber)(this).times(import_web34.LAMPORTS_PER_SOL).toNumber(); -}; - -// ../node/src/index.ts -var import_web35 = require("@solana/web3.js"); -var Node; -((Node2) => { - const setted = { - clusterUrl: "", - commitment: Constants.COMMITMENT, - customClusterUrl: [] - }; - Node2.getConnection = () => { - if (setted.customClusterUrl.length > 0) { - setted.clusterUrl = Constants.switchCluster({ - customClusterUrl: setted.customClusterUrl - }); - } else if (Constants.customClusterUrl.length > 0) { - setted.clusterUrl = Constants.switchCluster({ - customClusterUrl: Constants.customClusterUrl - }); - } else if (!setted.clusterUrl) { - setted.clusterUrl = Constants.switchCluster({ - cluster: Constants.currentCluster - }); - } - if (!setted.commitment) { - setted.commitment = Constants.COMMITMENT; - } - return new import_web35.Connection(setted.clusterUrl, setted.commitment); - }; - Node2.changeConnection = (param) => { - setted.clusterUrl = ""; - setted.customClusterUrl = []; - setted.commitment = Constants.COMMITMENT; - const { cluster, commitment, customClusterUrl } = param; - if (commitment) { - setted.commitment = commitment; - debugLog("# Node change commitment: ", setted.commitment); - } - if (cluster) { - setted.clusterUrl = Constants.switchCluster({ cluster }); - debugLog("# Node change clusterUrl: ", setted.clusterUrl); - } - if (customClusterUrl) { - debugLog("# customClusterUrl: ", customClusterUrl); - setted.clusterUrl = Constants.switchCluster({ customClusterUrl }); - setted.customClusterUrl = customClusterUrl; - debugLog( - "# Node change cluster, custom cluster url: ", - setted.clusterUrl - ); - } - }; - Node2.confirmedSig = async (signature, commitment = Constants.COMMITMENT) => { - const connection = Node2.getConnection(); - const latestBlockhash = await connection.getLatestBlockhash(); - return await connection.confirmTransaction( - { - blockhash: latestBlockhash.blockhash, - lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, - signature - }, - commitment - ).then(Result.ok).catch(Result.err); - }; -})(Node || (Node = {})); - -// src/define.ts -var MAX_RETRIES = 3; - -// src/batch.ts -var BatchTransaction = class { - submit = async (arr) => { - let i = 0; - for (const a of arr) { - if (!a.instructions && !a.signers) { - throw Error( - `only Instruction object that can use batchSubmit(). - Index: ${i}, Set value: ${JSON.stringify(a)}` - ); - } - i++; - } - const instructions = arr.flatMap((a) => a.instructions); - const signers = arr.flatMap((a) => a.signers); - const feePayers = arr.filter((a) => a.feePayer !== void 0); - let feePayer = signers[0]; - if (feePayers.length > 0 && feePayers[0].feePayer) { - feePayer = feePayers[0].feePayer; - } - const transaction = new import_web36.Transaction(); - let finalSigners = signers; - if (feePayer) { - transaction.feePayer = feePayer.publicKey; - finalSigners = [feePayer, ...signers]; - } - instructions.map((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - return await (0, import_web36.sendAndConfirmTransaction)( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }; -}; -Array.prototype.submit = async function() { - const instructions = []; - return Try(async () => { - let i = 0; - for (const obj of this) { - if (obj.isErr) { - const errorMess = obj.error.message; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.isOk) { - instructions.push(obj.value); - } else { - instructions.push(obj); - } - i++; - } - return new BatchTransaction().submit(instructions); - }); -}; - -// src/default.ts -var import_web37 = require("@solana/web3.js"); -var Transaction = class _Transaction { - instructions; - signers; - feePayer; - data; - constructor(instructions, signers, feePayer, data) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - submit = async () => { - return Try(async () => { - if (!(this instanceof _Transaction)) { - throw Error("only Instruction object that can use this"); - } - const transaction = new import_web37.Transaction(); - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - this.instructions.forEach((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - return await (0, import_web37.sendAndConfirmTransaction)( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }); - }; -}; - -// src/mint.ts -var import_web38 = require("@solana/web3.js"); -var MintTransaction = class _MintTransaction { - instructions; - signers; - feePayer; - data; - constructor(instructions, signers, feePayer, data) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - submit = async () => { - return Try(async () => { - if (!(this instanceof _MintTransaction)) { - throw Error("only MintInstruction object that can use this"); - } - const transaction = new import_web38.Transaction(); - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - this.instructions.forEach((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { - debugLog("# Change metaplex cluster on mainnet-beta"); - Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); - } - return await (0, import_web38.sendAndConfirmTransaction)( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }); - }; -}; - -// src/partial-sign.ts -var import_web39 = require("@solana/web3.js"); -var PartialSignTransaction = class _PartialSignTransaction { - hexInstruction; - data; - canSubmit; - constructor(instructions, mint, canSubmit = false) { - this.hexInstruction = instructions; - this.data = mint; - this.canSubmit = canSubmit; - } - submit = async (feePayer) => { - return Try(async () => { - if (!(this instanceof _PartialSignTransaction)) { - throw Error("only PartialSignInstruction object that can use this"); - } - const decode = Buffer.from(this.hexInstruction, "hex"); - const transactionFromJson = import_web39.Transaction.from(decode); - transactionFromJson.partialSign(feePayer.toKeypair()); - const options = { - maxRetries: MAX_RETRIES - }; - const wireTransaction = transactionFromJson.serialize(); - return await Node.getConnection().sendRawTransaction( - wireTransaction, - options - ); - }); - }; -}; -Array.prototype.submit = async function(feePayer) { - return Try(async () => { - let i = 0; - for await (const obj of this) { - if (obj.isErr) { - const errorMess = obj.error.message; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.canSubmit) { - await obj.submit(feePayer); - } else { - return await obj.submit(feePayer); - } - i++; - } - }); -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - BatchTransaction, - MintTransaction, - PartialSignTransaction, - Transaction -}); -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9iYXRjaC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL2NvbnN0YW50cy50cyIsICIuLi8uLi9zaGFyZWQvc3JjL3Jlc3VsdC50cyIsICIuLi8uLi9zaGFyZWQvc3JjL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oYXdhaXQgaW5zdC5zdWJtaXQoKSkubWFwKFxuICAgICAgICAgICAgICBhc3luYyAob2spID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBOb2RlLmNvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiBhY2NvdW50OiBgLCBlKTtcbiAgICAgICAgICBkZWJ1Z0xvZyhgIyBtaW50OiAke21pbnR9LCBvd25lcjogJHtvd25lcn0sIGZlZVBheWVyOiAke2ZlZVBheWVyfWApO1xuICAgICAgICB9XG4gICAgICAgIGF3YWl0IHNsZWVwKFJFVFJZX1NMRUVQX1RJTUUpO1xuICAgICAgICBjb3VudGVyKys7XG4gICAgICB9XG4gICAgICB0aHJvdyBFcnJvcihgcmV0cnkgYWN0aW9uIGlzIG92ZXIgbGltaXQgJHtSRVRSWV9PVkVSX0xJTUlUfWApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBbTWFpbiBsb2dpY11HZXQgQXNzb2NpYXRlZCB0b2tlbiBBY2NvdW50LlxuICAgICAqIGlmIG5vdCBjcmVhdGVkLCBjcmVhdGUgbmV3IHRva2VuIGFjY291aW50XG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1B1YmtleX0gbWludFxuICAgICAqIEBwYXJhbSB7UHVia2V5fSBvd25lclxuICAgICAqIE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BUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYXllciA/IG93bmVyIDogZmVlUGF5ZXI7XG5cbiAgICAgICAgY29uc3QgaW5zdCA9IGNyZWF0ZUFzc29jaWF0ZWRUb2tlbkFjY291bnRJbnN0cnVjdGlvbihcbiAgICAgICAgICBwYXllci50b1B1YmxpY0tleSgpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgb3duZXIudG9QdWJsaWNLZXkoKSxcbiAgICAgICAgICBtaW50LnRvUHVibGljS2V5KCksXG4gICAgICAgICAgVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICAgICBBU1NPQ0lBVEVEX1RPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgICk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB0b2tlbkFjY291bnQ6IGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSxcbiAgICAgICAgICBpbnN0LFxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH1cbn1cbiIsICJpbXBvcnQg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AgICAgICAgY2FzZSAncm95YWx0eSc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzUm95YWx0eShtZXRhZGF0YS5yb3lhbHR5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgJ3NlbGxlcl9mZWVfYmFzaXNfcG9pbnRzJzpcbiAgICAgICAgICAgIGlmIChrZXkgaW4gbWV0YWRhdGEgJiYgbWV0YWRhdGEuc2VsbGVyX2ZlZV9iYXNpc19wb2ludHMpIHtcbiAgICAgICAgICAgICAgcmVzID0gaXNTZWxsZXJGZWVCYXNpc1BvaW50cyhtZXRhZGF0YS5zZWxsZXJfZmVlX2Jhc2lzX3BvaW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzZWxsZXJGZWVCYXNpc1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAg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ViMyIsICJUeCIsICJpbXBvcnRfd2ViMyIsICJUeCIsICJpbXBvcnRfd2ViMyIsICJUeCJdCn0K \ No newline at end of file diff --git a/packages/transaction/dist/index.mjs b/packages/transaction/dist/index.mjs deleted file mode 100644 index 385046948..000000000 --- a/packages/transaction/dist/index.mjs +++ /dev/null @@ -1,1462 +0,0 @@ -// src/batch.ts -import { - sendAndConfirmTransaction, - Transaction as Tx -} from "@solana/web3.js"; - -// ../shared/src/constants.ts -import { PublicKey } from "@solana/web3.js"; -import SolanaJsonConfig from "@solana-suite/config/load"; -var Config = SolanaJsonConfig; -var Constants; -((Constants2) => { - let WarnningMessage; - ((WarnningMessage2) => { - const THRESHHOLD = 5; - let isDisplay = false; - WarnningMessage2.NFT_STORAGE_API_KEY = ` - [Warning] - -------------------------------------- - You need to update nftStorageApiKey define parameter in solana-suite.json. - Can get api key from https://nft.storage/ - -------------------------------------- - `; - WarnningMessage2.DAS_API_URL = ` - [Warning] - -------------------------------------- - You need to update dasApiUrl define parameter in solana-suite.json. - can get api url from https://www.helius.dev/ - -------------------------------------- - `; - WarnningMessage2.calculateProbability = () => { - const randomValue = Math.random(); - const probability = 1 / THRESHHOLD; - if (!isDisplay && randomValue < probability) { - isDisplay = true; - return true; - } - return false; - }; - })(WarnningMessage = Constants2.WarnningMessage || (Constants2.WarnningMessage = {})); -})(Constants || (Constants = {})); -((Constants2) => { - Constants2.currentCluster = Config.cluster.type; - Constants2.customClusterUrl = Config.cluster.customClusterUrl; - Constants2.isDebugging = Config.debugging; - Constants2.nftStorageApiKey = Config.nftStorageApiKey; - Constants2.dasApiUrl = Config.dasApiUrl; - let Cluster; - ((Cluster2) => { - Cluster2["prd"] = "mainnet-beta"; - Cluster2["prdMetaplex"] = "mainnet-beta-metaplex"; - Cluster2["dev"] = "devnet"; - Cluster2["test"] = "testnet"; - Cluster2["localhost"] = "localhost-devnet"; - })(Cluster = Constants2.Cluster || (Constants2.Cluster = {})); - let EndPointUrl; - ((EndPointUrl2) => { - EndPointUrl2["prd"] = "https://api.mainnet-beta.solana.com"; - EndPointUrl2["prdMetaplex"] = "https://api.metaplex.solana.com"; - EndPointUrl2["dev"] = "https://api.devnet.solana.com"; - EndPointUrl2["test"] = "https://api.testnet.solana.com"; - EndPointUrl2["localhost"] = "http://api.devnet.solana.com"; - })(EndPointUrl = Constants2.EndPointUrl || (Constants2.EndPointUrl = {})); - let BundlrUrl; - ((BundlrUrl2) => { - BundlrUrl2["prd"] = "https://node1.irys.xyz,https://node2.irys.xyz"; - BundlrUrl2["dev"] = "https://devnet.irys.xyz"; - })(BundlrUrl = Constants2.BundlrUrl || (Constants2.BundlrUrl = {})); - let DasApiUrl; - ((DasApiUrl2) => { - DasApiUrl2["dev"] = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639"; - })(DasApiUrl = Constants2.DasApiUrl || (Constants2.DasApiUrl = {})); - let NftstorageApiKey; - ((NftstorageApiKey2) => { - NftstorageApiKey2["dev"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE"; - })(NftstorageApiKey = Constants2.NftstorageApiKey || (Constants2.NftstorageApiKey = {})); - Constants2.loadConfig = async () => { - Config = await import("@solana-suite/config/load"); - }; - Constants2.switchCluster = (param) => { - const { cluster: env, customClusterUrl: customClusterUrl2 } = param; - if (customClusterUrl2 && customClusterUrl2.length > 0) { - const index = Date.now() % customClusterUrl2.length; - return customClusterUrl2[index]; - } - switch (env) { - case "mainnet-beta" /* prd */: - return "https://api.mainnet-beta.solana.com" /* prd */; - case "mainnet-beta-metaplex" /* prdMetaplex */: - return "https://api.metaplex.solana.com" /* prdMetaplex */; - case "testnet" /* test */: - return "https://api.testnet.solana.com" /* test */; - case "devnet" /* dev */: - return "https://api.devnet.solana.com" /* dev */; - default: - return "http://api.devnet.solana.com" /* localhost */; - } - }; - Constants2.switchBundlr = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: { - const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); - const index = Date.now() % urls.length; - return urls[index]; - } - default: { - return "https://devnet.irys.xyz" /* dev */; - } - } - }; - Constants2.switchDasApi = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: - if (Constants2.dasApiUrl.length < 1) { - throw Error(Constants2.WarnningMessage.DAS_API_URL); - } - const urls = "https://node1.irys.xyz,https://node2.irys.xyz" /* prd */.split(","); - const index = Date.now() % urls.length; - return urls[index]; - default: { - const urls2 = "https://devnet.helius-rpc.com/?api-key=15319bf4-5b40-4958-ac8d-6313aa55eb92,https://rpc-devnet.helius.xyz?api-key=9f70a843-3274-4ffd-a0a9-323f8b7c0639" /* dev */.split(","); - const index2 = Date.now() % urls2.length; - return urls2[index2]; - } - } - }; - Constants2.switchNftStorage = (env) => { - switch (env) { - case "mainnet-beta" /* prd */: - if (!Constants2.nftStorageApiKey) { - throw Error(Constants2.WarnningMessage.NFT_STORAGE_API_KEY); - } - return Constants2.nftStorageApiKey; - default: { - return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweERGMjcyN2VkODZhRGU1RTMyZDZDZEJlODc0YzRFNDlEODY1OWZmOEMiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyMDI2NDk0MzcwNiwibmFtZSI6ImRlbW8ifQ.d4J70mikxRB8a5vwNu6SO5HDA8JaueuseAj7Q_ytMCE" /* dev */; - } - } - }; - Constants2.WRAPPED_TOKEN_PROGRAM_ID = new PublicKey( - "So11111111111111111111111111111111111111112" - ); - Constants2.MEMO_PROGRAM_ID = new PublicKey( - "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo" - ); - Constants2.METAPLEX_PROGRAM_ID = new PublicKey( - "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" - ); - Constants2.COMMITMENT = "confirmed"; - Constants2.NFT_STORAGE_GATEWAY_URL = "https://ipfs.io/ipfs"; - Constants2.IRYS_GATEWAY_URL = "https://gateway.irys.xyz"; - Constants2.BUNDLR_NETWORK_URL = (0, Constants2.switchBundlr)(Config.cluster.type); - Constants2.DAS_API_URL = (0, Constants2.switchDasApi)(Config.cluster.type); - Constants2.NFT_STORAGE_API_KEY = (0, Constants2.switchNftStorage)(Config.cluster.type); - Constants2.EXPLORER_SOLSCAN_URL = "https://solscan.io"; - Constants2.EXPLORER_SOLANAFM_URL = "https://solana.fm"; - Constants2.EXPLORER_XRAY_URL = "https://xray.helius.xyz"; -})(Constants || (Constants = {})); - -// ../shared/src/result.ts -var AbstractResult = class { - // unified-signatures. into line 10 - // unwrap(ok: (value: T) => U, err: (error: E) => U): U; - unwrap(ok, err) { - const r = this._chain( - (value) => Result.ok(ok ? ok(value) : value), - (error) => err ? Result.ok(err(error)) : Result.err(error) - ); - if (r.isErr) { - throw r.error; - } - return r.value; - } - map(ok, err) { - return this._chain( - (value) => Result.ok(ok(value)), - (error) => Result.err(err ? err(error) : error) - ); - } - chain(ok, err) { - return this._chain(ok, err || ((error) => Result.err(error))); - } - match(ok, err) { - this._chain( - (value) => Result.ok(ok(value)), - (error) => Result.err(err(error)) - ); - } - /// submit (alias Instruction.submit) //// - async submit() { - try { - const instruction = this.unwrap(); - if (instruction.instructions && instruction.signers) { - return await instruction.submit(); - } - return Result.err(Error("Only Instruction object")); - } catch (err) { - return Result.err(err); - } - } -}; -var InternalOk = class extends AbstractResult { - constructor(value) { - super(); - this.value = value; - } - isOk = true; - isErr = false; - /* eslint-disable @typescript-eslint/no-unused-vars */ - _chain(ok, _err) { - return ok(this.value); - } -}; -var InternalErr = class extends AbstractResult { - constructor(error) { - super(); - this.error = error; - } - isOk = false; - isErr = true; - _chain(_ok, err) { - return err(this.error); - } -}; -var Result; -((Result7) => { - function ok(value) { - return new InternalOk(value); - } - Result7.ok = ok; - function err(error) { - return new InternalErr(error || Error()); - } - Result7.err = err; - function all(obj) { - if (Array.isArray(obj)) { - const resArr = []; - for (const item of obj) { - if (item.isErr) { - return item; - } - resArr.push(item.value); - } - return Result7.ok(resArr); - } - const res = {}; - const keys = Object.keys(obj); - for (const key of keys) { - const item = obj[key]; - if (item.isErr) { - return item; - } - res[key] = item.value; - } - return Result7.ok(res); - } - Result7.all = all; -})(Result || (Result = {})); - -// ../shared/src/shared.ts -var overwriteObject = (object, targets) => { - const that = object; - targets.forEach((target) => { - delete that[target.existsKey]; - that[target.will.key] = target.will.value; - }); - return that; -}; -var debugLog = (data1, data2 = "", data3 = "", data4 = "") => { - if (Constants.isDebugging === "true" || process.env.DEBUG === "true") { - console.log("[DEBUG]", data1, data2, data3, data4); - } -}; -var sleep = async (sec) => { - return new Promise((r) => setTimeout(r, sec * 1e3)); -}; -var isPromise = (obj) => { - return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; -}; -function Try(input, finallyInput) { - try { - const v = input(); - if (isPromise(v)) { - return v.then( - (x) => Result.ok(x), - (err) => Result.err(err) - ); - } else { - return Result.ok(v); - } - } catch (e) { - if (e instanceof Error) { - return Result.err(e); - } - return Result.err(Error(e)); - } finally { - if (finallyInput) { - debugLog("# finally input:", finallyInput); - finallyInput(); - } - } -} -var convertTimestampToDateTime = (created_at) => { - if (created_at) { - return new Date(created_at * 1e3); - } - return; -}; - -// ../account/src/associated.ts -import { - ASSOCIATED_TOKEN_PROGRAM_ID, - createAssociatedTokenAccountInstruction, - getAccount, - getAssociatedTokenAddressSync, - TOKEN_PROGRAM_ID, - TokenAccountNotFoundError, - TokenInvalidAccountOwnerError -} from "@solana/spl-token"; - -// ../account/src/keypair.ts -import { Keypair as Original, PublicKey as PublicKey2 } from "@solana/web3.js"; -import bs from "bs58"; -var Account; -((Account5) => { - class Keypair4 { - secret; - pubkey; - constructor(params) { - if (!params.pubkey) { - const keypair = params.secret.toKeypair(); - this.pubkey = keypair.publicKey.toString(); - } else { - this.pubkey = params.pubkey; - } - this.secret = params.secret; - } - toPublicKey() { - return new PublicKey2(this.pubkey); - } - toKeypair() { - const decoded = bs.decode(this.secret); - return Original.fromSecretKey(decoded); - } - static isPubkey = (value) => /^[0-9a-zA-Z]{32,44}$/.test(value); - static isSecret = (value) => /^[0-9a-zA-Z]{87,88}$/.test(value); - static create = () => { - const keypair = Original.generate(); - return new Keypair4({ - pubkey: keypair.publicKey.toString(), - secret: bs.encode(keypair.secretKey) - }); - }; - static toKeyPair = (keypair) => { - return new Keypair4({ - pubkey: keypair.publicKey.toString(), - secret: bs.encode(keypair.secretKey) - }); - }; - } - Account5.Keypair = Keypair4; -})(Account || (Account = {})); - -// ../account/src/associated.ts -var Account2; -((Account5) => { - let Associated; - ((Associated2) => { - const RETRY_OVER_LIMIT = 10; - const RETRY_SLEEP_TIME = 3; - const get = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { - const res = await (0, Associated2.makeOrCreateInstruction)( - mint, - owner, - new Account.Keypair({ secret: feePayer }).pubkey, - allowOwnerOffCurve - ); - if (!res.inst) { - return res.tokenAccount; - } - return new Transaction( - [res.inst], - [], - feePayer.toKeypair(), - res.tokenAccount - ); - }; - Associated2.retryGetOrCreate = async (mint, owner, feePayer) => { - let counter = 1; - while (counter < RETRY_OVER_LIMIT) { - try { - const inst = await get(mint, owner, feePayer, true); - if (inst && typeof inst === "string") { - debugLog("# associatedTokenAccount: ", inst); - return inst; - } else if (inst instanceof Transaction) { - (await inst.submit()).map( - async (ok) => { - await Node.confirmedSig(ok); - return inst.data; - }, - (err) => { - debugLog("# Error submit retryGetOrCreate: ", err); - throw err; - } - ); - } - } catch (e) { - debugLog(`# retry: ${counter} create token account: `, e); - debugLog(`# mint: ${mint}, owner: ${owner}, feePayer: ${feePayer}`); - } - await sleep(RETRY_SLEEP_TIME); - counter++; - } - throw Error(`retry action is over limit ${RETRY_OVER_LIMIT}`); - }; - Associated2.makeOrCreateInstruction = async (mint, owner, feePayer, allowOwnerOffCurve = false) => { - const associatedTokenAccount = getAssociatedTokenAddressSync( - mint.toPublicKey(), - owner.toPublicKey(), - allowOwnerOffCurve, - TOKEN_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID - ); - debugLog("# associatedTokenAccount: ", associatedTokenAccount.toString()); - try { - await getAccount( - Node.getConnection(), - associatedTokenAccount, - Node.getConnection().commitment, - TOKEN_PROGRAM_ID - ); - return { - tokenAccount: associatedTokenAccount.toString(), - inst: void 0 - }; - } catch (error) { - if (!(error instanceof TokenAccountNotFoundError) && !(error instanceof TokenInvalidAccountOwnerError)) { - throw Error("Unexpected error"); - } - const payer = !feePayer ? owner : feePayer; - const inst = createAssociatedTokenAccountInstruction( - payer.toPublicKey(), - associatedTokenAccount, - owner.toPublicKey(), - mint.toPublicKey(), - TOKEN_PROGRAM_ID, - ASSOCIATED_TOKEN_PROGRAM_ID - ); - return { - tokenAccount: associatedTokenAccount.toString(), - inst - }; - } - }; - })(Associated = Account5.Associated || (Account5.Associated = {})); -})(Account2 || (Account2 = {})); - -// ../account/src/pda.ts -import { PublicKey as PublicKey3 } from "@solana/web3.js"; -import { PROGRAM_ID } from "@metaplex-foundation/mpl-token-metadata"; -import { MPL_BUBBLEGUM_PROGRAM_ID } from "@metaplex-foundation/mpl-bubblegum"; -import BN from "bn.js"; -var Account3; -((Account5) => { - let Pda; - ((Pda2) => { - Pda2.getMetadata = (address) => { - const [publicKey] = PublicKey3.findProgramAddressSync( - [ - Buffer.from("metadata"), - PROGRAM_ID.toBuffer(), - address.toPublicKey().toBuffer() - ], - PROGRAM_ID - ); - return publicKey; - }; - Pda2.getMasterEdition = (address) => { - const [publicKey] = PublicKey3.findProgramAddressSync( - [ - Buffer.from("metadata"), - PROGRAM_ID.toBuffer(), - address.toPublicKey().toBuffer(), - Buffer.from("edition") - ], - PROGRAM_ID - ); - return publicKey; - }; - Pda2.getTreeAuthority = (address) => { - const [publicKey] = PublicKey3.findProgramAddressSync( - [address.toPublicKey().toBuffer()], - MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return publicKey; - }; - Pda2.getBgumSigner = () => { - const [publicKey] = PublicKey3.findProgramAddressSync( - [Buffer.from("collection_cpi", "utf8")], - MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return publicKey; - }; - Pda2.getAssetId = (address, leafIndex) => { - const node = new BN.BN(leafIndex); - const [assetId] = PublicKey3.findProgramAddressSync( - [ - Buffer.from("asset", "utf8"), - address.toPublicKey().toBuffer(), - Uint8Array.from(node.toArray("le", 8)) - ], - MPL_BUBBLEGUM_PROGRAM_ID.toPublicKey() - ); - return assetId.toString(); - }; - })(Pda = Account5.Pda || (Account5.Pda = {})); -})(Account3 || (Account3 = {})); - -// ../account/src/index.ts -var Account4 = { - ...Account2, - ...Account, - ...Account3 -}; - -// ../converter/src/collection.ts -var Converter; -((Converter15) => { - let Collection; - ((Collection2) => { - Collection2.intoInfra = (input) => { - if (!input) { - return null; - } - return { - key: input.toPublicKey(), - verified: false - }; - }; - Collection2.intoUser = (output) => { - if (!output) { - return void 0; - } - return { - address: output.key.toString(), - verified: output.verified - }; - }; - })(Collection = Converter15.Collection || (Converter15.Collection = {})); - let CollectionMint; - ((CollectionMint2) => { - CollectionMint2.intoUser = (output) => { - const res = output.find((value) => { - if (value.group_key === "collection") { - return value.group_value; - } - }); - return res ? res.group_value : ""; - }; - })(CollectionMint = Converter15.CollectionMint || (Converter15.CollectionMint = {})); -})(Converter || (Converter = {})); - -// ../converter/src/creators.ts -var Converter2; -((Converter15) => { - let Creators; - ((Creators2) => { - Creators2.intoInfra = (input) => { - if (!input) { - return null; - } - return input.map((data) => { - return { - address: data.address.toPublicKey(), - share: data.share, - verified: false - }; - }); - }; - Creators2.intoCompressedNftInfra = (input) => { - if (!input) { - return []; - } - return input.map((data) => { - return { - address: data.address.toPublicKey(), - share: data.share, - verified: false - }; - }); - }; - Creators2.intoUser = (output) => { - if (!output) { - return void 0; - } - return output.map((data) => { - return { - address: data.address.toString(), - share: data.share, - verified: data.verified - }; - }); - }; - })(Creators = Converter15.Creators || (Converter15.Creators = {})); -})(Converter2 || (Converter2 = {})); - -// ../converter/src/royalty.ts -var Converter3; -((Converter15) => { - let Royalty; - ((Royalty2) => { - Royalty2.THRESHOLD = 100; - Royalty2.intoInfra = (percentage) => { - return percentage * Royalty2.THRESHOLD; - }; - Royalty2.intoUser = (percentage) => { - return percentage * Royalty2.THRESHOLD; - }; - })(Royalty = Converter15.Royalty || (Converter15.Royalty = {})); -})(Converter3 || (Converter3 = {})); - -// ../converter/src/compressed-nft-metadata.ts -import { - TokenProgramVersion, - TokenStandard -} from "mpl-bubblegum-instruction"; -var Converter4; -((Converter15) => { - let CompressedNftMetadata; - ((CompressedNftMetadata2) => { - CompressedNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoCompressedNftInfra(input.creators), - collection: Converter.Collection.intoInfra(input.collection), - uses: input.uses || null, - primarySaleHappened: false, - isMutable: input.isMutable ?? false, - editionNonce: 0, - tokenStandard: TokenStandard.NonFungible, - tokenProgramVersion: TokenProgramVersion.Original - }; - }; - CompressedNftMetadata2.intoUser = (output) => { - return { - mint: output.onchain.id.toString(), - collectionMint: Converter.CollectionMint.intoUser( - output.onchain.grouping - ), - authorities: output.onchain.authorities, - royalty: Converter3.Royalty.intoUser(output.onchain.royalty.percent), - name: output.onchain.content.metadata.name, - symbol: output.onchain.content.metadata.symbol, - uri: output.onchain.content.json_uri, - creators: Converter2.Creators.intoUser(output.onchain.creators), - treeAddress: output.onchain.compression.tree, - isCompressed: output.onchain.compression.compressed, - isMutable: output.onchain.mutable, - isBurn: output.onchain.burnt, - editionNonce: output.onchain.supply.edition_nonce, - primarySaleHappened: output.onchain.royalty.primary_sale_happened, - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - })(CompressedNftMetadata = Converter15.CompressedNftMetadata || (Converter15.CompressedNftMetadata = {})); -})(Converter4 || (Converter4 = {})); - -// ../converter/src/memo.ts -var Converter5; -((Converter15) => { - let Memo; - ((Memo2) => { - Memo2.intoUserSide = (output, meta, outputTransfer, mappingTokenAccount) => { - const history = {}; - if (outputTransfer && outputTransfer.program !== "") { - if (mappingTokenAccount && outputTransfer.program === "spl-token") { - const foundSource = mappingTokenAccount.find( - (m) => m.account === outputTransfer.parsed.info.source - ); - const foundDest = mappingTokenAccount.find( - (m) => m.account === outputTransfer.parsed.info.destination - ); - history.mint = outputTransfer.parsed.info.mint; - foundSource && (history.source = foundSource.owner); - foundDest && (history.destination = foundDest.owner); - } else { - history.source = outputTransfer.parsed.info.source; - history.destination = outputTransfer.parsed.info.destination; - } - } - history.memo = output.parsed; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Memo = Converter15.Memo || (Converter15.Memo = {})); -})(Converter5 || (Converter5 = {})); - -// ../converter/src/mint.ts -var Converter6; -((Converter15) => { - let Mint; - ((Mint2) => { - Mint2.intoUserSide = (output, meta) => { - const history = {}; - history.mint = output.parsed.info.mint; - history.mintAuthority = output.parsed.info.mintAuthority; - history.tokenAmount = output.parsed.info.tokenAmount; - history.account = output.parsed.info.account; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Mint = Converter15.Mint || (Converter15.Mint = {})); -})(Converter6 || (Converter6 = {})); - -// ../converter/src/collection-details.ts -var Converter7; -((Converter15) => { - let CollectionDetails; - ((CollectionDetails2) => { - CollectionDetails2.intoUser = (output) => { - if (!output) { - return void 0; - } - return { - __kind: output.__kind, - size: parseInt(output.size.toString(10)) - }; - }; - })(CollectionDetails = Converter15.CollectionDetails || (Converter15.CollectionDetails = {})); -})(Converter7 || (Converter7 = {})); - -// ../converter/src/uses.ts -var Converter8; -((Converter15) => { - let Uses; - ((Uses2) => { - Uses2.intoUserSide = (output) => { - if (!output) { - return void 0; - } - return output; - }; - })(Uses = Converter15.Uses || (Converter15.Uses = {})); -})(Converter8 || (Converter8 = {})); - -// ../converter/src/token-metadata.ts -var Converter9; -((Converter15) => { - let TokenMetadata; - ((TokenMetadata2) => { - TokenMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoInfra(input.creators), - collection: null, - uses: input.uses || null - }; - }; - TokenMetadata2.intoUser = (output, tokenAmount) => { - return { - mint: output.onchain.mint.toString(), - royalty: output.onchain.data.sellerFeeBasisPoints, - name: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.name), - symbol: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.symbol), - tokenAmount, - uri: (0, TokenMetadata2.deleteNullStrings)(output.onchain.data.uri), - creators: Converter2.Creators.intoUser(output.onchain.data.creators), - uses: Converter8.Uses.intoUserSide(output.onchain.uses), - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - TokenMetadata2.deleteNullStrings = (str) => { - return str.replace(/\0/g, ""); - }; - })(TokenMetadata = Converter15.TokenMetadata || (Converter15.TokenMetadata = {})); -})(Converter9 || (Converter9 = {})); - -// ../converter/src/regular-nft-metadata.ts -var Converter10; -((Converter15) => { - let RegularNftMetadata; - ((RegularNftMetadata2) => { - RegularNftMetadata2.intoInfra = (input, uri, sellerFeeBasisPoints) => { - return { - name: input.name, - symbol: input.symbol, - uri, - sellerFeeBasisPoints, - creators: Converter2.Creators.intoInfra(input.creators), - collection: Converter.Collection.intoInfra(input.collection), - uses: input.uses || null - }; - }; - RegularNftMetadata2.intoUser = (output) => { - return { - mint: output.onchain.mint.toString(), - updateAuthority: output.onchain.updateAuthority.toString(), - royalty: output.onchain.data.sellerFeeBasisPoints, - name: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.name), - symbol: Converter9.TokenMetadata.deleteNullStrings( - output.onchain.data.symbol - ), - uri: Converter9.TokenMetadata.deleteNullStrings(output.onchain.data.uri), - isMutable: output.onchain.isMutable, - primarySaleHappened: output.onchain.primarySaleHappened, - creators: Converter2.Creators.intoUser(output.onchain.data.creators), - editionNonce: output.onchain.editionNonce, - collection: Converter.Collection.intoUser(output.onchain.collection), - collectionDetails: Converter7.CollectionDetails.intoUser( - output.onchain.collectionDetails - ), - uses: Converter8.Uses.intoUserSide(output.onchain.uses), - dateTime: convertTimestampToDateTime(output.offchain.created_at), - offchain: output.offchain - }; - }; - })(RegularNftMetadata = Converter15.RegularNftMetadata || (Converter15.RegularNftMetadata = {})); -})(Converter10 || (Converter10 = {})); - -// ../converter/src/properties.ts -var Converter11; -((Converter15) => { - let Properties; - ((Properties2) => { - Properties2.intoInfra = async (input, callbackFunc, storageType, feePayer) => { - if (!input || !input.files) { - return {}; - } - const files = await Promise.all( - input.files.map(async (file) => { - if (!file.filePath) { - return {}; - } - const res = await callbackFunc(file.filePath, storageType, feePayer); - if (res.isErr) { - throw Error(res.error.message); - } - return overwriteObject(file, [ - { - existsKey: "filePath", - will: { key: "uri", value: res.value } - } - ]); - }) - ); - return { ...input, files }; - }; - })(Properties = Converter15.Properties || (Converter15.Properties = {})); -})(Converter11 || (Converter11 = {})); - -// ../converter/src/transfer-checked.ts -var Converter12; -((Converter15) => { - let TransferChecked; - ((TransferChecked2) => { - TransferChecked2.intoUserSide = (output, meta, mappingTokenAccount) => { - const history = {}; - if (mappingTokenAccount) { - const foundSource = mappingTokenAccount.find( - (m) => m.account === output.parsed.info.source - ); - const foundDest = mappingTokenAccount.find( - (m) => m.account === output.parsed.info.destination - ); - foundSource && (history.source = foundSource.owner); - foundDest && (history.destination = foundDest.owner); - } - history.tokenAmount = output.parsed.info.tokenAmount; - history.mint = output.parsed.info.mint; - history.multisigAuthority = output.parsed.info.multisigAuthority; - history.signers = output.parsed.info.signers; - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(TransferChecked = Converter15.TransferChecked || (Converter15.TransferChecked = {})); -})(Converter12 || (Converter12 = {})); - -// ../converter/src/transfer.ts -var Converter13; -((Converter15) => { - let Transfer; - ((Transfer2) => { - Transfer2.intoUserSide = (output, meta) => { - const history = {}; - if (!output.parsed.info.destination || !output.parsed.info.lamports) { - return; - } - history.source = output.parsed.info.source; - history.destination = output.parsed.info.destination; - history.sol = output.parsed.info.lamports?.toSol().toString(); - history.type = output.program; - history.dateTime = convertTimestampToDateTime(meta.blockTime); - history.sig = meta.transaction.signatures[0]; - history.innerInstruction = false; - if (meta.meta?.innerInstructions && meta.meta?.innerInstructions.length !== 0) { - history.innerInstruction = true; - } - return history; - }; - })(Transfer = Converter15.Transfer || (Converter15.Transfer = {})); -})(Converter13 || (Converter13 = {})); - -// ../converter/src/index.ts -var Converter14 = { - ...Converter4, - ...Converter, - ...Converter2, - ...Converter5, - ...Converter6, - ...Converter10, - ...Converter11, - ...Converter3, - ...Converter9, - ...Converter12, - ...Converter13, - ...Converter8 -}; - -// ../validator/src/index.ts -var Validator; -((Validator2) => { - let Message; - ((Message2) => { - Message2.SUCCESS = "success"; - Message2.SMALL_NUMBER = "too small"; - Message2.BIG_NUMBER = "too big"; - Message2.LONG_LENGTH = "too long"; - Message2.EMPTY = "invalid empty value"; - Message2.INVALID_URL = "invalid url"; - Message2.ONLY_NODE_JS = "`string` type is only Node.js"; - })(Message = Validator2.Message || (Validator2.Message = {})); - Validator2.NAME_LENGTH = 32; - Validator2.SYMBOL_LENGTH = 10; - Validator2.URL_LENGTH = 200; - Validator2.ROYALTY_MAX = 100; - Validator2.SELLER_FEE_BASIS_POINTS_MAX = 1e4; - Validator2.ROYALTY_MIN = 0; - Validator2.isRoyalty = (royalty) => { - return Try(() => { - const key = "royalty"; - if (royalty !== 0 && !royalty) { - throw createError(key, Message.EMPTY, royalty); - } - if (royalty < Validator2.ROYALTY_MIN) { - throw createError(key, Message.SMALL_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MIN, - condition: "underMin" - }); - } else if (royalty > Validator2.ROYALTY_MAX) { - throw createError(key, Message.BIG_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MAX, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isSellerFeeBasisPoints = (royalty) => { - return Try(() => { - const key = "sellerFeeBasisPoints/seller_fee_basis_points"; - if (royalty !== 0 && !royalty) { - throw createError(key, Message.EMPTY, royalty); - } - if (royalty < Validator2.ROYALTY_MIN) { - throw createError(key, Message.SMALL_NUMBER, royalty, { - threshold: Validator2.ROYALTY_MIN, - condition: "underMin" - }); - } else if (royalty > Validator2.ROYALTY_MAX * Converter14.Royalty.THRESHOLD) { - throw createError(key, Message.BIG_NUMBER, royalty, { - threshold: Validator2.SELLER_FEE_BASIS_POINTS_MAX, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isName = (name) => { - return Try(() => { - const key = "name"; - if (!name) { - throw createError(key, Message.EMPTY, name); - } - if (byteLength(name) > Validator2.NAME_LENGTH) { - throw createError(key, Message.LONG_LENGTH, name, { - threshold: Validator2.NAME_LENGTH, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isSymbol = (symbol) => { - return Try(() => { - const key = "symbol"; - if (!symbol) { - throw createError(key, Message.EMPTY, symbol); - } - if (byteLength(symbol) > Validator2.SYMBOL_LENGTH) { - throw createError(key, Message.LONG_LENGTH, symbol, { - threshold: Validator2.SYMBOL_LENGTH, - condition: "overMax" - }); - } - return Message.SUCCESS; - }); - }; - Validator2.isImageUrl = (image) => isUriOrImage(image, "image"); - Validator2.checkAll = (metadata) => { - return Try(() => { - const keys = Object.keys(metadata); - const results = []; - keys.map((key) => { - let res; - switch (key) { - case "image": - if (key in metadata && metadata.image) { - res = (0, Validator2.isImageUrl)(metadata.image); - } - break; - case "royalty": - if (key in metadata) { - res = (0, Validator2.isRoyalty)(metadata.royalty); - } - break; - case "seller_fee_basis_points": - if (key in metadata && metadata.seller_fee_basis_points) { - res = (0, Validator2.isSellerFeeBasisPoints)(metadata.seller_fee_basis_points); - } - break; - case "sellerFeeBasisPoints": - if (key in metadata) { - res = (0, Validator2.isSellerFeeBasisPoints)(metadata.sellerFeeBasisPoints); - } - break; - case "name": - if (metadata.name) { - res = (0, Validator2.isName)(metadata.name); - } - break; - case "symbol": - if (metadata.symbol) { - res = (0, Validator2.isSymbol)(metadata.symbol); - } - break; - } - if (res && res.isErr) { - results.push(...res.error.details); - } - }); - if (results.length > 0) { - const message = "Caught in the validation errors. see information e.g: err.details"; - throw new ValidatorError(message, results); - } - return Message.SUCCESS; - }); - }; - const byteLength = (value) => { - const text = new TextEncoder(); - return text.encode(value).length; - }; - const createError = (key, message, actual, limit) => { - let error; - if (limit) { - error = new ValidatorError(message, [{ key, message, actual, limit }]); - } else { - error = new ValidatorError(message, [{ key, message, actual }]); - } - return error; - }; - const isUriOrImage = (imageOrUri, key) => { - return Try(() => { - if (!imageOrUri) { - throw createError(key, Message.EMPTY, imageOrUri); - } - if (byteLength(imageOrUri) > Validator2.URL_LENGTH) { - throw createError(key, Message.LONG_LENGTH, imageOrUri, { - threshold: Validator2.URL_LENGTH, - condition: "overMax" - }); - } - if (!/https?:\/\/[-_.!~*\\()a-zA-Z0-9;?:&=+,%#]+/g.test(imageOrUri)) { - throw createError(key, Message.INVALID_URL, imageOrUri); - } - return Message.SUCCESS; - }); - }; -})(Validator || (Validator = {})); -var ValidatorError = class extends Error { - details; - constructor(message, details) { - super(message); - this.details = details; - } -}; - -// ../global/src/index.ts -import { Keypair, LAMPORTS_PER_SOL, PublicKey as PublicKey4 } from "@solana/web3.js"; -import { BigNumber } from "bignumber.js"; -import bs2 from "bs58"; -String.prototype.toExplorerUrl = function(explorer = "solscan" /* Solscan */, options = {}) { - const endPointUrl = Node.getConnection().rpcEndpoint; - debugLog("# toExplorerUrl rpcEndpoint:", endPointUrl); - let cluster = ""; - if (endPointUrl === Constants.EndPointUrl.prd) { - cluster = Constants.Cluster.prd; - } else if (endPointUrl === Constants.EndPointUrl.test) { - cluster = Constants.Cluster.test; - } else if (endPointUrl === Constants.EndPointUrl.dev) { - cluster = Constants.Cluster.dev; - } else { - cluster = Constants.Cluster.dev; - } - const addressOrSignature = this.toString(); - let url = ""; - if (options.replacePath) { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/${options.replacePath}/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/${options.replacePath}/${addressOrSignature}?cluster=${cluster}`; - } - return url; - } - if (Account4.Keypair.isPubkey(addressOrSignature)) { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/address/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/account/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/account/${addressOrSignature}?cluster=${cluster}`; - } - } else { - if (explorer === "solanafm" /* SolanaFM */) { - url = `${Constants.EXPLORER_SOLANAFM_URL}/tx/${addressOrSignature}?cluster=${cluster}`; - } else if (explorer === "xray" /* Xray */) { - url = `${Constants.EXPLORER_XRAY_URL}/tx/${addressOrSignature}?network=${cluster}`; - } else { - url = `${Constants.EXPLORER_SOLSCAN_URL}/tx/${addressOrSignature}?cluster=${cluster}`; - } - } - return url; -}; -String.prototype.toPublicKey = function() { - if (!Account4.Keypair.isPubkey(this.toString())) { - throw Error(`No match KeyPair.PubKey: ${this.toString()}`); - } - return new PublicKey4(this.toString()); -}; -String.prototype.toKeypair = function() { - if (!Account4.Keypair.isSecret(this.toString())) { - throw Error(`No match KeyPair.Secret: ${this.toString()}`); - } - const decoded = bs2.decode(this.toString()); - return Keypair.fromSecretKey(decoded); -}; -Number.prototype.toSol = function() { - return BigNumber(this).div(LAMPORTS_PER_SOL).toNumber(); -}; -Number.prototype.toLamports = function() { - return BigNumber(this).times(LAMPORTS_PER_SOL).toNumber(); -}; - -// ../node/src/index.ts -import { Connection } from "@solana/web3.js"; -var Node; -((Node2) => { - const setted = { - clusterUrl: "", - commitment: Constants.COMMITMENT, - customClusterUrl: [] - }; - Node2.getConnection = () => { - if (setted.customClusterUrl.length > 0) { - setted.clusterUrl = Constants.switchCluster({ - customClusterUrl: setted.customClusterUrl - }); - } else if (Constants.customClusterUrl.length > 0) { - setted.clusterUrl = Constants.switchCluster({ - customClusterUrl: Constants.customClusterUrl - }); - } else if (!setted.clusterUrl) { - setted.clusterUrl = Constants.switchCluster({ - cluster: Constants.currentCluster - }); - } - if (!setted.commitment) { - setted.commitment = Constants.COMMITMENT; - } - return new Connection(setted.clusterUrl, setted.commitment); - }; - Node2.changeConnection = (param) => { - setted.clusterUrl = ""; - setted.customClusterUrl = []; - setted.commitment = Constants.COMMITMENT; - const { cluster, commitment, customClusterUrl } = param; - if (commitment) { - setted.commitment = commitment; - debugLog("# Node change commitment: ", setted.commitment); - } - if (cluster) { - setted.clusterUrl = Constants.switchCluster({ cluster }); - debugLog("# Node change clusterUrl: ", setted.clusterUrl); - } - if (customClusterUrl) { - debugLog("# customClusterUrl: ", customClusterUrl); - setted.clusterUrl = Constants.switchCluster({ customClusterUrl }); - setted.customClusterUrl = customClusterUrl; - debugLog( - "# Node change cluster, custom cluster url: ", - setted.clusterUrl - ); - } - }; - Node2.confirmedSig = async (signature, commitment = Constants.COMMITMENT) => { - const connection = Node2.getConnection(); - const latestBlockhash = await connection.getLatestBlockhash(); - return await connection.confirmTransaction( - { - blockhash: latestBlockhash.blockhash, - lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, - signature - }, - commitment - ).then(Result.ok).catch(Result.err); - }; -})(Node || (Node = {})); - -// src/define.ts -var MAX_RETRIES = 3; - -// src/batch.ts -var BatchTransaction = class { - submit = async (arr) => { - let i = 0; - for (const a of arr) { - if (!a.instructions && !a.signers) { - throw Error( - `only Instruction object that can use batchSubmit(). - Index: ${i}, Set value: ${JSON.stringify(a)}` - ); - } - i++; - } - const instructions = arr.flatMap((a) => a.instructions); - const signers = arr.flatMap((a) => a.signers); - const feePayers = arr.filter((a) => a.feePayer !== void 0); - let feePayer = signers[0]; - if (feePayers.length > 0 && feePayers[0].feePayer) { - feePayer = feePayers[0].feePayer; - } - const transaction = new Tx(); - let finalSigners = signers; - if (feePayer) { - transaction.feePayer = feePayer.publicKey; - finalSigners = [feePayer, ...signers]; - } - instructions.map((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - return await sendAndConfirmTransaction( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }; -}; -Array.prototype.submit = async function() { - const instructions = []; - return Try(async () => { - let i = 0; - for (const obj of this) { - if (obj.isErr) { - const errorMess = obj.error.message; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.isOk) { - instructions.push(obj.value); - } else { - instructions.push(obj); - } - i++; - } - return new BatchTransaction().submit(instructions); - }); -}; - -// src/default.ts -import { - sendAndConfirmTransaction as sendAndConfirmTransaction2, - Transaction as Tx2 -} from "@solana/web3.js"; -var Transaction = class _Transaction { - instructions; - signers; - feePayer; - data; - constructor(instructions, signers, feePayer, data) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - submit = async () => { - return Try(async () => { - if (!(this instanceof _Transaction)) { - throw Error("only Instruction object that can use this"); - } - const transaction = new Tx2(); - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - this.instructions.forEach((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - return await sendAndConfirmTransaction2( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }); - }; -}; - -// src/mint.ts -import { - sendAndConfirmTransaction as sendAndConfirmTransaction3, - Transaction as Tx3 -} from "@solana/web3.js"; -var MintTransaction = class _MintTransaction { - instructions; - signers; - feePayer; - data; - constructor(instructions, signers, feePayer, data) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - submit = async () => { - return Try(async () => { - if (!(this instanceof _MintTransaction)) { - throw Error("only MintInstruction object that can use this"); - } - const transaction = new Tx3(); - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - this.instructions.forEach((inst) => transaction.add(inst)); - const options = { - maxRetries: MAX_RETRIES - }; - if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { - debugLog("# Change metaplex cluster on mainnet-beta"); - Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); - } - return await sendAndConfirmTransaction3( - Node.getConnection(), - transaction, - finalSigners, - options - ); - }); - }; -}; - -// src/partial-sign.ts -import { - Transaction as Tx4 -} from "@solana/web3.js"; -var PartialSignTransaction = class _PartialSignTransaction { - hexInstruction; - data; - canSubmit; - constructor(instructions, mint, canSubmit = false) { - this.hexInstruction = instructions; - this.data = mint; - this.canSubmit = canSubmit; - } - submit = async (feePayer) => { - return Try(async () => { - if (!(this instanceof _PartialSignTransaction)) { - throw Error("only PartialSignInstruction object that can use this"); - } - const decode = Buffer.from(this.hexInstruction, "hex"); - const transactionFromJson = Tx4.from(decode); - transactionFromJson.partialSign(feePayer.toKeypair()); - const options = { - maxRetries: MAX_RETRIES - }; - const wireTransaction = transactionFromJson.serialize(); - return await Node.getConnection().sendRawTransaction( - wireTransaction, - options - ); - }); - }; -}; -Array.prototype.submit = async function(feePayer) { - return Try(async () => { - let i = 0; - for await (const obj of this) { - if (obj.isErr) { - const errorMess = obj.error.message; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.canSubmit) { - await obj.submit(feePayer); - } else { - return await obj.submit(feePayer); - } - i++; - } - }); -}; -export { - BatchTransaction, - MintTransaction, - PartialSignTransaction, - Transaction -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2JhdGNoLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvY29uc3RhbnRzLnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvcmVzdWx0LnRzIiwgIi4uLy4uL3NoYXJlZC9zcmMvc2hhcmVkLnRzIiwgIi4uLy4uL2FjY291bnQvc3JjL2Fzc29jaWF0ZWQudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMva2V5cGFpci50cyIsICIuLi8uLi9hY2NvdW50L3NyYy9wZGEudHMiLCAiLi4vLi4vYWNjb3VudC9zcmMvaW5kZXgudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9jb2xsZWN0aW9uLnRzIiwgIi4uLy4uL2NvbnZlcnRlci9zcmMvY3JlYXRvcnMudHMiLCAiLi4vLi4vY29udmVydGVyL3NyYy9yb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OiBzdHJpbmcpOiBzdHJpbmcgPT4ge1xuICAgIHN3aXRjaCAoZW52KSB7XG4gICAgICBjYXNlIENvbnN0YW50cy5DbHVzdGVyLnByZDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkJ1bmRsclVybC5wcmQuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICAgIGRlZmF1bHQ6IHtcbiAgICAgICAgcmV0dXJuIENvbnN0YW50cy5CdW5kbHJVcmwuZGV2O1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICBleHBvcnQgY29uc3Qgc3dpdGNoRGFzQXBpID0gKGVudjogc3RyaW5nKTogc3RyaW5nID0+IHtcbiAgICBzd2l0Y2ggKGVudikge1xuICAgICAgY2FzZSBDb25zdGFudHMuQ2x1c3Rlci5wcmQ6XG4gICAgICAgIGlmIChkYXNBcGlVcmwubGVuZ3RoIDwgMSkge1xuICAgICAgICAgIHRocm93IEVycm9yKENvbnN0YW50cy5XYXJubmluZ01lc3NhZ2UuREFTX0FQSV9VUkwpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IHVybHMgPSBDb25zdGFudHMuQnVuZGxyVXJsLnByZC5zcGxpdCgnLCcpO1xuICAgICAgICBjb25zdCBpbmRleCA9IERhdGUubm93KCkgJSB1cmxzLmxlbmd0aDtcbiAgICAgICAgcmV0dXJuIHVybHNbaW5kZXhdO1xuICAgICAgZGVmYXVsdDoge1xuICAgICAgICBjb25zdCB1cmxzID0gQ29uc3RhbnRzLkRhc0FwaVVybC5kZXYuc3BsaXQoJywnKTtcbiAgICAgICAgY29uc3QgaW5kZXggPSBEYXRlLm5vdygpICUgdXJscy5sZW5ndGg7XG4gICAgICAgIHJldHVybiB1cmxzW2luZGV4XTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbiA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iBQdWJrZXksXG4gICAgICBvd25lcjogUHVia2V5LFxuICAgICAgZmVlUGF5ZXI6IFNlY3JldCxcbiAgICApOiBQcm9taXNlPHN0cmluZz4gPT4ge1xuICAgICAgbGV0IGNvdW50ZXIgPSAxO1xuICAgICAgd2hpbGUgKGNvdW50ZXIgPCBSRVRSWV9PVkVSX0xJTUlUKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgaW5zdCA9IGF3YWl0IGdldChtaW50LCBvd25lciwgZmVlUGF5ZXIsIHRydWUpO1xuXG4gICAgICAgICAgaWYgKGluc3QgJiYgdHlwZW9mIGluc3QgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBkZWJ1Z0xvZygnIyBhc3NvY2lhdGVkVG9rZW5BY2NvdW50OiAnLCBpbnN0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnN0O1xuICAgICAgICAgIH0gZWxzZSBpZiAoaW5zdCBpbnN0YW5jZW9mIFRyYW5zYWN0aW9uKSB7XG4gICAgICAgICAgICAoYXdhaXQgaW5zdC5zdWJtaXQoKSkubWFwKFxuICAgICAgICAgICAgICBhc3luYyAob2spID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBOb2RlLmNvbmZpcm1lZFNpZyhvayk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGluc3QuZGF0YSBhcyBzdHJpbmc7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBkZWJ1Z0xvZygnIyBFcnJvciBzdWJtaXQgcmV0cnlHZXRPckNyZWF0ZTogJywgZXJyKTtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgIGRlYnVnTG9nKGAjIHJldHJ5OiAke2NvdW50ZXJ9IGNyZWF0ZSB0b2tlbiB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YyhcbiAgICAgICAgbWludC50b1B1YmxpY0tleSgpLFxuICAgICAgICBvd25lci50b1B1YmxpY0tleSgpLFxuICAgICAgICBhbGxvd093bmVyT2ZmQ3VydmUsXG4gICAgICAgIFRPS0VOX1BST0dSQU1fSUQsXG4gICAgICAgIEFTU09DSUFURURfVE9LRU5fUFJPR1JBTV9JRCxcbiAgICAgICk7XG5cbiAgICAgIGRlYnVnTG9nKCcjIGFzc29jaWF0ZWRUb2tlbkFjY291bnQ6ICcsIGFzc29jaWF0ZWRUb2tlbkFjY291bnQudG9TdHJpbmcoKSk7XG5cbiAgICAgIHRyeSB7XG4gICAgICAgIC8vIERvbnQgdXNlIFJlc3VsdFxuICAgICAgICBhd2FpdCBnZXRBY2NvdW50KFxuICAgICAgICAgIE5vZGUuZ2V0Q29ubmVjdGlvbigpLFxuICAgICAgICAgIGFzc29jaWF0ZWRUb2tlbkFjY291bnQsXG4gICAgICAgICAgTm9kZS5nZXRDb25uZWN0aW9uKCkuY29tbWl0bWVudCxcbiAgICAgICAgICBUT0tFTl9QUk9HUkFNX0lELFxuICAgICAgICApO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHRva2VuQWNjb3VudDogYXNzb2NpYXRlZFRva2VuQWNjb3VudC50b1N0cmluZygpLFxuICAgICAgICAgIGluc3Q6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgIH0gY2F0Y2ggKGVycm9yOiB1bmtub3duKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5BY2NvdW50Tm90Rm91bmRFcnJvcikgJiZcbiAgICAgICAgICAhKGVycm9yIGluc3RhbmNlb2YgVG9rZW5JbnZhbGlkQWNjb3VudE93bmVyRXJyb3IpXG4gICAgICAgICkge1xuICAgICAgICAgIHRocm93IEVycm9yKCdVbmV4cGVjdGVkIGVycm9yJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXllciA9ICFmZWVQYX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A9PiB7XG4gICAgICBpZiAoIWlucHV0IHx8ICFpbnB1dC5maWxlcykge1xuICAgICAgICByZXR1cm4ge307XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGZpbGVzID0gYXdhaXQgUHJvbWlzZS5hbGwoXG4gICAgICAgIGlucHV0LmZpbGVzLm1hcChhc3luYyAoZmlsZSkgPT4ge1xuICAgICAgICAgIGlmICghZmlsZS5maWxlUGF0aCkge1xuICAgICAgICAgICAgcmV0dXJuIHt9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCBjYWxsYmFja0Z1bmMoZmlsZS5maWxlUGF0aCwgc3RvcmFnZVR5cGUsIGZlZVBheWVyKTtcbiAgICAgICAgICBpZiAocmVzLmlzRXJyKSB7XG4gICAgICAgICAgICB0aHJvdyBFcnJvcihyZXMuZXJyb3IubWVzc2FnZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBvdmVyd3JpdGVPYmplY3QoZmlsZSwgW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBleGlzdHNLZXk6ICdmaWxlUGF0aCcsXG4gICAgICAgICAgICAgIHdpbGw6IHsga2V5OiAndXJpJywgdmFsdWU6IHJlcy52YWx1ZSB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICBdKTtcbiAgICAgICAgfSksXG4gICAgICApO1xuICAgICAgcmV0dXJuIHsgLi4uaW5wdXQsIGZpbGVzIH0gYXMgUHJvcGVydGllcztcbiAgICB9O1xuICB9XG59XG4iLCAiaW1wb3J0IHsgUGFyc2VkVHJhbnNhY3Rpb25XaXRoTWV0YSB9IGZyb20gJ0Bzb2xhbmEvd2ViMy5qcyc7XG5pbXBvcnQgeyBQb3N0VG9rZW5BY2NvdW50IH0gZnJvbSAnfi90eXBlcy90cmFuc2FjdGlvbi1maWx0ZXInO1xuaW1wb3J0IHsgSGlzdG9yeSB9IGZyb20gJ34vdHlwZXMvaGlzdG9yeSc7XG4vKiBlc2xpbn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1BvaW50cyc6XG4gICAgICAgICAgICBpZiAoa2V5IGluIG1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgIHJlcyA9IGlzU2VsbGVyRmVlQmFzaXNQb2ludHMobWV0YWRhdGEuc2VsbGVyRmVlQmFzaXNQb2ludHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSAnbmFtZSc6XG4gICAgICAgICAgICBpZiAobWV0YWRhdGEubmFtZSkge1xuICAgICAgICAgICAgICByZXMgPSBpc05hbWUobWV0YWRhdGEubmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzeW1ib2wnOlxuICAgICAgICAgICAgaWYgKG1ldGFkYXRhLnN5bWJvbCkge1xuICAgICAgICAgICAgICByZXMgPSBpc1N5bWJvbChtZXRhZGF0YS5zeW1ib2wpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlcyAmJiByZXMuaXNFcnIpIHtcbiAgICAgICAgICByZXN1bHRzLnB1c2goLi4ucmVzLmVycm9yLmRldGFpbHMpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgY29uc3QgbWVzc2FnZSA9XG4gICAgICAgICAgJ0NhdWdodCBpbiB0aGUgdmFsaWRhdGlvbiBlcnJvcnMuIHNlZSBpbmZvcm1hdGlvbiBlLmc6IGVycjxWYWxpZGF0b3JFcnJvcj4uZGV0YWlscyc7XG4gICAgICAgIHRocm93IG5ldyBWYWxpZGF0b3JFcnJvcihtZXNzYWdlLCByZXN1bHRzKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBNZXNzYWdlLlNVQ0NFU1M7XG4gICAgfSk7XG4gIH07XG5cbiAgdHlwZSBQaWNrTmZ0U3RvcmFnZSA9IFBpY2s8XG4gICAgT2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ICJBY2NvdW50IiwgIkNvbnZlcnRlciIsICJDb2xsZWN0aW9uIiwgIkNvbGxlY3Rpb25NaW50IiwgIkNvbnZlcnRlciIsICJDcmVhdG9ycyIsICJDb252ZXJ0ZXIiLCAiUm95YWx0eSIsICJDb252ZXJ0ZXIiLCAiQ29tcHJlc3NlZE5mdE1ldGFkYXRhIiwgIkNvbnZlcnRlciIsICJNZW1vIiwgIkNvbnZlcnRlciIsICJNaW50IiwgIkNvbnZlcnRlciIsICJDb2xsZWN0aW9uRGV0YWlscyIsICJDb252ZXJ0ZXIiLCAiVXNlcyIsICJDb252ZXJ0ZXIiLCAiVG9rZW5NZXRhZGF0YSIsICJDb252ZXJ0ZXIiLCAiUmVndWxhck5mdE1ldGFkYXRhIiwgIkNvbnZlcnRlciIsICJQcm9wZXJ0aWVzIiwgIkNvbnZlcnRlciIsICJUcmFuc2ZlckNoZWNrZWQiLCAiQ29udmVydGVyIiwgIlRyYW5zZmVyIiwgIkNvbnZlcnRlciIsICJWYWxpZGF0b3IiLCAiTWVzc2FnZSIsICJDb252ZXJ0ZXIiLCAiUHVibGljS2V5IiwgImJzIiwgIkFjY291bnQiLCAiUHVibGljS2V5IiwgIk5vZGUiLCAic2VuZEFuZENvbmZpcm1UcmFuc2FjdGlvbiIsICJUeCIsICJUeCIsICJzZW5kQW5kQ29uZmlybVRyYW5zYWN0aW9uIiwgInNlbmRBbmRDb25maXJtVHJhbnNhY3Rpb24iLCAiVHgiLCAiVHgiLCAic2VuZEFuZENvbmZpcm1UcmFuc2FjdGlvbiIsICJUeCIsICJUeCJdCn0K \ No newline at end of file diff --git a/packages/transaction/src/batch.ts b/packages/transaction/src/batch.ts deleted file mode 100644 index c9986e893..000000000 --- a/packages/transaction/src/batch.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { - ConfirmOptions, - sendAndConfirmTransaction, - Transaction as Tx, - TransactionSignature, -} from '@solana/web3.js'; - -import { Node } from '~/node'; -import { Try } from '~/shared'; -import { MAX_RETRIES } from './define'; -import { Transaction } from './default'; - -export class BatchTransaction { - submit = async (arr: Transaction[]): Promise => { - let i = 0; - for (const a of arr) { - if (!a.instructions && !a.signers) { - throw Error( - `only Instruction object that can use batchSubmit(). - Index: ${i}, Set value: ${JSON.stringify(a)}`, - ); - } - i++; - } - - const instructions = arr.flatMap((a) => a.instructions); - const signers = arr.flatMap((a) => a.signers); - const feePayers = arr.filter((a) => a.feePayer !== undefined); - let feePayer = signers[0]; - if (feePayers.length > 0 && feePayers[0].feePayer) { - feePayer = feePayers[0].feePayer; - } - - const transaction = new Tx(); - let finalSigners = signers; - if (feePayer) { - transaction.feePayer = feePayer.publicKey; - finalSigners = [feePayer, ...signers]; - } - instructions.map((inst) => transaction.add(inst)); - - const options: ConfirmOptions = { - maxRetries: MAX_RETRIES, - }; - - return await sendAndConfirmTransaction( - Node.getConnection(), - transaction, - finalSigners, - options, - ); - }; -} - -/** - * senTransaction() TransactionInstruction - * - * @see {@link types/global.ts} - * @returns Promise> - */ - -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* @ts-ignore */ -Array.prototype.submit = async function () { - const instructions: Transaction[] = []; - // dont use forEach - // It is not possible to stop the process by RETURN in the middle of the process. - return Try(async () => { - let i = 0; - for (const obj of this) { - if (obj.isErr) { - const errorMess: string = obj.error.message as string; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.isOk) { - instructions.push(obj.value as Transaction); - } else { - instructions.push(obj as Transaction); - } - i++; - } - return new BatchTransaction().submit(instructions); - }); -}; diff --git a/packages/transaction/src/common.ts b/packages/transaction/src/common.ts deleted file mode 100644 index 4b20f9168..000000000 --- a/packages/transaction/src/common.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { - ConfirmOptions, - Keypair, - PublicKey, - sendAndConfirmTransaction, - Transaction as Tx, - TransactionInstruction, - TransactionSignature, -} from '@solana/web3.js'; - -import { Node } from '~/node'; -import { Result, Try } from '~/shared'; - -export class Transaction { - static MAX_RETRIES = 3; - static MAX_TRANSACTION_SIZE = 1232; - - instructions: TransactionInstruction[]; - signers: Keypair[]; - feePayer?: Keypair; - data?: unknown; - - constructor( - instructions: TransactionInstruction[], - signers: Keypair[], - feePayer?: Keypair, - data?: unknown, - ) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - - submit = async (): Promise> => { - return Try(async () => { - if (!(this instanceof Transaction)) { - throw Error('only Instruction object that can use this'); - } - const transaction = new Tx(); - - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - - this.instructions.forEach((inst) => transaction.add(inst)); - - - - const options: ConfirmOptions = { - maxRetries: Transaction.MAX_RETRIES, - }; - - return await sendAndConfirmTransaction( - Node.getConnection(), - transaction, - finalSigners, - options, - ); - }); - }; -} - -/** - * @param tx a solana transaction - * @param feePayer the publicKey of the signer - * @returns size in bytes of the transaction - */ -export const getTxSize = (tx: Tx, feePayer: PublicKey): number => { - const feePayerPk = [feePayer.toBase58()]; - - const signers = new Set(feePayerPk); - const accounts = new Set(feePayerPk); - - const ixsSize = tx.instructions.reduce((acc, ix) => { - ix.keys.forEach(({ pubkey, isSigner }) => { - const pk = pubkey.toBase58(); - if (isSigner) signers.add(pk); - accounts.add(pk); - }); - - accounts.add(ix.programId.toBase58()); - - const nIndexes = ix.keys.length; - const opaqueData = ix.data.length; - - return ( - acc + - 1 + // PID index - compactArraySize(nIndexes, 1) + - compactArraySize(opaqueData, 1) - ); - }, 0); - - return ( - compactArraySize(signers.size, 64) + // signatures - 3 + // header - compactArraySize(accounts.size, 32) + // accounts - 32 + // blockhash - compactHeader(tx.instructions.length) + // instructions - ixsSize - ); -}; - -// COMPACT ARRAY - -const LOW_VALUE = 127; // 0x7f -const HIGH_VALUE = 16383; // 0x3fff - -/** - * Compact u16 array header size - * @param n elements in the compact array - * @returns size in bytes of array header - */ -const compactHeader = (n: number) => - n <= LOW_VALUE ? 1 : n <= HIGH_VALUE ? 2 : 3; - -/** - * Compact u16 array size - * @param n elements in the compact array - * @param size bytes per each element - * @returns size in bytes of array - */ -const compactArraySize = (n: number, size: number) => - compactHeader(n) + n * size; diff --git a/packages/transaction/src/default.ts b/packages/transaction/src/default.ts deleted file mode 100644 index d1a873447..000000000 --- a/packages/transaction/src/default.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { - ConfirmOptions, - Keypair, - sendAndConfirmTransaction, - Transaction as Tx, - TransactionInstruction, - TransactionSignature, -} from '@solana/web3.js'; - -import { Node } from '~/node'; -import { Result, Try } from '~/shared'; -import { MAX_RETRIES } from './define'; - -export class Transaction { - instructions: TransactionInstruction[]; - signers: Keypair[]; - feePayer?: Keypair; - data?: unknown; - - constructor( - instructions: TransactionInstruction[], - signers: Keypair[], - feePayer?: Keypair, - data?: unknown, - ) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - - submit = async (): Promise> => { - return Try(async () => { - if (!(this instanceof Transaction)) { - throw Error('only Instruction object that can use this'); - } - const transaction = new Tx(); - - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - - this.instructions.forEach((inst) => transaction.add(inst)); - - const options: ConfirmOptions = { - maxRetries: MAX_RETRIES, - }; - - return await sendAndConfirmTransaction( - Node.getConnection(), - transaction, - finalSigners, - options, - ); - }); - }; -} diff --git a/packages/transaction/src/define.ts b/packages/transaction/src/define.ts deleted file mode 100644 index a18d83c07..000000000 --- a/packages/transaction/src/define.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@internals -export const MAX_RETRIES = 3; diff --git a/packages/transaction/src/index.ts b/packages/transaction/src/index.ts deleted file mode 100644 index 070296070..000000000 --- a/packages/transaction/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './batch'; -export * from './default'; -export * from './mint'; -export * from './partial-sign'; - -import '~/types/global'; -import '~/global'; diff --git a/packages/transaction/src/mint.ts b/packages/transaction/src/mint.ts deleted file mode 100644 index 35e1b3610..000000000 --- a/packages/transaction/src/mint.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { - ConfirmOptions, - Keypair, - sendAndConfirmTransaction, - Transaction as Tx, - TransactionInstruction, - TransactionSignature, -} from '@solana/web3.js'; - -import { Constants, debugLog, Result, Try } from '~/shared'; -import { Node } from '~/node'; -import { MAX_RETRIES } from './define'; - -export class MintTransaction { - instructions: TransactionInstruction[]; - signers: Keypair[]; - feePayer?: Keypair; - data?: T; - - constructor( - instructions: TransactionInstruction[], - signers: Keypair[], - feePayer?: Keypair, - data?: T, - ) { - this.instructions = instructions; - this.signers = signers; - this.feePayer = feePayer; - this.data = data; - } - - submit = async (): Promise> => { - return Try(async () => { - if (!(this instanceof MintTransaction)) { - throw Error('only MintInstruction object that can use this'); - } - const transaction = new Tx(); - const blockhashObj = await Node.getConnection().getLatestBlockhash(); - transaction.lastValidBlockHeight = blockhashObj.lastValidBlockHeight; - transaction.recentBlockhash = blockhashObj.blockhash; - let finalSigners = this.signers; - - if (this.feePayer) { - transaction.feePayer = this.feePayer.publicKey; - finalSigners = [this.feePayer, ...this.signers]; - } - - this.instructions.forEach((inst) => transaction.add(inst)); - - const options: ConfirmOptions = { - maxRetries: MAX_RETRIES, - }; - - if (Node.getConnection().rpcEndpoint === Constants.EndPointUrl.prd) { - debugLog('# Change metaplex cluster on mainnet-beta'); - Node.changeConnection({ cluster: Constants.Cluster.prdMetaplex }); - } - - return await sendAndConfirmTransaction( - Node.getConnection(), - transaction, - finalSigners, - options, - ); - }); - }; -} diff --git a/packages/transaction/src/partial-sign.ts b/packages/transaction/src/partial-sign.ts deleted file mode 100644 index 68c4b4997..000000000 --- a/packages/transaction/src/partial-sign.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { - ConfirmOptions, - Transaction as Tx, - TransactionSignature, -} from '@solana/web3.js'; - -import { Result, sleep, Try } from '~/shared'; -import { Node } from '~/node'; -import { Pubkey, Secret } from '~/types/account'; -import { MAX_RETRIES } from './define'; - -export class PartialSignTransaction { - hexInstruction: string; - data?: Pubkey; - canSubmit?: boolean; - - constructor(instructions: string, mint?: Pubkey, canSubmit = false) { - this.hexInstruction = instructions; - this.data = mint; - this.canSubmit = canSubmit; - } - - submit = async ( - feePayer: Secret, - ): Promise> => { - return Try(async () => { - if (!(this instanceof PartialSignTransaction)) { - throw Error('only PartialSignInstruction object that can use this'); - } - - const decode = Buffer.from(this.hexInstruction, 'hex'); - const transactionFromJson = Tx.from(decode); - transactionFromJson.partialSign(feePayer.toKeypair()); - - const options: ConfirmOptions = { - maxRetries: MAX_RETRIES, - }; - const wireTransaction = transactionFromJson.serialize(); - return await Node.getConnection().sendRawTransaction( - wireTransaction, - options, - ); - }); - }; -} - -/** - * senTransaction() TransactionInstruction - * - * @see {@link types/global.ts} - * @returns Promise> - */ - -/* eslint-disable @typescript-eslint/ban-ts-comment */ -/* @ts-ignore */ -Array.prototype.submit = async function (feePayer: Secret) { - return Try(async () => { - let i = 0; - for await (const obj of this) { - if (obj.isErr) { - const errorMess: string = obj.error.message as string; - throw Error(`[Array index of caught 'Result.err': ${i}]${errorMess}`); - } else if (obj.canSubmit) { - console.log('# canSubmit', obj); - await obj.submit(feePayer); - console.log('# canSubmit finish'); - await sleep(30); - console.log('# sleep finish'); - } else { - console.log('# transfer transaction start: ', obj); - return await obj.submit(feePayer); - } - i++; - } - }); -};