Skip to content
Snippets Groups Projects
Unverified Commit 26403b7e authored by emostov's avatar emostov
Browse files

Crowloan contribute

parent 878aa749
Branches
Tags
No related merge requests found
......@@ -53,10 +53,13 @@ async function main(): Promise<void> {
// Now we can create our `balances.transfer` unsigned tx. The following
// function takes the above data as arguments, so can be performed offline
// if desired.
const unsigned = methods.balances.transfer(
const unsigned = methods.crowdloan.contribute(
{
value: '90071992547409910',
dest: '14E5nqKAp3oAJcmzgZhUD2RcptBeUBScxKHgJKU4HPNcKVf3', // Bob
index: 12,
signature: {
Sr25519: '0xFFFFFFFFFFFFFFFF',
},
},
{
address: deriveAddress(alice.publicKey, POLKADOT_SS58_FORMAT),
......
......@@ -23,7 +23,7 @@
"test": "jest"
},
"dependencies": {
"@polkadot/api": "4.0.3",
"@polkadot/api": "4.1.1",
"memoizee": "^0.4.14"
},
"devDependencies": {
......@@ -31,7 +31,7 @@
"@types/memoizee": "^0.4.3",
"standard-version": "^9.1.1",
"ts-node": "^9.0.0",
"typedoc": "^0.20.28",
"typedoc": "^0.20.32",
"typedoc-plugin-markdown": "^3.6.0"
},
"resolutions": {
......
import {
Args,
BaseTxInfo,
createMethod,
OptionsWithMeta,
UnsignedTransaction,
} from '../../util';
import { MultiSignature } from './types';
export interface CrowdloanContributeArgs extends Args {
index: number | string;
value: number | string;
signature: MultiSignature;
}
export function contribute(
args: CrowdloanContributeArgs,
info: BaseTxInfo,
options: OptionsWithMeta
): UnsignedTransaction {
return createMethod(
{
method: {
args,
name: 'contribute',
pallet: 'crowdloan',
},
...info,
},
options
);
}
export * from './contribute';
export * from './types';
export type MultiSignature = {
Ed25519?: string;
Sr25519?: string;
Ecdsa?: string;
};
import * as balances from './balances';
import * as claims from './claims';
import * as crowdloan from './crowdloan';
import * as democracy from './democracy';
import * as poll from './poll';
import * as proxy from './proxy';
......@@ -12,6 +13,7 @@ import * as vesting from './vesting';
export {
balances,
claims,
crowdloan,
democracy,
poll,
proxy,
......
......@@ -306,6 +306,15 @@ export const TEST_METHOD_ARGS = {
target: 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P', // seed "//Charlie"
},
},
crowdlaon: {
contribute: {
value: '90071992547409910',
index: 12,
signature: {
Sr25519: '0xFFFFFFFFFFFFFFFF',
},
},
},
};
/**
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment