-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rapha/cosmos-sdk-0.47.x-upgrade' into main
- Loading branch information
Showing
54 changed files
with
11,018 additions
and
5,976 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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { AminoConverters } from '@cosmjs/stargate'; | ||
import { | ||
MsgCreateFunder, | ||
MsgDefundPool, | ||
MsgFundPool, | ||
MsgUpdateFunder | ||
} from '@kyvejs/types/client/kyve/funders/v1beta1/tx'; | ||
import { isNotEmpty } from '../utils'; | ||
|
||
export const createFundersAminoConverters = (): AminoConverters => { | ||
return { | ||
'/kyve.funders.v1beta1.MsgFundPool': { | ||
aminoType: 'kyve/funders/MsgFundPool', | ||
toAmino: (msg: MsgFundPool) => ({ | ||
creator: msg.creator, | ||
...(isNotEmpty(msg.pool_id) && { pool_id: msg.pool_id }), | ||
...(isNotEmpty(msg.amount) && { amount: msg.amount }), | ||
...(isNotEmpty(msg.amount_per_bundle) && { amount_per_bundle: msg.amount_per_bundle }) | ||
}), | ||
fromAmino: (msg): MsgFundPool => ({ | ||
creator: msg.creator, | ||
pool_id: msg.pool_id, | ||
amount: msg.amount, | ||
amount_per_bundle: msg.amount_per_bundle | ||
}) | ||
}, | ||
'/kyve.funders.v1beta1.MsgDefundPool': { | ||
aminoType: 'kyve/funders/MsgDefundPool', | ||
toAmino: (msg: MsgDefundPool) => ({ | ||
creator: msg.creator, | ||
...(isNotEmpty(msg.pool_id) && { id: msg.pool_id }), | ||
...(isNotEmpty(msg.amount) && { amount: msg.amount }) | ||
}), | ||
fromAmino: (msg): MsgDefundPool => ({ | ||
creator: msg.creator, | ||
pool_id: msg.pool_id, | ||
amount: msg.amount | ||
}) | ||
}, | ||
'/kyve.funders.v1beta1.MsgCreateFunder': { | ||
aminoType: 'kyve/funders/MsgCreateFunder', | ||
toAmino: (msg: MsgCreateFunder) => ({ | ||
creator: msg.creator, | ||
...(isNotEmpty(msg.moniker) && { moniker: msg.moniker }), | ||
...(isNotEmpty(msg.description) && { description: msg.description }), | ||
...(isNotEmpty(msg.website) && { website: msg.website }), | ||
...(isNotEmpty(msg.identity) && { identity: msg.identity }), | ||
...(isNotEmpty(msg.contact) && { contact: msg.contact }) | ||
}), | ||
fromAmino: (msg): MsgCreateFunder => ({ | ||
creator: msg.creator, | ||
moniker: msg.moniker, | ||
description: msg.description, | ||
website: msg.website, | ||
identity: msg.identity, | ||
contact: msg.contact | ||
}) | ||
}, | ||
'/kyve.funders.v1beta1.MsgUpdateFunder': { | ||
aminoType: 'kyve/funders/MsgUpdateFunder', | ||
toAmino: (msg: MsgUpdateFunder) => ({ | ||
creator: msg.creator, | ||
...(isNotEmpty(msg.moniker) && { moniker: msg.moniker }), | ||
...(isNotEmpty(msg.description) && { description: msg.description }), | ||
...(isNotEmpty(msg.website) && { website: msg.website }), | ||
...(isNotEmpty(msg.identity) && { identity: msg.identity }), | ||
...(isNotEmpty(msg.contact) && { contact: msg.contact }) | ||
}), | ||
fromAmino: (msg): MsgUpdateFunder => ({ | ||
creator: msg.creator, | ||
moniker: msg.moniker, | ||
description: msg.description, | ||
website: msg.website, | ||
identity: msg.identity, | ||
contact: msg.contact | ||
}) | ||
} | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from "./gov.v1.amino"; | ||
export * from "./pool.amino"; | ||
export * from "./funders.amino"; | ||
export * from "./stakers.amino"; | ||
export * from "./delegation.amino"; | ||
export * from "./bundles.amino"; |
This file was deleted.
Oops, something went wrong.
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
79 changes: 79 additions & 0 deletions
79
common/sdk/src/clients/rpc-client/kyve/funders/v1beta1/funders.ts
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,79 @@ | ||
import { StdFee } from '@cosmjs/amino/build/signdoc'; | ||
import { | ||
MsgCreateFunder, | ||
MsgDefundPool, | ||
MsgFundPool, | ||
MsgUpdateFunder | ||
} from '@kyvejs/types/client/kyve/funders/v1beta1/tx'; | ||
|
||
import { withTypeUrl } from '../../../../../registry/tx.registry'; | ||
import { KyveSigning, PendingTx } from '../../../signing'; | ||
|
||
export default class KyveFundersMethods extends KyveSigning { | ||
public createFunder( | ||
value: Omit<MsgCreateFunder, 'creator'>, | ||
options?: { | ||
fee?: StdFee | 'auto' | number; | ||
memo?: string; | ||
} | ||
) { | ||
const tx = withTypeUrl.createFunder({ | ||
...value, | ||
creator: this.account.address | ||
}); | ||
|
||
return new PendingTx({ tx: [tx] }, () => | ||
this.getPendingSignedTx(tx, options) | ||
); | ||
} | ||
|
||
public updateFunder( | ||
value: Omit<MsgUpdateFunder, 'creator'>, | ||
options?: { | ||
fee?: StdFee | 'auto' | number; | ||
memo?: string; | ||
} | ||
) { | ||
const tx = withTypeUrl.updateFunder({ | ||
...value, | ||
creator: this.account.address | ||
}); | ||
|
||
return new PendingTx({ tx: [tx] }, () => | ||
this.getPendingSignedTx(tx, options) | ||
); | ||
} | ||
|
||
public fundPool( | ||
value: Omit<MsgFundPool, 'creator'>, | ||
options?: { | ||
fee?: StdFee | 'auto' | number; | ||
memo?: string; | ||
} | ||
) { | ||
const tx = withTypeUrl.fundPool({ | ||
...value, | ||
creator: this.account.address | ||
}); | ||
|
||
return new PendingTx({ tx: [tx] }, () => | ||
this.getPendingSignedTx(tx, options) | ||
); | ||
} | ||
|
||
public defundPool( | ||
value: Omit<MsgDefundPool, 'creator'>, | ||
options?: { | ||
fee?: StdFee | 'auto' | number; | ||
memo?: string; | ||
} | ||
) { | ||
const tx = withTypeUrl.defundPool({ | ||
...value, | ||
creator: this.account.address | ||
}); | ||
return new PendingTx({ tx: [tx] }, () => | ||
this.getPendingSignedTx(tx, options) | ||
); | ||
} | ||
} |
Oops, something went wrong.