Skip to content

Commit

Permalink
Merge pull request #47 from ComposableFi/kirina/fix-config
Browse files Browse the repository at this point in the history
Fix config
  • Loading branch information
nahyunbak authored Nov 21, 2024
2 parents f33f88a + 2bf2630 commit 303432c
Show file tree
Hide file tree
Showing 30 changed files with 679 additions and 460 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to npm

on:
push:
branches:
- main # main 브랜치로 머지될 때 트리거

jobs:
publish:
name: Publish npm Package
runs-on: ubuntu-latest

steps:
# 1. store checkout
- name: Checkout code
uses: actions/checkout@v3

# 2. Node.js install
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18 # 원하는 Node.js 버전
cache: 'npm'

# 3. install dependencies
- name: Install dependencies
run: npm ci

# 4. npm login
- name: Authenticate with npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc

# 5. update version and publish
- name: Publish package
run: |
npm version patch -m "Release v%s [skip ci]" # 버전 업데이트
npm publish
19 changes: 0 additions & 19 deletions .github/workflows/.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dist/chains/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var getTimeOut = function (plusMin) {
if (plusMin === void 0) { plusMin = 30; }
var now = new Date();
var minutesLater = new Date(now.getTime() + plusMin * 60 * 1000);
return new big_js_1.default(minutesLater.getTime()).mul(1000000).toFixed();
return new big_js_1.default(minutesLater.getTime()).mul(1000000).toNumber();
};
exports.getTimeOut = getTimeOut;
var findSourceChannelId = function (sourceChainId, destChainId) {
Expand Down
2 changes: 1 addition & 1 deletion dist/chains/solana/methods.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 24 additions & 7 deletions dist/chains/solana/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ var solanaTransfer = function (_a) { return __awaiter(void 0, [_a], void 0, func
};
console.log(instructionPayload, 'instructionPayload ');
buffer = (0, borsher_1.borshSerialize)(helper_1.instructionSchema, instructionPayload);
console.log(buffer, 'buffer');
_d = (0, helper_1.getSolanaGuestChainAccounts)(constants_1.solanaPortId, refinedSourceChannel, hashedDenom), guestChainPDA = _d.guestChainPDA, triePDA = _d.triePDA, ibcStoragePDA = _d.ibcStoragePDA, mintAuthorityPDA = _d.mintAuthorityPDA, escrowAccountPDA = _d.escrowAccountPDA, feePDA = _d.feePDA;
instruction = new web3_js_1.TransactionInstruction({
keys: [
Expand All @@ -215,7 +216,8 @@ var solanaTransfer = function (_a) { return __awaiter(void 0, [_a], void 0, func
programId: constants_1.solanaIbcProgramId,
data: buffer, // All instructions are hellos
});
return [4 /*yield*/, sendTX(tx, accountId, endpoint, false, undefined, function () {
console.log(instruction, 'instruction');
return [4 /*yield*/, sendTX(tx, accountId, endpoint, true, undefined, function () {
tx.add(web3_js_1.ComputeBudgetProgram.requestHeapFrame({ bytes: 128 * 1024 }));
tx.add(web3_js_1.ComputeBudgetProgram.setComputeUnitLimit({ units: 700000 }));
tx.add(instruction);
Expand Down Expand Up @@ -247,7 +249,7 @@ var sendTX = function (inputTx_1, address_1, endpoint_1) {
//set owner as feePayer
tx.feePayer = depositor;
beforeFeeFunc === null || beforeFeeFunc === void 0 ? void 0 : beforeFeeFunc();
tx.add(getFee());
tx.add(getFee(address, isBundle));
return [4 /*yield*/, constants_1.solana.signTransaction(tx).catch(function (err) {
utils_1.emitter.emit('CANCEL_SOLANA');
throw err;
Expand Down Expand Up @@ -338,10 +340,25 @@ var pollingSignatureStatus = function (rawTx_1, endpoint_1) {
});
});
};
var getFee = function () {
var SEND_AMT = 0.01 * web3_js_1.LAMPORTS_PER_SOL; // for test, it used to be 0.006
var PRIORITY_FEE_IX = web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
microLamports: SEND_AMT,
var getFee = function (address, isBundle) {
if (isBundle) {
return getTips(address, 15000000);
}
else {
var SEND_AMT = 0.01 * web3_js_1.LAMPORTS_PER_SOL; // for test, it used to be 0.006
var PRIORITY_FEE_IX = web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
microLamports: SEND_AMT,
});
return PRIORITY_FEE_IX;
}
};
var getTips = function (accountId, lamports) {
if (lamports === void 0) { lamports = 4000000; }
//0.000035
//0.015
return web3_js_1.SystemProgram.transfer({
toPubkey: (0, helper_1.getPublicKey)('96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5'),
fromPubkey: (0, helper_1.getPublicKey)(accountId),
lamports: lamports,
});
return PRIORITY_FEE_IX;
};
2 changes: 1 addition & 1 deletion dist/config/crossChainAssets.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 303432c

Please sign in to comment.