Trigger Reference of GS2-Money Script

createWallet

Event trigger to call GS2-Script before creating a new wallet.

Request

TypeDescription
namespaceNamespaceNamespace
walletWalletWallet

Result

TypeRequireDefaultLimitationDescription
permitboolAllow wallet creation
initialAmountint~ 2147483645Initial Wallet balance - will be credited as a free grant

Implementation Example

namespace = args.namespace
wallet = args.wallet

result = {
  permit=permit,
  initialAmount=initialAmount
}

createWalletDone

GS2-Script called after creating a new wallet.

Request

TypeDescription
namespaceNamespaceNamespace
walletWalletWallet

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
wallet = args.wallet

result = {
}

deposit

Event trigger to call GS2-Script before wallet balance is added.

Request

TypeDescription
namespaceNamespaceNamespace
walletWalletWallet

Result

TypeRequireDefaultLimitationDescription
permitboolAllow wallet balance addition
overrideCountint~ 2147483645Actual amount of addition to be applied

Implementation Example

namespace = args.namespace
wallet = args.wallet

result = {
  permit=permit,
  overrideCount=overrideCount
}

depositDone

GS2-Script called after wallet balance is added.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletWallet before deposit
newWalletWalletWallet after deposit

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet

result = {
}

withdraw

Event trigger to call GS2-Script before wallet balance is consumed.

Request

TypeDescription
namespaceNamespaceNamespace
walletWalletWallet

Result

TypeRequireDefaultLimitationDescription
permitboolAllow wallet balance consumption
overrideCountint~ 2147483645Actual consumption to be applied

Implementation Example

namespace = args.namespace
wallet = args.wallet

result = {
  permit=permit,
  overrideCount=overrideCount
}

withdrawDone

GS2-Script called after wallet balance is consumed.

Request

TypeDescription
namespaceNamespaceNamespace
oldWalletWalletPre-withdraw Wallet
newWalletWalletPost-withdraw Wallet

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
oldWallet = args.oldWallet
newWallet = args.newWallet

result = {
}