Skip to content

Instantly share code, notes, and snippets.

As far as I understand, the high level goal of this bounty is to give normal wallets the ability to interact with dapps via their respective ICA's. More concretely, we want to write a service that translates transactions meant to be signed and submitted on chain B, into transactions that are signed and submitted on chain A, ultimately affecting the state on chain B via ICA's.

As an example, if I have an EOA on Polygon (0xA) and an ICA on Arbitrum (0xB), I should be able to issue transactions on uniswap.org that change the state of my 0xB account only by signing with 0xA.

Considerations

Dapps aren't built with ICA's in mind and because of this a few limitations could arise,

  • Gas, dapps often require the active account to have a sufficient gas balance. In the context of an ICA where gas is paid via the home chain, they often won't have a gas balance which could lead to UX problems
  • Signatures, some dapps (e.g. OpenSea, 1Inch) require users to sign ToS before being given access. When the active accou
Verify Github on Galxe. gid:oj3hVKoMzzUxJDYvHvtwh5
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
} from '@solana/spl-token';
import { Connection, PublicKey } from '@solana/web3.js';
const STSOL = new PublicKey('7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj');
const SUNNY = new PublicKey('SUNNYWgPQmFxe9wTZzNK7iPnJ3vYDrkgnxJRJm1s3ag');
import { InMemorySigner } from '@taquito/signer';
import { TezosToolkit } from '@taquito/taquito';
async function main() {
const tezos = new TezosToolkit('https://mainnet.api.tez.ie');
tezos.setProvider({
signer: InMemorySigner.fromFundraiser(
'hello',
'there',
[
import Onboard from "@pooltogether/bnc-onboard"
import Web3 from "web3"
let web3 = null
function App() {
const send = async () => {
if (!web3) {
return
}
import { newKit } from '@celo/contractkit'
// import {
// // ensureLeading0x,
// privateKeyToPublicKey,
// trimLeading0x,
// } from '@celo/utils/lib/address'
// import { ECIES } from '@celo/utils/lib/ecies'
// import * as readline from 'readline'
// import {
// serializeSignature,
{
"app_message": {
"accounts": [
{
"account_number": "0",
"address": "cosmos19s96k8judmxx7jwf3tug7adux5g7k9pmr2yqwm",
"coins": [
{ "amount": "1000", "denom": "dxt" },
{ "amount": "100000000", "denom": "stake" }
],
{
"genesis_time": "2019-09-04T14:29:02.563542Z",
"chain_id": "engine",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
The main issue is that your line
q.query({uid:"dan"})
is not synchronous. So your promise resolves with undefined. You need to do two things:
1. Pass a callback to your query function so you can retrieve the value of your query
2. Resolve the promise with the result of this query.
So here we're passing a callback to your custom `query` function...
package io.deepstream;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import java.util.Properties;
public class test {