Skip to content

Instantly share code, notes, and snippets.

View siddharthborderwala's full-sized avatar

Siddharth Borderwala siddharthborderwala

View GitHub Profile
import type { ChainInfo } from "@keplr-wallet/types";
type ChainInfoWithRegistryPath = ChainInfo & {
chainRegistryPath: string;
beta: true;
};
export const initiaChains: ChainInfoWithRegistryPath[] = [
{
beta: true,
import type { ChainInfo } from '@keplr-wallet/types'
type ChainInfoWithRegistryPath = ChainInfo & {
chainRegistryPath: string
beta: true
}
export const initiaChains: ChainInfoWithRegistryPath[] = [
{
beta: true,
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown
? Omit<T, K>
: never;
type DistributivePick<T, K extends keyof T> = T extends unknown
? Pick<T, K>
: never;
@siddharthborderwala
siddharthborderwala / restrict-destination-tokens.tsx
Last active June 21, 2024 05:34
Restrict destination tokens for a chain in `@leapwallet/elements`
const ElementsSwapsImplementation = () => {
return (
<Swaps
allowedDestinationChains={[
{
chainId: 'osmosis-1',
assetDenoms: [
// specify allowed tokens via denoms
'uosmo',
'ibc/a87adce9f0....',
/*
* The Stride dApp is in light mode, so we will update .leap-ui declaration
*/
.leap-ui.stride {
/*
* Stride primary color is #E50571
* Convert it to HSL - hsl(331deg, 95.7%, 45.9%)
* We set the --primary variable to 331 95.7% 45.9%
*/
--primary: 331 95.7% 45.9%;
const headers = {
// bearer-token authorization header
'Authorization': `Bearer ${process.env.NOTION_API_SECRET}`,
// the payload content-type
'Content-Type': 'application/json',
// specify the version of the API
'Notion-Version': '2021-08-16',
};
const handler = async (req, res) => {
package main
import (
"fmt"
)
type BSTNode struct {
key int
left *BSTNode
right *BSTNode
@siddharthborderwala
siddharthborderwala / linkedlist.go
Created December 18, 2021 16:38
Simple linked list implementation in golang
package main
type Node struct {
data int
next *Node
}
func NewNode(data int) *Node {
return &Node{
data: data,