Currencies¶
Calls¶
transfer¶
Transfer some balance to another account under currency_id
.
The dispatch origin for this call must be Signed
by the
transactor.
Attributes¶
Name | Type |
---|---|
dest | <T::Lookup as StaticLookup>::Source |
currency_id | CurrencyIdOf<T> |
amount | BalanceOf<T> |
Python¶
call = substrate.compose_call(
'Currencies', 'transfer', {
'amount': 'u128',
'currency_id': {
'Native': None,
'Stellar': {
'AlphaNum12': {
'code': '[u8; 12]',
'issuer': '[u8; 32]',
},
'AlphaNum4': {
'code': '[u8; 4]',
'issuer': '[u8; 32]',
},
'StellarNative': None,
},
'Token': 'u64',
'XCM': 'u8',
'ZenlinkLPToken': (
'u8',
'u8',
'u8',
'u8',
),
},
'dest': {
'Address20': '[u8; 20]',
'Address32': '[u8; 32]',
'Id': 'AccountId',
'Index': (),
'Raw': 'Bytes',
},
}
)
transfer_native_currency¶
Transfer some native currency to another account.
The dispatch origin for this call must be Signed
by the
transactor.
Attributes¶
Name | Type |
---|---|
dest | <T::Lookup as StaticLookup>::Source |
amount | BalanceOf<T> |
Python¶
call = substrate.compose_call(
'Currencies', 'transfer_native_currency', {
'amount': 'u128',
'dest': {
'Address20': '[u8; 20]',
'Address32': '[u8; 32]',
'Id': 'AccountId',
'Index': (),
'Raw': 'Bytes',
},
}
)
update_balance¶
update amount of account who
under currency_id
.
The dispatch origin of this call must be Root.
Attributes¶
Name | Type |
---|---|
who | <T::Lookup as StaticLookup>::Source |
currency_id | CurrencyIdOf<T> |
amount | AmountOf<T> |
Python¶
call = substrate.compose_call(
'Currencies', 'update_balance', {
'amount': 'i128',
'currency_id': {
'Native': None,
'Stellar': {
'AlphaNum12': {
'code': '[u8; 12]',
'issuer': '[u8; 32]',
},
'AlphaNum4': {
'code': '[u8; 4]',
'issuer': '[u8; 32]',
},
'StellarNative': None,
},
'Token': 'u64',
'XCM': 'u8',
'ZenlinkLPToken': (
'u8',
'u8',
'u8',
'u8',
),
},
'who': {
'Address20': '[u8; 20]',
'Address32': '[u8; 32]',
'Id': 'AccountId',
'Index': (),
'Raw': 'Bytes',
},
}
)
Storage functions¶
Constants¶
GetNativeCurrencyId¶
Value¶
'Native'
Python¶
constant = substrate.get_constant('Currencies', 'GetNativeCurrencyId')
Errors¶
AmountIntoBalanceFailed¶
Unable to convert the Amount type into Balance.
BalanceTooLow¶
Balance is too low.
DepositFailed¶
Deposit result is not expected