const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../constants/fees.constants.cjs`),r=require(`../../types/hinkal.types.cjs`),i=require(`./erc20tokenFunctions.cjs`);var a=(e,t)=>{if(e.length!==t.length)throw Error(`length mismatch`);let n=e.findIndex(e=>e!==0n);return n===-1?r.defaultFeeStructure:{feeToken:t[n],flatFee:e[n],variableRate:0n}},o=r=>{if(!r)return n.EXTENDED_NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS;let a=t.zeroAddress;e.isSolanaLike(r)&&(a=t.solanaNativeAddress);let o=i.getERC20Token(a,r)?.symbol;return e.isSolanaLike(r)&&o?[o]:o&&!n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r).includes(o)?[o,...n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r)]:n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r)},s=(e,t)=>{let r=e*t.variableRate/n.BPS_DENOMINATOR;return t.flatFee+r};exports.calculateTotalFee=s,exports.generateFeeStructure=a,exports.getGasTokenSymbols=o;