-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
João Sousa
authored and
João Sousa
committed
Jan 27, 2025
1 parent
7961607
commit a270dbd
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { AminoConverters } from "@cosmjs/stargate"; | ||
import { toBech32 } from "@cosmjs/encoding"; | ||
import { toAccAddress } from "@cosmjs/stargate/build/queryclient/utils"; | ||
|
||
import { AXELAR_PREFIX } from "../const"; | ||
|
||
import Long from "long"; | ||
|
||
export const createAxelarAminoConverters = (): AminoConverters => ({ | ||
|
||
// nexus module | ||
"/axelar.nexus.v1beta1.SetTransferRateLimitRequest": { | ||
aminoType: "nexus/SetTransferRateLimit", | ||
toAmino: ({ sender, chain, limit: { amount, denom }, window: { seconds, nanos } }) => ({ | ||
sender: toBech32(AXELAR_PREFIX, sender), | ||
chain, | ||
window: Long.fromValue(seconds).multiply(1000000000).add(nanos).toString(), | ||
limit: { | ||
amount, | ||
denom, | ||
}, | ||
|
||
}), | ||
fromAmino: ({ sender, chain, limit: { amount, denom }, window }) => ({ | ||
sender: toAccAddress(sender), | ||
chain, | ||
window: { | ||
seconds: Long.fromNumber(Number(window) / (1000000000)), | ||
Check failure on line 28 in src/libs/AxelarSigningClient/aminomessages/index.ts
|
||
nanos: Number(window) % (1000000000), | ||
Check failure on line 29 in src/libs/AxelarSigningClient/aminomessages/index.ts
|
||
}, | ||
|
||
limit: { | ||
amount, | ||
denom, | ||
}, | ||
}), | ||
}, | ||
"/axelar.nexus.v1beta1.ActivateChainRequest": { | ||
aminoType: "nexus/ActivateChain", | ||
toAmino: ({ sender, chains }) => ({ | ||
sender: toBech32(AXELAR_PREFIX, sender), | ||
chains, | ||
|
||
}), | ||
fromAmino: ({ sender, chains }) => ({ | ||
sender: toAccAddress(sender), | ||
chains, | ||
}), | ||
}, | ||
"/axelar.nexus.v1beta1.DeactivateChainRequest": { | ||
aminoType: "nexus/DeactivateChain", | ||
toAmino: ({ sender, chains }) => ({ | ||
sender: toBech32(AXELAR_PREFIX, sender), | ||
chains, | ||
|
||
}), | ||
fromAmino: ({ sender, chains }) => ({ | ||
sender: toAccAddress(sender), | ||
chains, | ||
}), | ||
}, | ||
}); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters